Browse Source

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

lujialiang 2 weeks ago
parent
commit
d3bd6c9453
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/store/modules/dict/index.ts

+ 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 = ',') {