import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';

export const columns: BasicColumn[] = [
  {
    title: '姓名',
    dataIndex: 'zjxm'
  },
  {
    title: '工作单位所在区域',
    dataIndex: 'gzdwszqyName'
  },
  {
    title: '工作单位',
    dataIndex: 'gzdw'
  },
  {
    title: '技术职称',
    dataIndex: 'jszc',
    customRender: ({ record }: any) => {
      console.log(record, 'record')
      let res = ''
      if (record.status == 1) {
        res = '副研究员'
      } else if (record.status == 2) {
        res = '助理研究员'
      } else if (record.status == 4) {
        res = '研究员'
      } else if (record.status == 5) {
        res = '教授'
      } else if (record.status == 6) {
        res = '教授级高工'
      } else if (record.status == 7) {
        res = '工程师'
      } else if (record.status == 8) {
        res = '农艺师'
      } else if (record.status == 9) {
        res = '"千人计划"特聘专家'
      } else if (record.status == 10) {
        res = '副教授'
      } else if (record.status == 11) {
        res = '助理工程师'
      } else if (record.status == 12) {
        res = '高级农艺师'
      } else if (record.status == 13) {
        res = '环评工程师'
      }
      return res
    },
  },
  {
    title: '专家类别',
    dataIndex: 'zjlbName'
  },
  {
    title: '创建人',
    dataIndex: 'createByName'
  },
  {
    title: '登录账号',
    dataIndex: 'lxfsSj'
  },
  {
    title: '状态',
    dataIndex: 'status',
    customRender: ({ record }: any) => {
      console.log(record, 'record')
      let res = ''
      if (record.status == 10) {
        res = '启用'
      } else if (record.status == -10) {
        res = '停用'
      }
      return res
    },
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    label: '姓名',
    field: 'zjxm',
    component: 'Input'
  },
  {
    label: '工作单位',
    field: 'gzdw',
    component: 'Input'
  },
  {
    label: '专家类别',
    field: 'zjlbName',
    component: 'Input'
  },
  {
    label: '创建人',
    field: 'createByName',
    component: 'Input'
  },
  {
    label: '工作单位所在区域',
    field: 'createByName',
    component: 'Select',
    
  },
];

export const formSchema: FormSchema[] = [
  // TODO 主键隐藏字段，目前写死为ID
  { label: '', field: 'id', component: 'Input', show: false },
  {
    label: '身份证号',
    field: 'sfzh',
    component: 'Input',
  },
  {
    label: '姓名',
    field: 'zjxm',
    component: 'Input',
  },
  {
    label: '出生年月',
    field: 'csny',
    component: 'Input',
  },
  {
    label: '性别',
    field: 'sex',
    component: 'Input',
  },
  {
    label: '民族',
    field: 'mz',
    component: 'Input',
  },
  {
    label: '照片',
    field: 'photo',
    component: 'Input',
  },
  {
    label: '工作单位所在区域',
    field: 'gzdwszqyName',
    component: 'Input',
  },
  {
    label: '健康状况',
    field: 'jkzk',
    component: 'Input',
  },
  {
    label: '技术职称',
    field: 'jszc',
    component: 'Input',
  },
  {
    label: '评聘时间',
    field: 'ppsj',
    component: 'Input',
  },
  {
    label: '创建人',
    field: 'createByName',
    component: 'Input',
  },

  {
    label: '单位地址',
    field: 'dwdz',
    component: 'Input',
  },
  {
    label: '单位电话',
    field: 'dwdh',
    component: 'Input',
  },
  {
    label: '职业资格证书名称',
    field: 'zyzgzsmc',
    component: 'Input',
  },
  {
    label: '职业资格证书编号',
    field: 'zyzgzsbh',
    component: 'Input',
  },
  {
    label: '专业类别',
    field: 'zylb',
    component: 'Input',
  },
  {
    label: '状态：启用、停用',
    field: 'status',
    component: 'Input',
  },
  {
    label: '行业领域编码',
    field: 'hylyCode',
    component: 'Input',
  },
  {
    label: '行业领域名称',
    field: 'hylyName',
    component: 'Input',
  },
  {
    label: '行业领域其它',
    field: 'hylyQt',
    component: 'Input',
  },
  {
    label: '专业领域编码',
    field: 'zylyCode',
    component: 'Input',
  },
  {
    label: '专业领域名称',
    field: 'zylyName',
    component: 'Input',
  },
  {
    label: '专业领域其它',
    field: 'zylyQt',
    component: 'Input',
  },
  {
    label: '专家类别编码',
    field: 'zjlbCode',
    component: 'Input',
  },
  {
    label: '专家类别名称',
    field: 'zjlbName',
    component: 'Input',
  },
  {
    label: '专家类别其它',
    field: 'zjlbQt',
    component: 'Input',
  },
  {
    label: '个人简历',
    field: 'grjl',
    component: 'Input',
  },
  {
    label: '备注',
    field: 'bz',
    component: 'Input',
  },
  {
    label: '附件名称',
    field: 'fileName',
    component: 'Input',
  },
  {
    label: '附件地址',
    field: 'filePath',
    component: 'Input',
  },
  {
    label: '专家级别',
    field: 'level',
    component: 'Input',
  },
  {
    label: '备注',
    field: 'bz',
    component: 'Input',
  },
];
