import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';

export const queryFormSchema: FormSchemaGetter = () => [
  {
    component: 'Select',
    fieldName: 'station',
    label: '油站',
    componentProps: {
      placeholder: '请选择油站',
      options: [
        { label: '油站1', value: '油站1' },
        { label: '油站2', value: '油站2' },
        { label: '油站3', value: '油站3' },
        { label: '油站4', value: '油站4' },
        { label: '油站5', value: '油站5' },
      ],
    },
  },
  {
    component: 'DatePicker',
    fieldName: 'taskProcessingTime',
    label: '任务时间',
    componentProps: {
      type: 'daterange',
      format: 'YYYY-MM-DD',
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
      startPlaceholder: '开始日期',
      endPlaceholder: '结束日期',
    },
  },
  {
    component: 'Input',
    fieldName: 'taskName',
    label: '任务名称',
    componentProps: {
      placeholder: '请输入任务名称',
    },
  },
  {
    component: 'Input',
    fieldName: 'checkPerson',
    label: '查阅人',
    componentProps: {
      placeholder: '请输入查阅人',
    },
  },
  {
    component: 'Select',
    fieldName: 'checkPersonPosition',
    label: '查询人岗位',
    componentProps: {
      placeholder: '请选择查询人岗位',
      options: [
        { label: '站长', value: '站长' },
        { label: '营业员', value: '营业员' },
        { label: '安全员', value: '安全员' },
        { label: '主管', value: '主管' },
        { label: '区域经理', value: '区域经理' },
      ],
    },
  },
  {
    component: 'Input',
    fieldName: 'checkedPerson',
    label: '被查阅人',
    componentProps: {
      placeholder: '请输入被查阅人',
    },
  },
  {
    component: 'Select',
    fieldName: 'checkedPersonPosition',
    label: '被查阅岗位',
    componentProps: {
      placeholder: '请选择被查阅岗位',
      options: [
        { label: '站长', value: '站长' },
        { label: '营业员', value: '营业员' },
        { label: '安全员', value: '安全员' },
        { label: '主管', value: '主管' },
        { label: '区域经理', value: '区域经理' },
      ],
    },
  },
];

export const tableColumns: VxeGridProps['columns'] = [
  {
    type: 'checkbox',
    width: 80,
  },
  {
    field: 'checkedPerson',
    title: '被查阅人',
    minWidth: 120,
  },
  {
    field: 'checkedPersonPosition',
    title: '被查阅人岗位',
    minWidth: 120,
  },
  {
    field: 'station',
    title: '油站',
    minWidth: 120,
  },
  {
    field: 'taskName',
    title: '任务名称',
    minWidth: 150,
  },
  {
    field: 'taskProcessingTime',
    title: '处理任务时间',
    minWidth: 180,
  },
  {
    field: 'checkPerson',
    title: '查阅人',
    minWidth: 120,
  },
  {
    field: 'checkPersonPosition',
    title: '查阅人岗位',
    minWidth: 120,
  },
  {
    field: 'checkTime',
    title: '查阅时间',
    minWidth: 180,
  },
  {
    field: 'intervalDays',
    title: '时间间隔(天)',
    minWidth: 120,
    align: 'center',
  }
];
