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 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

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