Эх сурвалжийг харах

修复 根据字典类型和值取描述

Signed-off-by: LSluoshi <smallstar0621@outlook.com>
LSluoshi 2 жил өмнө
parent
commit
5da242ea27

+ 11 - 1
Web/src/stores/userInfo.ts

@@ -136,7 +136,17 @@ export const useUserInfo = defineStore('userInfo', {
 
 		// 根据字典类型和值取描述
 		getDictLabelByVal(typePCode: string, val: string) {
-			return this.getDictItemByVal(typePCode, val).value;
+			if (val) {
+				const _val = val.toString();
+				const ds = this.getDictDatasByCode(typePCode);
+				for (let index = 0; index < ds.length; index++) {
+					const element = ds[index];
+					if (element.value == _val) {
+						return element;
+					}
+				}                
+			}
+			return {};
 		},
 
 		// 根据字典类型和描述取值