From 9e958900c3ae5c6c3932caaf11d019d6bbef2db3 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Tue, 13 Apr 2021 19:26:58 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E5=A4=84=E7=90=86projectTopo=20?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=8F=98=E4=B8=BA=E5=85=A8=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/common/project/topologyL5.vue | 10 +++++++--- nezha-fronted/src/store/index.js | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/nezha-fronted/src/components/common/project/topologyL5.vue b/nezha-fronted/src/components/common/project/topologyL5.vue index 4466b033f..50080fcf8 100644 --- a/nezha-fronted/src/components/common/project/topologyL5.vue +++ b/nezha-fronted/src/components/common/project/topologyL5.vue @@ -481,7 +481,8 @@ export default { name: '', unit: '' }, - unitArr: [] + unitArr: [], + topoScreenState: '' // 记录编辑前的 $store.ShowTopoScreen 结束编辑后返回 } }, components: { @@ -528,7 +529,6 @@ export default { deep: true, immediate: true, handler (n) { - console.log(n, '123123123') if (n.id) { if (getTopology(this.topologyIndex)) { getTopology(this.topologyIndex).destroy() @@ -1717,6 +1717,8 @@ export default { editTopology (val) { this.editTopologyFlag = true + this.topoScreenState = JSON.parse(JSON.stringify(this.topoScreen)) + this.$store.commit('setShowTopoScreen', true) setTimeout(() => { getTopology(this.topologyIndex).lock(0) getTopology(this.topologyIndex).data.pens.forEach((item, index) => { // 停止动画 以及赋值默认data @@ -1846,6 +1848,7 @@ export default { message: this.$t('tip.saveSuccess'), type: 'success' }) + this.$store.commit('setShowTopoScreen', this.topoScreenState) this.$nextTick(() => { getTopology(this.topologyIndex).lock(1) const domRect = document.getElementById('topology-canvas' + this.topologyIndexF).getBoundingClientRect() @@ -1879,6 +1882,7 @@ export default { this.toolShow.attrCord = [domRect.width - 350, 0] this.toolShow.height = domRect.height getTopology(this.topologyIndex).canvasPos = domRect + this.$store.commit('setShowTopoScreen', this.topoScreenState) }) this.reload() }, @@ -2021,7 +2025,7 @@ export default { getTopology(this.topologyIndex).bottom() }, changeScreen () { - this.$store.commit('setShowTopoScreen') + this.$store.commit('setShowTopoScreen', !this.topoScreen) } }, destroyed () { diff --git a/nezha-fronted/src/store/index.js b/nezha-fronted/src/store/index.js index aebff1236..4e5660ac4 100644 --- a/nezha-fronted/src/store/index.js +++ b/nezha-fronted/src/store/index.js @@ -133,8 +133,8 @@ const store = new Vuex.Store({ state.dcDataRefresh = false }, 100) }, - setShowTopoScreen (state) { - state.showTopoScreen = !state.showTopoScreen + setShowTopoScreen (state, boolean) { + state.showTopoScreen = boolean } }, actions: {