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: 'IGasstationstatus',
    label: '我方油站',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
    },
    fieldName: 'youGasstationstatus',
    label: '竟对油站',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
    },
    fieldName: 'Status',
    label: '状态',
  },
  {
    component: 'DatePicker',
    componentProps: {
      type: 'daterange',
      format: 'YYYY-MM-DD',
      valueFormat: 'YYYY-MM-DD',
      startPlaceholder: '开始日期',
      endPlaceholder: '结束日期',
    },
    fieldName: 'Time',
    label: '时间',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
    },
    fieldName: 'Commentstatus',
    label: '评论',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
    },
    fieldName: 'PositionStatus',
    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: '执行人',
  },
];

export const columns: VxeGridProps['columns'] = [
  {
    field: 'action',
    fixed: 'left',
    slots: { default: 'action' },
    resizable: false,
    title: '操作',
    width: 180,
  },
  {
    title: '处理时间',
    fixed: 'left',
    field: 'ProcessingTime',
    minWidth: 130,
  },
  {
    title: '我方油站',
    fixed: 'left',
    field: 'IGasstationstatus',
    minWidth: 130,
  },
  {
    title: '竟对油站',
    fixed: 'left',
    field: 'youGasstationstatus',
    minWidth: 130,
  },

  {
    title: '汽油车',
    field: 'Gasolinecar',
    // minWidth: 130,
    children: [
      {
        title: '路面车流',
        field: 'GasRoadtraffic',
        minWidth: 130,
      },
      {
        title: '进站车流',
        field: 'GasIncomingtraffic',
        minWidth: 130,
      },
      {
        title: '拐入率',
        field: 'GasTurninrate',
        minWidth: 130,
      },
    ],
  },
  {
    title: '柴油车',
    field: 'dieselcar',
    // minWidth: 130,
    children: [
      {
        title: '路面车流',
        field: 'DieselRoadtraffic',
        minWidth: 130,
      },
      {
        title: '进站车流',
        field: 'DieselIncomingtraffic',
        minWidth: 130,
      },
      {
        title: '拐入率',
        field: 'DieselTurninrate',
        minWidth: 130,
      },
    ],
  },
  {
    title: '摩托车',
    field: 'Motorcycle',
    // minWidth: 130,
    children: [
      {
        title: '路面车流',
        field: 'MotoRoadtraffic',
        minWidth: 130,
      },
      {
        title: '进站车流',
        field: 'MotoIncomingtraffic',
        minWidth: 130,
      },
      {
        title: '拐入率',
        field: 'MotoTurninrate',
        minWidth: 130,
      },
    ],
  },
];
export const mockData = [
  {
    ProcessingTime: '2024-06-01 08:00:00',
    IGasstationstatus: '正常营业',
    youGasstationstatus: '促销中',
    GasRoadtraffic: 1200,
    GasIncomingtraffic: 320,
    GasTurninrate: '26.7%',
    DieselRoadtraffic: 800,
    DieselIncomingtraffic: 180,
    DieselTurninrate: '22.5%',
    MotoRoadtraffic: 450,
    MotoIncomingtraffic: 90,
    MotoTurninrate: '20.0%',
  },
  {
    ProcessingTime: '2024-06-01 09:15:00',
    IGasstationstatus: '库存预警',
    youGasstationstatus: '正常营业',
    GasRoadtraffic: 1350,
    GasIncomingtraffic: 380,
    GasTurninrate: '28.1%',
    DieselRoadtraffic: 920,
    DieselIncomingtraffic: 210,
    DieselTurninrate: '22.8%',
    MotoRoadtraffic: 510,
    MotoIncomingtraffic: 105,
    MotoTurninrate: '20.6%',
  },
  {
    ProcessingTime: '2024-06-01 10:30:00',
    IGasstationstatus: '正常营业',
    youGasstationstatus: '降价促销',
    GasRoadtraffic: 1100,
    GasIncomingtraffic: 310,
    GasTurninrate: '28.2%',
    DieselRoadtraffic: 750,
    DieselIncomingtraffic: 170,
    DieselTurninrate: '22.7%',
    MotoRoadtraffic: 480,
    MotoIncomingtraffic: 98,
    MotoTurninrate: '20.4%',
  },
  {
    ProcessingTime: '2024-06-01 11:45:00',
    IGasstationstatus: '设备维护',
    youGasstationstatus: '正常营业',
    GasRoadtraffic: 1250,
    GasIncomingtraffic: 340,
    GasTurninrate: '27.2%',
    DieselRoadtraffic: 880,
    DieselIncomingtraffic: 200,
    DieselTurninrate: '22.7%',
    MotoRoadtraffic: 520,
    MotoIncomingtraffic: 110,
    MotoTurninrate: '21.2%',
  },
  {
    ProcessingTime: '2024-06-01 13:00:00',
    IGasstationstatus: '正常营业',
    youGasstationstatus: '会员日',
    GasRoadtraffic: 1400,
    GasIncomingtraffic: 410,
    GasTurninrate: '29.3%',
    DieselRoadtraffic: 950,
    DieselIncomingtraffic: 225,
    DieselTurninrate: '23.7%',
    MotoRoadtraffic: 560,
    MotoIncomingtraffic: 120,
    MotoTurninrate: '21.4%',
  },
];
