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: 'inspectGasStation',
    label: '检查油站',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
    },
    fieldName: 'inspectionTimeSelect',
    label: '检查时间',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
    },
    fieldName: 'checkNameStatus',
    label: '检查名称',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
    },
    fieldName: 'labelStatus',
    label: '标签',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
    },
    fieldName: 'executorSelect',
    label: '执行人',
  },
  {
    component: 'DatePicker',
    componentProps: {
      type: 'daterange',
      format: 'YYYY-MM-DD',
      valueFormat: 'YYYY-MM-DD',
      startPlaceholder: '开始日期',
      endPlaceholder: '结束日期',
    },
    fieldName: 'closeTime',
    label: '关闭时间',
  },
];

export const columns: VxeGridProps['columns'] = [
  {
    field: 'action',
    fixed: 'left',
    slots: { default: 'action' },
    resizable: false,
    title: '操作',
    width: 180,
  },
  {
    title: '检查油站',
    field: 'inspectGas',
    minWidth: 130,
  },
  {
    title: '检查名称',
    field: 'checkName',
    minWidth: 130,
  },
  {
    title: '检查人',
    field: 'Inspector',
    minWidth: 130,
  },
  {
    title: '检查时间',
    field: 'inspectionTime',
    minWidth: 130,
  },
  {
    title: '标签',
    field: 'labeltext',
    minWidth: 130,
  },
  {
    title: '发现问题',
    field: 'discoverProblem',
    minWidth: 130,
  },
  {
    title: '主要危害描述',
    field: 'mainHazardDescription',
    minWidth: 130,
  },
  {
    title: '风险度',
    field: 'riskLevel',
    minWidth: 130,
  },
  {
    title: '处理建议',
    field: 'handlingSuggestions',
    minWidth: 130,
  },
];
export const mockData = [
  {
    inspectGas: '中山路加油站',
    checkName: '油罐安全附件检查',
    Inspector: '王保瑞',
    inspectionTime: '2024-06-01 08:00',
    labeltext: '安全',
    discoverProblem: '液位计读数漂移',
    mainHazardDescription: '计量失准导致溢油风险',
    riskLevel: '中等',
    handlingSuggestions: '立即校准并更换探头',
  },
  {
    inspectGas: '北环大道油站',
    checkName: '消防器材巡检',
    Inspector: '王凯',
    inspectionTime: '2024-06-01 09:15',
    labeltext: '消防',
    discoverProblem: '灭火器压力不足',
    mainHazardDescription: '火灾初期无法扑灭',
    riskLevel: '高',
    handlingSuggestions: '重新充装并记录',
  },
  {
    inspectGas: '城南综合能源站',
    checkName: '加油机滤芯检查',
    Inspector: '李威',
    inspectionTime: '2024-06-01 10:30',
    labeltext: '设备',
    discoverProblem: '滤芯堵塞超标',
    mainHazardDescription: '杂质进入车辆油箱',
    riskLevel: '中等',
    handlingSuggestions: '停机更换滤芯',
  },
  {
    inspectGas: '高速服务区东站',
    checkName: 'POS系统巡检',
    Inspector: '张敏',
    inspectionTime: '2024-06-01 11:45',
    labeltext: '系统',
    discoverProblem: '小票打印机卡纸',
    mainHazardDescription: '交易凭证无法出具',
    riskLevel: '低',
    handlingSuggestions: '清理纸屑并测试',
  },
  {
    inspectGas: '城西快充站',
    checkName: '充电桩接地检测',
    Inspector: '刘洋',
    inspectionTime: '2024-06-01 13:00',
    labeltext: '电气',
    discoverProblem: '接地电阻偏高',
    mainHazardDescription: '漏电触电风险',
    riskLevel: '高',
    handlingSuggestions: '重新打接地极',
  },
];
