From 47b4489452eb8d19660fe7af8f02299540035424 Mon Sep 17 00:00:00 2001 From: "Mr.An" <42627702+SnowMoon-Dev@users.noreply.github.com> Date: Thu, 28 Apr 2022 18:11:02 +0800 Subject: [PATCH] [Fix] json object serialization error (#9828) * fix json object parser error * delete password validator * Update use-form.ts * Update use-form.ts * Update use-detail.ts --- .../src/views/datasource/list/use-form.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dolphinscheduler-ui-next/src/views/datasource/list/use-form.ts b/dolphinscheduler-ui-next/src/views/datasource/list/use-form.ts index 575a05ac0b..6ac6e31e5d 100644 --- a/dolphinscheduler-ui-next/src/views/datasource/list/use-form.ts +++ b/dolphinscheduler-ui-next/src/views/datasource/list/use-form.ts @@ -23,7 +23,8 @@ import type { IDataSourceDetail, IDataBase, IDataBaseOption, - IDataBaseOptionKeys + IDataBaseOptionKeys, + IDataSource } from './types' export function useForm(id?: number) { @@ -138,9 +139,15 @@ export function useForm(id?: number) { const resetFieldsValue = () => { state.detailForm = { ...initialValues } } - const setFieldsValue = (values: object) => { - state.detailForm = { ...state.detailForm, ...values } + + const setFieldsValue = (values: IDataSource) => { + state.detailForm = { + ...state.detailForm, + ...values, + other: values.other ? JSON.stringify(values.other) : values.other + } } + const getFieldsValue = () => state.detailForm return {