feat: 工作流

This commit is contained in:
shaohuzhang1 2024-06-20 18:29:13 +08:00
parent 7058321678
commit 2ceddb5c40

View File

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