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 = () => {