From 7d40d06b6920f9bcaedcf30ce7e5f49a52a3f117 Mon Sep 17 00:00:00 2001 From: zhaoying Date: Tue, 23 Dec 2025 14:30:22 +0800 Subject: [PATCH] fix(web): workflow properties --- web/src/views/Workflow/components/Properties/index.tsx | 1 + web/src/views/Workflow/hooks/useWorkflowGraph.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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 = {