From e11dbf0f8c659685dbc41b5bb40a59404babc6ee Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 27 Aug 2024 17:53:05 +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=E5=AD=90=E7=94=BB?= =?UTF-8?q?=E5=B8=83=E4=B8=AD=E7=BB=84=E4=BB=B6=E5=88=A0=E9=99=A4=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BC=98=E5=8C=96=EF=BC=8C=E9=98=B2=E6=AD=A2=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=AD=90=E7=94=BB=E5=B8=83=E6=9C=AC=E8=BA=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/utils/DeShortcutKey.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/core-frontend/src/utils/DeShortcutKey.ts b/core/core-frontend/src/utils/DeShortcutKey.ts index f48c7c2746..13fcc990e7 100644 --- a/core/core-frontend/src/utils/DeShortcutKey.ts +++ b/core/core-frontend/src/utils/DeShortcutKey.ts @@ -5,6 +5,7 @@ import { copyStoreWithOut } from '@/store/modules/data-visualization/copy' 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' const dvMainStore = dvMainStoreWithOut() const composeStore = composeStoreWithOut() @@ -235,7 +236,10 @@ function preview() { function deleteComponent() { if (curComponent.value) { - dvMainStore.deleteComponentById(curComponent.value.id) + const curInfo = getCurInfo() + if (curInfo) { + dvMainStore.deleteComponent(curInfo.index, curInfo.componentData) + } } else if (areaData.value.components.length) { areaData.value.components.forEach(component => { dvMainStore.deleteComponentById(component.id)