From e2704bee3cdbcdeba542850b543f56e2274900cf Mon Sep 17 00:00:00 2001 From: ZLY Date: Mon, 8 Dec 2025 16:32:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(flowEditor):=20=E4=BF=AE=E5=A4=8D=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E8=BF=9E=E6=8E=A5=E8=BE=B9=E8=BF=87=E6=BB=A4=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修正目标句柄匹配条件,同时检查目标节点ID和目标句柄ID - 修正源句柄匹配条件,同时检查源节点ID和源句柄ID - 移除调试日志输出语句 - 添加空输入字段占位元素以改善界面显示效果 --- .../flowEditor/components/nodeContentOther.tsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/pages/flowEditor/components/nodeContentOther.tsx b/src/pages/flowEditor/components/nodeContentOther.tsx index 556b863..3205036 100644 --- a/src/pages/flowEditor/components/nodeContentOther.tsx +++ b/src/pages/flowEditor/components/nodeContentOther.tsx @@ -124,10 +124,12 @@ const renderSpecialNodeHandles = (isStartNode: boolean, isEndNode: boolean, data const getConnectedEdgesForHandle = (edges: any[], nodeId: string, handleId: string, handleType: 'source' | 'target') => { return edges.filter(edge => { if (handleType === 'target') { - return edge.targetHandle === handleId; + // 检查目标节点ID和目标句柄ID都匹配 + return edge.target === nodeId && edge.targetHandle === handleId; } else { - return edge.sourceHandle === handleId; + // 检查源节点ID和源句柄ID都匹配 + return edge.source === nodeId && edge.sourceHandle === handleId; } }); }; @@ -287,7 +289,6 @@ const NodeContent = ({ data }: { data: NodeContentData }) => { connectedIns.push(...relatedDataIn); const relatedDataOut = getDataFieldsForApi(apiIn, dataOuts, 'out'); - // console.log("relatedDataOut:",relatedDataOut); connectedOuts.push(...relatedDataOut); } }); @@ -344,6 +345,15 @@ const NodeContent = ({ data }: { data: NodeContentData }) => { )} + {connectedDataFields.connectedIns.length === 0 && ( +
+
+ + +
+
+ )} + {/* Data 输出 */} {connectedDataFields.connectedOuts.length > 0 && !isEndNode && (