import { BasicColumn } from '@/components/Table';
import { FormSchema } from '@/components/Form';

export const formSchemas: FormSchema[] = [
  {
    label: '注册代码',
    field: 'registCode',
    component: 'Input',
  },
  {
    label: '电梯编号',
    field: 'elevatorCode',
    component: 'Input',
  },
  {
    label: '二维码编号',
    field: 'qrCode',
    component: 'Input',
  },
  {
    label: '反馈状态',
    field: 'status',
    component: 'Select',
    componentProps: {
      options: [
        { label: '待回复', value: 1 },
        { label: '已回复', value: 2 },
      ],
    },
  },
  {
    label: '反馈时间起',
    field: 'startTime',
    required: false,
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      format: 'YYYY-MM-DD ',
      valueFormat: 'YYYY-MM-DD',
    },
  },
  {
    label: '反馈时间止',
    field: 'endTime',
    required: false,
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      format: 'YYYY-MM-DD ',
      valueFormat: 'YYYY-MM-DD',
    },
  },
  {
    label: '回复时间起',
    field: 'dealStartTime',
    required: false,
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      format: 'YYYY-MM-DD ',
      valueFormat: 'YYYY-MM-DD',
    },
  },
  {
    label: '回复时间止',
    field: 'dealEndTime',
    required: false,
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      format: 'YYYY-MM-DD ',
      valueFormat: 'YYYY-MM-DD',
    },
  },
];

export const columns: BasicColumn[] = [
  {
    title: '主键id',
    dataIndex: 'id',
    ifShow: false,
  },
  {
    title: '注册代码',
    dataIndex: 'registCode',
  },
  {
    title: '电梯编号',
    dataIndex: 'elevatorNum',
  },
  {
    title: '二维码编号',
    dataIndex: 'qrCode',
  },
  {
    title: '电梯名称',
    dataIndex: 'elevatorName',
  },
  {
    title: '回复状态',
    dataIndex: 'replyState',
  },
  {
    title: '回复时间',
    dataIndex: 'replyTime',
  },
  {
    title: '反馈内容',
    dataIndex: 'content',
  },
  {
    title: '处理意见',
    dataIndex: 'suggestion',
  },
];

export const modalSchemas: FormSchema[] = [
  {
    label: '主键id',
    field: 'id',
    required: false,
    component: 'Input',
    show: false,
  },
  {
    label: '电梯编号',
    field: 'elevatorNum',
    required: true,
    component: 'Input',
  },
  {
    label: '电梯名称',
    field: 'elevatorName',
    required: true,
    component: 'Input',
  },
  {
    label: '电梯地址',
    field: 'elevatorAddress',
    required: true,
    component: 'Input',
  },
  {
    label: '联系人',
    field: 'contacts',
    required: true,
    component: 'Input',
  },
  {
    label: '联系方式',
    field: 'contactsPhone',
    required: true,
    component: 'Input',
  },
  {
    label: '物业单位',
    field: 'tenement',
    required: true,
    component: 'Input',
  },
  {
    label: '维保单位',
    field: 'maintenance',
    required: true,
    component: 'Input',
  },
  {
    label: '品牌',
    field: 'brand',
    required: true,
    component: 'Input',
  },
  {
    label: '楼宇',
    field: 'building',
    required: true,
    component: 'Input',
  },
  {
    label: '回复状态',
    field: 'replyState',
    required: true,
    component: 'Input',
  },
  {
    label: '回复时间',
    field: 'replyTime',
    required: true,
    component: 'Input',
  },
  {
    label: '反馈内容',
    field: 'content',
    required: true,
    component: 'RichTextarea',
    /**
     * 注意 好像没啥可写的
     */
    componentProps: {
      // 没啥可写的
    },
  },
  {
    label: '处理意见',
    field: 'suggestion',
    required: true,
    component: 'Input',
  },
];
