From db8280fa1308c44d44c74fd9081e1c18133df602 Mon Sep 17 00:00:00 2001 From: zhaowei Date: Tue, 26 Aug 2025 12:34:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=B5=81=E6=B0=B4?= =?UTF-8?q?=E7=BA=BF=E6=A8=A1=E6=9D=BF=E6=95=B0=E6=8D=AE=E9=9B=86=E3=80=81?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E3=80=81=E9=95=9C=E5=83=8F=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=95=B0=E6=8D=AE=E8=BF=98=E5=AD=98=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- react-ui/src/components/ParameterSelect/index.tsx | 2 +- .../Pipeline/components/PipelineNodeDrawer/index.tsx | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/react-ui/src/components/ParameterSelect/index.tsx b/react-ui/src/components/ParameterSelect/index.tsx index cdae15ed..2fe4a127 100644 --- a/react-ui/src/components/ParameterSelect/index.tsx +++ b/react-ui/src/components/ParameterSelect/index.tsx @@ -122,7 +122,7 @@ function ParameterSelect({ const handleChange = (text: string) => { // 数据集、模型、服务,转换成对象 if (isObjectValue) { - // 设置为 null 是因为 antv g6 的 bug + // 设置为 null 是因为 ant g6 bug // 如果值为 undefined 时, graph.changeData(data) 会保留前面的值 const selectValue = text ? valueMap.get(text) : null; if (typeof value === 'object' && value !== null) { diff --git a/react-ui/src/pages/Pipeline/components/PipelineNodeDrawer/index.tsx b/react-ui/src/pages/Pipeline/components/PipelineNodeDrawer/index.tsx index c1341eb1..d6da2b16 100644 --- a/react-ui/src/pages/Pipeline/components/PipelineNodeDrawer/index.tsx +++ b/react-ui/src/pages/Pipeline/components/PipelineNodeDrawer/index.tsx @@ -20,6 +20,7 @@ import { PipelineNodeModelParameter, PipelineNodeModelSerialize, } from '@/types'; +import { undefinedToNull } from '@/utils'; import { openAntdModal } from '@/utils/modal'; import { to } from '@/utils/promise'; import { removeFormListItem } from '@/utils/ui'; @@ -92,8 +93,12 @@ const PipelineNodeParameter = forwardRef(({ onFormChange }: PipelineNodeParamete out_parameters: out_parameters, formError: !!error, }; - console.log('res', res); - onFormChange(res); + + // ant g6 bug + // 如果值为 undefined 时, graph.changeData(data) 会保留前面的值 + const convertRes = undefinedToNull(res); + console.log('res', convertRes); + onFormChange(convertRes as PipelineNodeModelSerialize); } }; const onClose = () => {