From 80f1c8dbe0fa97f60709345033ab3ab7d6dae6a9 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 24 Jul 2024 17:38:14 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=B0=E5=BB=BA=E4=BB=AA=E8=A1=A8=E6=9D=BF?= =?UTF-8?q?=E5=B9=B6=E5=B0=86=E5=9B=BE=E8=A1=A8=E6=B7=BB=E5=8A=A0=E8=87=B3?= =?UTF-8?q?tab=E7=BB=84=E4=BB=B6=E4=B8=AD=E6=8F=90=E7=A4=BA=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/custom-component/de-tabs/Component.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/core-frontend/src/custom-component/de-tabs/Component.vue b/core/core-frontend/src/custom-component/de-tabs/Component.vue index 42fe90be30..98b2ae0e0d 100644 --- a/core/core-frontend/src/custom-component/de-tabs/Component.vue +++ b/core/core-frontend/src/custom-component/de-tabs/Component.vue @@ -260,9 +260,11 @@ function handleCommand(command) { const reloadLinkage = () => { // 刷新联动信息 - getPanelAllLinkageInfo(dvInfo.value.id).then(rsp => { - dvMainStore.setNowPanelTrackInfo(rsp.data) - }) + if (dvInfo.value.id) { + getPanelAllLinkageInfo(dvInfo.value.id).then(rsp => { + dvMainStore.setNowPanelTrackInfo(rsp.data) + }) + } } const componentMoveIn = component => { From f5508ebbde6b23e58d9dc4eb405574198c065d9d Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 24 Jul 2024 20:53:09 +0800 Subject: [PATCH 2/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 --- .../data-visualization/RealTimeListTree.vue | 14 ++++++++++++-- .../data-visualization/canvas/CanvasCore.vue | 1 - .../store/modules/data-visualization/compose.ts | 2 +- .../src/store/modules/data-visualization/dvMain.ts | 9 +++++++++ .../store/modules/data-visualization/snapshot.ts | 1 + core/core-frontend/src/utils/canvasUtils.ts | 1 + 6 files changed, 24 insertions(+), 4 deletions(-) diff --git a/core/core-frontend/src/components/data-visualization/RealTimeListTree.vue b/core/core-frontend/src/components/data-visualization/RealTimeListTree.vue index 99c1caa6b0..9d8ade415b 100644 --- a/core/core-frontend/src/components/data-visualization/RealTimeListTree.vue +++ b/core/core-frontend/src/components/data-visualization/RealTimeListTree.vue @@ -33,7 +33,13 @@ const transformIndex = index => { return componentData.value.length - 1 - index } const areaDataPush = component => { - if (component && !component.isLock && component.isShow && component.canvasId === 'canvas-main') { + if ( + component && + !component.isLock && + component.isShow && + component.canvasId === 'canvas-main' && + component.category !== 'hidden' + ) { areaData.value.components.push(component) } } @@ -63,7 +69,11 @@ const shiftDataPush = curClickIndex => { const shiftAreaComponents = componentData.value .slice(indexBegin, indexEnd + 1) .filter( - component => !areaDataIdArray.includes(component.id) && !component.isLock && component.isShow + component => + !areaDataIdArray.includes(component.id) && + !component.isLock && + component.isShow && + component.category !== 'hidden' ) areaData.value.components.push(...shiftAreaComponents) dvMainStore.setCurComponent({ component: null, index: null }) 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 581aea4bb0..1532403877 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue @@ -1382,7 +1382,6 @@ const groupAreaClickChange = async () => { if (areaData.value.components.length > 1) { // 重新计算边界 composeStore.calcComposeArea() - const hist2 = dvMainStore.componentData.filter(ele => ele.component === 'GroupArea') if (groupAreaHis.length === 0) { // 如果不存在 新建视括组件 groupAreaCom = findNewComponent('GroupArea', 'GroupArea') 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 5514ee0c8f..e631efcc30 100644 --- a/core/core-frontend/src/store/modules/data-visualization/compose.ts +++ b/core/core-frontend/src/store/modules/data-visualization/compose.ts @@ -142,7 +142,7 @@ export const composeStore = defineStore('compose', { const components = [] areaData.components.forEach(component => { - if (component.component != 'Group') { + if (!['Group', 'GroupArea'].includes(component.component)) { components.push(component) } else { // 如果要组合的组件中,已经存在组合数据,则需要提前拆分 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 dc1e81eac2..36709fb489 100644 --- a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts +++ b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts @@ -1272,6 +1272,15 @@ export const dvMainStore = defineStore('dataVisualization', { mobileLayout: false } this.canvasStyleData = { ...deepCopy(DEFAULT_CANVAS_STYLE_DATA_DARK), backgroundColor: null } + }, + removeGroupArea() { + // 清理临时组件 + const groupAreaHis = this.componentData.filter(ele => ele.component === 'GroupArea') + if (groupAreaHis && groupAreaHis.length > 0) { + groupAreaHis.forEach(ele => { + this.deleteComponentById(ele.id) + }) + } } } }) 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 ea9e798e46..627ba302d5 100644 --- a/core/core-frontend/src/store/modules/data-visualization/snapshot.ts +++ b/core/core-frontend/src/store/modules/data-visualization/snapshot.ts @@ -154,6 +154,7 @@ export const snapshotStore = defineStore('snapshot', { recordSnapshot() { this.styleChangeTimes = ++this.styleChangeTimes if (dataPrepareState.value) { + dvMainStore.removeGroupArea() // 添加新的快照 const newSnapshot = { componentData: deepCopy(componentData.value), diff --git a/core/core-frontend/src/utils/canvasUtils.ts b/core/core-frontend/src/utils/canvasUtils.ts index 35e312764a..99795ad1ee 100644 --- a/core/core-frontend/src/utils/canvasUtils.ts +++ b/core/core-frontend/src/utils/canvasUtils.ts @@ -329,6 +329,7 @@ export function checkIsBatchOptView(viewId) { } export async function canvasSave(callBack) { + dvMainStore.removeGroupArea() const componentDataToSave = cloneDeep(componentData.value) componentDataToSave.forEach(item => { if (item.component === 'UserView') {