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

Merge pull request !1 from Phone/test
pull/59/head
Phone 2024-12-17 04:52:46 +00:00 committed by Gitee
commit c3b115673d
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}`
: valueType === 'boolean'
? `${dict.value}` === 'true'
: Number.parseInt(`${dict.value}`),
: valueType === 'number' && !isNaN(parseFloat(`${dict.value}`))
? Number.parseInt(`${dict.value}`)
: dict.value,
})
})
}