From 3c2e46fef0e866901cbb5de889166b6fda748e5d Mon Sep 17 00:00:00 2001
From: xyc <jc_xiong@hotmail.com>
Date: 星期二, 22 十月 2024 14:39:09 +0800
Subject: [PATCH] 同类设备有多个的修改

---
 web/src/views/modules/taskReliability/TimeDiagram.vue |   17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/web/src/views/modules/taskReliability/TimeDiagram.vue b/web/src/views/modules/taskReliability/TimeDiagram.vue
index ec5a79e..3e6d46f 100644
--- a/web/src/views/modules/taskReliability/TimeDiagram.vue
+++ b/web/src/views/modules/taskReliability/TimeDiagram.vue
@@ -142,6 +142,7 @@
     },
     mounted() {
       this.getProductList()
+      this.init()
       this.$refs.textDiagram.init()
       this.$refs.timeDiagramThumbnail.init()
     },
@@ -162,8 +163,6 @@
         this.$refs.timeDiagramThumbnail.getNodePointX(left,this.bigWidth)
       },
       init() {
-        console.log(document.documentElement.clientWidth, 'document.documentElement.clientWidth')
-        console.log(document.documentElement.clientHeight, 'document.documentElement.clientHeight')
         this.graph = new Graph({
           container: document.getElementById('timeDiagram'),
           // width: document.documentElement.clientWidth - 100,
@@ -246,8 +245,8 @@
         this.knob = document.createElement('div',false)
         this.knob.style.position = 'absolute'
         document.getElementById('timeDiagram').appendChild(this.knob)
-        this.graph.centerContent()
-
+        this.graph.positionContent('left',{ padding: { left: 0 }})
+        // this.graph.centerContent()
         Graph.registerNode(
           'custom-rect',
           {
@@ -582,7 +581,7 @@
         this.$nextTick(() => {
           this.$refs.ProductModelTree.getProductList()
         })
-        this.init()
+        // this.init()
       },
       onTaskSelected(data) {
         console.log(data, ' onProductSelected(data)')
@@ -632,16 +631,12 @@
           this.$refs.timeDiagramThumbnail.getThumbnail(smallDiagramJson)
         } else {
           this.graph.fromJSON(this.emptyJson)
-          this.graph.centerContent()
+          this.graph.positionContent('left',{ padding: { left: 0 }})
+          // this.graph.centerContent()
           //this.graph.zoomToFit()
           this.graph.freeze()
         }
         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))

--
Gitblit v1.9.1