Browse Source

字典报错

lifanagju_citu 11 tháng trước cách đây
mục cha
commit
6b3bd853bf
2 tập tin đã thay đổi với 4 bổ sung4 xóa
  1. 3 3
      src/store/user.js
  2. 1 1
      src/utils/getText.js

+ 3 - 3
src/store/user.js

@@ -71,15 +71,15 @@ export const useUserStore = defineStore('user',
     }
     // 字典对应中文
     const getFieldText = async (data) => {
-      if (data.areaId && data.areaId !== 0) await getBaseInfoDictOfName(0, data, data.areaId, 'areaName') // 现居住地text
       if (data.birthday && data.birthday !== 0) data.birthdayText = timesTampChange(data.birthday).slice(0, 10) // 出生日期
+      if (data.firstWorkTime && data.firstWorkTime !== 0) data.firstWorkTimeText = timesTampChange(data.firstWorkTime).slice(0, 10) // 首次工作时间
+      if (data.areaId && data.areaId !== 0) await getBaseInfoDictOfName(0, data, data.areaId, 'areaName') // 现居住地text
       if (data.eduType && data.eduType !== 0) await getBaseInfoDictOfName(1, data, data.eduType, 'eduTypeText') // 学历
       if (data.expType && data.expType !== 0) await getBaseInfoDictOfName(2, data, data.expType, 'expTypeText') // 工作经验
       // if (data.sex && data.sex !== 0) await getBaseInfoDictOfName(3, data, data.sex, 'sexTypeText') // 性别
+      // if (data.jobType && data.jobType !== 0) await getBaseInfoDictOfName(4, data, data.jobType, 'jobTypeText') // 求职类型
       if (data.maritalStatus && data.maritalStatus !== 0) await getMaritalText(data, data.maritalStatus) // 	婚姻状况
       if (data.jobStatus && data.jobStatus !== 0) await getJobStatusText(data, data.jobStatus) // 	求职状态
-      // if (data.jobType && data.jobType !== 0) await getBaseInfoDictOfName(4, data, data.jobType, 'jobTypeText') // 求职类型
-      if (data.firstWorkTime && data.firstWorkTime !== 0) data.firstWorkTimeText = timesTampChange(data.firstWorkTime).slice(0, 10) // 首次工作时间
       return data
     }
     const getMaritalText = async (data, value) => { // 字典未加上,暂时的

+ 1 - 1
src/utils/getText.js

@@ -14,7 +14,7 @@ export const getBaseInfoDictOfName = async (index = 0, baseInfo, value, addKeyNa
     { dictType: 'menduner_education_type', itemText: 'label', itemValue: 'value' },
     { dictType: 'menduner_exp_type', itemText: 'label', itemValue: 'value' },
     { dictType: 'system_user_sex', itemText: 'label', itemValue: 'value', saveType: 'dict' },
-    { dictType: 'menduner_job_type', itemText: 'label', itemValue: 'value' },
+    { dictType: 'menduner_job_type', itemText: 'label', itemValue: 'value', saveType: 'dict' },
   ]
   const e = test[index]