From 5eec729cc139469ea014ba537e5d57fd58a7e065 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 25 Jul 2024 10:44:22 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=E7=BB=84=E5=90=88=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=A4=9A=E9=80=89=E5=A4=A7=E5=B1=8F=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E5=90=8E=EF=BC=8C=E6=8B=96=E5=8A=A8=E8=BE=B9=E6=A1=86?= =?UTF-8?q?=E5=90=8E=E7=BB=84=E5=90=88=E5=87=BA=E7=8E=B0=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=AD=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/store/modules/data-visualization/dvMain.ts | 6 +++--- .../src/store/modules/data-visualization/snapshot.ts | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts index 36709fb489..567afe4125 100644 --- a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts +++ b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts @@ -1273,12 +1273,12 @@ export const dvMainStore = defineStore('dataVisualization', { } this.canvasStyleData = { ...deepCopy(DEFAULT_CANVAS_STYLE_DATA_DARK), backgroundColor: null } }, - removeGroupArea() { + removeGroupArea(curComponentData = this.componentData) { // 清理临时组件 - const groupAreaHis = this.componentData.filter(ele => ele.component === 'GroupArea') + const groupAreaHis = curComponentData.filter(ele => ele.component === 'GroupArea') if (groupAreaHis && groupAreaHis.length > 0) { groupAreaHis.forEach(ele => { - this.deleteComponentById(ele.id) + this.deleteComponentById(ele.id, curComponentData) }) } } diff --git a/core/core-frontend/src/store/modules/data-visualization/snapshot.ts b/core/core-frontend/src/store/modules/data-visualization/snapshot.ts index 627ba302d5..085235bc3c 100644 --- a/core/core-frontend/src/store/modules/data-visualization/snapshot.ts +++ b/core/core-frontend/src/store/modules/data-visualization/snapshot.ts @@ -154,10 +154,11 @@ export const snapshotStore = defineStore('snapshot', { recordSnapshot() { this.styleChangeTimes = ++this.styleChangeTimes if (dataPrepareState.value) { - dvMainStore.removeGroupArea() + const snapshotComponentData = deepCopy(componentData.value) + dvMainStore.removeGroupArea(snapshotComponentData) // 添加新的快照 const newSnapshot = { - componentData: deepCopy(componentData.value), + componentData: snapshotComponentData, canvasStyleData: deepCopy(canvasStyleData.value), canvasViewInfo: deepCopy(canvasViewInfo.value), cacheViewIdInfo: deepCopy(this.cacheViewIdInfo), From 508a578f0b46fd083f5bdcb678d505891e949e73 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 25 Jul 2024 11:40:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat(=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):?= =?UTF-8?q?=20=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=A0=B7=E5=BC=8F=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-visualization/canvas/CanvasCore.vue | 13 ++++ .../data-visualization/canvas/Shape.vue | 15 ++-- .../visualization/ComponentEditBar.vue | 6 +- .../editor/editor-style/ChartStyle.vue | 10 ++- .../editor-style/ChartStyleBatchSet.vue | 11 ++- .../src/views/data-visualization/index.vue | 75 +++++++++++-------- 6 files changed, 89 insertions(+), 41 deletions(-) diff --git a/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue b/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue index 1532403877..daffd76982 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue @@ -1371,6 +1371,15 @@ const contextMenuShow = computed(() => { const markLineShow = computed(() => isMainCanvas(canvasId.value)) +// 批量设置 + +const dataVBatchOptAdaptor = () => { + dvMainStore.setBatchOptStatus(true) + areaData.value.components.forEach(component => { + dvMainStore.addCurBatchComponent(component) + }) +} + // 点击事件导致选择区域变更 const groupAreaClickChange = async () => { let groupAreaCom @@ -1378,8 +1387,12 @@ const groupAreaClickChange = async () => { if (groupAreaHis && groupAreaHis.length > 0) { groupAreaCom = groupAreaHis[0] } + if (areaData.value.components.length === 0) { + dvMainStore.setBatchOptStatus(false) + } // 显示Group视括组件 if (areaData.value.components.length > 1) { + dataVBatchOptAdaptor() // 重新计算边界 composeStore.calcComposeArea() if (groupAreaHis.length === 0) { 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 795cdd1e5e..6387da7b24 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/Shape.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/Shape.vue @@ -59,7 +59,7 @@ :style="getPointStyle(item)" @mousedown="handleMouseDownOnPoint(item, $event)" > -
+