diff --git a/core/core-frontend/src/components/data-visualization/canvas/Shape.vue b/core/core-frontend/src/components/data-visualization/canvas/Shape.vue index cce3dbea96..4165129d83 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/Shape.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/Shape.vue @@ -865,7 +865,13 @@ const componentBackgroundStyle = computed(() => { innerPadding, borderRadius } = element.value.commonBackground - const style = { padding: innerPadding * scale.value + 'px', borderRadius: borderRadius + 'px' } + const innerPaddingTarget = ['Group', 'DeTabs'].includes(element.value.component) + ? 0 + : innerPadding + const style = { + padding: innerPaddingTarget * scale.value + 'px', + borderRadius: borderRadius + 'px' + } let colorRGBA = '' if (backgroundColorSelect && backgroundColor) { colorRGBA = backgroundColor 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 }) } }