import { BasicColumn, FormSchema } from '@/components/Table';
import { asyncGetOptions } from '@/utils/global'

export const statusOptions = await asyncGetOptions('JGPickUpStatus');
export const carTypeOptions = await asyncGetOptions('JGVehicleType');

export const columns: BasicColumn[] = [
  {
    title: '发起时间',
    dataIndex: 'InitiateTime',
  },
  {
    title: '发起人',
    dataIndex: 'InitiatorName',
  },
  {
    title: '状态',
    dataIndex: 'Status',
  },
  {
    title: '巡查点',
    dataIndex: 'PointName',
  },
  {
    title: '审核人',
    dataIndex: 'ReviewerName',
  },
  {
    title: '审核时间',
    dataIndex: 'ReviewTime',
  },
  {
    title: '审核意见',
    dataIndex: 'ReviewComments',
  },
  {
    title: '备注',
    dataIndex: 'Remark',
  }
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'key',
    label: '名称',
    component: 'Input',
    colProps: { span: 4 },
  },
  {
    field: 'pointname',
    label: '巡查点名称',
    component: 'Input',
    colProps: { span: 4 },
  },
  {
    field: 'status',
    label: '提车状态',
    component: 'Select',
    colProps: { span: 4 },
    componentProps: {
      options: statusOptions,
    },
  },
  {
    field: '[begindate, enddate]',
    label: '发起时间',
    component: 'RangePicker',
    colProps: { span: 5 },
    componentProps: {
      format: 'YYYY-MM-DD',
      placeholder: ['开始日期', '结束日期'],
    },
  },
];
