From 664db98c9e8595ce4dd636a27f480e3a08b81ff5 Mon Sep 17 00:00:00 2001
From: xyc <jc_xiong@hotmail.com>
Date: 星期五, 21 二月 2025 11:13:51 +0800
Subject: [PATCH] 新增可忽略的维修时间
---
web/src/views/modules/taskReliability/timeDiagramThumbnail.vue | 31 ++++++++++++++++++-------------
1 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/web/src/views/modules/taskReliability/timeDiagramThumbnail.vue b/web/src/views/modules/taskReliability/timeDiagramThumbnail.vue
index b3678a7..7475f33 100644
--- a/web/src/views/modules/taskReliability/timeDiagramThumbnail.vue
+++ b/web/src/views/modules/taskReliability/timeDiagramThumbnail.vue
@@ -9,7 +9,7 @@
name: "timeDiagramThumbnail",
data(){
return{
- graph:null,
+ thumbnailGraph:null,
smallWidth:0,
targetNode:{},
}
@@ -19,7 +19,7 @@
console.log(document.documentElement.clientWidth, 'document.documentElement.clientWidth')
console.log(document.documentElement.clientHeight, 'document.documentElement.clientHeight')
- this.graph = new Graph({
+ this.thumbnailGraph = new Graph({
container: document.getElementById('timeDiagramThumbnail'),
// width:250,
height: 150,
@@ -66,7 +66,7 @@
// autoResize: true,
// keyboard: true,
})
- this.graph.centerContent()
+ this.thumbnailGraph.centerContent()
Graph.registerNode(
'custom-rect',
{
@@ -265,29 +265,34 @@
true,
)
- this.graph.on('node:moved', ({ e, x, y, node, view }) => {
+ this.thumbnailGraph.on('node:moving', ({ e, x, y, node, view }) => {
this.$emit('getPoint',x,this.smallWidth)
})
},
getThumbnail(smallDiagramJson){
- this.graph.fromJSON(smallDiagramJson)
- this.graph.centerContent()
- this.smallWidth = this.graph.getContentBBox().width
- const nodes = this.graph.getNodes()
+ this.thumbnailGraph.fromJSON(smallDiagramJson)
+ this.thumbnailGraph.centerContent()
+ this.smallWidth = this.thumbnailGraph.getContentBBox().width
+ const nodes = this.thumbnailGraph.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')
- // this.graph.zoomToFit()
+ // console.log(this.thumbnailGraph.getContentBBox().width,'DiagramJson11')
+ // this.thumbnailGraph.zoomToFit()
},
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)
+ // this.thumbnailGraph.setScrollbarPosition(null, top)
// }
},
}
--
Gitblit v1.9.1