From 7bfdb4f9eba9bd46dc0d3c194078910f7b411e15 Mon Sep 17 00:00:00 2001 From: wente <329538422@qq.com> Date: 星期六, 12 十月 2024 15:54:39 +0800 Subject: [PATCH] 缩略时序图 --- web/src/views/modules/taskReliability/timeDiagramThumbnail.vue | 11 ++++++++--- web/src/views/modules/taskReliability/TimeDiagram.vue | 5 ----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/web/src/views/modules/taskReliability/TimeDiagram.vue b/web/src/views/modules/taskReliability/TimeDiagram.vue index ec5a79e..1361558 100644 --- a/web/src/views/modules/taskReliability/TimeDiagram.vue +++ b/web/src/views/modules/taskReliability/TimeDiagram.vue @@ -638,11 +638,6 @@ } console.log(res.data) }, - graphRightTranslate(){ - this.left+=200 - this.graph.scrollToPoint(this.left, null, { animation: { duration: 400 }}) - // this.graph.setScrollbarPosition(100, null, { animation: { duration: 200, easing: 'linear' }}) - }, getPoint(x,smallWidth){ let pointX = Number((x * (this.bigWidth / smallWidth )).toFixed(0)) // console.log(pointX) diff --git a/web/src/views/modules/taskReliability/timeDiagramThumbnail.vue b/web/src/views/modules/taskReliability/timeDiagramThumbnail.vue index b3678a7..f0b0876 100644 --- a/web/src/views/modules/taskReliability/timeDiagramThumbnail.vue +++ b/web/src/views/modules/taskReliability/timeDiagramThumbnail.vue @@ -265,7 +265,7 @@ true, ) - this.graph.on('node:moved', ({ e, x, y, node, view }) => { + this.graph.on('node:moving', ({ e, x, y, node, view }) => { this.$emit('getPoint',x,this.smallWidth) }) }, @@ -275,8 +275,9 @@ this.smallWidth = this.graph.getContentBBox().width const nodes = this.graph.getNodes() for (const otherNode of nodes) { - if (otherNode.parent){ + if (otherNode.hasParent()){ this.targetNode = otherNode + console.log(this.targetNode,'targetNode') } } // console.log(this.graph.getContentBBox().width,'DiagramJson11') @@ -284,7 +285,11 @@ }, getNodePointX(x,bigWidth){ let pointX = Number((x / ( bigWidth /this.smallWidth)).toFixed(0)) - this.targetNode.position(pointX, this.targetNode.position().y) + if(this.targetNode){ + this.targetNode.position(pointX, this.targetNode.position().y) + return false + } + }, // setScroll(top){ // this.graph.setScrollbarPosition(null, top) -- Gitblit v1.9.1