From 71bafb628c11b28163c5ffe3f964a779e3332618 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Fri, 28 May 2021 00:04:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20UI=20=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/canvas/components/Editor/Preview.vue | 9 +++++++++ .../src/components/canvas/custom-component/UserView.vue | 4 +++- frontend/src/views/panel/edit/index.vue | 8 +++++++- frontend/src/views/panel/list/PanelMain.vue | 8 ++++++++ 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/canvas/components/Editor/Preview.vue b/frontend/src/components/canvas/components/Editor/Preview.vue index 42fbc95b8f..f986f92742 100644 --- a/frontend/src/components/canvas/components/Editor/Preview.vue +++ b/frontend/src/components/canvas/components/Editor/Preview.vue @@ -82,6 +82,14 @@ export default { 'canvasStyleData' ]) }, + watch: { + componentData: { + handler(newVal, oldVla) { + this.restore() + }, + deep: true + } + }, mounted() { const _this = this const erd = elementResizeDetectorMaker() @@ -119,6 +127,7 @@ export default { }, handleScaleChange() { if (this.componentData) { + debugger const componentData = deepCopy(this.componentData) componentData.forEach(component => { Object.keys(component.style).forEach(key => { diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue index ddb3288519..bff4dba06c 100644 --- a/frontend/src/components/canvas/custom-component/UserView.vue +++ b/frontend/src/components/canvas/custom-component/UserView.vue @@ -77,7 +77,9 @@ export default { // 监听外部的样式变化 outStyle: { handler(newVal, oldVla) { - this.$refs[this.element.propValue.id].chartResize() + if (this.$refs[this.element.propValue.id]) { + this.$refs[this.element.propValue.id].chartResize() + } }, deep: true } diff --git a/frontend/src/views/panel/edit/index.vue b/frontend/src/views/panel/edit/index.vue index 817b5a8521..d671c5c6e3 100644 --- a/frontend/src/views/panel/edit/index.vue +++ b/frontend/src/views/panel/edit/index.vue @@ -263,7 +263,13 @@ export default { }, showPanel(type) { if (this.showIndex === -1 || this.showIndex === type) { - this.$nextTick(() => (this.show = !this.show)) + this.$nextTick(() => { + if (this.show) { + this.showIndex === -1 + } + this.show = !this.show + } + ) } this.showIndex = type }, diff --git a/frontend/src/views/panel/list/PanelMain.vue b/frontend/src/views/panel/list/PanelMain.vue index 73ef176e0e..ae4c3e114f 100644 --- a/frontend/src/views/panel/list/PanelMain.vue +++ b/frontend/src/views/panel/list/PanelMain.vue @@ -46,6 +46,14 @@ export default { return this.$store.state.panel.mainActiveName } }, + watch: { + // 切换展示页面后 重新点击一下当前节点 + '$store.state.panel.mainActiveName': function(newVal, oldVal) { + if (newVal === 'PanelMain' && this.lastActiveNode && this.lastActiveNodeData) { + this.activeNodeAndClickOnly(this.lastActiveNodeData) + } + } + }, mounted() { this.$store.dispatch('panel/setMainActiveName', 'PanelMain') },