From 43f19979cff25c97ae9e2e2c0a971483da115c53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=98=89=E8=B1=AA?= <42510293+ziyujiahao@users.noreply.github.com> Date: Wed, 15 Oct 2025 14:08:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E5=85=B3=E8=81=94=E5=A4=9A=E4=B8=AA=E5=AD=97=E6=AE=B5=EF=BC=8C?= =?UTF-8?q?=E9=83=A8=E5=88=86=E5=AD=97=E6=AE=B5=E5=AD=98=E5=9C=A8=E7=A9=BA?= =?UTF-8?q?=E5=80=BC=E6=97=B6=E8=B7=B3=E8=BD=AC=E5=A4=B1=E8=B4=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20(#17192)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/data-visualization/dvMain.ts | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 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 1e569d7561..4c5805fe70 100644 --- a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts +++ b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts @@ -1431,17 +1431,19 @@ export const dvMainStore = defineStore('dataVisualization', { sourceViewId: viewId } } - let j = currentFilters.length - while (j--) { - const filter = currentFilters[j] - // 兼容性准备 viewIds 只会存放一个值 - if (targetFieldId === filter.fieldId && filter.viewIds.includes(targetViewId)) { - currentFilters.splice(j, 1) + if (condition) { + let j = currentFilters.length + while (j--) { + const filter = currentFilters[j] + // 兼容性准备 viewIds 只会存放一个值 + if (targetFieldId === filter.fieldId && filter.viewIds.includes(targetViewId)) { + currentFilters.splice(j, 1) + } } + // 不存在该条件 且 条件有效 直接保存该条件 + // !filterExist && vValid && currentFilters.push(condition) + currentFilters.push(condition) } - // 不存在该条件 且 条件有效 直接保存该条件 - // !filterExist && vValid && currentFilters.push(condition) - currentFilters.push(condition) } preActiveComponentIds.includes(element.id) || preActiveComponentIds.push(element.id) } @@ -1501,6 +1503,7 @@ export const dvMainStore = defineStore('dataVisualization', { }) }) element.linkageFilters = currentFilters + console.log('===test===' + JSON.stringify(element.linkageFilters)) }, clearPanelLinkageInfo() {