diff --git a/ui/src/workflow/common/app-node.ts b/ui/src/workflow/common/app-node.ts index fcfac040e..a46b7ee2a 100644 --- a/ui/src/workflow/common/app-node.ts +++ b/ui/src/workflow/common/app-node.ts @@ -110,12 +110,20 @@ class AppNodeModel extends HtmlResize.model { } setAttributes() { this.width = this.properties?.width || 340 + const circleOnlyAsTarget = { message: '只允许从右边的锚点连出', validate: (sourceNode: any, targetNode: any, sourceAnchor: any) => { return sourceAnchor.type === 'right' } } + + this.sourceRules.push({ + message: '只允许连一个节点', + validate: (sourceNode: any, targetNode: any, sourceAnchor: any) => { + return !this.graphModel.edges.some((item) => item.sourceNodeId === sourceNode.id) + } + }) this.sourceRules.push(circleOnlyAsTarget) this.targetRules.push({ message: '只允许连接左边的锚点',