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 1/2] =?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) From d704bc618fa9ecb5a9f8c077eaa0b49031db384c Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 27 Aug 2024 18:06:25 +0800 Subject: [PATCH 2/2] =?UTF-8?q?refactor(=E6=95=B0=E6=8D=AE=E5=A4=A7?= =?UTF-8?q?=E5=B1=8F):=20=E5=88=86=E7=BB=84=E5=92=8CTab=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E7=A6=81=E7=94=A8=E7=9B=B8=E4=BA=92=E7=BB=84=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-visualization/RealTimeListTree.vue | 4 ++-- .../data-visualization/canvas/Shape.vue | 4 ++-- .../modules/data-visualization/compose.ts | 18 +++++++++++------- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/core/core-frontend/src/components/data-visualization/RealTimeListTree.vue b/core/core-frontend/src/components/data-visualization/RealTimeListTree.vue index 76dd03d7c1..652cd0acb4 100644 --- a/core/core-frontend/src/components/data-visualization/RealTimeListTree.vue +++ b/core/core-frontend/src/components/data-visualization/RealTimeListTree.vue @@ -39,7 +39,7 @@ const areaDataPush = component => { component.isShow && component.canvasId === 'canvas-main' && component.category !== 'hidden' && - !['Group', 'GroupArea'].includes(component.component) + !['Group', 'GroupArea', 'DeTabs'].includes(component.component) ) { areaData.value.components.push(component) } @@ -75,7 +75,7 @@ const shiftDataPush = curClickIndex => { !component.isLock && component.isShow && component.category !== 'hidden' && - !['Group', 'GroupArea'].includes(component.component) + !['Group', 'GroupArea', 'DeTabs'].includes(component.component) ) areaData.value.components.push(...shiftAreaComponents) dvMainStore.setCurComponent({ component: null, index: null }) 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 436510023e..1c506234a6 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/Shape.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/Shape.vue @@ -160,7 +160,7 @@ const state = reactive({ id: '' }, // 禁止移入Tab中的组件 - ignoreTabMoveComponent: ['de-button', 'de-reset-button', 'DeTabs'], + ignoreTabMoveComponent: ['de-button', 'de-reset-button', 'DeTabs', 'Group'], // 当画布在tab中是 宽度左右拓展的余量 parentWidthTabOffset: 40, canvasChangeTips: 'none', @@ -431,7 +431,7 @@ const areaDataPush = component => { !component.isLock && component.isShow && component.canvasId === 'canvas-main' && - !['Group', 'GroupArea'].includes(component.component) + !['Group', 'GroupArea', 'DeTabs'].includes(component.component) ) { areaData.value.components.push(component) } diff --git a/core/core-frontend/src/store/modules/data-visualization/compose.ts b/core/core-frontend/src/store/modules/data-visualization/compose.ts index e631efcc30..9aa7a298ad 100644 --- a/core/core-frontend/src/store/modules/data-visualization/compose.ts +++ b/core/core-frontend/src/store/modules/data-visualization/compose.ts @@ -142,9 +142,7 @@ export const composeStore = defineStore('compose', { const components = [] areaData.components.forEach(component => { - if (!['Group', 'GroupArea'].includes(component.component)) { - components.push(component) - } else { + if (['Group'].includes(component.component)) { // 如果要组合的组件中,已经存在组合数据,则需要提前拆分 const parentStyle = { ...component.style } const subComponents = component.propValue @@ -155,6 +153,10 @@ export const composeStore = defineStore('compose', { }) components.push(...component.propValue) + } else if (['DeTabs', 'GroupArea'].includes(component.component)) { + // do nothing GroupAreas组合视阔区 DeTabs 均不加入分组中 + } else { + components.push(component) } }) @@ -202,10 +204,12 @@ export const composeStore = defineStore('compose', { // 将已经放到 Group 组件数据删除,也就是在 componentData 中删除,因为它们已经从 componentData 挪到 Group 组件中了 batchDeleteComponent(deleteData) { deleteData.forEach(component => { - for (let i = 0, len = componentData.value.length; i < len; i++) { - if (component.id == componentData.value[i].id) { - componentData.value.splice(i, 1) - break + if (!['DeTabs', 'GroupArea'].includes(component.component)) { + for (let i = 0, len = componentData.value.length; i < len; i++) { + if (component.id == componentData.value[i].id) { + componentData.value.splice(i, 1) + break + } } } })