import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { DictEnum } from '@vben/constants';
import { getDictOptions } from '#/utils/dict';
export const querySchema: FormSchemaGetter = () => [
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
    },
    fieldName: 'Areastatus',
    label: '片区',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
    },
    fieldName: 'Gasstationstatus',
    label: '油站',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
    },
    fieldName: 'Completedstatus',
    label: '完成状态',
  },
  {
    component: 'DatePicker',
    componentProps: {
      type: 'daterange',
      format: 'YYYY-MM-DD',
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
      startPlaceholder: '开始日期',
      endPlaceholder: '结束日期',
    },
    fieldName: 'createTime',
    label: '处理时间',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
    },
    fieldName: 'Positionstatus',
    label: '岗位',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
    },
    fieldName: 'Commentstatus',
    label: '评论',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
    },
    fieldName: 'createStatus',
    label: '创建',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
    },
    fieldName: 'executorStatus',
    label: '执行人',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
    },
    fieldName: 'taskStatus',
    label: '任务名称',
  },
  {
    component: 'Input',
    fieldName: 'TaskName',
    componentProps: {
      maxlength: 30,
    },
    label: '任务名称',
  },
  {
    component: 'RadioGroup',
    fieldName: 'extraFlag',
    defaultValue: '',
    componentProps: {
      options: [
        { label: '异常', value: 'abnormal' },
        { label: '不拍照', value: 'noPhoto' },
      ],
    },
  },
];

export const columns: VxeGridProps['columns'] = [
  {
    field: 'action',
    fixed: 'left',
    slots: { default: 'action' },
    resizable: false,
    title: '操作',
    width: 180,
  },
  {
    title: '任务名称',
    field: 'TaskName',
    minWidth: 130,
  },
  {
    title: '油站',
    field: 'Gasstation',
    minWidth: 130,
  },
  {
    title: '异常总数',
    field: 'Abnormalnumber',
    minWidth: 130,
  },
  {
    title: '无拍照数',
    field: 'NoPhotographynumber',
    minWidth: 130,
  },
  {
    title: '执行人',
    field: 'Executor',
    minWidth: 130,
  },
  {
    title: '岗位',
    field: 'Position',
    minWidth: 130,
  },
  {
    title: '评论',
    field: 'Comment',
    minWidth: 130,
  },
  {
    title: '截止时间',
    field: 'Deadline',
    minWidth: 130,
  },
  {
    title: '处理时间',
    field: 'ProcessingTime',
    minWidth: 130,
  },
  {
    title: '完成状态',
    field: 'CompletionStatus',
    minWidth: 130,
  },
  {
    title: '创建',
    field: 'Create',
    minWidth: 130,
  },
];
export const mockData = [
  {
    TaskName: '高峰期车流异常核查',
    Gasstation: '中山路加油站',
    Abnormalnumber: 3,
    NoPhotographynumber: 1,
    Executor: '王保瑞',
    Position: '当班经理',
    Comment: '车流异常需增派人手',
    Deadline: '2024-06-10 18:00',
    ProcessingTime: '2024-06-01 08:00',
    CompletionStatus: '处理中',
    Create: '2024-05-30 14:00',
  },
  {
    TaskName: '油罐液位异常处理',
    Gasstation: '北环大道油站',
    Abnormalnumber: 2,
    NoPhotographynumber: 0,
    Executor: '王凯',
    Position: '安全员',
    Comment: '液位传感器读数漂移',
    Deadline: '2024-06-05 12:00',
    ProcessingTime: '2024-06-01 09:15',
    CompletionStatus: '已完成',
    Create: '2024-05-29 16:30',
  },
  {
    TaskName: '加油机滤芯更换',
    Gasstation: '城南综合能源站',
    Abnormalnumber: 1,
    NoPhotographynumber: 0,
    Executor: '李威',
    Position: '设备管理员',
    Comment: '滤芯堵塞超标需更换',
    Deadline: '2024-06-08 17:00',
    ProcessingTime: '2024-06-01 10:30',
    CompletionStatus: '已完成',
    Create: '2024-05-28 10:00',
  },
  {
    TaskName: 'POS系统异常处理',
    Gasstation: '高速服务区东站',
    Abnormalnumber: 2,
    NoPhotographynumber: 1,
    Executor: '张敏',
    Position: '收银员',
    Comment: '小票打印机卡纸异常',
    Deadline: '2024-06-07 20:00',
    ProcessingTime: '2024-06-01 11:45',
    CompletionStatus: '处理中',
    Create: '2024-05-30 09:20',
  },
  {
    TaskName: '充电桩接地检测',
    Gasstation: '城西快充站',
    Abnormalnumber: 1,
    NoPhotographynumber: 0,
    Executor: '刘洋',
    Position: '电工',
    Comment: '接地电阻偏高需复检',
    Deadline: '2024-06-06 16:00',
    ProcessingTime: '2024-06-01 13:00',
    CompletionStatus: '待处理',
    Create: '2024-05-31 15:10',
  },
];
