diff --git a/web/src/views/Workflow/components/Properties/index.tsx b/web/src/views/Workflow/components/Properties/index.tsx index 717df355..b5b7a42c 100644 --- a/web/src/views/Workflow/components/Properties/index.tsx +++ b/web/src/views/Workflow/components/Properties/index.tsx @@ -31,6 +31,7 @@ const Properties: FC = ({ const [editIndex, setEditIndex] = useState(null) useEffect(() => { + form.resetFields() if (selectedNode && form) { const { type = 'default', name = '', config } = selectedNode.getData() || {} const initialValue: Record = {} diff --git a/web/src/views/Workflow/hooks/useWorkflowGraph.ts b/web/src/views/Workflow/hooks/useWorkflowGraph.ts index 1e652a7b..d5cd9bb9 100644 --- a/web/src/views/Workflow/hooks/useWorkflowGraph.ts +++ b/web/src/views/Workflow/hooks/useWorkflowGraph.ts @@ -624,7 +624,7 @@ export const useWorkflowGraph = ({ let nodeLibraryConfig = [...nodeLibrary] .flatMap(category => category.nodes) .find(n => n.type === dragData.type); - nodeLibraryConfig = { config: {}, ...nodeLibraryConfig } as NodeProperties; + nodeLibraryConfig = JSON.parse(JSON.stringify({ config: {}, ...nodeLibraryConfig })) as NodeProperties // 创建干净的节点数据,只保留必要的字段 const cleanNodeData = {