From 980f3a11de34fe9f04ab8efbe1c767c89e6dd36f Mon Sep 17 00:00:00 2001 From: dataeaseShu <106045316+dataeaseShu@users.noreply.github.com> Date: Fri, 28 Oct 2022 10:19:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=A8=E5=B1=8F=E9=A2=84=E8=A7=88=20?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=AB=AF=E6=A8=A1=E5=BC=8F=E4=B8=8B=20?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E6=A0=87=E9=A2=98=E7=A6=81=E6=AD=A2=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/store/index.js | 8 ++++++-- frontend/src/views/chart/components/ChartComponentG2.vue | 9 +++++++-- frontend/src/views/chart/components/ChartComponentS2.vue | 9 +++++++-- frontend/src/views/panel/edit/index.vue | 3 +++ 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index f75bc770f1..a01641835f 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -151,8 +151,8 @@ const data = { mouseY: 0, width: 0, height: 0 - } - + }, + previewVisible: false }, mutations: { ...animation.mutations, @@ -172,6 +172,10 @@ const data = { state.isClickComponent = status }, + setPreviewVisible(state, previewVisible) { + state.previewVisible = previewVisible + }, + setEditMode(state, mode) { state.editMode = mode }, diff --git a/frontend/src/views/chart/components/ChartComponentG2.vue b/frontend/src/views/chart/components/ChartComponentG2.vue index 4b0b2940b8..c55b9c80fe 100644 --- a/frontend/src/views/chart/components/ChartComponentG2.vue +++ b/frontend/src/views/chart/components/ChartComponentG2.vue @@ -67,6 +67,7 @@ import TitleRemark from '@/views/chart/view/TitleRemark' import { DEFAULT_TITLE_STYLE } from '@/views/chart/chart/chart' import { baseMixOptionAntV } from '@/views/chart/chart/mix/mix_antv' import { compareItem } from '@/views/chart/chart/compare' +import { mapState } from 'vuex' import clickoutside from 'element-ui/src/utils/clickoutside.js' import bus from '@/utils/bus' @@ -163,7 +164,11 @@ export default { }, mainActiveName() { return this.$store.state.panel.mainActiveName - } + }, + ...mapState([ + 'mobileLayoutStatus', + 'previewVisible' + ]) }, watch: { chart: { @@ -444,7 +449,7 @@ export default { }) }, handleTitleEditer() { - if (this.mainActiveName !== 'PanelEdit') return + if (this.mainActiveName !== 'PanelEdit' || this.mobileLayoutStatus || this.previewVisible) return this.chartTitleEditer = true this.chartTitleUpdate = this.chart.title this.$nextTick(() => { diff --git a/frontend/src/views/chart/components/ChartComponentS2.vue b/frontend/src/views/chart/components/ChartComponentS2.vue index 8ed97e0ff3..8c55c3a9ce 100644 --- a/frontend/src/views/chart/components/ChartComponentS2.vue +++ b/frontend/src/views/chart/components/ChartComponentS2.vue @@ -98,6 +98,7 @@ import TitleRemark from '@/views/chart/view/TitleRemark' import { DEFAULT_TITLE_STYLE } from '@/views/chart/chart/chart' import clickoutside from 'element-ui/src/utils/clickoutside.js' import bus from '@/utils/bus' +import { mapState } from 'vuex' import { compareItem } from '@/views/chart/chart/compare' import { getChartDetails @@ -197,7 +198,11 @@ export default { }, mainActiveName() { return this.$store.state.panel.mainActiveName - } + }, + ...mapState([ + 'mobileLayoutStatus', + 'previewVisible' + ]) }, watch: { chart: { @@ -479,7 +484,7 @@ export default { }) }, handleTitleEditer() { - if (this.mainActiveName !== 'PanelEdit') return + if (this.mainActiveName !== 'PanelEdit' || this.mobileLayoutStatus || this.previewVisible) return this.chartTitleEditer = true this.chartTitleUpdate = this.chart.title this.$nextTick(() => { diff --git a/frontend/src/views/panel/edit/index.vue b/frontend/src/views/panel/edit/index.vue index 511495400e..dc79ab3d56 100644 --- a/frontend/src/views/panel/edit/index.vue +++ b/frontend/src/views/panel/edit/index.vue @@ -777,6 +777,9 @@ export default { }, mobileLayoutStatus() { this.restore() + }, + previewVisible(val) { + this.$store.commit('setPreviewVisible', val) } }, created() {