fix: 【工作流】修复结束锚点不能连接到已被链接的锚点(#686)

This commit is contained in:
shaohuzhang1 2024-07-02 12:04:49 +08:00 committed by GitHub
parent 00f2a8bbd4
commit ff9c613602
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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: '只允许连接左边的锚点',