From 9f6744ef4ba36c9945e3b7ecbefa74ebdb0f5510 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Sun, 19 Jan 2025 16:21:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=A4=96=E9=83=A8=E5=8F=82=E6=95=B0=E8=B7=B3=E8=BD=AC=EF=BC=8C?= =?UTF-8?q?=E7=BA=A7=E8=81=94=E6=9D=A1=E4=BB=B6=E5=AE=B9=E6=98=93=E5=8F=97?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E6=9D=A1=E4=BB=B6=E5=BD=B1=E5=93=8D=E8=80=8C?= =?UTF-8?q?=E4=B8=8D=E5=87=86=E7=A1=AE=E9=97=AE=E9=A2=98=20#14656=20#14352?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/data-visualization/dvMain.ts | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) 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 f6fb2275af..d2a9a29ae1 100644 --- a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts +++ b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts @@ -1202,6 +1202,7 @@ export const dvMainStore = defineStore('dataVisualization', { preActiveComponentIds.push(element.id) } if (element.component === 'VQuery') { + const defaultValueMap = {} element.propValue.forEach(filterItem => { if (filterItem.id === targetViewId) { let queryParams = paramValue @@ -1245,8 +1246,30 @@ export const dvMainStore = defineStore('dataVisualization', { filterItem['conditionValueF'] = null filterItem['defaultConditionValueF'] = null } + if (filterItem['defaultValue']) { + defaultValueMap[filterItem.id] = filterItem['defaultValue'] + } } }) + // 级联条件处理 + if (element.cascade?.length && Object.keys(defaultValueMap).length) { + element.cascade.forEach(cascadeItem => { + Object.keys(defaultValueMap).forEach(key => { + const curDefaultValue = defaultValueMap[key] + if (cascadeItem.length) { + cascadeItem.forEach(itemInner => { + if (itemInner.datasetId.includes(key) && curDefaultValue) { + itemInner['currentSelectValue'] = Array.isArray(curDefaultValue) + ? curDefaultValue + : [curDefaultValue] + } else { + itemInner['currentSelectValue'] = [] + } + }) + } + }) + }) + } } }) })