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: 'Gasstationstatus',
    label: '油站',
  },
  {
    component: 'DatePicker',
    componentProps: {
      type: 'daterange',
      format: 'YYYY-MM-DD',
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
      startPlaceholder: '开始日期',
      endPlaceholder: '结束日期',
    },
    fieldName: 'CheckTime',
    label: '检查时间',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
    },
    fieldName: 'CheckName',
    label: '检查名称',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
    },
    fieldName: 'Label',
    label: '标签',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
    },
    fieldName: 'executorStatus',
    label: '执行人',
  },
  {
    component: 'DatePicker',
    componentProps: {
      type: 'daterange',
      format: 'YYYY-MM-DD',
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
      startPlaceholder: '开始日期',
      endPlaceholder: '结束日期',
    },
    fieldName: 'CloseTime',
    label: '关闭时间',
  },
];

export const columns: VxeGridProps['columns'] = [
  {
    field: 'action',
    fixed: 'left',
    slots: { default: 'action' },
    resizable: false,
    title: '操作',
    width: 180,
  },
  {
    title: '油站',
    field: 'Gasstation',
    minWidth: 130,
  },
  {
    title: '检查名称',
    field: 'CheckName',
    minWidth: 130,
  },
  {
    title: '检查人',
    field: 'CheckPerson',
    minWidth: 130,
  },
  {
    title: '标签',
    field: 'Label',
    minWidth: 130,
  },
  {
    title: '发现问题',
    field: 'Discoverproblem',
    minWidth: 130,
  },
  {
    title: '处理建议',
    field: 'HandlingSuggestions',
    minWidth: 130,
  },
  {
    title: '是否转任务',
    field: 'Whethertransfertask',
    minWidth: 130,
  },
  {
    title: '任务状态',
    field: 'TaskStatus',
    minWidth: 130,
  },
];
export const mockData = [
  {
    Gasstation: '中山路加油站',
    CheckName: '油罐液位巡检',
    CheckPerson: '王保瑞',
    Label: '安全',
    Discoverproblem: '液位传感器读数漂移',
    HandlingSuggestions: '立即校准并更换探头',
    Whethertransfertask: '是',
    TaskStatus: '待处理',
  },
  {
    Gasstation: '北环大道油站',
    CheckName: '消防器材检查',
    CheckPerson: '王凯',
    Label: '消防',
    Discoverproblem: '灭火器压力不足',
    HandlingSuggestions: '重新充装并记录',
    Whethertransfertask: '否',
    TaskStatus: '已完成',
  },
  {
    Gasstation: '城南综合能源站',
    CheckName: '加油机滤芯检查',
    CheckPerson: '李威',
    Label: '设备',
    Discoverproblem: '滤芯堵塞超标',
    HandlingSuggestions: '停机更换滤芯',
    Whethertransfertask: '是',
    TaskStatus: '处理中',
  },
  {
    Gasstation: '高速服务区东站',
    CheckName: 'POS 系统巡检',
    CheckPerson: '张敏',
    Label: '系统',
    Discoverproblem: '小票打印机卡纸',
    HandlingSuggestions: '清理纸屑并测试',
    Whethertransfertask: '否',
    TaskStatus: '已完成',
  },
  {
    Gasstation: '城西快充站',
    CheckName: '充电桩接地检测',
    CheckPerson: '刘洋',
    Label: '电气',
    Discoverproblem: '接地电阻偏高',
    HandlingSuggestions: '重新打接地极',
    Whethertransfertask: '是',
    TaskStatus: '待处理',
  },
];
