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 575a05ac0bbd5fd4eb217dd45c7ce0a4afd8b7ed..6ac6e31e5dc408c543d5504caf74ed43dfd8b5f8 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 {