From 300e62192126a4ce32f487cbab65d26e073a2cb2 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 14 Oct 2024 14:14:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E3=80=81=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E4=BF=AE=E5=A4=8Dtab,?= =?UTF-8?q?=E5=88=86=E7=BB=84=E5=86=85=E9=83=A8=E7=BB=84=E4=BB=B6=E5=BF=AB?= =?UTF-8?q?=E6=8D=B7=E9=94=AE=E7=A7=BB=E5=8A=A8=E6=9C=AA=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/utils/DeShortcutKey.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/core/core-frontend/src/utils/DeShortcutKey.ts b/core/core-frontend/src/utils/DeShortcutKey.ts index dc6a7758bb..b15c514134 100644 --- a/core/core-frontend/src/utils/DeShortcutKey.ts +++ b/core/core-frontend/src/utils/DeShortcutKey.ts @@ -6,6 +6,8 @@ import { composeStoreWithOut } from '@/store/modules/data-visualization/compose' import { lockStoreWithOut } from '@/store/modules/data-visualization/lock' import { storeToRefs } from 'pinia' import { getCurInfo } from '@/store/modules/data-visualization/common' +import { isGroupCanvas, isTabCanvas } from '@/utils/canvasUtils' +import { groupStyleRevert } from '@/utils/style' const dvMainStore = dvMainStoreWithOut() const composeStore = composeStoreWithOut() @@ -191,10 +193,14 @@ function move(keyCode) { } function groupAreaAdaptor(leftOffset = 0, topOffset = 0) { - if (curComponent.value.component === 'GroupArea') { - composeStore.areaData.components.forEach(component => { - component.style.top = component.style.top + topOffset - component.style.left = component.style.left + leftOffset + const canvasId = curComponent.value.canvasId + const parentNode = document.querySelector('#editor-' + canvasId) + + //如果当前画布是Group内部画布 则对应组件定位在resize时要还原到groupStyle中 + if (isGroupCanvas(canvasId) || isTabCanvas(canvasId)) { + groupStyleRevert(curComponent.value, { + width: parentNode.offsetWidth, + height: parentNode.offsetHeight }) } }