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

pull/59/head^2
Phone 2024-12-17 11:52:38 +08:00
parent 62f27cfb3a
commit c97a2a9135
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,
})
})
}