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: 'Input',
    fieldName: 'TaskName',
    label: '任务名称',
  },
  {
    component: 'Input',
    fieldName: 'Executor',
    label: '执行人',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
    },
    fieldName: 'Createstatus',
    label: '创建',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
    },
    fieldName: 'TaskStatus',
    label: '任务状态',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
    },
    fieldName: 'Authorizablestatus',
    label: '可授权',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
    },
    fieldName: 'Authorizedstatus',
    label: '已授权',
  },
  {
    component: 'Input',
    fieldName: 'TaskLeader',
    label: '任务负责人',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
    },
    fieldName: 'Positionstatus',
    label: '岗位',
  },
  {
    component: 'DatePicker',
    componentProps: {
      type: 'daterange',
      format: 'YYYY-MM-DD',
      valueFormat: 'YYYY-MM-DD',
      startPlaceholder: '开始日期',
      endPlaceholder: '结束日期',
    },
    fieldName: 'OperationTime',
    label: '操作时间',
  },
  {
    component: 'DatePicker',
    componentProps: {
      type: 'daterange',
      format: 'YYYY-MM-DD',
      valueFormat: 'YYYY-MM-DD',
      startPlaceholder: '开始日期',
      endPlaceholder: '结束日期',
    },
    fieldName: 'InvalidTime',
    label: '失效时间',
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
    },
    fieldName: 'TaskTypestatus',
    label: '任务类型',
  },
];

export const columns: VxeGridProps['columns'] = [
  {
    field: 'action',
    fixed: 'left',
    slots: { default: 'action' },
    resizable: false,
    title: '操作',
    width: 180,
  },
  {
    title: '任务名称',
    field: 'TaskName',
    minWidth: 130,
  },
  {
    title: '可授权',
    field: 'Authorizable',
    minWidth: 130,
  },
  {
    title: '已授权',
    field: 'Authorized',
    minWidth: 130,
  },
  {
    title: '执行人',
    field: 'Executor',
    minWidth: 130,
  },
  {
    title: '岗位',
    field: 'Position',
    minWidth: 130,
  },
  {
    title: '油站',
    field: 'Gasstation',
    minWidth: 130,
  },
  {
    title: '失效时间',
    field: 'ExpirationDate',
    minWidth: 130,
  },
  {
    title: '操作时间',
    field: 'OperationTime',
    minWidth: 130,
  },
  {
    title: '任务状态',
    field: 'TaskStatus',
    minWidth: 130,
  },
  {
    title: '创建',
    field: 'Create',
    minWidth: 130,
  },
  {
    title: '任务类型',
    field: 'TaskType',
    minWidth: 130,
  },
  {
    title: '任务负责人',
    field: 'TaskLeader',
    minWidth: 130,
  },
  {
    title: '片区',
    field: 'Area',
    minWidth: 130,
  },
];
