fix: DictTag造成打包后页面卡死

pull/24/head
dap1 2023-06-30 22:49:41 +08:00
parent 2ac7af9fc8
commit e8bc53f6cc
1 changed files with 9 additions and 21 deletions

View File

@ -25,30 +25,18 @@ export function getDictDatas(dictType: string) {
} }
export function getDictOpts(dictType: string) { export function getDictOpts(dictType: string) {
const dictOption: DictDataType[] = [] /**
const dictOptions: DictDataType[] = getDictDatas(dictType) * Tag
if (dictOptions && dictOptions.length > 0) { * getDictOptions
dictOptions.forEach((dict: DictDataType) => { *
if (typeof dict.value === 'number') { * bugfix:
dictOption.push({ * dictOption.push({
...dict, ...dict,
value: parseInt(dict.value + '') value: parseInt(dict.value + '')
}) })
} else if (typeof dict.value === 'string') {
dictOption.push({ */
...dict, return getDictDatas(dictType)
value: dict.value + ''
})
} else if (typeof dict.value === 'boolean') {
dictOption.push({
...dict,
value: dict.value + '' === 'true' ? true : false
})
}
})
}
return dictOption
} }
export function getDictOptions(dictType: string, valueType?: 'string' | 'number' | 'boolean') { export function getDictOptions(dictType: string, valueType?: 'string' | 'number' | 'boolean') {