import {getDetails} from '@/api/admin/user';

export const tableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  menuAlign: 'center',
  searchMenuSpan: 6,
  editBtn: false,
  delBtn: false,
  dialogClickModal: false,
  dialogCloseBtn: false,
  align: 'center',
  addBtn: false,
  column: [
    {
      fixed: true,
      label: 'id',
      prop: 'userId',
      span: 24,
      hide: true,
      editDisplay: false,
      addDisplay: false
    },
    {
      fixed: true,
      label: '人员名称',
      prop: 'realname',
      editDisabled: true,
      search: true,
      slot: true,
      span: 24,
      rules: [
        {
          required: true,
          message: '请输入正确的承接方'
        },
        {
          min: 1,
          max: 20,
          message: '长度在 1 到 20 个字符',
          trigger: 'blur'
        }
      ]
    },
    {
      fixed: true,
      label: '手机号',
      prop: 'username',
      slot: true,
      editDisabled: true,
      search: true,
      maxlength: 11,
      span: 24,
      rules: [
        {
          required: true,
          pattern: /^[0-9]*$/g,
          message: '请输入正确的手机号格式'
        },
        {
          min: 11,
          max: 11,
          message: '长度在 11 个字符',
          trigger: 'blur'
        }
      ]
    },
    {
      label: '身份证号',
      prop: 'idCardNumber',
      type: 'input',
      value: '',
      span: 24,
      hide: true,
      rules: [
        {
          pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X)$)/,
          message: '请输入正确的身份证号格式，如存在x请输入大写',
          trigger: 'blur'
        }
      ],
      tip: '注：全职及兼职用户需年满18周岁未满60周岁\n'
    },

    {
      label: '人员角色',
      prop: 'role',
      type: 'select',
      multiple: true,
      slot: true,
      formslot: true,
      overHidden: true,
      span: 24,
      search: true,
      rules: [
        {
          required: true,
          message: '请选择角色',
          trigger: 'blur'
        }
      ],
      dicUrl: '/admin/role/listRoleExcludeAdmin',
      props: {
        label: 'roleName',
        value: 'roleId'
      }
    },
    {
      editDisplay: false,
      addDisplay: false,
      label: '派工方',
      prop: 'deptId',
      span: 24,
      search: true,
      searchslot: true,
      formslot: true,
      rules: [
        {
          required: true,
          message: '请选择派工方',
          trigger: 'change'
        }
      ],
      dicUrl: '/admin/wmdaagent/listByDept',
      type: 'select',
      props: {
        label: 'name',
        value: 'deptId'
      }
    },
    {
      hide: true,
      addDisplay: false,
      editDisplay: false,
      label: '上级主管',
      prop: 'parentIdList',
      span: 24,
      dicUrl: '/admin/user/list-csm',
      type: 'select',
      multiple: true,
      props: {
        label: 'realname',
        value: 'userId'
      }
    },
    {
      label: '所属区域',
      type: 'select',
      multiple: true,
      prop: 'areaCodes',
      searchType: Array,
      searchValue: [],
      addDisplay: false,
      editDisplay: false,
      hide: true,
      search: true,
      searchslot: true
    },
    {
      label: '所属区域',
      prop: 'areaCodesData',
      type: 'select',
      hide: true,
      formslot: true,
      slot: true,
      overHidden: true,
      span: 24,
      rules: [
        {
          required: true,
          message: '请选择所属区域',
          trigger: 'blur'
        }
      ]
    },
    {
      width: 120,
      label: '启停状态',
      prop: 'lockFlag',
      type: 'radio',
      search: true,
      slot: true,
      border: true,
      span: 24,
      rules: [
        {
          required: true,
          message: '请选择状态',
          trigger: 'blur'
        }
      ],
      dicData: [
        {
          label: '活跃',
          value: '0'
        },
        {
          label: '休眠',
          value: '9'
        }
      ]
    },
    {
      width: 120,
      label: '创建时间',
      prop: 'createTime',
      type: 'datetime',
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      editDisabled: true,
      addDisplay: false,
      span: 24
    }
    // {
    //   type: "input",
    //   addDisplay: false,
    //   editDisplay: false,
    //   span: 24,
    //   label: "测评结果",
    //   prop: "quizResult",
    //   slot: true,
    //   width: 90
    // }
  ]
};

export const importErrorTableOption = {
  align: 'center',
  border: true,
  addBtn: false,
  editBtn: false,
  delBtn: false,
  viewBtn: false,
  menu: false,
  refreshBtn: false,
  columnBtn: false,
  searchBtn: false,
  column: [
    {
      label: '错误原因',
      prop: 'reason'
    },
    {
      label: '错误行序号',
      prop: 'index'
    }
  ]
};

export const revisitTableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  // stripe: true,
  menuAlign: 'center',
  searchMenuSpan: 6,
  editBtn: false,
  delBtn: false,
  align: 'center',
  addBtn: false,
  column: [
    {
      label: '类型',
      prop: 'type'
    },
    {
      label: '创建时间',
      prop: 'createTime'
    }
  ]
};

export const recordReviewTableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  menuAlign: 'center',
  searchMenuSpan: 6,
  editBtn: false,
  delBtn: false,
  dialogClickModal: false,
  dialogCloseBtn: false,
  align: 'center',
  addBtn: false,
  column: [
    {
      type: 'input',
      label: '人员名称',
      prop: 'realname',
      search: true,
      span: 24
    },
    {
      type: 'input',
      label: '手机号',
      prop: 'username',
      search: true,
      maxlength: 11,
      span: 24
    },

    {
      label: '人员角色',
      prop: 'role',
      type: 'select',
      slot: true,
      overHidden: true,
      span: 24,
      dicData: [
        {
          roleName: '全职学术推广员',
          roleId: '5'
        },
        {
          roleName: '兼职学术信息沟通专员',
          roleId: '6'
        }
      ],
      dicUrl: '/admin/role/listRoleExcludeAdmin',
      props: {
        label: 'roleName',
        value: 'roleId'
      }
    },
    {
      label: '派工方',
      prop: 'deptName'
    },
    {
      editDisplay: false,
      addDisplay: false,
      label: '派工方',
      prop: 'deptId',
      span: 24,
      hide: true,
      search: true,
      rules: [
        {
          required: true,
          message: '请选择派工方',
          trigger: 'change'
        }
      ],

      dicUrl: '/admin/wmdaagent/listByDept',
      type: 'select',
      formatter: function(row) {
        return row.deptId + '';
      },
      props: {
        label: 'name',
        value: 'deptId'
      }
    },

    {
      label: '所属区域',
      type: 'select',
      multiple: true,
      prop: 'areaCodes',
      searchType: Array,
      searchValue: [],
      addDisplay: false,
      editDisplay: false,
      hide: true,
      searchslot: true
    },
    {
      label: '所属区域',
      prop: 'areaCodesData',
      type: 'select',
      hide: true,
      formslot: true,
      slot: true,
      overHidden: true,
      span: 24,
      rules: [
        {
          required: true,
          message: '请选择所属区域',
          trigger: 'blur'
        }
      ]
    },
    {
      width: 120,
      label: '启停状态',
      prop: 'lockFlag',
      type: 'radio',
      search: true,
      slot: true,
      border: true,
      span: 24,
      rules: [
        {
          required: true,
          message: '请选择状态',
          trigger: 'blur'
        }
      ],
      dicData: [
        {
          label: '活跃',
          value: '0'
        },
        {
          label: '休眠',
          value: '9'
        }
      ]
    },
    {
      width: 120,
      label: '创建时间',
      prop: 'createTime',
      type: 'datetime',
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      editDisabled: true,
      addDisplay: false,
      span: 24
    }
  ]
};
