From 37f5e5e4254a80bb592fb2516c270e2aa39fe27a Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 16 Apr 2024 18:22:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E8=BF=87=E6=BB=A4=E7=BB=84=E4=BB=B6=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E4=BD=9C=E7=94=A8=E4=BA=8ETab=E5=86=85=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/canvas/components/editor/Preview.vue | 7 +++++++ core/frontend/src/components/canvas/utils/utils.js | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/core/frontend/src/components/canvas/components/editor/Preview.vue b/core/frontend/src/components/canvas/components/editor/Preview.vue index 6669efb492..87501b528d 100644 --- a/core/frontend/src/components/canvas/components/editor/Preview.vue +++ b/core/frontend/src/components/canvas/components/editor/Preview.vue @@ -452,6 +452,7 @@ export default { return this.componentDataShow || [] }, ...mapState([ + 'sourceComponentData', 'previewCanvasScale', 'isClickComponent' ]), @@ -824,10 +825,16 @@ export default { formatPoint(value, pointScale) { return value * pointScale }, + findSourceComponent(id) { + return this.sourceComponentData.filter(element => element.id === id)[0] + }, handleScaleChange() { if (this.componentData) { const componentData = deepCopy(this.componentData) componentData.forEach(component => { + if (component.type === 'custom') { + component.style = deepCopy(this.findSourceComponent(component.id).style) + } Object.keys(component.style).forEach(key => { if (this.needToChangeHeight.includes(key)) { component.style[key] = this.format(component.style[key], this.scaleHeight) diff --git a/core/frontend/src/components/canvas/utils/utils.js b/core/frontend/src/components/canvas/utils/utils.js index 1bba78f644..8498eee2b0 100644 --- a/core/frontend/src/components/canvas/utils/utils.js +++ b/core/frontend/src/components/canvas/utils/utils.js @@ -309,8 +309,6 @@ export function imgUrlTrans(url) { export function getNowCanvasComponentData(canvasId, showPosition) { if (showPosition && (showPosition.includes('email-task') || showPosition.includes('multiplexing'))) { return store.state.previewComponentData.filter(item => item.canvasId === canvasId) - } else if (showPosition === 'preview') { - return deepCopy(store.state.sourceComponentData.filter(item => item.canvasId === canvasId)) } else { return store.state.componentData.filter(item => item.canvasId === canvasId) }