|
@@ -1,3 +1,41 @@
|
|
|
+import { getDictOptions } from '@/utils/dict'
|
|
|
+import { cloneDeep } from 'lodash-es'
|
|
|
+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: '基本信息',
|
|
@@ -333,11 +371,33 @@ export const formConfigList = [
|
|
|
}
|
|
|
]
|
|
|
|
|
|
+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
|
|
|
+ }
|
|
|
+ })
|
|
|
+ child.options = options
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ return configList
|
|
|
+}
|
|
|
+
|
|
|
export const formRules = {
|
|
|
nickname: [{ required: true, message: '名称不能为空', trigger: 'blur' }]
|
|
|
}
|
|
|
|
|
|
-export const tableColumnConfigList = [
|
|
|
+// 表格
|
|
|
+export const tableColumnConfig = [
|
|
|
{
|
|
|
name: 'deptName',
|
|
|
title: '所属部门'
|
|
@@ -466,10 +526,8 @@ export const tableColumnConfigList = [
|
|
|
type: 'time'
|
|
|
}
|
|
|
]
|
|
|
-
|
|
|
//搜索
|
|
|
-
|
|
|
-export const searchConfigList = [
|
|
|
+export const searchConfig = [
|
|
|
{
|
|
|
name: 'nickname',
|
|
|
title: '员工名称'
|
|
@@ -573,3 +631,21 @@ export const searchConfigList = [
|
|
|
]
|
|
|
}
|
|
|
]
|
|
|
+
|
|
|
+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
|
|
|
+}
|