[Fix][UI] ensure number type field has number type value in alarm-instance-manage (#16089)

This commit is contained in:
rockfang 2024-05-30 11:21:14 +08:00 committed by GitHub
parent a7245189a8
commit ac1eacafe0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -115,6 +115,15 @@ export function useForm() {
state.detailForm.warningType = record.warningType
if (record.pluginInstanceParams)
state.json = JSON.parse(record.pluginInstanceParams)
// ensure number type field has number type value
state.json.forEach((item: any) => {
if (item.validate && item.validate.length) {
const numberTypeItem = item.validate.find(
(v: any) => v.type === 'number'
)
if (numberTypeItem) item.value = +item.value
}
})
}
return {