update src/utils/dict.ts.
64行getDictObj,原来采用forEach的话找到值之后return只会中断循环不会返回值,应改为for Signed-off-by: MeaoFun <1357423913@qq.com>pull/74/head
parent
8c39e503f7
commit
c7fe2e1ce4
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue