From d3e7780a8f2d219a0f73c21074da8762c62b732a Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 27 Dec 2023 12:05:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=96=87=E6=9C=AC=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=A6=96=E9=A1=B9=E5=9C=A8=E5=85=A8=E5=B1=8F?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E5=8F=AF=E8=83=BD=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/widget/deWidget/DeSelect.vue | 11 ++++++++++- core/frontend/src/utils/conditionUtil.js | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/core/frontend/src/components/widget/deWidget/DeSelect.vue b/core/frontend/src/components/widget/deWidget/DeSelect.vue index 156ac552f4..6a3ea05449 100644 --- a/core/frontend/src/components/widget/deWidget/DeSelect.vue +++ b/core/frontend/src/components/widget/deWidget/DeSelect.vue @@ -501,7 +501,16 @@ export default { if (!this.selectFirst) { return } - const defaultV = this.data[0].id + let defaultV = this.data[0].id + if (this.inDraw) { + let lastFilters = null + if (this.$store.state.lastValidFilters) { + lastFilters = this.$store.state.lastValidFilters[this.element.id] + if (lastFilters) { + defaultV = lastFilters.val === null ? '' : lastFilters.val.toString() + } + } + } if (this.element.options.attrs.multiple) { if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return [] this.value = defaultV.split(this.separator) diff --git a/core/frontend/src/utils/conditionUtil.js b/core/frontend/src/utils/conditionUtil.js index 2e36428102..177d4a7933 100644 --- a/core/frontend/src/utils/conditionUtil.js +++ b/core/frontend/src/utils/conditionUtil.js @@ -121,7 +121,7 @@ export const buildViewKeyFilters = (panelItems, result, isEdit = false) => { // 进行过滤时 如果过滤组件在主画布 则条件适用于所有画布视图 否则需要过滤组件和视图在相同画布 if (element.canvasId === 'canvas-main' || element.canvasId === canvasIdMap[viewId]) { const vidMatch = viewIdMatch(condition.viewIds, viewId) - if (vidMatch && selectFirst && !element.options.loaded) { + if (vidMatch && selectFirst && !element.options.loaded && !lastFilter) { const obj = {} const promise = new Promise(resolve => { cacheCondition(cbParam => {