Browse Source

fix: 修复流水线模板数据集、模型、镜像删除时,数据还存在

pull/282/head
zhaowei 5 months ago
parent
commit
db8280fa13
2 changed files with 8 additions and 3 deletions
  1. +1
    -1
      react-ui/src/components/ParameterSelect/index.tsx
  2. +7
    -2
      react-ui/src/pages/Pipeline/components/PipelineNodeDrawer/index.tsx

+ 1
- 1
react-ui/src/components/ParameterSelect/index.tsx View File

@@ -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) {


+ 7
- 2
react-ui/src/pages/Pipeline/components/PipelineNodeDrawer/index.tsx View File

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


Loading…
Cancel
Save