|
|
@@ -82,10 +82,10 @@ export default class Process {
|
|
|
line: {
|
|
|
stroke: '#A2B1C3',
|
|
|
strokeWidth: 3,
|
|
|
- strokeDasharray: 5,
|
|
|
- style: {
|
|
|
- animation: 'ant-line 30s infinite linear',
|
|
|
- },
|
|
|
+ strokeDasharray: 6,
|
|
|
+ // style: {
|
|
|
+ // animation: 'ant-line 30s infinite linear',
|
|
|
+ // },
|
|
|
},
|
|
|
router: {
|
|
|
name: 'metro',
|
|
|
@@ -112,9 +112,9 @@ export default class Process {
|
|
|
stroke: '#A2B1C3',
|
|
|
strokeWidth: 3,
|
|
|
strokeDasharray: 6,
|
|
|
- style: {
|
|
|
- animation: 'ant-line 30s infinite linear',
|
|
|
- },
|
|
|
+ // style: {
|
|
|
+ // animation: 'ant-line 30s infinite linear',
|
|
|
+ // },
|
|
|
},
|
|
|
},
|
|
|
zIndex: 0,
|
|
|
@@ -451,10 +451,22 @@ export default class Process {
|
|
|
|
|
|
this.graph.on('node:mouseleave', ({ view} ) => {
|
|
|
})
|
|
|
+
|
|
|
this.graph.on('node:click', ({ node} ) => {
|
|
|
- console.log('click')
|
|
|
+ console.log('node:click')
|
|
|
// this.graph.clearTransformWidgets()
|
|
|
+ //取消动画
|
|
|
+ let allEdges=this.graph.getEdges()
|
|
|
+ allEdges?.forEach((edge) => {
|
|
|
+ edge.attr('line/style/animation', '')
|
|
|
+ })
|
|
|
+ //设置动画
|
|
|
+ let edges = this.graph.getOutgoingEdges(node)
|
|
|
+ edges?.forEach((edge) => {
|
|
|
+ edge.attr('line/style/animation', 'ant-line 30s infinite linear')
|
|
|
+ })
|
|
|
})
|
|
|
+
|
|
|
// 监听节点选中
|
|
|
this.graph.on('node:selected', ({ node} ) => {
|
|
|
console.log('selected')
|
|
|
@@ -462,6 +474,11 @@ export default class Process {
|
|
|
})
|
|
|
this.graph.on('node:unselected', ({ node} ) => {
|
|
|
this.showPorts(this.graph.findViewByCell(node.id),false)
|
|
|
+ //取消动画
|
|
|
+ let allEdges=this.graph.getEdges()
|
|
|
+ allEdges?.forEach((edge) => {
|
|
|
+ edge.attr('line/style/animation', '')
|
|
|
+ })
|
|
|
})
|
|
|
// endregion
|
|
|
|