From ff9c613602a41fc3885bd18b6a8240d86e32ae41 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Tue, 2 Jul 2024 12:04:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E3=80=90=E5=B7=A5=E4=BD=9C=E6=B5=81?= =?UTF-8?q?=E3=80=91=E4=BF=AE=E5=A4=8D=E7=BB=93=E6=9D=9F=E9=94=9A=E7=82=B9?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E8=BF=9E=E6=8E=A5=E5=88=B0=E5=B7=B2=E8=A2=AB?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E7=9A=84=E9=94=9A=E7=82=B9(#686)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/workflow/common/app-node.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/src/workflow/common/app-node.ts b/ui/src/workflow/common/app-node.ts index a23f6538f..0a29641ab 100644 --- a/ui/src/workflow/common/app-node.ts +++ b/ui/src/workflow/common/app-node.ts @@ -195,10 +195,14 @@ class AppNodeModel extends HtmlResize.model { this.sourceRules.push({ message: '只允许连一个节点', - validate: (sourceNode: any, targetNode: any, sourceAnchor: any) => { - return !this.graphModel.edges.some((item) => item.sourceAnchorId === sourceAnchor.id) + validate: (sourceNode: any, targetNode: any, sourceAnchor: any, targetAnchor: any) => { + return !this.graphModel.edges.some( + (item) => + item.sourceAnchorId === sourceAnchor.id || item.targetAnchorId === targetAnchor.id + ) } }) + this.sourceRules.push(circleOnlyAsTarget) this.targetRules.push({ message: '只允许连接左边的锚点',