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

export const statusOptions = await asyncGetOptions('FMViolationStatus');
export const violationTypeOptions = await asyncGetOptions('JGViolationType');
export const carTypeOptions = await asyncGetOptions('JGVehicleType');

export const columns: BasicColumn[] = [
  {
    title: '标题',
    dataIndex: 'Title',
  },
  {
    title: '上报时间',
    dataIndex: 'ReportTime',
  },
  {
    title: '状态',
    dataIndex: 'StatusName',
  },
  {
    title: '巡查点',
    dataIndex: 'PointName',
  },
  {
    title: '违法类型',
    dataIndex: 'ViolationTypeName',
  },
  {
    title: '当事人',
    dataIndex: 'PartyName',
  },
  {
    title: '当事人电话',
    dataIndex: 'PartyPhone',
  },
  {
    title: '问题描述',
    dataIndex: 'ProblemDescription',
  },
  // {
  //   title: '处理人',
  //   dataIndex: 'HandelUserName',
  // },
  // {
  //   title: '处理单位',
  //   dataIndex: 'HandelUnit',
  // },
  // {
  //   title: '处理时间',
  //   dataIndex: 'HandlingTime',
  // },
  {
    title: '上报人',
    dataIndex: 'ReportUserName',
  },
  {
    title: '上报单位',
    dataIndex: 'OrgName',
  },

];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'key',
    label: '标题',
    component: 'Input',
    colProps: { span: 4 },
  },
  {
    field: 'status',
    label: '违法状态',
    component: 'Select',
    colProps: { span: 4 },
    componentProps: {
      options: statusOptions,
    },
  },
  {
    field: 'viotype',
    label: '违法类型',
    component: 'Select',
    colProps: { span: 3 },
    componentProps: {
      options: violationTypeOptions,
    },
  },
  {
    field: 'pointname',
    label: '巡查点名称',
    component: 'Input',
    colProps: { span: 4 },
  },
  {
    field: '[begindate, enddate]',
    label: '上报时间',
    component: 'RangePicker',
    colProps: { span: 5 },
    componentProps: {
      format: 'YYYY-MM-DD',
      placeholder: ['开始日期', '结束日期'],
    },
  },
];
