From 61926c29e5277d3721f069d1df514a1e9f4a67f2 Mon Sep 17 00:00:00 2001 From: zhaoying Date: Tue, 30 Dec 2025 20:06:50 +0800 Subject: [PATCH] fix(web): workflow save function --- .../views/ToolManagement/components/McpServiceModal.tsx | 4 +--- web/src/views/Workflow/hooks/useWorkflowGraph.ts | 9 +++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/web/src/views/ToolManagement/components/McpServiceModal.tsx b/web/src/views/ToolManagement/components/McpServiceModal.tsx index 01a69641..a104c2d6 100644 --- a/web/src/views/ToolManagement/components/McpServiceModal.tsx +++ b/web/src/views/ToolManagement/components/McpServiceModal.tsx @@ -113,11 +113,9 @@ const McpServiceModal = forwardRef(({ request.then((res: any) => { message.success(t('common.saveSuccess')); testConnection(res.tool_id || editVo?.id) - .then(() => { - handleClose(); - }) .finally(() => { setLoading(false); + handleClose(); refresh() }) }) diff --git a/web/src/views/Workflow/hooks/useWorkflowGraph.ts b/web/src/views/Workflow/hooks/useWorkflowGraph.ts index 2a100259..27c168f1 100644 --- a/web/src/views/Workflow/hooks/useWorkflowGraph.ts +++ b/web/src/views/Workflow/hooks/useWorkflowGraph.ts @@ -783,20 +783,21 @@ export const useWorkflowGraph = ({ }), edges: edges.map((edge: Edge) => { const sourceCell = graphRef.current?.getCellById(edge.getSourceCellId()); + const targetCell = graphRef.current?.getCellById(edge.getTargetCellId()); const sourcePortId = edge.getSourcePortId(); // 如果是if-else节点的右侧端口连线,添加label if (sourceCell?.getData()?.type === 'if-else' && sourcePortId?.startsWith('CASE')) { return { - source: edge.getSourceCellId(), - target: edge.getTargetCellId(), + source: sourceCell.getData().id, + target: targetCell?.getData().id, label: sourcePortId, }; } return { - source: edge.getSourceCellId(), - target: edge.getTargetCellId(), + source: sourceCell?.getData().id, + target: targetCell?.getData().id, }; }), }