123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659 |
- import { getDictOptions } from '@/utils/dict'
- import { cloneDeep } from 'lodash-es'
- export const getDictList = () => {
- const dictOptionsObj: any = {}
- // 性别
- // const sex = getDictOptions('system_user_sex')
- // 状态
- 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 formConfigList = [
- {
- title: '基本信息',
- children: [
- {
- name: 'nickname',
- title: '员工名称'
- },
- {
- name: 'sex',
- title: '性别',
- type: 'select',
- options: [
- {
- value: 0,
- label: '女'
- },
- {
- value: 1,
- label: '男'
- }
- ]
- },
- {
- name: 'mobilePhone',
- title: '手机'
- },
- {
- name: 'state',
- title: '状态',
- type: 'select',
- options: [
- {
- value: 1,
- label: '实习'
- },
- {
- value: 2,
- label: '试用'
- },
- {
- value: 3,
- label: '正式'
- },
- {
- value: 4,
- label: '离职'
- }
- ]
- },
- {
- name: 'drzw',
- title: '在岗职位',
- type: 'select',
- options: [
- {
- value: '1',
- label: 'JAVA工程师'
- },
- {
- value: '2',
- label: '前端工程师'
- }
- ]
- },
- {
- name: 'nation',
- title: '民族',
- type: 'select',
- options: [
- {
- value: '1',
- label: '汉族'
- },
- {
- value: '2',
- label: '其他'
- }
- ]
- },
- {
- name: 'loginName',
- title: '员工工号',
- type: 'button'
- },
- {
- name: 'deptName',
- title: '所属部门',
- type: 'dept-select'
- },
- {
- name: 'qdgs',
- title: '签订公司'
- },
- {
- name: 'birthday',
- title: '出生日期',
- type: 'time'
- },
- {
- name: 'hyzk',
- title: '婚姻状况',
- type: 'select',
- options: [
- {
- value: 1,
- label: '已婚'
- },
- {
- value: 2,
- label: '未婚'
- }
- ]
- },
- {
- name: 'hkxz',
- title: '户口性质',
- type: 'select',
- options: [
- {
- value: 1,
- label: '城镇'
- },
- {
- value: 2,
- label: '农村'
- }
- ]
- },
- {
- name: 'zzmm',
- title: '政治面貌',
- type: 'select',
- options: [
- {
- value: 1,
- label: '群众'
- },
- {
- value: 2,
- label: '团员'
- },
- {
- value: 3,
- label: '党员'
- }
- ]
- },
- {
- name: 'xjzdz',
- title: '现居住地址'
- },
- {
- name: 'hkszd',
- title: '户口所在地'
- },
- {
- name: 'rgssj',
- title: '入职时间',
- type: 'time'
- },
- {
- name: 'cjgzsj',
- title: '参加工作时间',
- type: 'time'
- },
- {
- name: 'nldj',
- title: '能力等级',
- type: 'select',
- options: [
- {
- value: '1',
- label: 'L1'
- },
- {
- value: '2',
- label: 'L2'
- },
- {
- value: '3',
- label: 'L3'
- },
- {
- value: '4',
- label: 'L4'
- },
- {
- value: '5',
- label: 'L5'
- },
- {
- value: '6',
- label: 'L6'
- },
- {
- value: '7',
- label: 'L7'
- },
- {
- value: '8',
- label: 'L8'
- },
- {
- value: '9',
- label: 'L9'
- },
- {
- value: '10',
- label: 'L10'
- }
- ]
- },
- {
- name: 'htqdsj',
- title: '合同签订时间',
- type: 'time'
- },
- {
- name: 'htdqs',
- title: '合同到期时间',
- type: 'time'
- },
- {
- 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: '紧急联系人电话'
- },
- {
- name: 'jjlxrgx',
- title: '紧急联系人关系',
- type: 'select',
- options: [
- {
- value: 1,
- label: '父母'
- },
- {
- value: 2,
- label: '夫妻'
- },
- {
- value: 3,
- label: '子女'
- },
- {
- value: 4,
- label: '兄弟姐妹'
- },
- {
- value: 5,
- label: '其他'
- }
- ]
- }
- ]
- }
- ]
- 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: numberType.includes(child.name) ? Number(item.value) : item.value
- value: item.value
- }
- })
- child.options = options
- }
- })
- })
- return configList
- }
- export const formRules = {
- nickname: [{ required: true, message: '名称不能为空', trigger: 'blur' }]
- }
- // 表格
- export const tableColumnConfig = [
- {
- name: 'deptName',
- title: '所属部门'
- },
- {
- name: 'state',
- title: '状态',
- type: 'select',
- options: [
- {
- value: 1,
- label: '实习'
- },
- {
- value: 2,
- label: '试用'
- },
- {
- value: 3,
- label: '正式'
- },
- {
- value: 4,
- label: '离职'
- }
- ]
- },
- {
- name: 'zzmm',
- title: '政治面貌',
- type: 'select',
- options: [
- {
- value: 1,
- label: '群众'
- },
- {
- value: 2,
- label: '团员'
- },
- {
- value: 3,
- label: '党员'
- }
- ]
- },
- {
- name: 'hkxz',
- title: '户口性质',
- type: 'select',
- options: [
- {
- value: 1,
- label: '城镇'
- },
- {
- value: 2,
- label: '农村'
- }
- ]
- },
- {
- 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: '专业'
- },
- {
- name: 'cjgzsj',
- title: '参加工作时间',
- type: 'time'
- },
- {
- name: 'rgssj',
- title: '入职时间',
- type: 'time'
- },
- {
- name: 'htdqs',
- title: '合同到期时间',
- type: 'time'
- },
- {
- name: 'zzsj',
- title: '转正时间',
- type: 'time'
- }
- ]
- //搜索
- export const searchConfig = [
- {
- name: 'nickname',
- title: '员工名称'
- },
- // {
- // name: 'loginName',
- // title: '员工工号'
- // },
- {
- name: 'deptName',
- title: '所属部门',
- type: 'dept-select'
- },
- {
- name: 'state',
- title: '状态',
- type: 'select',
- options: [
- {
- value: 1,
- label: '实习'
- },
- {
- value: 2,
- label: '试用'
- },
- {
- value: 3,
- label: '正式'
- },
- {
- value: 4,
- label: '离职'
- }
- ]
- },
- {
- name: 'zzmm',
- title: '政治面貌',
- type: 'select',
- options: [
- {
- value: 1,
- label: '群众'
- },
- {
- value: 2,
- label: '团员'
- },
- {
- value: 3,
- label: '党员'
- }
- ]
- },
- {
- name: 'hkxz',
- title: '户口性质',
- type: 'select',
- options: [
- {
- value: 1,
- label: '城镇'
- },
- {
- value: 2,
- label: '农村'
- }
- ]
- },
- {
- name: 'zgxl',
- title: '最高学历',
- type: 'select',
- options: [
- {
- value: 1,
- label: '高中'
- },
- {
- value: 2,
- label: '中专'
- },
- {
- value: 3,
- label: '大专'
- },
- {
- value: 4,
- label: '本科'
- },
- {
- value: 5,
- label: '硕士'
- },
- {
- value: 6,
- label: '博士'
- }
- ]
- }
- ]
- export const getTableConfigDict = (dataSource) => {
- const dictList = getDictList()
- const configList = cloneDeep(dataSource)
- const numberType = ['sex', 'state', 'hyzk', 'hkxz', 'zzmm', 'zgxl', 'jjlxrgx']
- configList.forEach((item) => {
- if (item.type == 'select' && dictList[item.name]) {
- const options = dictList[item.name].map((item) => {
- return {
- label: item.label,
- value: numberType.includes(item.name) ? Number(item.value) : item.value
- }
- })
- item.options = options
- }
- })
- return configList
- }
|