import { getDictOptions } from '@/utils/dict' import { cloneDeep } from 'lodash-es' export const formConfigList = [ { title: '基本信息', children: [ { name: 'birthday', title: '出生日期', type: 'time' }, { name: 'hkxz', title: '户口性质', type: 'select', options: [ { value: 1, label: '城镇' }, { value: 2, label: '农村' } ] }, { name: 'hyzk', title: '婚姻状况', type: 'select', options: [ { value: 1, label: '已婚' }, { value: 2, label: '未婚' }, { value: 3, label: '未知' } ] }, { name: 'nation', title: '民族', type: 'select' }, { name: 'cjgzsj', title: '参加工作时间', type: 'time' }, { name: 'zzmm', title: '政治面貌', type: 'select', options: [ { value: 1, label: '群众' }, { value: 2, label: '团员' }, { value: 3, label: '党员' } ] }, { name: 'xjzdz', title: '现居住地址' }, { name: 'hkszd', title: '户口所在地' }, { name: 'xqah', title: '兴趣爱好' }, { name: 'jntc', title: '技能特长' }, { name: 'cgjl', title: '成果奖励' } ] }, { title: '工资卡信息', children: [ { name: 'khyh', title: '开户行' }, { name: 'yhzh', title: '银行卡号' } ] }, { title: '教育信息', children: [ { name: 'byxx', title: '毕业院校' }, { name: 'bysj', title: '毕业时间', type: 'time' }, { name: 'zgxl', title: '最高学历', type: 'select', options: [ { value: 1, label: '高中' }, { value: 2, label: '中专' }, { value: 3, label: '大专' }, { value: 4, label: '本科' }, { value: 5, label: '硕士' }, { value: 6, label: '博士' } ] }, { name: 'major', title: '专业' } ] }, { title: '紧急联系人信息', children: [ { name: 'jjlxrxm', title: '紧急联系人姓名' }, { name: 'jjlxrhm', title: '紧急联系人电话' } ] } ] // 追加的档案 const additionalConfig = [ { title: '工作经历', children: [ { name: '', title: '' } ] }, { title: '学习经历', children: [ { name: '', title: '' } ] }, { title: '职称证书', children: [ { name: '', title: '' } ] } ] const getDictList = () => { const dictOptionsObj: any = {} // 性别 const sex = getDictOptions('sex_type') // 状态 const state = getDictOptions('staff_state_type') // 在岗职位 const drzw = getDictOptions('post_type') // 民族 const nation = getDictOptions('nation_type') // 婚姻情况 const hyzk = getDictOptions('hy_type') // 户口性质 const hkxz = getDictOptions('hk_type') // 政治面貌 const zzmm = getDictOptions('polity_type') // 能力等级 const nldj = getDictOptions('ABILITY_LEVEL') // 最高学历 const zgxl = getDictOptions('xl_type') // 紧急联系人关系 const jjlxrgx = getDictOptions('contact_type') dictOptionsObj.sex = sex dictOptionsObj.state = state dictOptionsObj.drzw = drzw dictOptionsObj.nation = nation dictOptionsObj.hyzk = hyzk dictOptionsObj.hkxz = hkxz dictOptionsObj.zzmm = zzmm dictOptionsObj.nldj = nldj dictOptionsObj.zgxl = zgxl dictOptionsObj.jjlxrgx = jjlxrgx return dictOptionsObj } export const getConfigDict = () => { const dictList = getDictList() const configList = cloneDeep(formConfigList) // const numberType = ['sex', 'state', 'hyzk', 'hkxz', 'zzmm', 'zgxl', 'jjlxrgx'] configList.forEach((item) => { item.children.forEach((child: any) => { if (child.type == 'select' && dictList[child.name]) { const options = dictList[child.name].map((item) => { return { label: item.label, value: item.value // value: numberType.includes(child.name) ? Number(item.value) : item.value } }) child.options = options } }) }) return configList }