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

export const formSchemas: FormSchema[] = [
  {
    label: '配件编号',
    field: 'code',
    component: 'Input',
  },
  {
    label: '配件名称',
    field: 'name',
    component: 'Input',
  },
  {
    label: '配件数量',
    field: 'number',
    component: 'Input',
  },
  {
    label: '配件规格',
    field: 'specs',
    component: 'Input',
  },
  // {
  //   label: '部门id',
  //   field: 'deptId',
  //   component: 'Input',
  // },
  {
    label: '电梯编号',
    field: 'elevatorNum',
    component: 'Input',
  },
];

export const columns: BasicColumn[] = [
  {
    title: '主键id',
    dataIndex: 'id',
    ifShow: false,
  },
  {
    title: '配件编号',
    dataIndex: 'code',
  },
  {
    title: '配件名称',
    dataIndex: 'name',
  },
  {
    title: '配件数量',
    dataIndex: 'number',
  },
  {
    title: '配件规格',
    dataIndex: 'specs',
  },
  {
    title: '部门id',
    dataIndex: 'deptId',
  },
  {
    title: '备注',
    dataIndex: 'remark',
  },
  {
    title: '电梯编号',
    dataIndex: 'elevatorNum',
  },
];

export const modalSchemas: FormSchema[] = [
  {
    label: '主键id',
    field: 'id',
    required: false,
    component: 'Input',
    show: false,
  },
  {
    label: '配件编号',
    field: 'code',
    required: true,
    component: 'Input',
  },
  {
    label: '配件名称',
    field: 'name',
    required: true,
    component: 'Input',
  },
  {
    label: '配件数量',
    field: 'number',
    required: true,
    component: 'Input',
  },
  {
    label: '配件规格',
    field: 'specs',
    required: true,
    component: 'Input',
  },
  {
    label: '项目',
    field: 'deptId',
    required: true,
    component: 'TreeSelect',
    helpMessage: ['注意绑定的角色要带相应的部门权限, 否则无法正常登录'],
  },
  {
    label: '备注',
    field: 'remark',
    required: true,
    component: 'Input',
  },
  {
    label: '电梯编号',
    field: 'elevatorNum',
    required: true,
    component: 'Input',
  },
];
