From ac1eacafe0e013626071c9e84caaea19655e0e9e Mon Sep 17 00:00:00 2001 From: rockfang Date: Thu, 30 May 2024 11:21:14 +0800 Subject: [PATCH] [Fix][UI] ensure number type field has number type value in alarm-instance-manage (#16089) --- .../src/views/security/alarm-instance-manage/use-form.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dolphinscheduler-ui/src/views/security/alarm-instance-manage/use-form.ts b/dolphinscheduler-ui/src/views/security/alarm-instance-manage/use-form.ts index 5e14148f2d..0a003daf43 100644 --- a/dolphinscheduler-ui/src/views/security/alarm-instance-manage/use-form.ts +++ b/dolphinscheduler-ui/src/views/security/alarm-instance-manage/use-form.ts @@ -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 {