From ce797b26218d6a2a1c70a8144df88a9b97ae2d31 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 5 Nov 2024 09:54:22 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E9=94=81=E5=AE=9A=E5=A4=B1=E6=95=88=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20#12783?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/ContextMenuDetails.vue | 8 +++++++- .../src/store/modules/data-visualization/lock.ts | 16 ++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/core/core-frontend/src/components/data-visualization/canvas/ContextMenuDetails.vue b/core/core-frontend/src/components/data-visualization/canvas/ContextMenuDetails.vue index 88c567a8ef..4057a38ad8 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/ContextMenuDetails.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/ContextMenuDetails.vue @@ -37,8 +37,14 @@ const popComponentDataLength = computed( ) const lock = () => { + if (curComponent.value && !isGroupArea.value) { + lockStore.lock() + } else if (areaData.value.components.length) { + areaData.value.components.forEach(component => { + lockStore.lock(component) + }) + } snapshotStore.recordSnapshotCache() - lockStore.lock() menuOpt('lock') } diff --git a/core/core-frontend/src/store/modules/data-visualization/lock.ts b/core/core-frontend/src/store/modules/data-visualization/lock.ts index 4ab0b44014..2cc5c2e9f2 100644 --- a/core/core-frontend/src/store/modules/data-visualization/lock.ts +++ b/core/core-frontend/src/store/modules/data-visualization/lock.ts @@ -7,19 +7,19 @@ const { curComponent } = storeToRefs(dvMainStore) export const lockStore = defineStore('lock', { actions: { - lock() { - curComponent.value.isLock = true - if (curComponent.value.component === 'Group') { - curComponent.value.propValue.forEach(component => { + lock(optComponent = curComponent.value) { + optComponent.isLock = true + if (optComponent.component === 'Group') { + optComponent.propValue.forEach(component => { component.isLock = true }) } }, - unlock() { - curComponent.value.isLock = false - if (curComponent.value.component === 'Group') { - curComponent.value.propValue.forEach(component => { + unlock(optComponent = curComponent.value) { + optComponent.isLock = false + if (optComponent.component === 'Group') { + optComponent.propValue.forEach(component => { component.isLock = false }) }