NEZ-967 fix: 下滑框 内 diagram 图无法触发 悬浮图表

This commit is contained in:
zhangyu
2021-09-13 13:37:08 +08:00
parent e3b2457979
commit 979e856a2c
3 changed files with 10 additions and 4 deletions

View File

@@ -551,6 +551,9 @@ export default {
const chartBox = document.getElementById('chart-' + item.id)// this.$refs['editChart'+item.id][0]; const chartBox = document.getElementById('chart-' + item.id)// this.$refs['editChart'+item.id][0];
this.handleElementInViewport(chartBox, scrollTop, item, index) this.handleElementInViewport(chartBox, scrollTop, item, index)
} }
if (item.type === 'diagram') {
this.$refs['editChart' + item.id][0].resize()
}
}) })
} }
}, },

View File

@@ -742,6 +742,9 @@ export default {
const chartBox = document.getElementById('chart-' + item.id)// this.$refs['editChart'+item.id][0]; const chartBox = document.getElementById('chart-' + item.id)// this.$refs['editChart'+item.id][0];
this.handleElementInViewport(chartBox, scrollTop, item, index) this.handleElementInViewport(chartBox, scrollTop, item, index)
} }
if (item.type === 'diagram') {
this.$refs['editChart' + item.id][0].resize()
}
if (item.type === 'group') { if (item.type === 'group') {
this.$refs['editChart' + item.id][0].$refs.listGroup.loadChartData(scrollTop) this.$refs['editChart' + item.id][0].$refs.listGroup.loadChartData(scrollTop)
} }

View File

@@ -732,16 +732,16 @@ export default {
}) })
} }
}) })
this.winResize() })
},200)
// if(this.fromPrev){ // if(this.fromPrev){
// getTopology(this.topologyIndex).scaleTo(data.scale/2) // getTopology(this.topologyIndex).scaleTo(data.scale/2)
// } // }
// getTopology(this.topologyIndex).fitView(); // getTopology(this.topologyIndex).fitView();
this.oldTopologyData = JSON.stringify(getTopology(this.topologyIndex).data) this.oldTopologyData = JSON.stringify(getTopology(this.topologyIndex).data)
this.getNodesArr() this.winResize()
}) })
} }
this.winResize()
}) })
}) })
}, },
@@ -2052,7 +2052,7 @@ export default {
winResize () { winResize () {
setTimeout(() => { setTimeout(() => {
const domRect = document.getElementById('topology-canvas' + this.topologyIndex).getBoundingClientRect() const domRect = getTopology(this.topologyIndex).divLayer.canvas.getBoundingClientRect()
getTopology(this.topologyIndex).canvasPos = domRect getTopology(this.topologyIndex).canvasPos = domRect
if (this.fromOverView) { if (this.fromOverView) {
getTopology(this.topologyIndex).open(this.oldTopologyData) getTopology(this.topologyIndex).open(this.oldTopologyData)