diff --git a/docs/变更管理/code-adjust-record-2025-01-27-ai.md b/docs/变更管理/code-adjust-record-2025-01-27-ai.md new file mode 100644 index 00000000..a66c9d82 --- /dev/null +++ b/docs/变更管理/code-adjust-record-2025-01-27-ai.md @@ -0,0 +1,76 @@ +# 学生信息管理页面是否字段字典化修改记录 + +**修改时间**: 2025-01-27 15:30:00 +**修改人员**: AI助手 +**修改文件**: `web/src/views/xg/xsjcxx/studentMsg/studentMsg/index.vue` + +## 修改内容 + +### 1. 添加字典类型引用 +- 在字典引用中添加了 `sys_yesno` 字典类型 +- 用于统一管理所有的是否字段选项 + +### 2. 修改表单字段为字典数据源 +将以下字段从硬编码的选项改为使用 `sys_yesno` 字典数据: + +#### 扩展信息Tab中的字段: +- **是否贫困生** (isPoorStudent) +- **是否少数民族** (isMinority) +- **是否孤儿** (isOrphan) +- **是否留守儿童** (isLeftBehindChild) +- **是否独生子女** (isSingleChild) +- **是否低保** (isLowIncome) +- **是否有助学贷款** (hasLoan) + +#### 健康信息Tab中的字段: +- **是否残疾** (isDisabled) + +#### 学籍信息Tab中的字段: +- **是否住校** (isBoarder) + +### 3. 修改详情显示字段 +将详情显示页面中的对应字段也改为使用 `getDictLabel(sys_yesno, value)` 函数来显示字典标签,确保显示一致性。 + +### 4. 修复类型错误 +- 将 `detailForm` 的类型从 `StudentVO` 改为 `StudentMsgForm` +- 解决了 `academicLevel` 字段类型不匹配的问题 + +## 技术实现 + +### 字典数据使用方式 +```vue + + + +``` + +### 详情显示方式 +```vue +{{ getDictLabel(sys_yesno, detailForm.isPoorStudent) }} +``` + +## 影响范围 + +### 正面影响 +1. **数据一致性**: 所有是否字段现在使用统一的字典数据源 +2. **维护性**: 字典数据可以在后台统一管理,无需修改前端代码 +3. **扩展性**: 新增是否字段时可以直接使用 `sys_yesno` 字典 +4. **国际化支持**: 字典数据支持多语言配置 + +### 注意事项 +1. 确保后端 `sys_yesno` 字典类型已正确配置 +2. 字典值应该与数据库字段值保持一致 +3. 建议字典值使用数字类型(0-否,1-是)以保持与数据库字段类型一致 + +## 验证建议 + +1. **功能测试**: 验证所有是否字段的下拉选项是否正确显示 +2. **数据保存**: 验证选择字典值后数据是否正确保存到数据库 +3. **详情显示**: 验证详情页面是否正确显示字典标签 +4. **数据导入**: 验证导入功能是否与新的字典值兼容 + +## 相关文档 + +- 字典管理配置文档 +- 学生信息管理API文档 +- 数据库字段设计文档 \ No newline at end of file diff --git a/docs/变更管理/code-adjust-record-2025-01-27-cursor.md b/docs/变更管理/code-adjust-record-2025-01-27-cursor.md index bfc0a05b..c85da3c2 100644 --- a/docs/变更管理/code-adjust-record-2025-01-27-cursor.md +++ b/docs/变更管理/code-adjust-record-2025-01-27-cursor.md @@ -576,4 +576,204 @@ Cursor AI **最终修复时间**: 2025-01-27 15:15:00 **最终状态**: ✅ 完全修复,无白屏问题 **测试状态**: ✅ 通过,所有功能正常 -**代码质量**: ✅ 符合Vue 3规范 \ No newline at end of file +**代码质量**: ✅ 符合Vue 3规范 + +# 修改概述 +将学生信息管理页面中的户口类型字段从硬编码选项改为从字典表获取数据。 + +## 修改详情 + +### 修改文件 +- `web/src/views/xg/xsjcxx/studentMsg/studentMsg/index.vue` + +### 具体修改内容 + +#### 1. 添加字典类型引用 +在 `useDict` 调用中添加了 `house_hold_register_type` 字典类型: +```javascript +const { wenhuachengdu, xg_political_status, sys_user_sex, xg_nation, sys_question_category, sys_item_enable, sys_item_required, sys_item_delete, house_hold_register_type } = + toRefs( + proxy?.useDict( + 'wenhuachengdu', + 'xg_political_status', + 'sys_user_sex', + 'xg_nation', + 'sys_question_category', + 'sys_item_enable', + 'sys_item_required', + 'sys_item_delete', + 'house_hold_register_type' + ) + ); +``` + +#### 2. 修改表单选择器 +将户口类型的选择器从硬编码选项改为使用字典数据: +```vue + + + + + + + + + + +``` + +#### 3. 修改详情显示 +将详情页面中的户口类型显示改为使用字典标签: +```vue + +{{ detailForm.householdRegisterType }} + + +{{ getDictLabel(house_hold_register_type, detailForm.householdRegisterType) }} +``` + +#### 4. 修改默认值 +将表单初始化数据中的户口类型默认值从硬编码的"非农业"改为空字符串: +```javascript +// 修改前 +householdRegisterType: '非农业', + +// 修改后 +householdRegisterType: '', +``` + +## 技术要点 + +### 字典类型 +- **字典类型**: `house_hold_register_type` +- **用途**: 户口类型选项管理 +- **数据来源**: 系统字典表 + +### 相关函数 +- `getDictLabel()`: 根据字典值和字典数据获取对应的标签显示 + +## 影响范围 + +### 功能影响 +- ✅ 户口类型选择器现在从字典表动态获取选项 +- ✅ 详情页面正确显示户口类型标签 +- ✅ 支持字典表配置的户口类型选项 + +### 兼容性 +- ✅ 保持现有数据结构不变 +- ✅ 现有数据仍然可以正常显示 +- ✅ 表单验证逻辑无需修改 + +## 后续工作 + +### 字典配置 +需要在系统字典管理中配置 `house_hold_register_type` 字典类型,包含以下选项: +- 农业 +- 非农业 +- 其他可能的户口类型选项 + +### 测试验证 +1. 验证户口类型选择器正常显示字典选项 +2. 验证新增/编辑学生时户口类型选择正常 +3. 验证详情页面户口类型显示正确 +4. 验证现有数据的户口类型显示正常 + +## 修改时间 +- **开始时间**: 2025-01-27 14:30:00 +- **完成时间**: 2025-01-27 14:45:00 +- **修改人员**: Cursor AI + +## 备注 +此次修改遵循了项目的字典管理规范,将硬编码的选项改为从字典表获取,提高了系统的可维护性和扩展性。 + +# 修改概述 +将学生信息管理页面中的婚姻状况字段改为从字典表获取数据,字典类型为 `marital_status`。 + +## 修改详情 + +### 修改文件 +- `web/src/views/xg/xsjcxx/studentMsg/studentMsg/index.vue` + +### 具体修改内容 + +#### 1. 添加字典类型引用 +在 `useDict` 中添加了 `marital_status` 字典类型: +```javascript +const { + // ... 其他字典类型 + marital_status +} = toRefs( + proxy?.useDict( + // ... 其他字典类型 + 'marital_status' + ) +); +``` + +#### 2. 更新婚姻状况选择组件 +将硬编码的选项改为使用字典数据: +```vue + + + + + + + + + + + + +``` + +#### 3. 更新标签显示函数 +将 `getMaritalStatusLabel` 函数改为使用字典数据: +```javascript +// 修改前 +const getMaritalStatusLabel = (value: string | number) => { + const maritalStatusMap: Record = { + '1': '未婚', + '2': '已婚', + '3': '离异', + '4': '丧偶' + }; + return maritalStatusMap[String(value)] || value || '未知'; +}; + +// 修改后 +const getMaritalStatusLabel = (value: string | number) => { + const dict = marital_status.value.find((item: any) => item.value === String(value)); + return dict ? dict.label : value || '未知'; +}; +``` + +## 影响范围 +- 学生信息管理页面的婚姻状况选择功能 +- 学生信息详情页面的婚姻状况显示 +- 所有使用 `getMaritalStatusLabel` 函数的地方 + +## 技术要点 +1. **字典数据驱动**:使用 `useDict` 获取字典数据,实现数据与代码分离 +2. **动态选项生成**:通过 `v-for` 循环生成选项,支持字典数据的动态更新 +3. **标签显示优化**:使用字典查找替代硬编码映射,提高代码可维护性 + +## 验证要点 +1. 确保字典类型 `marital_status` 已在后端配置 +2. 验证婚姻状况选择功能正常工作 +3. 验证详情页面婚姻状况显示正确 +4. 确认字典数据更新后前端能正确显示 + +## 相关文档 +- 字典管理配置文档 +- 学生信息管理API文档 + +--- +**修改时间**: 2025-01-27 +**修改人**: Cursor AI +**修改类型**: 功能优化 - 字典数据集成 \ No newline at end of file diff --git a/docs/变更管理/code-adjust-record-2025-01-27-wuzilong.md b/docs/变更管理/code-adjust-record-2025-01-27-wuzilong.md index f796f0b0..ecd3c1cd 100644 --- a/docs/变更管理/code-adjust-record-2025-01-27-wuzilong.md +++ b/docs/变更管理/code-adjust-record-2025-01-27-wuzilong.md @@ -1,66 +1,119 @@ -# 代码调整记录 - 2025-01-27 +# 学生信息管理页面字典数据修改记录 -## 调整概述 -**调整时间**: 2025-01-27 14:30:00 -**调整人员**: wuzilong -**调整原因**: 题目分类界面与其他界面产生冲突,导致界面打开白屏 -**调整目标**: 统一添加 `sc_` 前缀避免变量名冲突 +**修改时间**: 2025-01-27 15:30:00 +**修改人**: wuzilong +**修改文件**: `web/src/views/xg/xsjcxx/studentMsg/studentMsg/index.vue` -## 调整详情 +## 修改内容 -### 调整文件 -- `web/src/views/hq/myddc/satCategory/index.vue` +### 1. 新增字典类型 +在字典数据获取中添加了以下新的字典类型: +- `xg_family_economic` - 家庭经济状况 +- `xg_blood_type` - 血型 +- `disability_type` - 残疾类型 +- `zsjy_education_level` - 学历层次 +- `xg_training_mode` - 培养方式 +- `admission_category` - 录取类别 +- `student_status` - 学籍状态 -### 变量名称调整清单 +### 2. 修改表单选择框 +将以下字段的硬编码选项改为使用字典数据: -#### 1. 响应式变量调整 -- `satCategoryList` → `sc_satCategoryList` -- `buttonLoading` → `sc_buttonLoading` -- `loading` → `sc_loading` -- `showSearch` → `sc_showSearch` -- `ids` → `sc_ids` -- `single` → `sc_single` -- `multiple` → `sc_multiple` -- `total` → `sc_total` +#### 基础信息表单 +- **家庭经济状况**: 从硬编码选项改为使用 `xg_family_economic` 字典 +- **血型**: 从硬编码选项改为使用 `xg_blood_type` 字典 +- **残疾类型**: 从硬编码选项改为使用 `disability_type` 字典 -#### 2. 表单引用调整 -- `queryFormRef` → `sc_queryFormRef` -- `satCategoryFormRef` → `sc_satCategoryFormRef` +#### 学籍信息表单 +- **学历层次**: 从硬编码选项改为使用 `zsjy_education_level` 字典 +- **培养方式**: 从硬编码选项改为使用 `xg_training_mode` 字典 +- **录取类别**: 从硬编码选项改为使用 `admission_category` 字典 +- **学籍状态**: 从硬编码选项改为使用 `student_status` 字典 -#### 3. 对话框对象调整 -- `dialog` → `sc_dialog` -- `initFormData` → `sc_initFormData` -- `data` → `sc_data` +### 3. 修改查询表单 +- **学籍状态查询**: 从使用 `sys_normal_disable` 改为使用 `student_status` 字典 -#### 4. 解构变量调整 -- `queryParams` → `sc_queryParams` -- `form` → `sc_form` -- `rules` → `sc_rules` +### 4. 修改映射函数 +更新了以下映射函数,使其使用字典数据: +- `getFamilyEconomicStatusLabel()` - 家庭经济状况映射 +- `getBloodTypeLabel()` - 血型映射 +- `getDisabilityTypeLabel()` - 残疾类型映射 +- `getAcademicLevelLabel()` - 学历层次映射 +- `getTrainingModeLabel()` - 培养方式映射 +- `getAdmissionCategoryLabel()` - 录取类别映射 +- `getStudentStatusLabel()` - 学籍状态映射 +- `getStatusLabel()` - 状态标签映射 -### 模板引用调整 -- 所有模板中的变量引用已同步更新为带 `sc_` 前缀的版本 -- 包括搜索表单、表格数据、分页组件、对话框等所有相关引用 +### 5. 修改详情页面显示 +详情页面中的相关字段显示已经使用了对应的映射函数,无需额外修改。 -### JavaScript逻辑调整 -- 所有函数中的变量引用已同步更新 -- 包括查询、新增、修改、删除、导出等所有业务逻辑 +## 技术细节 -## 调整效果 -✅ **解决冲突**: 通过统一前缀避免与其他界面的变量名冲突 -✅ **保持功能**: 所有原有功能保持不变,仅调整变量命名 -✅ **提高稳定性**: 避免界面白屏问题,提升用户体验 +### 字典数据获取 +```javascript +const { + // ... 原有字典 + xg_family_economic, + xg_blood_type, + disability_type, + zsjy_education_level, + xg_training_mode, + admission_category, + student_status +} = toRefs( + proxy?.useDict( + // ... 原有字典类型 + 'xg_family_economic', + 'xg_blood_type', + 'disability_type', + 'zsjy_education_level', + 'xg_training_mode', + 'admission_category', + 'student_status' + ) +); +``` -## 注意事项 -⚠️ **Linter警告**: 存在部分TypeScript类型定义相关的linter警告,但不影响功能正常运行 -⚠️ **API依赖**: 需要确保 `@/api/hq/satCategory` 相关API文件存在 -⚠️ **类型定义**: 可能需要补充完整的TypeScript类型定义 +### 映射函数示例 +```javascript +/** 家庭经济状况码表映射 */ +const getFamilyEconomicStatusLabel = (value: string | number) => { + const dict = xg_family_economic.value.find((item: any) => item.value === String(value)); + return dict ? dict.label : value || '未知'; +}; +``` -## 验证建议 -1. 启动前端服务,访问题目分类页面 -2. 验证搜索、新增、修改、删除等功能是否正常 -3. 确认界面不再出现白屏问题 -4. 检查其他相关页面是否受影响 +### 表单选择框示例 +```vue + + + + + +``` ---- -**记录人**: wuzilong -**记录时间**: 2025-01-27 14:30:00 \ No newline at end of file +## 影响范围 + +### 正面影响 +1. **数据一致性**: 所有相关字段现在都从统一的字典表获取数据,确保数据一致性 +2. **维护性**: 字典数据可以在后台统一管理,无需修改前端代码 +3. **扩展性**: 新增选项只需在字典表中添加,无需修改前端代码 +4. **标准化**: 符合项目的字典数据使用规范 + +### 注意事项 +1. **字典数据依赖**: 需要确保后端字典表中已配置相应的字典类型和数据 +2. **数据迁移**: 如果数据库中已有数据,需要确保数据格式与字典值匹配 +3. **测试验证**: 需要测试所有相关功能,确保字典数据正确显示 + +## 后续工作 + +1. **字典数据配置**: 确保后端字典表中已配置所有新增的字典类型 +2. **数据验证**: 验证现有数据与字典值的匹配情况 +3. **功能测试**: 测试学生信息的增删改查功能 +4. **文档更新**: 更新相关的API文档和业务文档 + +## 相关文档 + +- 字典管理规范 +- 学生信息管理API文档 +- 前端开发规范 \ No newline at end of file diff --git a/web/src/views/hq/bgtgl/hallAudit/index.vue b/web/src/views/hq/bgtgl/hallAudit/index.vue index 8e7b5da5..2565ad29 100644 --- a/web/src/views/hq/bgtgl/hallAudit/index.vue +++ b/web/src/views/hq/bgtgl/hallAudit/index.vue @@ -80,9 +80,9 @@ >拒绝 - + diff --git a/web/src/views/hq/bgtgl/hallInfo/index.vue b/web/src/views/hq/bgtgl/hallInfo/index.vue index e9cc4499..f6a663cc 100644 --- a/web/src/views/hq/bgtgl/hallInfo/index.vue +++ b/web/src/views/hq/bgtgl/hallInfo/index.vue @@ -44,9 +44,9 @@ 删除 - + diff --git a/web/src/views/hq/bgtgl/hallReservation/index.vue b/web/src/views/hq/bgtgl/hallReservation/index.vue index d53dc8d2..c7cb12aa 100644 --- a/web/src/views/hq/bgtgl/hallReservation/index.vue +++ b/web/src/views/hq/bgtgl/hallReservation/index.vue @@ -68,9 +68,9 @@ 删除 - + diff --git a/web/src/views/hq/myddc/satCategory/index.vue b/web/src/views/hq/myddc/satCategory/index.vue index 36faa5b0..58cec1d5 100644 --- a/web/src/views/hq/myddc/satCategory/index.vue +++ b/web/src/views/hq/myddc/satCategory/index.vue @@ -47,9 +47,9 @@ 删除 - + diff --git a/web/src/views/hq/myddc/satDetail/index.vue b/web/src/views/hq/myddc/satDetail/index.vue index 1c39334b..a0485356 100644 --- a/web/src/views/hq/myddc/satDetail/index.vue +++ b/web/src/views/hq/myddc/satDetail/index.vue @@ -39,9 +39,9 @@ 删除 - + diff --git a/web/src/views/hq/myddc/satOption/index.vue b/web/src/views/hq/myddc/satOption/index.vue index 640f9330..b43030c3 100644 --- a/web/src/views/hq/myddc/satOption/index.vue +++ b/web/src/views/hq/myddc/satOption/index.vue @@ -44,9 +44,9 @@ 删除 - + diff --git a/web/src/views/hq/myddc/satQuestion/index.vue b/web/src/views/hq/myddc/satQuestion/index.vue index d0bd09f9..96990ee2 100644 --- a/web/src/views/hq/myddc/satQuestion/index.vue +++ b/web/src/views/hq/myddc/satQuestion/index.vue @@ -70,9 +70,9 @@ 删除 - + diff --git a/web/src/views/hq/pm/repairOrder/index.vue b/web/src/views/hq/pm/repairOrder/index.vue index 03408e5a..23ae703d 100644 --- a/web/src/views/hq/pm/repairOrder/index.vue +++ b/web/src/views/hq/pm/repairOrder/index.vue @@ -214,9 +214,9 @@ 删除 - + diff --git a/web/src/views/hq/venue/info/index.vue b/web/src/views/hq/venue/info/index.vue index e417cfb1..de45f6c1 100644 --- a/web/src/views/hq/venue/info/index.vue +++ b/web/src/views/hq/venue/info/index.vue @@ -68,9 +68,9 @@ 删除 - + diff --git a/web/src/views/hq/venue/reservation/index.vue b/web/src/views/hq/venue/reservation/index.vue index 001a739c..a6c3cf2c 100644 --- a/web/src/views/hq/venue/reservation/index.vue +++ b/web/src/views/hq/venue/reservation/index.vue @@ -97,9 +97,9 @@ 删除 - + diff --git a/web/src/views/hq/venue/statistics/index.vue b/web/src/views/hq/venue/statistics/index.vue index ce10a213..807d7fb5 100644 --- a/web/src/views/hq/venue/statistics/index.vue +++ b/web/src/views/hq/venue/statistics/index.vue @@ -93,10 +93,10 @@ 查询 - + diff --git a/web/src/views/xg/xgss/ssqxx/dormArea/index.vue b/web/src/views/xg/xgss/ssqxx/dormArea/index.vue index 0fe0c45e..55aa5e94 100644 --- a/web/src/views/xg/xgss/ssqxx/dormArea/index.vue +++ b/web/src/views/xg/xgss/ssqxx/dormArea/index.vue @@ -50,9 +50,9 @@ >删除 - + diff --git a/web/src/views/xg/xgss/xqxx/dormCampus/index.vue b/web/src/views/xg/xgss/xqxx/dormCampus/index.vue index 02eef373..7c4c2019 100644 --- a/web/src/views/xg/xgss/xqxx/dormCampus/index.vue +++ b/web/src/views/xg/xgss/xqxx/dormCampus/index.vue @@ -35,9 +35,9 @@ >删除 - + diff --git a/web/src/views/xg/xsjcxx/XgStuColBatch/stuColBatch/index.vue b/web/src/views/xg/xsjcxx/XgStuColBatch/stuColBatch/index.vue index 39a9058a..12be1955 100644 --- a/web/src/views/xg/xsjcxx/XgStuColBatch/stuColBatch/index.vue +++ b/web/src/views/xg/xsjcxx/XgStuColBatch/stuColBatch/index.vue @@ -38,9 +38,9 @@ >删除 --> - + diff --git a/web/src/views/xg/xsjcxx/classmsg/classMsg/index.vue b/web/src/views/xg/xsjcxx/classmsg/classMsg/index.vue index 7bd4c4f1..95d26d7f 100644 --- a/web/src/views/xg/xsjcxx/classmsg/classMsg/index.vue +++ b/web/src/views/xg/xsjcxx/classmsg/classMsg/index.vue @@ -59,9 +59,9 @@ >删除 - + diff --git a/web/src/views/xg/xsjcxx/studentMsg/studentMsg/index.vue b/web/src/views/xg/xsjcxx/studentMsg/studentMsg/index.vue index 52d97c19..b25dae53 100644 --- a/web/src/views/xg/xsjcxx/studentMsg/studentMsg/index.vue +++ b/web/src/views/xg/xsjcxx/studentMsg/studentMsg/index.vue @@ -45,7 +45,7 @@ - + @@ -128,7 +128,7 @@ @@ -356,8 +356,7 @@ - - + @@ -410,10 +409,7 @@ - - - - + @@ -439,32 +435,28 @@ - - + - - + - - + @@ -473,24 +465,21 @@ - - + - - + - - + @@ -499,8 +488,7 @@ - - + @@ -616,10 +604,7 @@ - - - - + @@ -649,11 +634,7 @@ - - - - - + @@ -667,18 +648,14 @@ - - + - - - - + @@ -740,11 +717,7 @@ - - - - - + @@ -775,19 +748,14 @@ - - - - + - - - + @@ -796,19 +764,14 @@ - - - - - + - - + @@ -1014,7 +977,7 @@ - {{ detailForm.householdRegisterType }} + {{ getDictLabel(house_hold_register_type, detailForm.householdRegisterType) }} @@ -1077,41 +1040,41 @@ - {{ detailForm.isPoorStudent === 1 ? '是' : '否' }} + {{ getDictLabel(sys_yesno, detailForm.isPoorStudent) }} - {{ detailForm.isMinority === 1 ? '是' : '否' }} + {{ getDictLabel(sys_yesno, detailForm.isMinority) }} - {{ detailForm.isOrphan === 1 ? '是' : '否' }} + {{ getDictLabel(sys_yesno, detailForm.isOrphan) }} - {{ detailForm.isLeftBehindChild === 1 ? '是' : '否' }} + {{ getDictLabel(sys_yesno, detailForm.isLeftBehindChild) }} - {{ detailForm.isSingleChild === 1 ? '是' : '否' }} + {{ getDictLabel(sys_yesno, detailForm.isSingleChild) }} - {{ detailForm.isLowIncome === 1 ? '是' : '否' }} + {{ getDictLabel(sys_yesno, detailForm.isLowIncome) }} - {{ detailForm.hasLoan === 1 ? '是' : '否' }} + {{ getDictLabel(sys_yesno, detailForm.hasLoan) }} @@ -1265,7 +1228,7 @@ - {{ detailForm.isDisabled === 1 ? '是' : '否' }} + {{ getDictLabel(sys_yesno, detailForm.isDisabled) }} @@ -1362,12 +1325,12 @@ - {{ detailForm.trainingType }} + {{ getTrainingModeLabel(detailForm.trainingType) }} - {{ detailForm.admissionCategory }} + {{ getAdmissionCategoryLabel(detailForm.admissionCategory) }} @@ -1375,13 +1338,13 @@ - {{ getStatusLabel(detailForm.studentStatus) }} + {{ getStudentStatusLabel(detailForm.studentStatus) }} - {{ detailForm.isBoarder === 1 ? '是' : '否' }} + {{ getDictLabel(sys_yesno, detailForm.isBoarder) }} @@ -1491,83 +1454,94 @@ interface ComponentInternalInstance { } const router = useRouter(); const { proxy } = getCurrentInstance() as ComponentInternalInstance; -const { wenhuachengdu, xg_political_status, sys_user_sex, xg_nation, sys_question_category, sys_item_enable, sys_item_required, sys_item_delete } = - toRefs( - proxy?.useDict( - 'wenhuachengdu', - 'xg_political_status', - 'sys_user_sex', - 'xg_nation', - 'sys_question_category', - 'sys_item_enable', - 'sys_item_required', - 'sys_item_delete' - ) - ); - -const sys_normal_disable = ref([ - { value: '1', label: '在籍' }, - { value: '2', label: '休学' }, - { value: '3', label: '复学' }, - { value: '4', label: '退学' }, - { value: '5', label: '毕业' } -]); +const { + wenhuachengdu, + xg_political_status, + sys_user_sex, + xg_nation, + sys_question_category, + sys_item_enable, + sys_item_required, + sys_item_delete, + house_hold_register_type, + marital_status, + sys_yesno, + xg_family_economic, + xg_blood_type, + disability_type, + zsjy_education_level, + xg_training_mode, + admission_category, + student_status +} = toRefs( + proxy?.useDict( + 'wenhuachengdu', + 'xg_political_status', + 'sys_user_sex', + 'xg_nation', + 'sys_question_category', + 'sys_item_enable', + 'sys_item_required', + 'sys_item_delete', + 'house_hold_register_type', + 'marital_status', + 'sys_yesno', + 'xg_family_economic', + 'xg_blood_type', + 'disability_type', + 'zsjy_education_level', + 'xg_training_mode', + 'admission_category', + 'student_status' + ) +); /** 婚姻状况码表映射 */ const getMaritalStatusLabel = (value: string | number) => { - const maritalStatusMap: Record = { - '1': '未婚', - '2': '已婚', - '3': '离异', - '4': '丧偶' - }; - return maritalStatusMap[String(value)] || value || '未知'; + const dict = marital_status.value.find((item: any) => item.value === String(value)); + return dict ? dict.label : value || '未知'; }; /** 家庭经济状况码表映射 */ const getFamilyEconomicStatusLabel = (value: string | number) => { - const economicStatusMap: Record = { - '富裕': '富裕', - '一般': '一般', - '困难': '困难', - '特困': '特困' - }; - return economicStatusMap[String(value)] || value || '未知'; + const dict = xg_family_economic.value.find((item: any) => item.value === String(value)); + return dict ? dict.label : value || '未知'; }; /** 血型码表映射 */ const getBloodTypeLabel = (value: string | number) => { - const bloodTypeMap: Record = { - 'A': 'A型', - 'B': 'B型', - 'AB': 'AB型', - 'O': 'O型', - '未知': '未知' - }; - return bloodTypeMap[String(value)] || value || '未知'; + const dict = xg_blood_type.value.find((item: any) => item.value === String(value)); + return dict ? dict.label : value || '未知'; }; /** 残疾类型码表映射 */ const getDisabilityTypeLabel = (value: string | number) => { - const disabilityTypeMap: Record = { - '1': '视力残疾', - '2': '听力残疾', - '3': '智力残疾', - '9': '其他残疾' - }; - return disabilityTypeMap[String(value)] || value || '未知'; + const dict = disability_type.value.find((item: any) => item.value === String(value)); + return dict ? dict.label : value || '未知'; }; /** 学历层级码表映射 */ const getAcademicLevelLabel = (value: string | number) => { - const academicLevelMap: Record = { - '1': '中级工', - '2': '高级工', - '3': '预备技师', - '4': '技师', - '5': '中高职一体' - }; - return academicLevelMap[String(value)] || value || '未知'; + const dict = zsjy_education_level.value.find((item: any) => item.value === String(value)); + return dict ? dict.label : value || '未知'; +}; + +/** 培养方式码表映射 */ +const getTrainingModeLabel = (value: string | number) => { + const dict = xg_training_mode.value.find((item: any) => item.value === String(value)); + return dict ? dict.label : value || '未知'; +}; + +/** 录取类别码表映射 */ +const getAdmissionCategoryLabel = (value: string | number) => { + const dict = admission_category.value.find((item: any) => item.value === String(value)); + return dict ? dict.label : value || '未知'; +}; + +/** 学籍状态码表映射 */ +const getStudentStatusLabel = (value: string | number) => { + const dict = student_status.value.find((item: any) => item.value === String(value)); + return dict ? dict.label : value || '未知'; }; const activeTab = ref('basic'); // 当前激活的tab页 @@ -1627,7 +1601,7 @@ const detailDialog = reactive({ title: '学生详情' }); -const detailForm = reactive({ +const detailForm = reactive({ id: '', studentNo: '', name: '' @@ -1675,7 +1649,7 @@ const initFormData: StudentMsgForm = { // // 扩展信息字段 educationLevel: '2', - householdRegisterType: '非农业', + householdRegisterType: '', religion: '', sourceRegion: '', graduateSchool: '', @@ -1783,7 +1757,7 @@ const filterNode = (value: string, data: any) => { /** 获取状态标签 */ const getStatusLabel = (status: string) => { - const statusDict = sys_normal_disable.value.find((item: any) => item.value === status); + const statusDict = student_status.value.find((item: any) => item.value === status); return statusDict ? statusDict.label : status; }; diff --git a/web/src/views/xg/xsjcxx/xgClassPosDict/xgClassPosDict/index.vue b/web/src/views/xg/xsjcxx/xgClassPosDict/xgClassPosDict/index.vue index 5ec47652..3e94f5c2 100644 --- a/web/src/views/xg/xsjcxx/xgClassPosDict/xgClassPosDict/index.vue +++ b/web/src/views/xg/xsjcxx/xgClassPosDict/xgClassPosDict/index.vue @@ -88,11 +88,11 @@ >删除 - + diff --git a/web/src/views/xg/xsjcxx/xgClassPosMsg/xgClassPosMsg/index.vue b/web/src/views/xg/xsjcxx/xgClassPosMsg/xgClassPosMsg/index.vue index bd86a585..a30d77d2 100644 --- a/web/src/views/xg/xsjcxx/xgClassPosMsg/xgClassPosMsg/index.vue +++ b/web/src/views/xg/xsjcxx/xgClassPosMsg/xgClassPosMsg/index.vue @@ -129,11 +129,11 @@ >删除 - +