wente
2024-10-12 7bfdb4f9eba9bd46dc0d3c194078910f7b411e15
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)