移动端集中修改dict字典展示

This commit is contained in:
zlwu committed 2025-08-10 09:53:20 +08:00
1 parent 4b9dbe40fb
commit 8bbe4e6a35
16 files changed
+1684 -134

No files matched your search

+2 -11
View File
@@ -34,7 +34,6 @@
#### 📋 文档管理规范 (.cursor/cursorrules-docs.md)
- 文档目录组织(中文化架构)
- **🚨 强制性文档同步更新规则**
- 变更记录管理规范(按日期和用户分文件)
- 业务模块文档管理(为AI提供完整上下文)
- **📊 API文档拆分管理规范** (2025-07-01新增,文件夹重组):
- **📁 文件夹结构**: 所有API文档统一存放在 `docs/开发文档/API/` 文件夹下
@@ -107,11 +106,6 @@
- **移动端功能变更** → `docs/业务模块/[模块名称]/` 移动端部分
- **移动端技术规范变更** → `.cursor/cursorrules-mobile.md`
#### 变更记录规范
- **文件格式**: `docs/变更管理/code-adjust-record-YYYY-MM-DD-{username}.md`
- **排序要求**: 按时间倒序排列,最新记录在最上面
- **时间填写**: 必须填写真实的当前时间(YYYY-MM-DD HH:mm:ss)
### 2. 🔴 数据库开发强制要求
- **标准基础字段**: 所有业务表必须包含统一的基础字段
- **雪花ID主键**: 统一使用 `bigint(20)` 作为主键
@@ -141,8 +135,7 @@
1. **确定开发场景** → 自动应用对应技术栈规范
2. **编写/修改代码** → 遵循相应的编码规范
3. **立即更新文档** → 同步更新API文档和相关文档
4. **记录变更日志** → 在当日变更文件中记录
5. **验证和测试** → 确保功能正常和文档准确
4. **验证和测试** → 确保功能正常和文档准确
```
### 🤖 Cursor AI 规范应用
@@ -173,7 +166,6 @@
- **技术规范**: 对应的`.cursor/cursorrules-*.md`文件
- **最佳实践**: `docs/开发文档/API开发最佳实践总结.md`
- **项目知识库**: `docs/知识库/`目录
- **变更记录**: `docs/变更管理/code-adjust-record-YYYY-MM-DD-{username}.md`
#### 总结流程
```
@@ -190,13 +182,12 @@
**⚠️ 基于场地预约管理系统开发实践制定的标准流程**
#### 完整开发流程(6个阶段)
#### 完整开发流程(5个阶段)
1. **需求分析和文档创建** → 业务需求+技术架构文档
2. **数据库设计和初始化** → 表结构+字典+权限+示例数据
3. **后端模块开发** → 完整ruoyi模块(16个API接口)
4. **API文档编写** → 400+行详细API文档
5. **自动化测试脚本** → 450+行Python测试脚本
6. **变更记录和验证** → 完整的变更日志
#### 16个标准API接口模式
- **基础管理接口(6个)**: list、详情、新增、修改、删除、可用选项
Whitespace-only changes.
@@ -233,4 +233,32 @@ public class XgStudentLeaveVo implements Serializable {
@ExcelProperty(value = "销假备注")
private String cancelRemark;
// ========== 基础字段(项目强制性规范要求) ==========
/**
* 创建者
*/
@ExcelProperty(value = "创建者")
private Long createBy;
/**
* 创建时间
*/
@ExcelProperty(value = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**
* 更新者
*/
@ExcelProperty(value = "更新者")
private Long updateBy;
/**
* 更新时间
*/
@ExcelProperty(value = "更新时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
}
-47
View File
@@ -1,47 +0,0 @@
#!/usr/bin/env python3
"""
批量修复XgStudentInfo实体类中的字段映射
将不存在的字段标记为 exist = false
"""
import re
import os
# 需要标记为不存在的字段
NON_EXISTENT_FIELDS = [
'name_english', 'former_name', 'name_pinyin', 'marital_status', 'religion',
'photo_url', 'photo_path', 'enrollment_year', 'school_system', 'education_level',
'training_type', 'admission_category', 'source_region', 'middle_school',
'major_code', 'major_name', 'class_code', 'grade', 'college_code',
'counselor_id', 'counselor_name', 'class_teacher_id', 'class_teacher_name',
'current_address', 'postal_code', 'household_register_type', 'hukou_location',
'info_status', 'data_source', 'last_batch_id', 'last_audit_time',
'is_complete', 'completion_rate', 'ext_field1', 'ext_field2', 'ext_field3',
'ext_field4', 'ext_field5'
]
def fix_entity_file():
file_path = '../ruoyi-modules/ruoyi-xg-xx/src/main/java/org/dromara/xg/domain/XgStudentInfo.java'
if not os.path.exists(file_path):
print(f"文件不存在: {file_path}")
return
with open(file_path, 'r', encoding='utf-8') as f:
content = f.read()
# 修复每个字段
for field in NON_EXISTENT_FIELDS:
# 查找 @TableField("field_name") 并替换为 @TableField(value = "field_name", exist = false)
pattern = f'@TableField\\("{field}"\\)'
replacement = f'@TableField(value = "{field}", exist = false)'
content = re.sub(pattern, replacement, content)
# 保存修改后的文件
with open(file_path, 'w', encoding='utf-8') as f:
f.write(content)
print("实体类字段映射修复完成")
if __name__ == '__main__':
fix_entity_file()
+37
View File
@@ -305,5 +305,42 @@ export const refreshDict = async (dictTypes) => {
}
};
/**
* 获取字典项的标签类型(Tag Type)
* @param {Array} dictData - 字典数据数组
* @param {string|number} value - 字典值
* @param {Object} fallbackMap - 降级处理映射对象(可选)
* @returns {string} 标签类型
*/
export const getDictTagType = (dictData, value, fallbackMap = {}) => {
// 参数验证
if (!Array.isArray(dictData) || value === null || value === undefined) {
return 'info'; // 默认类型
}
// 优先从字典数据中获取
if (dictData.length > 0) {
const dictItem = dictData.find((item) => String(item.value) === String(value));
if (dictItem && dictItem.elTagType) {
// 处理特殊值转换
let tagType = dictItem.elTagType;
if (tagType === 'danger') {
tagType = 'error';
} else if (tagType === 'default') {
tagType = 'primary';
}
return tagType;
}
}
// 字典未加载或无样式信息时的降级处理
if (fallbackMap && typeof fallbackMap === 'object') {
return fallbackMap[value] || 'info';
}
return 'info';
};
// 导出缓存管理对象(用于高级用法)
export { dictCache };
@@ -80,12 +80,17 @@
)"
:key="nameIndex"
:text="name.trim()"
type="success"
:type="getApproverType()"
size="mini"
class="approver-tag"
/>
</template>
<u-tag v-else text="无" type="info" size="mini" />
<u-tag
v-else
text="无"
:type="getNoApproverType()"
size="mini"
/>
</view>
</view>
@@ -458,6 +463,16 @@ export default {
}
},
// 获取审批人员标签类型
getApproverType() {
return 'success'; // 审批人员使用成功样式
},
// 获取无审批人员标签类型
getNoApproverType() {
return 'info'; // 无审批人员使用信息样式
},
// 注:getDownloadUrl方法已被移除,现在统一使用request.js中的downloadFile方法
},
};
@@ -76,7 +76,7 @@
v-for="user in selectCopyUserList"
:key="user.userId"
:text="user.nickName"
type="primary"
:type="getCopyUserType()"
size="mini"
closable
@close="handleCopyCloseTag(user)"
@@ -1060,6 +1060,11 @@ export default {
});
});
},
// 获取抄送用户标签类型
getCopyUserType() {
return 'primary'; // 抄送用户使用主要样式
},
},
};
</script>
+6 -1
View File
@@ -20,7 +20,7 @@
v-for="user in selectUserList"
:key="user.userId"
:text="user.nickName"
type="primary"
:type="getSelectedUserType()"
size="mini"
closable
@close="handleCloseTag(user)"
@@ -403,6 +403,11 @@ export default {
this.$emit('confirmCallBack', this.selectUserList);
this.close();
},
// 获取选中用户标签类型
getSelectedUserType() {
return 'primary'; // 选中用户使用主要样式
},
},
};
</script>
+12 -2
View File
@@ -11,7 +11,7 @@
<u-col span="6">
<u-tag
:text="isInitialized ? '已初始化' : '未初始化'"
:type="isInitialized ? 'success' : 'warning'"
:type="getInitStatusType(isInitialized)"
/>
</u-col>
</u-row>
@@ -23,7 +23,7 @@
<u-col span="6">
<u-tag
:text="isWeChatEnv ? '微信浏览器' : '非微信环境'"
:type="isWeChatEnv ? 'success' : 'error'"
:type="getWeChatEnvType(isWeChatEnv)"
/>
</u-col>
</u-row>
@@ -462,6 +462,16 @@ export default {
duration: 2000,
});
},
// 获取初始化状态标签类型
getInitStatusType(isInitialized) {
return isInitialized ? 'success' : 'warning';
},
// 获取微信环境标签类型
getWeChatEnvType(isWeChatEnv) {
return isWeChatEnv ? 'success' : 'error';
},
},
};
</script>
+8
View File
@@ -81,6 +81,14 @@
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/xg/xsjcxx/xsqj/leave/index",
"style": {
"navigationBarTitleText": "学生请假",
"navigationBarBackgroundColor": "#0051d9",
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/xg/xsjcxx/xsqj/leaveEdit/index",
"style": {
+8 -1
View File
@@ -99,7 +99,7 @@
<ServiceItem
v-if="hasPermi(['student:leave:list'])"
title="学生请假"
@click="handleServiceClick"
@click="gotoStudentLeave"
>
<template #icon>
<u-icon name="calendar" size="24" />
@@ -725,6 +725,13 @@ export default {
});
},
// 跳转到学生请假页面
gotoStudentLeave() {
uni.navigateTo({
url: '/pages/xg/xsjcxx/xsqj/leave/index',
});
},
// 图片加载成功处理
handleImageLoad(event) {
console.log('✅ 轮播图片加载成功:', event.detail);
+240 -23
View File
@@ -71,7 +71,7 @@
<u-tag
v-if="form.gender"
:text="getDictLabel(genderOptions, form.gender)"
type="primary"
:type="getGenderType()"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -87,7 +87,7 @@
<u-tag
v-if="form.nationality"
:text="getDictLabel(nationalityOptions, form.nationality)"
type="warning"
:type="getNationalityType()"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -103,7 +103,7 @@
<u-tag
v-if="form.politicalStatus"
:text="getDictLabel(politicalStatusOptions, form.politicalStatus)"
type="error"
:type="getPoliticalStatusType()"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -142,7 +142,7 @@
<u-tag
v-if="form.educationLevel"
:text="getDictLabel(educationLevelOptions, form.educationLevel)"
type="success"
:type="getEducationLevelType()"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -159,7 +159,7 @@
form.householdRegisterType,
)
"
type="info"
:type="getHouseholdRegisterType()"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -197,7 +197,7 @@
<u-tag
v-if="form.maritalStatus"
:text="getDictLabel(maritalStatusOptions, form.maritalStatus)"
type="primary"
:type="getMaritalStatusType()"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -221,7 +221,7 @@
<u-tag
v-if="form.isPoorStudent !== undefined"
:text="getDictLabel(yesNoOptions, form.isPoorStudent)"
:type="form.isPoorStudent === '1' ? 'warning' : 'info'"
:type="getYesNoType(form.isPoorStudent)"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -233,7 +233,7 @@
<u-tag
v-if="form.isMinority !== undefined"
:text="getDictLabel(yesNoOptions, form.isMinority)"
:type="form.isMinority === '1' ? 'warning' : 'info'"
:type="getYesNoType(form.isMinority)"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -245,7 +245,7 @@
<u-tag
v-if="form.isOrphan !== undefined"
:text="getDictLabel(yesNoOptions, form.isOrphan)"
:type="form.isOrphan === '1' ? 'error' : 'info'"
:type="getOrphanType(form.isOrphan)"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -257,7 +257,7 @@
<u-tag
v-if="form.isLeftBehindChild !== undefined"
:text="getDictLabel(yesNoOptions, form.isLeftBehindChild)"
:type="form.isLeftBehindChild === '1' ? 'error' : 'info'"
:type="getLeftBehindType(form.isLeftBehindChild)"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -269,7 +269,7 @@
<u-tag
v-if="form.isSingleChild !== undefined"
:text="getDictLabel(yesNoOptions, form.isSingleChild)"
:type="form.isSingleChild === '1' ? 'primary' : 'info'"
:type="getSingleChildType(form.isSingleChild)"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -281,7 +281,7 @@
<u-tag
v-if="form.isLowIncome !== undefined"
:text="getDictLabel(yesNoOptions, form.isLowIncome)"
:type="form.isLowIncome === '1' ? 'warning' : 'info'"
:type="getYesNoType(form.isLowIncome)"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -293,7 +293,7 @@
<u-tag
v-if="form.hasLoan !== undefined"
:text="getDictLabel(yesNoOptions, form.hasLoan)"
:type="form.hasLoan === '1' ? 'success' : 'info'"
:type="getLoanType(form.hasLoan)"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -382,7 +382,7 @@
:text="
getDictLabel(familyEconomicOptions, form.familyEconomicStatus)
"
type="primary"
:type="getFamilyEconomicStatusType()"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -413,7 +413,7 @@
<u-tag
v-if="form.bloodType"
:text="getDictLabel(bloodTypeOptions, form.bloodType)"
type="error"
:type="getBloodType()"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -429,7 +429,7 @@
<u-tag
v-if="form.isDisabled !== undefined"
:text="getDictLabel(yesNoOptions, form.isDisabled)"
:type="form.isDisabled === '1' ? 'warning' : 'info'"
:type="getYesNoType(form.isDisabled)"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -441,7 +441,7 @@
<u-tag
v-if="form.disabilityType"
:text="getDictLabel(disabilityTypeOptions, form.disabilityType)"
type="warning"
:type="getDisabilityType()"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -492,7 +492,7 @@
<u-tag
v-if="form.academicLevel"
:text="getDictLabel(academicLevelOptions, form.academicLevel)"
type="success"
:type="getAcademicLevelType()"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -520,7 +520,7 @@
<u-tag
v-if="form.trainingType"
:text="getDictLabel(trainingModeOptions, form.trainingType)"
type="primary"
:type="getTrainingType()"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -534,7 +534,7 @@
:text="
getDictLabel(admissionCategoryOptions, form.admissionCategory)
"
type="info"
:type="getAdmissionCategoryType()"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -546,7 +546,7 @@
<u-tag
v-if="form.studentStatus"
:text="getDictLabel(studentStatusOptions, form.studentStatus)"
type="warning"
:type="getStudentStatusType()"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -558,7 +558,7 @@
<u-tag
v-if="form.isBoarder !== undefined"
:text="getDictLabel(yesNoOptions, form.isBoarder)"
:type="form.isBoarder === '1' ? 'success' : 'info'"
:type="getBoarderType(form.isBoarder)"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -615,7 +615,7 @@
<script>
import { request } from '@/common/request.js';
import { useDict, getDictLabel } from '@/common/dict.js';
import { useDict, getDictLabel, getDictTagType } from '@/common/dict.js';
export default {
name: 'StuPersonalMsg',
@@ -799,6 +799,223 @@ export default {
uni.navigateBack();
},
// 获取是否类型(Yes/No)的类型
getYesNoType(value) {
const fallbackMap = {
1: 'warning', // 是
0: 'info', // 否
};
return getDictTagType(this.yesNoOptions, value, fallbackMap);
},
// 获取孤儿状态类型
getOrphanType(value) {
const fallbackMap = {
1: 'error', // 是
0: 'info', // 否
};
return getDictTagType(this.yesNoOptions, value, fallbackMap);
},
// 获取留守儿童状态类型
getLeftBehindType(value) {
const fallbackMap = {
1: 'error', // 是
0: 'info', // 否
};
return getDictTagType(this.yesNoOptions, value, fallbackMap);
},
// 获取独生子女状态类型
getSingleChildType(value) {
const fallbackMap = {
1: 'primary', // 是
0: 'info', // 否
};
return getDictTagType(this.yesNoOptions, value, fallbackMap);
},
// 获取助学贷款状态类型
getLoanType(value) {
const fallbackMap = {
1: 'success', // 是
0: 'info', // 否
};
return getDictTagType(this.yesNoOptions, value, fallbackMap);
},
// 获取寄宿生状态类型
getBoarderType(value) {
const fallbackMap = {
1: 'success', // 是
0: 'info', // 否
};
return getDictTagType(this.yesNoOptions, value, fallbackMap);
},
// 获取性别类型
getGenderType() {
const fallbackMap = {
1: 'primary', // 男
0: 'success', // 女
};
return getDictTagType(this.genderOptions, this.form.gender, fallbackMap);
},
// 获取民族类型
getNationalityType() {
const fallbackMap = {
1: 'primary', // 汉族
2: 'warning', // 少数民族
};
return getDictTagType(this.nationalityOptions, this.form.nationality, fallbackMap);
},
// 获取政治面貌类型
getPoliticalStatusType() {
const fallbackMap = {
1: 'error', // 中共党员
2: 'warning', // 共青团员
3: 'info', // 群众
};
return getDictTagType(
this.politicalStatusOptions,
this.form.politicalStatus,
fallbackMap,
);
},
// 获取文化程度类型
getEducationLevelType() {
const fallbackMap = {
1: 'info', // 小学
2: 'primary', // 初中
3: 'warning', // 高中
4: 'success', // 大专
5: 'error', // 本科
};
return getDictTagType(
this.educationLevelOptions,
this.form.educationLevel,
fallbackMap,
);
},
// 获取户口类型
getHouseholdRegisterType() {
const fallbackMap = {
1: 'primary', // 城镇
2: 'success', // 农村
};
return getDictTagType(
this.householdRegisterTypeOptions,
this.form.householdRegisterType,
fallbackMap,
);
},
// 获取婚姻状况类型
getMaritalStatusType() {
const fallbackMap = {
1: 'info', // 未婚
2: 'primary', // 已婚
3: 'warning', // 离异
4: 'error', // 丧偶
};
return getDictTagType(this.maritalStatusOptions, this.form.maritalStatus, fallbackMap);
},
// 获取家庭经济状况类型
getFamilyEconomicStatusType() {
const fallbackMap = {
1: 'error', // 贫困
2: 'warning', // 一般困难
3: 'primary', // 一般
4: 'success', // 富裕
};
return getDictTagType(
this.familyEconomicOptions,
this.form.familyEconomicStatus,
fallbackMap,
);
},
// 获取血型类型
getBloodType() {
const fallbackMap = {
1: 'error', // A型
2: 'primary', // B型
3: 'warning', // AB型
4: 'success', // O型
};
return getDictTagType(this.bloodTypeOptions, this.form.bloodType, fallbackMap);
},
// 获取残疾类型
getDisabilityType() {
const fallbackMap = {
1: 'error', // 视力残疾
2: 'warning', // 听力残疾
3: 'primary', // 言语残疾
4: 'success', // 肢体残疾
5: 'info', // 智力残疾
};
return getDictTagType(
this.disabilityTypeOptions,
this.form.disabilityType,
fallbackMap,
);
},
// 获取学历层次类型
getAcademicLevelType() {
const fallbackMap = {
1: 'info', // 专科
2: 'primary', // 本科
3: 'success', // 硕士
4: 'error', // 博士
};
return getDictTagType(this.academicLevelOptions, this.form.academicLevel, fallbackMap);
},
// 获取培养方式类型
getTrainingType() {
const fallbackMap = {
1: 'primary', // 全日制
2: 'warning', // 非全日制
3: 'info', // 函授
4: 'success', // 自考
};
return getDictTagType(this.trainingModeOptions, this.form.trainingType, fallbackMap);
},
// 获取录取类别类型
getAdmissionCategoryType() {
const fallbackMap = {
1: 'success', // 统招
2: 'primary', // 单招
3: 'warning', // 对口升学
4: 'info', // 其他
};
return getDictTagType(
this.admissionCategoryOptions,
this.form.admissionCategory,
fallbackMap,
);
},
// 获取学籍状态类型
getStudentStatusType() {
const fallbackMap = {
1: 'success', // 在读
2: 'warning', // 休学
3: 'error', // 退学
4: 'primary', // 毕业
5: 'info', // 结业
};
return getDictTagType(this.studentStatusOptions, this.form.studentStatus, fallbackMap);
},
// 加载字典数据
async loadDictData() {
console.log('开始加载字典数据...');
File diff suppressed because it is too large. Load diff
+23 -4
View File
@@ -43,7 +43,7 @@
<view class="batch-status">
<u-tag
:text="item.status === '0' ? '正常' : '停用'"
:type="item.status === '0' ? 'success' : 'error'"
:type="getStatusType(item.status)"
size="mini"
></u-tag>
</view>
@@ -67,7 +67,7 @@
<text class="label">收集类型:</text>
<u-tag
:text="item.collectionType === '1' ? '新学期收集' : '其他'"
:type="item.collectionType === '1' ? 'primary' : 'info'"
:type="getCollectionType(item.collectionType)"
size="mini"
></u-tag>
</view>
@@ -143,7 +143,7 @@
<text class="detail-label">状态:</text>
<u-tag
:text="viewForm.status === '0' ? '正常' : '停用'"
:type="viewForm.status === '0' ? 'success' : 'error'"
:type="getStatusType(viewForm.status)"
size="mini"
></u-tag>
</view>
@@ -151,7 +151,7 @@
<text class="detail-label">收集类型:</text>
<u-tag
:text="viewForm.collectionType === '1' ? '新学期收集' : '其他'"
:type="viewForm.collectionType === '1' ? 'primary' : 'info'"
:type="getCollectionType(viewForm.collectionType)"
size="mini"
></u-tag>
</view>
@@ -181,6 +181,7 @@
<script>
import { request } from '@/common/request.js';
import { getDictTagType } from '@/common/dict.js';
export default {
name: 'StuMsgSupply',
@@ -229,6 +230,24 @@ export default {
uni.navigateBack();
},
// 获取批次状态类型
getStatusType(status) {
const fallbackMap = {
0: 'success', // 正常
1: 'error', // 停用
};
return getDictTagType([], status, fallbackMap);
},
// 获取收集类型类型
getCollectionType(collectionType) {
const fallbackMap = {
1: 'primary', // 新学期收集
0: 'info', // 其他
};
return getDictTagType([], collectionType, fallbackMap);
},
// 获取学生信息收集批次列表
async getList() {
this.loading = true;
@@ -90,7 +90,7 @@
<u-tag
v-if="studentInfo.gender"
:text="getDictLabel(genderOptions, studentInfo.gender)"
type="primary"
:type="getGenderType(studentInfo.gender)"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -113,7 +113,7 @@
studentInfo.nationality,
)
"
type="warning"
:type="getNationalityType(studentInfo.nationality)"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -136,7 +136,9 @@
studentInfo.politicalStatus,
)
"
type="error"
:type="
getPoliticalStatusType(studentInfo.politicalStatus)
"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -186,7 +188,9 @@
studentInfo.educationLevel,
)
"
type="success"
:type="
getEducationLevelType(studentInfo.educationLevel)
"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -203,7 +207,11 @@
studentInfo.householdRegisterType,
)
"
type="info"
:type="
getHouseholdRegisterType(
studentInfo.householdRegisterType,
)
"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -250,7 +258,7 @@
studentInfo.maritalStatus,
)
"
type="primary"
:type="getMaritalStatusType(studentInfo.maritalStatus)"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -287,11 +295,7 @@
studentInfo.isPoorStudent,
)
"
:type="
studentInfo.isPoorStudent === '1'
? 'warning'
: 'info'
"
:type="getPoorStudentType(studentInfo.isPoorStudent)"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -305,9 +309,7 @@
:text="
getDictLabel(yesNoOptions, studentInfo.isMinority)
"
:type="
studentInfo.isMinority === '1' ? 'warning' : 'info'
"
:type="getYesNoType(studentInfo.isMinority)"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -319,7 +321,7 @@
<u-tag
v-if="studentInfo.isOrphan !== undefined"
:text="getDictLabel(yesNoOptions, studentInfo.isOrphan)"
:type="studentInfo.isOrphan === '1' ? 'error' : 'info'"
:type="getOrphanType(studentInfo.isOrphan)"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -337,9 +339,9 @@
)
"
:type="
studentInfo.isLeftBehindChild === '1'
? 'error'
: 'info'
getLeftBehindChildType(
studentInfo.isLeftBehindChild,
)
"
size="mini"
></u-tag>
@@ -357,11 +359,7 @@
studentInfo.isSingleChild,
)
"
:type="
studentInfo.isSingleChild === '1'
? 'primary'
: 'info'
"
:type="getSingleChildType(studentInfo.isSingleChild)"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -375,9 +373,7 @@
:text="
getDictLabel(yesNoOptions, studentInfo.isLowIncome)
"
:type="
studentInfo.isLowIncome === '1' ? 'warning' : 'info'
"
:type="getYesNoType(studentInfo.isLowIncome)"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -389,7 +385,7 @@
<u-tag
v-if="studentInfo.hasLoan !== undefined"
:text="getDictLabel(yesNoOptions, studentInfo.hasLoan)"
:type="studentInfo.hasLoan === '1' ? 'success' : 'info'"
:type="getLoanType(studentInfo.hasLoan)"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -501,7 +497,11 @@
studentInfo.familyEconomicStatus,
)
"
type="primary"
:type="
getFamilyEconomicType(
studentInfo.familyEconomicStatus,
)
"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -539,7 +539,7 @@
studentInfo.bloodType,
)
"
type="error"
:type="getBloodType(studentInfo.bloodType)"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -559,9 +559,7 @@
:text="
getDictLabel(yesNoOptions, studentInfo.isDisabled)
"
:type="
studentInfo.isDisabled === '1' ? 'warning' : 'info'
"
:type="getYesNoType(studentInfo.isDisabled)"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -578,7 +576,7 @@
studentInfo.disabilityType,
)
"
type="warning"
:type="getDisabilityType(studentInfo.disabilityType)"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -644,7 +642,7 @@
studentInfo.academicLevel,
)
"
type="success"
:type="getAcademicLevelType(studentInfo.academicLevel)"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -681,7 +679,7 @@
studentInfo.trainingType,
)
"
type="primary"
:type="getTrainingModeType(studentInfo.trainingType)"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -698,7 +696,11 @@
studentInfo.admissionCategory,
)
"
type="info"
:type="
getAdmissionCategoryType(
studentInfo.admissionCategory,
)
"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -715,7 +717,7 @@
studentInfo.studentStatus,
)
"
type="warning"
:type="getStudentStatusType(studentInfo.studentStatus)"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -729,9 +731,7 @@
:text="
getDictLabel(yesNoOptions, studentInfo.isBoarder)
"
:type="
studentInfo.isBoarder === '1' ? 'success' : 'info'
"
:type="getBoarderType(studentInfo.isBoarder)"
size="mini"
></u-tag>
<text v-else>-</text>
@@ -830,7 +830,7 @@
<script>
import { request } from '@/common/request.js';
import { useDict, getDictLabel } from '@/common/dict.js';
import { useDict, getDictLabel, getDictTagType } from '@/common/dict.js';
export default {
name: 'StuMsgDetailDialog',
@@ -920,6 +920,205 @@ export default {
uni.navigateBack();
},
// 获取是否类型(Yes/No)的类型
getYesNoType(value) {
const fallbackMap = {
1: 'warning', // 是
0: 'info', // 否
};
return getDictTagType(this.yesNoOptions, value, fallbackMap);
},
// 获取孤儿状态类型
getOrphanType(value) {
const fallbackMap = {
1: 'error', // 是
0: 'info', // 否
};
return getDictTagType(this.yesNoOptions, value, fallbackMap);
},
// 获取助学贷款状态类型
getLoanType(value) {
const fallbackMap = {
1: 'success', // 是
0: 'info', // 否
};
return getDictTagType(this.yesNoOptions, value, fallbackMap);
},
// 获取是否贫困生状态类型
getPoorStudentType(value) {
const fallbackMap = {
1: 'warning', // 是
0: 'info', // 否
};
return getDictTagType(this.yesNoOptions, value, fallbackMap);
},
// 获取是否留守儿童状态类型
getLeftBehindChildType(value) {
const fallbackMap = {
1: 'error', // 是
0: 'info', // 否
};
return getDictTagType(this.yesNoOptions, value, fallbackMap);
},
// 获取是否独生子女状态类型
getSingleChildType(value) {
const fallbackMap = {
1: 'primary', // 是
0: 'info', // 否
};
return getDictTagType(this.yesNoOptions, value, fallbackMap);
},
// 获取是否住校状态类型
getBoarderType(value) {
const fallbackMap = {
1: 'success', // 是
0: 'info', // 否
};
return getDictTagType(this.yesNoOptions, value, fallbackMap);
},
// 获取性别标签类型
getGenderType(value) {
const fallbackMap = {
0: 'primary', // 男
1: 'error', // 女
2: 'info', // 未知
};
return getDictTagType(this.genderOptions, value, fallbackMap);
},
// 获取民族标签类型
getNationalityType(value) {
const fallbackMap = {
'01': 'primary', // 汉族
};
// 其他民族使用warning类型
return getDictTagType(this.nationalityOptions, value, fallbackMap) || 'warning';
},
// 获取政治面貌标签类型
getPoliticalStatusType(value) {
const fallbackMap = {
'01': 'error', // 中共党员
'02': 'warning', // 中共预备党员
'03': 'primary', // 共青团员
13: 'info', // 群众
};
return getDictTagType(this.politicalStatusOptions, value, fallbackMap);
},
// 获取文化程度标签类型
getEducationLevelType(value) {
const fallbackMap = {
7: 'success', // 博士
6: 'primary', // 硕士
5: 'warning', // 本科
4: 'info', // 专科
};
return getDictTagType(this.educationLevelOptions, value, fallbackMap);
},
// 获取户口类型标签类型
getHouseholdRegisterType(value) {
const fallbackMap = {
1: 'primary', // 农业户口
2: 'info', // 非农业户口
};
return getDictTagType(this.householdRegisterTypeOptions, value, fallbackMap);
},
// 获取婚姻状况标签类型
getMaritalStatusType(value) {
const fallbackMap = {
1: 'success', // 未婚
2: 'primary', // 已婚
3: 'warning', // 离异
4: 'error', // 丧偶
};
return getDictTagType(this.maritalStatusOptions, value, fallbackMap);
},
// 获取家庭经济状况标签类型
getFamilyEconomicType(value) {
const fallbackMap = {
1: 'error', // 困难
2: 'warning', // 一般困难
3: 'primary', // 一般
4: 'success', // 富裕
};
return getDictTagType(this.familyEconomicOptions, value, fallbackMap);
},
// 获取血型标签类型
getBloodType(value) {
const fallbackMap = {
A: 'error',
B: 'warning',
AB: 'primary',
O: 'success',
};
return getDictTagType(this.bloodTypeOptions, value, fallbackMap);
},
// 获取残疾类型标签类型
getDisabilityType(value) {
const fallbackMap = {
1: 'warning', // 视力残疾
2: 'error', // 听力残疾
3: 'primary', // 言语残疾
4: 'info', // 肢体残疾
};
return getDictTagType(this.disabilityTypeOptions, value, fallbackMap);
},
// 获取学历层次标签类型
getAcademicLevelType(value) {
const fallbackMap = {
1: 'success', // 博士
2: 'primary', // 硕士
3: 'warning', // 本科
4: 'info', // 专科
};
return getDictTagType(this.academicLevelOptions, value, fallbackMap);
},
// 获取培养方式标签类型
getTrainingModeType(value) {
const fallbackMap = {
1: 'primary', // 统招
2: 'warning', // 委培
3: 'info', // 自费
};
return getDictTagType(this.trainingModeOptions, value, fallbackMap);
},
// 获取录取类别标签类型
getAdmissionCategoryType(value) {
const fallbackMap = {
1: 'success', // 统招
2: 'primary', // 推免
3: 'info', // 其他
};
return getDictTagType(this.admissionCategoryOptions, value, fallbackMap);
},
// 获取学籍状态标签类型
getStudentStatusType(value) {
const fallbackMap = {
1: 'success', // 在校
2: 'warning', // 休学
3: 'error', // 退学
4: 'primary', // 毕业
};
return getDictTagType(this.studentStatusOptions, value, fallbackMap);
},
// Tab点击事件处理
handleTabClick(item, index) {
index = item.index;
+1 -1
View File
@@ -8,7 +8,7 @@ const SERVICE_ROUTES = {
// 学工管理
'student:info': '/pages/xg/xsjcxx/xsjcxx/index',
'student:dorm': '/pages/student/dorm/index',
'student:leave': '/pages/student/leave/index',
'student:leave': '/pages/xg/xsjcxx/xsqj/leave/index',
'student:psychology': '/pages/student/psychology/index',
'student:club': '/pages/student/club/index',
'student:counsel': '/pages/student/counsel/index',