diff --git a/frontend/src/views/student/studentInfo/index.vue b/frontend/src/views/student/studentInfo/index.vue index 0e5a1937e..0a8f0d715 100644 --- a/frontend/src/views/student/studentInfo/index.vue +++ b/frontend/src/views/student/studentInfo/index.vue @@ -14,8 +14,7 @@ - - + @@ -112,7 +111,7 @@ - + @@ -163,7 +162,7 @@ - + @@ -415,6 +414,7 @@ export default { degreeOptions: [], educationLevelOptions: [], studentCategoryOptions: [], + sexOptions: [], // ==================== 数据表格 ==================== loading: false, @@ -500,15 +500,17 @@ export default { /** 加载学员基础信息字典,业务字段按字典标签查询和提交。 */ async loadStudentDictionaries() { const emptyResponse = { data: [] } - const [politicalStatusResponse, nationResponse, degreeResponse, educationLevelResponse, dictTypeResponse] = + const [politicalStatusResponse, nationResponse, degreeResponse, educationLevelResponse, sexResponse, dictTypeResponse] = await Promise.all([ getDicts(POLITICAL_STATUS_DICT_CODE).catch(() => emptyResponse), getDicts(NATION_DICT_CODE).catch(() => emptyResponse), getDicts(DEGREE_DICT_CODE).catch(() => emptyResponse), getDicts(EDUCATION_LEVEL_DICT_CODE).catch(() => emptyResponse), + getDicts('stu_sex').catch(() => emptyResponse), optionselect().catch(() => emptyResponse) ]) + this.sexOptions = sexResponse.data || [] this.politicalStatusOptions = politicalStatusResponse.data || [] this.nationOptions = nationResponse.data || [] this.degreeOptions = degreeResponse.data || [] @@ -541,6 +543,16 @@ export default { this.studentCategoryOptions = this.mergeFieldOptions(this.studentCategoryOptions, 'xylb') }, + /** 性别列:字典值转中文名 */ + sexFormatter(row) { + const value = row && row.xb + if (value === '' || value === null || value === undefined) { + return '' + } + const hit = this.sexOptions.find(item => String(item.dictValue) === String(value)) + return hit ? hit.dictLabel : String(value) + }, + mergeFieldOptions(dictionaryOptions, fieldName) { const options = dictionaryOptions.slice() const existingLabels = new Set(options.map(item => String(item.dictLabel)))