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: 'Select',
    fieldName: 'tag',
    label: '标签',
    componentProps: {
      placeholder: '请选择标签',
      options: [
        { label: '服务态度', value: '服务态度' },
        { label: '安全管理', value: '安全管理' },
        { label: '设备维护', value: '设备维护' },
        { label: '库存管理', value: '库存管理' },
        { label: '环境整洁', value: '环境整洁' },
      ],
    },
  },
  {
    component: 'DatePicker',
    fieldName: 'processingTime',
    label: '处理时间',
    componentProps: {
      type: 'daterange',
      format: 'YYYY-MM-DD',
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
      startPlaceholder: '开始日期',
      endPlaceholder: '结束日期',
    },
  },
  {
    component: 'Input',
    fieldName: 'taskName',
    label: '任务名称',
    componentProps: {
      placeholder: '请输入任务名称',
    },
  },
];

export const tableColumns: VxeGridProps['columns'] = [
  {
    type: 'checkbox',
    width: 80,
  },
  {
    field: 'station',
    title: '油站',
    minWidth: 120,
  },
  {
    field: 'processingTime',
    title: '任务处理时间',
    minWidth: 180,
  },
  {
    field: 'taskName',
    title: '任务名称',
    minWidth: 150,
  },
  {
    field: 'tag',
    title: '标签',
    minWidth: 120,
  },
  {
    field: 'tagTotalScore',
    title: '标签总分',
    minWidth: 120,
    align: 'center',
  },
  {
    field: 'exceptionCount',
    title: '异常数',
    minWidth: 120,
    align: 'center',
  },
  {
    field: 'noPhotoCount',
    title: '无拍照',
    minWidth: 120,
    align: 'center',
  }
];
