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: 'GasArrivingTrains',
        minWidth: 130,
      },
      {
        title: '加油升数差',
        field: 'GasOilNumber',
        minWidth: 130,
      },
    ],
  },
  {
    title: '柴油车',
    field: 'dieselcar',
    // minWidth: 130,
    children: [
      {
        title: '进站车次',
        field: 'dieArrivingTrains',
        minWidth: 130,
      },
      {
        title: '加油升数差',
        field: 'dieOilNumber',
        minWidth: 130,
      },
    ],
  },
  {
    title: '摩托车',
    field: 'Motorcycle',
    // minWidth: 130,
    children: [
      {
        title: '进站车次',
        field: 'MotoArrivingTrains',
        minWidth: 130,
      },
      {
        title: '加油升数差',
        field: 'MotoOilNumber',
        minWidth: 130,
      },
    ],
  },
  {
    title: '气车',
    field: 'pneumaticcar',
    // minWidth: 130,
    children: [
      {
        title: '进站车次',
        field: 'pneuArrivingTrains',
        minWidth: 130,
      },
      {
        title: '加油升数差',
        field: 'pneuOilNumber',
        minWidth: 130,
      },
    ],
  },
  {
    title: '时段预测销量差（升）',
    field: 'TimePredictionSales',
    minWidth: 170,
  },
];
export const mockData = [
  {
    ProcessingTime: '2024-06-01 08:00:00',
    IGasstationstatus: '正常营业',
    youGasstationstatus: '促销中',
    GasArrivingTrains: 320,
    GasOilNumber: -120,
    dieArrivingTrains: 180,
    dieOilNumber: -80,
    MotoArrivingTrains: 90,
    MotoOilNumber: -35,
    pneuArrivingTrains: 50,
    pneuOilNumber: -20,
    TimePredictionSales: -355,
  },
  {
    ProcessingTime: '2024-06-01 09:15:00',
    IGasstationstatus: '库存预警',
    youGasstationstatus: '正常营业',
    GasArrivingTrains: 380,
    GasOilNumber: -150,
    dieArrivingTrains: 210,
    dieOilNumber: -95,
    MotoArrivingTrains: 105,
    MotoOilNumber: -42,
    pneuArrivingTrains: 60,
    pneuOilNumber: -25,
    TimePredictionSales: -312,
  },
  {
    ProcessingTime: '2024-06-01 10:30:00',
    IGasstationstatus: '正常营业',
    youGasstationstatus: '降价促销',
    GasArrivingTrains: 310,
    GasOilNumber: -135,
    dieArrivingTrains: 170,
    dieOilNumber: -78,
    MotoArrivingTrains: 98,
    MotoOilNumber: -40,
    pneuArrivingTrains: 55,
    pneuOilNumber: -22,
    TimePredictionSales: -275,
  },
  {
    ProcessingTime: '2024-06-01 11:45:00',
    IGasstationstatus: '设备维护',
    youGasstationstatus: '正常营业',
    GasArrivingTrains: 340,
    GasOilNumber: -160,
    dieArrivingTrains: 200,
    dieOilNumber: -88,
    MotoArrivingTrains: 110,
    MotoOilNumber: -45,
    pneuArrivingTrains: 65,
    pneuOilNumber: -28,
    TimePredictionSales: -321,
  },
  {
    ProcessingTime: '2024-06-01 13:00:00',
    IGasstationstatus: '正常营业',
    youGasstationstatus: '会员日',
    GasArrivingTrains: 410,
    GasOilNumber: -185,
    dieArrivingTrains: 225,
    dieOilNumber: -105,
    MotoArrivingTrains: 120,
    MotoOilNumber: -52,
    pneuArrivingTrains: 70,
    pneuOilNumber: -30,
    TimePredictionSales: -372,
  },
];
