!59 修复了数据字典值为true和false时,选中select value变nan的bug

Merge pull request !59 from Phone/master
master
xingyu 2024-12-17 06:27:59 +00:00 committed by Gitee
commit 3e7a104aa8
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 3 additions and 1 deletions

View File

@ -52,7 +52,9 @@ export function getDictOptions(dictType: string, valueType?: 'string' | 'number'
? `${dict.value}` ? `${dict.value}`
: valueType === 'boolean' : valueType === 'boolean'
? `${dict.value}` === 'true' ? `${dict.value}` === 'true'
: Number.parseInt(`${dict.value}`), : valueType === 'number' && !isNaN(parseFloat(`${dict.value}`))
? Number.parseInt(`${dict.value}`)
: dict.value,
}) })
}) })
} }