From 951fca808fe5552cb6bef422531a5698aa12c13f Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 30 Jul 2024 08:26:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A4=A7=E5=B1=8F=E8=81=94=E5=8A=A8?= =?UTF-8?q?=E6=9C=89=E6=97=B6=E6=97=A0=E6=B3=95=E6=B8=85=E9=99=A4=E3=80=81?= =?UTF-8?q?=E5=8F=8C=E5=90=91=E8=81=94=E5=8A=A8=E7=9B=B8=E4=BA=92=E5=BD=B1?= =?UTF-8?q?=E5=93=8D=E7=AD=89=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/ContextMenuDetails.vue | 2 +- .../components/visualization/CanvasOptBar.vue | 6 +++ .../modules/data-visualization/dvMain.ts | 37 ++++++++++++------- .../views/components/ChartComponentG2Plot.vue | 10 +++-- .../src/views/data-visualization/index.vue | 1 + 5 files changed, 38 insertions(+), 18 deletions(-) diff --git a/core/core-frontend/src/components/data-visualization/canvas/ContextMenuDetails.vue b/core/core-frontend/src/components/data-visualization/canvas/ContextMenuDetails.vue index cecef7b90a..91d0e726c1 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/ContextMenuDetails.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/ContextMenuDetails.vue @@ -253,7 +253,7 @@ const editQueryCriteria = () => { popComponentDataLength === 0 " > - 移动到大屏弹框区 + 移动到大屏弹窗区
  • 隐藏
  • diff --git a/core/core-frontend/src/components/visualization/CanvasOptBar.vue b/core/core-frontend/src/components/visualization/CanvasOptBar.vue index aef5ea60e3..a8c68c2bca 100644 --- a/core/core-frontend/src/components/visualization/CanvasOptBar.vue +++ b/core/core-frontend/src/components/visualization/CanvasOptBar.vue @@ -3,6 +3,7 @@ v-if="existLinkage && !dvMainStore.mobileInPc" class="bar-main-right" :class="{ 'bar-main-edit-right': dvEditMode }" + @mousedown="handOptBarMousedown" > { + e.preventDefault() + e.stopPropagation() +} + const clearAllLinkage = () => { dvMainStore.clearPanelLinkageInfo() useEmitt().emitter.emit('clearPanelLinkage', { viewId: 'all' }) 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 331caadd92..db3439df7b 100644 --- a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts +++ b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts @@ -537,6 +537,7 @@ export const dvMainStore = defineStore('dataVisualization', { if (item.linkageFilters && item.linkageFilters.length > 0) { const historyLinkageFiltersLength = item.linkageFilters.length const newList = item.linkageFilters.filter(linkage => linkage.sourceViewId !== viewId) + console.log('===newList= ' + JSON.stringify(newList)) item.linkageFilters.splice(0, item.linkageFilters.length) // 重新push 可保证数组指针不变 可以watch到 if (newList.length > 0) { @@ -894,27 +895,35 @@ export const dvMainStore = defineStore('dataVisualization', { const checkQDList = [...data.dimensionList, ...data.quotaList] for (let indexOuter = 0; indexOuter < this.componentData.length; indexOuter++) { const element = this.componentData[indexOuter] - if (['UserView', 'VQuery'].includes(element.component)) { - this.trackFilterCursor(element, checkQDList, trackInfo, preActiveComponentIds, viewId) - this.componentData[indexOuter] = element - } else if (element.component === 'Group') { - element.propValue.forEach((groupItem, index) => { - this.trackFilterCursor(groupItem, checkQDList, trackInfo, preActiveComponentIds, viewId) - element.propValue[index] = groupItem - }) - } else if (element.component === 'DeTabs') { - element.propValue.forEach(tabItem => { - tabItem.componentData.forEach((tabComponent, index) => { + if (element.id !== viewId) { + if (['UserView', 'VQuery'].includes(element.component)) { + this.trackFilterCursor(element, checkQDList, trackInfo, preActiveComponentIds, viewId) + this.componentData[indexOuter] = element + } else if (element.component === 'Group') { + element.propValue.forEach((groupItem, index) => { this.trackFilterCursor( - tabComponent, + groupItem, checkQDList, trackInfo, preActiveComponentIds, viewId ) - tabItem.componentData[index] = tabComponent + element.propValue[index] = groupItem }) - }) + } else if (element.component === 'DeTabs') { + element.propValue.forEach(tabItem => { + tabItem.componentData.forEach((tabComponent, index) => { + this.trackFilterCursor( + tabComponent, + checkQDList, + trackInfo, + preActiveComponentIds, + viewId + ) + tabItem.componentData[index] = tabComponent + }) + }) + } } } preActiveComponentIds.forEach(viewId => { diff --git a/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue b/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue index 04185cec96..4c1202469e 100644 --- a/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue +++ b/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue @@ -102,9 +102,13 @@ const viewTrack = ref(null) const clearLinkage = () => { linkageActiveHistory.value = false - myChart?.setState('active', () => true, false) - myChart?.setState('inactive', () => true, false) - myChart?.setState('selected', () => true, false) + try { + myChart?.setState('active', () => true, false) + myChart?.setState('inactive', () => true, false) + myChart?.setState('selected', () => true, false) + } catch (e) { + console.warn('clearLinkage error') + } } const reDrawView = () => { linkageActiveHistory.value = false diff --git a/core/core-frontend/src/views/data-visualization/index.vue b/core/core-frontend/src/views/data-visualization/index.vue index 5f102a55b1..a4cd931d35 100644 --- a/core/core-frontend/src/views/data-visualization/index.vue +++ b/core/core-frontend/src/views/data-visualization/index.vue @@ -169,6 +169,7 @@ const handleDragOver = e => { } const handleMouseDown = e => { + console.log('====handleMouseDown===' + e) // e.stopPropagation() dvMainStore.setClickComponentStatus(false) // 点击画布的空区域 提前清空curComponent 防止右击菜单内容抖动