From 6353960bc096af563006c66a1988e5cd254d479e Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 1 Nov 2022 17:20:50 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E4=BB=BB=E5=8A=A1=E9=A2=84=E8=A7=88tab=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=86=85=E7=9A=84=E8=A7=86=E5=9B=BE=E9=94=99=E4=BD=8D?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/DeViewSelect/index.vue | 8 +++++++- frontend/src/components/canvas/store/copy.js | 2 ++ frontend/src/components/canvas/utils/utils.js | 8 ++++++-- frontend/src/components/widget/DeWidget/DeTabs.vue | 3 ++- frontend/src/store/index.js | 7 +++++-- frontend/src/views/panel/ViewSelect/multiplexing.vue | 3 ++- 6 files changed, 24 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/DeViewSelect/index.vue b/frontend/src/components/DeViewSelect/index.vue index 5a30cdcda3..057055c43f 100644 --- a/frontend/src/components/DeViewSelect/index.vue +++ b/frontend/src/components/DeViewSelect/index.vue @@ -34,7 +34,7 @@ :style="{'height': panelHeight + 'px'}" > item.canvasId === this.canvasId) + }, popperClass() { const _c = 'el-view-select-popper ' + this.popoverClass return this.disabled ? _c + ' disabled ' : _c @@ -148,6 +153,7 @@ export default { panelDataPrepare(JSON.parse(response.data.panelData), JSON.parse(response.data.panelStyle), rsp => { this.viewLoaded = true this.componentData = rsp.componentData + this.$store.commit('setPreviewComponentData', this.componentData) this.canvasStyleData = rsp.componentStyle this.loadOptions() }) diff --git a/frontend/src/components/canvas/store/copy.js b/frontend/src/components/canvas/store/copy.js index afb3f9e91f..86a7feafbc 100644 --- a/frontend/src/components/canvas/store/copy.js +++ b/frontend/src/components/canvas/store/copy.js @@ -108,6 +108,8 @@ export default { Vue.set(newView, 'needAdaptor', needAdaptor) newView.id = uuid.v1() newView.propValue.viewId = res.data + newView['canvasId'] = 'canvas-main' + newView['canvasPid'] = '0' if (newView.filters && newView.filters.length) { newView.filters = [] } diff --git a/frontend/src/components/canvas/utils/utils.js b/frontend/src/components/canvas/utils/utils.js index aba32e1d9e..988461c2cb 100644 --- a/frontend/src/components/canvas/utils/utils.js +++ b/frontend/src/components/canvas/utils/utils.js @@ -231,6 +231,10 @@ export function imgUrlTrans(url) { } } -export function getNowCanvasComponentData(canvasId) { - return store.state.componentData.filter(item => item.canvasId === canvasId) +export function getNowCanvasComponentData(canvasId, showPosition) { + if (showPosition && (showPosition.includes('email-task') || showPosition.includes('multiplexing'))) { + return store.state.previewComponentData.filter(item => item.canvasId === canvasId) + } else { + return store.state.componentData.filter(item => item.canvasId === canvasId) + } } diff --git a/frontend/src/components/widget/DeWidget/DeTabs.vue b/frontend/src/components/widget/DeWidget/DeTabs.vue index d9526cad50..865f1e8ed8 100644 --- a/frontend/src/components/widget/DeWidget/DeTabs.vue +++ b/frontend/src/components/widget/DeWidget/DeTabs.vue @@ -76,6 +76,7 @@ :canvas-id="element.id+'-'+item.name" :panel-info="panelInfo" :in-screen="true" + :show-position="showPosition" /> @@ -431,7 +432,7 @@ export default { if (this.mobileLayoutStatus) { return this.pcComponentData.filter(item => item.canvasId === tabCanvasId) } else { - return getNowCanvasComponentData(tabCanvasId) + return getNowCanvasComponentData(tabCanvasId, this.showPosition) } }, setContentThemeStyle() { diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index c7fded233e..f6a2031416 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -152,7 +152,8 @@ const data = { width: 0, height: 0 }, - previewVisible: false + previewVisible: false, + previewComponentData: [] }, mutations: { ...animation.mutations, @@ -242,7 +243,9 @@ const data = { setComponentData(state, componentData = []) { Vue.set(state, 'componentData', componentData) }, - + setPreviewComponentData(state, previewComponentData = []) { + Vue.set(state, 'previewComponentData', previewComponentData) + }, setComponentViewsData(state, componentViewsData = {}) { Vue.set(state, 'componentViewsData', componentViewsData) }, diff --git a/frontend/src/views/panel/ViewSelect/multiplexing.vue b/frontend/src/views/panel/ViewSelect/multiplexing.vue index 2012a9da11..33970e6670 100644 --- a/frontend/src/views/panel/ViewSelect/multiplexing.vue +++ b/frontend/src/views/panel/ViewSelect/multiplexing.vue @@ -75,7 +75,7 @@ export default { }, computed: { mainCanvasComponentData() { - return getNowCanvasComponentData(this.canvasId) + return this.componentData.filter(item => item.canvasId === this.canvasId) } }, watch: { @@ -105,6 +105,7 @@ export default { _this.componentData = rsp.componentData _this.canvasStyleData = rsp.componentStyle _this.selectedPanel = params + _this.$store.commit('setPreviewComponentData', _this.componentData) }) }) } else if (params.showType === 'view') {