fix:处理 topology的报错信息

This commit is contained in:
zhangyu
2021-11-26 17:52:28 +08:00
parent 5086fc2fc6
commit 2b3dbebf30

View File

@@ -1425,7 +1425,7 @@ export default {
} }
break break
case 'resize': { case 'resize': {
const dom = document.getElementById('topology-camvas' + this.topologyIndexF) const dom = document.getElementById('topology-canvas' + this.topologyIndexF)
const domRect = dom ? dom.getBoundingClientRect() : {} const domRect = dom ? dom.getBoundingClientRect() : {}
if (getTopology(this.topologyIndex)) { if (getTopology(this.topologyIndex)) {
getTopology(this.topologyIndex).canvasPos = domRect getTopology(this.topologyIndex).canvasPos = domRect
@@ -1436,7 +1436,7 @@ export default {
if (this.$refs.topTool) { if (this.$refs.topTool) {
this.$refs.topTool.scaleNum = parseInt(data * 100) this.$refs.topTool.scaleNum = parseInt(data * 100)
} }
const dom = document.getElementById('topology-camvas' + this.topologyIndexF) const dom = document.getElementById('topology-canvas' + this.topologyIndexF)
const domRect = dom ? dom.getBoundingClientRect() : {} const domRect = dom ? dom.getBoundingClientRect() : {}
if (getTopology(this.topologyIndex)) { if (getTopology(this.topologyIndex)) {
getTopology(this.topologyIndex).canvasPos = domRect getTopology(this.topologyIndex).canvasPos = domRect
@@ -1897,7 +1897,7 @@ export default {
index: 0, index: 0,
list: [JSON.parse(JSON.stringify(getTopology(this.topologyIndex).data))] list: [JSON.parse(JSON.stringify(getTopology(this.topologyIndex).data))]
} }
const dom = document.getElementById('topology-camvas' + this.topologyIndexF) const dom = document.getElementById('topology-canvas' + this.topologyIndexF)
const domRect = dom ? dom.getBoundingClientRect() : {} const domRect = dom ? dom.getBoundingClientRect() : {}
getTopology(this.topologyIndex).canvasPos = domRect getTopology(this.topologyIndex).canvasPos = domRect
}) })
@@ -2000,7 +2000,7 @@ export default {
this.$store.commit('setShowTopoScreen', this.topoScreenState) this.$store.commit('setShowTopoScreen', this.topoScreenState)
this.$nextTick(() => { this.$nextTick(() => {
getTopology(this.topologyIndex).lock(1) getTopology(this.topologyIndex).lock(1)
const dom = document.getElementById('topology-camvas' + this.topologyIndexF) const dom = document.getElementById('topology-canvas' + this.topologyIndexF)
const domRect = dom ? dom.getBoundingClientRect() : {} const domRect = dom ? dom.getBoundingClientRect() : {}
getTopology(this.topologyIndex).canvasPos = domRect getTopology(this.topologyIndex).canvasPos = domRect
this.reload() this.reload()
@@ -2028,7 +2028,7 @@ export default {
this.editTopologyFlag = false this.editTopologyFlag = false
this.$nextTick(() => { this.$nextTick(() => {
getTopology(this.topologyIndex).lock(1) getTopology(this.topologyIndex).lock(1)
const dom = document.getElementById('topology-camvas' + this.topologyIndexF) const dom = document.getElementById('topology-canvas' + this.topologyIndexF)
const domRect = dom ? dom.getBoundingClientRect() : {} const domRect = dom ? dom.getBoundingClientRect() : {}
getTopology(this.topologyIndex).canvasPos = domRect getTopology(this.topologyIndex).canvasPos = domRect
this.$store.commit('setShowTopoScreen', this.topoScreenState) this.$store.commit('setShowTopoScreen', this.topoScreenState)
@@ -2076,7 +2076,7 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.previewData = topologyData this.previewData = topologyData
getTopology(this.topologyIndex).lock(1) getTopology(this.topologyIndex).lock(1)
const dom = document.getElementById('topology-camvas' + this.topologyIndexF) const dom = document.getElementById('topology-canvas' + this.topologyIndexF)
const domRect = dom ? dom.getBoundingClientRect() : {} const domRect = dom ? dom.getBoundingClientRect() : {}
getTopology(this.topologyIndex).canvasPos = domRect getTopology(this.topologyIndex).canvasPos = domRect
this.initPens(topologyData) this.initPens(topologyData)