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

export const queryFormSchema: FormSchemaGetter = () => [
  {
    component: 'Select',
    fieldName: 'area',
    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: '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: 'timeRange',
    label: '时间',
    componentProps: {
      type: 'daterange',
      format: 'YYYY-MM-DD HH:mm:ss',
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
      startPlaceholder: '开始时间',
      endPlaceholder: '结束时间',
    },
  },
  {
    component: 'Input',
    fieldName: 'executor',
    label: '执行人',
    componentProps: {
      placeholder: '请输入执行人',
    },
  },
];

export const tableColumns: VxeGridProps['columns'] = [
  {
    type: 'checkbox',
    width: 80,
  },
  {
    field: 'station',
    title: '油站',
    minWidth: 120,
  },
  {
    field: 'name',
    title: '任务名称',
    minWidth: 180,
  },
  {
    field: 'type',
    title: '类型',
    minWidth: 120,
  },
  {
    field: 'score',
    title: '分数',
    minWidth: 100,
    align: 'center',
  },
  {
    field: 'percentageScore',
    title: '折算百分制',
    minWidth: 120,
    align: 'center',
  },
  {
    field: 'exceptionCount',
    title: '异常数',
    minWidth: 100,
    align: 'center',
  },
  {
    field: 'time',
    title: '时间',
    minWidth: 200,
  },
  {
    field: 'executor',
    title: '执行人',
    minWidth: 120,
  },
  {
    field: 'position',
    title: '岗位',
    minWidth: 120,
  }
];
