index.ts 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. import { getDictOptions } from '@/utils/dict'
  2. import { cloneDeep } from 'lodash-es'
  3. export const formConfigList = [
  4. {
  5. title: '基本信息',
  6. children: [
  7. {
  8. name: 'birthday',
  9. title: '出生日期',
  10. type: 'time'
  11. },
  12. {
  13. name: 'hkxz',
  14. title: '户口性质',
  15. type: 'select',
  16. options: [
  17. {
  18. value: 1,
  19. label: '城镇'
  20. },
  21. {
  22. value: 2,
  23. label: '农村'
  24. }
  25. ]
  26. },
  27. {
  28. name: 'hyzk',
  29. title: '婚姻状况',
  30. type: 'select',
  31. options: [
  32. {
  33. value: 1,
  34. label: '已婚'
  35. },
  36. {
  37. value: 2,
  38. label: '未婚'
  39. },
  40. {
  41. value: 3,
  42. label: '未知'
  43. }
  44. ]
  45. },
  46. {
  47. name: 'nation',
  48. title: '民族',
  49. type: 'select'
  50. },
  51. {
  52. name: 'cjgzsj',
  53. title: '参加工作时间',
  54. type: 'time'
  55. },
  56. {
  57. name: 'zzmm',
  58. title: '政治面貌',
  59. type: 'select',
  60. options: [
  61. {
  62. value: 1,
  63. label: '群众'
  64. },
  65. {
  66. value: 2,
  67. label: '团员'
  68. },
  69. {
  70. value: 3,
  71. label: '党员'
  72. }
  73. ]
  74. },
  75. {
  76. name: 'xjzdz',
  77. title: '现居住地址'
  78. },
  79. {
  80. name: 'hkszd',
  81. title: '户口所在地'
  82. },
  83. {
  84. name: 'xqah',
  85. title: '兴趣爱好'
  86. },
  87. {
  88. name: 'jntc',
  89. title: '技能特长'
  90. },
  91. {
  92. name: 'cgjl',
  93. title: '成果奖励'
  94. }
  95. ]
  96. },
  97. {
  98. title: '工资卡信息',
  99. children: [
  100. {
  101. name: 'khyh',
  102. title: '开户行'
  103. },
  104. {
  105. name: 'yhzh',
  106. title: '银行卡号'
  107. }
  108. ]
  109. },
  110. {
  111. title: '教育信息',
  112. children: [
  113. {
  114. name: 'byxx',
  115. title: '毕业院校'
  116. },
  117. {
  118. name: 'bysj',
  119. title: '毕业时间',
  120. type: 'time'
  121. },
  122. {
  123. name: 'zgxl',
  124. title: '最高学历',
  125. type: 'select',
  126. options: [
  127. {
  128. value: 1,
  129. label: '高中'
  130. },
  131. {
  132. value: 2,
  133. label: '中专'
  134. },
  135. {
  136. value: 3,
  137. label: '大专'
  138. },
  139. {
  140. value: 4,
  141. label: '本科'
  142. },
  143. {
  144. value: 5,
  145. label: '硕士'
  146. },
  147. {
  148. value: 6,
  149. label: '博士'
  150. }
  151. ]
  152. },
  153. {
  154. name: 'major',
  155. title: '专业'
  156. }
  157. ]
  158. },
  159. {
  160. title: '紧急联系人信息',
  161. children: [
  162. {
  163. name: 'jjlxrxm',
  164. title: '紧急联系人姓名'
  165. },
  166. {
  167. name: 'jjlxrhm',
  168. title: '紧急联系人电话'
  169. }
  170. ]
  171. }
  172. ]
  173. // 追加的档案
  174. const additionalConfig = [
  175. {
  176. title: '工作经历',
  177. children: [
  178. {
  179. name: '',
  180. title: ''
  181. }
  182. ]
  183. },
  184. {
  185. title: '学习经历',
  186. children: [
  187. {
  188. name: '',
  189. title: ''
  190. }
  191. ]
  192. },
  193. {
  194. title: '职称证书',
  195. children: [
  196. {
  197. name: '',
  198. title: ''
  199. }
  200. ]
  201. }
  202. ]
  203. const getDictList = () => {
  204. const dictOptionsObj: any = {}
  205. // 性别
  206. const sex = getDictOptions('sex_type')
  207. // 状态
  208. const state = getDictOptions('staff_state_type')
  209. // 在岗职位
  210. const drzw = getDictOptions('post_type')
  211. // 民族
  212. const nation = getDictOptions('nation_type')
  213. // 婚姻情况
  214. const hyzk = getDictOptions('hy_type')
  215. // 户口性质
  216. const hkxz = getDictOptions('hk_type')
  217. // 政治面貌
  218. const zzmm = getDictOptions('polity_type')
  219. // 能力等级
  220. const nldj = getDictOptions('ABILITY_LEVEL')
  221. // 最高学历
  222. const zgxl = getDictOptions('xl_type')
  223. // 紧急联系人关系
  224. const jjlxrgx = getDictOptions('contact_type')
  225. dictOptionsObj.sex = sex
  226. dictOptionsObj.state = state
  227. dictOptionsObj.drzw = drzw
  228. dictOptionsObj.nation = nation
  229. dictOptionsObj.hyzk = hyzk
  230. dictOptionsObj.hkxz = hkxz
  231. dictOptionsObj.zzmm = zzmm
  232. dictOptionsObj.nldj = nldj
  233. dictOptionsObj.zgxl = zgxl
  234. dictOptionsObj.jjlxrgx = jjlxrgx
  235. return dictOptionsObj
  236. }
  237. export const getConfigDict = () => {
  238. const dictList = getDictList()
  239. const configList = cloneDeep(formConfigList)
  240. // const numberType = ['sex', 'state', 'hyzk', 'hkxz', 'zzmm', 'zgxl', 'jjlxrgx']
  241. configList.forEach((item) => {
  242. item.children.forEach((child: any) => {
  243. if (child.type == 'select' && dictList[child.name]) {
  244. const options = dictList[child.name].map((item) => {
  245. return {
  246. label: item.label,
  247. value: item.value
  248. // value: numberType.includes(child.name) ? Number(item.value) : item.value
  249. }
  250. })
  251. child.options = options
  252. }
  253. })
  254. })
  255. return configList
  256. }