| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205 |
- import type { FormSchemaGetter } from '#/adapter/form';
- import type { VxeGridProps } from '#/adapter/vxe-table';
- import {
- selectAllSysAreaList,
- selectAllSysStation,
- } from '#/api/system/infoEntry/stationInfo/stationInfo';
- // 获取过滤后的岗位列表
- import { getFilteredPositions } from '../../utils/positionFilter';
- export const querySchema: FormSchemaGetter = () => [
- {
- component: 'ApiSelect',
- fieldName: 'areaId',
- label: '片区',
- componentProps: {
- placeholder: '请选择片区',
- clearable: true,
- api: async () => {
- const resp = await selectAllSysAreaList();
- const data = resp || [];
- return Array.isArray(data)
- ? data.map((item: any) => ({
- label: item.areaName,
- value: item.id,
- }))
- : [];
- },
- labelField: 'label',
- valueField: 'value',
- },
- },
- {
- component: 'ApiSelect',
- fieldName: 'stationId',
- label: '油站',
- componentProps: {
- placeholder: '请选择油站',
- clearable: true,
- api: async () => {
- const resp = await selectAllSysStation();
- const data = resp || [];
- return Array.isArray(data)
- ? data.map((item: any) => ({
- label: item.stationName,
- value: item.id.toString(),
- }))
- : [];
- },
- labelField: 'label',
- valueField: 'value',
- },
- },
- {
- component: 'Select',
- fieldName: 'completionStatus',
- label: '状态',
- componentProps: {
- placeholder: '请选择完成状态',
- options: [
- { label: '按时完成', value: 2 },
- { label: '逾期完成', value: 1 },
- ],
- },
- },
- {
- component: 'DatePicker',
- componentProps: {
- type: 'daterange',
- format: 'YYYY-MM-DD HH:mm:ss',
- valueFormat: 'YYYY-MM-DD HH:mm:ss',
- startPlaceholder: '开始日期',
- endPlaceholder: '结束日期',
- },
- fieldName: 'surveyStartTime',
- label: '提交时间',
- },
- {
- component: 'Select',
- fieldName: 'isComment',
- label: '评论',
- componentProps: {
- placeholder: '请选择评论状态',
- options: [
- { label: '未评', value: 0 },
- { label: '已评', value: 1 },
- ],
- },
- },
- {
- component: 'ApiSelect',
- fieldName: 'position',
- label: '岗位',
- componentProps: {
- placeholder: '请选择岗位',
- clearable: true,
- api: getFilteredPositions,
- labelField: 'label',
- valueField: 'value',
- },
- },
- {
- component: 'Select',
- fieldName: 'createType',
- label: '创建',
- componentProps: {
- placeholder: '请选择创建方式',
- options: [
- { label: '系统', value: 0 },
- { label: '新增', value: 1 },
- ],
- },
- },
- {
- component: 'Input',
- fieldName: 'executorName',
- label: '执行人',
- componentProps: {
- placeholder: '请输入执行人',
- },
- },
- ];
- export const columns: VxeGridProps['columns'] = [
- {
- type: 'checkbox',
- width: 80,
- },
- {
- field: 'action',
- fixed: 'right',
- slots: { default: 'action' },
- title: '操作',
- width: 150,
- },
- {
- field: 'taskName',
- title: '任务名称',
- minWidth: 150,
- },
- {
- field: 'stationName',
- title: '油站',
- minWidth: 120,
- },
- {
- field: 'executorName',
- title: '执行人',
- minWidth: 120,
- },
- {
- field: 'position',
- title: '岗位',
- minWidth: 120,
- },
- {
- field: 'isComment',
- title: '评论',
- minWidth: 100,
- align: 'center',
- formatter: (cellValue: number) => {
- return cellValue === 1 ? '已评' : '未评';
- },
- },
- {
- field: 'deadline',
- title: '截止时间',
- minWidth: 180,
- },
- {
- field: 'processTime',
- title: '提交时间',
- minWidth: 180,
- },
- {
- field: 'completionStatus',
- title: '任务状态',
- minWidth: 120,
- align: 'center',
- formatter: ({ row }) => {
- return row.completionStatus === 2 ? '按时完成' : '逾期完成';
- },
- },
- {
- field: 'createType',
- title: '创建',
- minWidth: 100,
- align: 'center',
- formatter: (cellValue: number) => {
- return cellValue === 0 ? '系统' : '新增';
- },
- },
- {
- field: 'shiftDate',
- title: '上班日期',
- minWidth: 180,
- },
- {
- field: 'shiftId',
- title: '上班班次',
- minWidth: 120,
- },
- ];
|