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: 'stationStatus',
    label: '油站',
  },
  {
    component: 'Input',
    fieldName: 'taskName',
    label: '任务名称',
  },
  {
    component: 'Input',
    fieldName: 'executorName',
    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: 'authorizable',
    label: '可授权',
  },
  {
    component: 'Select',
    componentProps: { options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE) },
    fieldName: 'authorized',
    label: '已授权',
  },
  {
    component: 'Input',
    fieldName: 'taskLeader',
    label: '任务负责人',
  },
  {
    component: 'Select',
    componentProps: { options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE) },
    fieldName: 'position',
    label: '岗位',
  },
  {
    component: 'DatePicker',
    componentProps: {
      type: 'daterange',
      format: 'YYYY-MM-DD',
      valueFormat: 'YYYY-MM-DD',
      startPlaceholder: '开始日期',
      endPlaceholder: '结束日期',
    },
    fieldName: 'operateTime',
    label: '操作时间',
  },
  {
    component: 'DatePicker',
    componentProps: {
      type: 'daterange',
      format: 'YYYY-MM-DD',
      valueFormat: 'YYYY-MM-DD',
      startPlaceholder: '开始日期',
      endPlaceholder: '结束日期',
    },
    fieldName: 'expireTime',
    label: '失效时间',
  },
];
export const columns: VxeGridProps['columns'] = [
  {
    type: 'checkbox',
    width: 60,
  },
  {
    type: 'seq',
    title: '序号',
    // fixed: 'left',
    width: 70,
  },
  {
    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: 'executorName',
    minWidth: 130,
  },
  {
    title: '岗位',
    field: 'position',
    minWidth: 130,
  },
  {
    title: '油站',
    field: 'stationName',
    minWidth: 130,
  },
  {
    title: '失效时间',
    field: 'expireTime',
    minWidth: 130,
  },
  {
    title: '计划时间',
    field: 'planTime',
    minWidth: 130,
  },
  {
    title: '任务状态',
    field: 'taskStatus',
    minWidth: 130,
  },
  {
    title: '创建',
    field: 'createStatus',
    minWidth: 130,
  },
  {
    title: '任务负责人',
    field: 'taskLeader',
    minWidth: 130,
  },
  {
    title: '片区',
    field: 'areaName',
    minWidth: 130,
  },
];
