Browse Source

!1166 修复 根据字典类型和值取描述
Merge pull request !1166 from LSluoshi/N/A

zuohuaijun 2 years ago
parent
commit
f8ccc11780
1 changed files with 11 additions and 1 deletions
  1. 11 1
      Web/src/stores/userInfo.ts

+ 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 {};
 		},
 
 		// 根据字典类型和描述取值