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

chore: 字典值使用字符串匹配

lujialiang 2 долоо хоног өмнө
parent
commit
d3bd6c9453

+ 1 - 1
src/store/modules/dict/index.ts

@@ -56,7 +56,7 @@ export const useDictStore = defineStore(SetupStoreId.Dict, () => {
   }
 
   function findNameByValue(options: dictItem[], value: string, separator: string = ',') {
-    return options.flatMap(option => (option.value === value ? option.label : [])).join(separator);
+    return options.flatMap(option => (option.value === value.toString() ? option.label : [])).join(separator);
   }
 
   function findNameByDict(dictKey: string, value: string, separator: string = ',') {