!74 update src/utils/dict.ts.

Merge pull request !74 from MeaoFun/N/A
This commit is contained in:
芋道源码
2025-04-23 14:40:53 +00:00
committed by Gitee

View File

@@ -64,10 +64,11 @@ export function getDictOptions(dictType: string, valueType?: 'string' | 'number'
export function getDictObj(dictType: string, value: any) {
const dictOptions: DictDataType[] = getDictDatas(dictType)
if (dictOptions) {
dictOptions.forEach((dict: DictDataType) => {
if (dict.value === value.toString())
for (const dict of dictOptions) {
if (dict.value === value.toString()) {
return dict
})
}
}
}
else {
return null