From 20a076c03549c5ba52af78dcffd38b40b86cbdd7 Mon Sep 17 00:00:00 2001
From: wangjiahao <1522128093@qq.com>
Date: Thu, 14 Nov 2024 16:28:16 +0800
Subject: [PATCH] =?UTF-8?q?feat(=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):=20t?=
=?UTF-8?q?ab=E7=BB=84=E4=BB=B6=E5=9C=A8=E8=B0=83=E6=95=B4=E5=A4=A7?=
=?UTF-8?q?=E5=B0=8F=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E5=8F=AF=E4=BB=A5?=
=?UTF-8?q?=E9=80=89=E6=8B=A9tab=E7=BB=84=E4=BB=B6=E5=86=85=E7=9A=84?=
=?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=98=AF=E5=90=A6=E8=87=AA=E9=80=82=E5=BA=94?=
=?UTF-8?q?=E8=B0=83=E6=95=B4=E5=A4=A7=E5=B0=8F=20#12888?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../data-visualization/canvas/Shape.vue | 6 +++++-
.../visualization/common/ComponentPosition.vue | 18 ++++++++++++++++++
core/core-frontend/src/utils/canvasUtils.ts | 5 ++---
3 files changed, 25 insertions(+), 4 deletions(-)
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 f55b9e2de0..e2353ecfbb 100644
--- a/core/core-frontend/src/components/data-visualization/canvas/Shape.vue
+++ b/core/core-frontend/src/components/data-visualization/canvas/Shape.vue
@@ -772,9 +772,13 @@ const handleMouseDownOnPoint = (point, e) => {
dashboardActive.value && emit('onResizing', moveEvent)
element.value['resizing'] = true
//如果当前组件是Group分组或者Tab 则要进行内部组件深度计算
- if (['DeTabs', 'Group'].includes(element.value.component)) {
+ if (
+ ['Group'].includes(element.value.component) ||
+ (['DeTabs'].includes(element.value.component) && !element.value.resizeInnerKeep)
+ ) {
groupSizeStyleAdaptor(element.value)
}
+
//如果当前画布是Group内部画布 则对应组件定位在resize时要还原到groupStyle中
if (isGroupCanvas(canvasId.value) || isTabCanvas(canvasId.value)) {
groupStyleRevert(element.value, {
diff --git a/core/core-frontend/src/components/visualization/common/ComponentPosition.vue b/core/core-frontend/src/components/visualization/common/ComponentPosition.vue
index bea33fd1bb..45cf6ac003 100644
--- a/core/core-frontend/src/components/visualization/common/ComponentPosition.vue
+++ b/core/core-frontend/src/components/visualization/common/ComponentPosition.vue
@@ -17,6 +17,20 @@
+
+
+ 调整大小保持内部组件尺寸
+
+
{
snapshotStore.recordSnapshotCache()
}
+const snapshotChange = () => {
+ snapshotStore.recordSnapshotCache()
+}
+
const positionInit = () => {
if (curComponent.value) {
canvasId.value = curComponent.value.canvasId
diff --git a/core/core-frontend/src/utils/canvasUtils.ts b/core/core-frontend/src/utils/canvasUtils.ts
index e01fff11d9..3ab5adccfe 100644
--- a/core/core-frontend/src/utils/canvasUtils.ts
+++ b/core/core-frontend/src/utils/canvasUtils.ts
@@ -152,9 +152,8 @@ export function historyItemAdaptor(
componentItem.style['titleHide'] = componentItem.style['titleHide'] || false
}
- if (componentItem.component === 'Group') {
- componentItem.expand = componentItem.expand || false
- }
+ componentItem['expand'] = componentItem['expand'] || false
+ componentItem['resizeInnerKeep'] = componentItem['resizeInnerKeep'] || false
if (componentItem.component === 'Picture') {
componentItem.style['adaptation'] = componentItem.style['adaptation'] || 'adaptation'