import { BasicColumn } from '@/components/Table';
import { FormSchema } from '@/components/Form';
import { getDictOptions } from '@/utils/dict';
export const formSchemas: FormSchema[] = [
  {
    label: '电梯编号',
    field: 'elevatorNum',
    component: 'Input',
  },
  {
    label: '电梯名称',
    field: 'elevatorName',
    component: 'Input',
  },

  {
    label: '生成维保计划',
    field: 'maintenanceType',
    component: 'Select',
    componentProps: {
      options: getDictOptions('common_yes_no'),
    },
  },
  {
    label: '完成维保工作',
    field: 'achieveType',
    component: 'Select',
    componentProps: {
      options: getDictOptions('common_yes_no'),
    },
  },
];
import { useRender } from '@/hooks/component/useRender';
const { renderTag, renderDict } = useRender();
export const columns: BasicColumn[] = [
  {
    title: '主键id',
    dataIndex: 'id',
    ifShow: false,
  },
  {
    title: '电梯编号',
    dataIndex: 'elevatorNum',
  },
  {
    title: '电梯编名称',
    dataIndex: 'elevatorName',
  },
  {
    title: '电梯地址',
    dataIndex: 'elevatorAddress',
  },
  {
    title: '楼宇',
    dataIndex: 'buildingName',
  },
  {
    title: '类型',
    dataIndex: 'maintenanceType',
  },
  {
    title: '品牌',
    dataIndex: 'brand',
    customRender: ({ value }) => renderDict(value, 'eva_brand'),
  },

  {
    title: '完成时间',
    dataIndex: 'installDate',
  },
];

export const planColmus: BasicColumn[] = [
  {
    title: '主键id',
    dataIndex: 'id',
    ifShow: false,
  },
  {
    title: '电梯名称',
    dataIndex: 'elevatorName',
  },
  {
    title: '电梯地址',
    dataIndex: 'elevatorAddress',
    width: 300
  },
  {
    title: '期望时间',
    dataIndex: 'expectTime',
  },
  {
    title: '创建时间',
    dataIndex: 'createdTime',
  },
  {
    title: '状态',
    dataIndex: 'state',
    customRender: ({ value }) => renderDict(value, 'workinfo_status'),
  },
  // {
  //   title: '工作类型',
  //   dataIndex: 'workType',
  //   customRender: ({ value }) => renderDict(value, 'sys_work_type'),
  // },
  {
    title: '维保类型',
    dataIndex: 'planType',
    customRender: ({ value }) => renderDict(value, 'maintenance_type'),
  },
  {
    title: '电梯编号',
    dataIndex: 'elevatorNum',
  },
  {
    title: '二维码编号',
    dataIndex: 'qrCode',
  },







  {
    title: '描述',
    dataIndex: 'description',
  },
];
export const yearColmus: BasicColumn[] = [
  {
    title: '主键id',
    dataIndex: 'id',
    ifShow: false,
  },
  {
    title: '本次年检日期',
    dataIndex: 'annualDate',
  },
  {
    title: '下次年检日期',
    dataIndex: 'nextAnnual',
  },

  {
    title: '状态',
    dataIndex: 'state',
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
  },
];
export const modalSchemas: FormSchema[] = [
  {
    label: '主键id',
    field: 'id',
    required: false,
    component: 'Input',
    show: false,
  },
  {
    label: '电梯编号',
    field: 'elevatorNum',
    required: true,
    component: 'Input',
  },
  {
    label: '维保人员',
    field: 'maintainer',
    required: true,
    component: 'Input',
  },
  {
    label: '维保类型',
    field: 'maintenanceType',
    required: true,
    component: 'Select',
  },
  {
    label: '描述',
    field: 'description',
    required: true,
    component: 'Input',
  },
  {
    label: '完成时间',
    field: 'finishTime',
    required: true,
    component: 'DatePicker',
  },
];
export const modalPlanSchemas: FormSchema[] = [
  {
    label: '生成类型',
    field: 'planType',
    required: false,
    component: 'Select',
    componentProps: {
      options: getDictOptions('maintenance_type_create'),
    },
  },
  {
    label: '计划日期',
    field: 'planTime',
    required: true,
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      format: 'YYYY-MM-DD ',
      valueFormat: 'YYYY-MM-DD',
    },
  },
];
export const formEvaSchemas: FormSchema[] = [
  {
    label: '电梯名称',
    field: 'elevatorName',
    component: 'Input',
  },
];

export const evaColumns: BasicColumn[] = [
  {
    title: '电梯名称',
    dataIndex: 'elevatorName',
  },
];

export const modalEvaSchemas: FormSchema[] = [
  {
    label: '主键id',
    field: 'id',
    required: false,
    component: 'Input',
    show: false,
  },
  {
    label: '工作类型',
    field: 'workType',
    required: false,
    component: 'Select',
    componentProps: {
      options: getDictOptions('sys_work_type'),
    },
  },
  {
    label: '期望时间',
    field: 'exceptTime',
    required: false,
    component: 'DatePicker',
  },
];
