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/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 => { 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') {