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 => {