diff --git a/core/frontend/src/components/widget/deWidget/DeDate.vue b/core/frontend/src/components/widget/deWidget/DeDate.vue index ecac34c02d..13f675a979 100644 --- a/core/frontend/src/components/widget/deWidget/DeDate.vue +++ b/core/frontend/src/components/widget/deWidget/DeDate.vue @@ -371,7 +371,8 @@ export default { if (this.refreshHandler()) { return } - if (this.element.options.value) { + const existLastValidFilters = this.$store.state.lastValidFilters && this.$store.state.lastValidFilters[this.element.id]?.length + if (this.element.options.value || existLastValidFilters) { this.values = this.fillValueDerfault() this.dateChange(this.values) } diff --git a/core/frontend/src/components/widget/deWidget/DeInputSearch.vue b/core/frontend/src/components/widget/deWidget/DeInputSearch.vue index 5447cc3212..238627c2a6 100644 --- a/core/frontend/src/components/widget/deWidget/DeInputSearch.vue +++ b/core/frontend/src/components/widget/deWidget/DeInputSearch.vue @@ -86,7 +86,8 @@ export default { } }, created() { - if (this.element.options.value) { + const existLastValidFilters = this.$store.state.lastValidFilters && this.$store.state.lastValidFilters[this.element.id]?.length + if (this.element.options.value || existLastValidFilters) { this.value = this.fillValueDerfault() this.search() } diff --git a/core/frontend/src/components/widget/deWidget/DeNumberRange.vue b/core/frontend/src/components/widget/deWidget/DeNumberRange.vue index c66186c86e..cbf698da51 100644 --- a/core/frontend/src/components/widget/deWidget/DeNumberRange.vue +++ b/core/frontend/src/components/widget/deWidget/DeNumberRange.vue @@ -144,7 +144,8 @@ export default { } }, created() { - if (this.element.options.value && this.element.options.value.length > 0) { + const existLastValidFilters = this.$store.state.lastValidFilters && this.$store.state.lastValidFilters[this.element.id]?.length + if ((this.element.options.value && this.element.options.value.length > 0) || existLastValidFilters) { const values = this.fillValueDerfault() this.form.min = values[0] if (values.length > 1) { diff --git a/core/frontend/src/components/widget/deWidget/DeSelect.vue b/core/frontend/src/components/widget/deWidget/DeSelect.vue index 3baf0596a6..21cce4bbbb 100644 --- a/core/frontend/src/components/widget/deWidget/DeSelect.vue +++ b/core/frontend/src/components/widget/deWidget/DeSelect.vue @@ -370,7 +370,7 @@ export default { this.firstChange(this.value) return } - if (this.value.toString() !== eleVal && this.defaultValueStr === eleVal) { + if (this.value?.toString() !== eleVal && this.defaultValueStr === eleVal) { this.value = this.fillValueDerfault() this.changeValue(this.value) } @@ -387,7 +387,8 @@ export default { }, initLoad() { this.initOptions(this.fillFirstSelected) - if (this.element.options.value && !this.selectFirst) { + const existLastValidFilters = this.$store.state.lastValidFilters && this.$store.state.lastValidFilters[this.element.id]?.length + if ((this.element.options.value || existLastValidFilters) && !this.selectFirst) { this.value = this.fillValueDerfault() this.changeValue(this.value) } diff --git a/core/frontend/src/components/widget/deWidget/DeSelectGrid.vue b/core/frontend/src/components/widget/deWidget/DeSelectGrid.vue index df937aa02b..b9569d2dc1 100644 --- a/core/frontend/src/components/widget/deWidget/DeSelectGrid.vue +++ b/core/frontend/src/components/widget/deWidget/DeSelectGrid.vue @@ -342,7 +342,8 @@ export default { initLoad() { this.value = this.element.options.attrs.multiple ? [] : null this.initOptions() - if (this.element.options.value) { + const existLastValidFilters = this.$store.state.lastValidFilters && this.$store.state.lastValidFilters[this.element.id]?.length + if (this.element.options.value || existLastValidFilters) { this.value = this.fillValueDerfault() this.changeValue(this.value) } diff --git a/core/frontend/src/components/widget/deWidget/DeSelectTree.vue b/core/frontend/src/components/widget/deWidget/DeSelectTree.vue index 7bc39163b7..de37cb107d 100644 --- a/core/frontend/src/components/widget/deWidget/DeSelectTree.vue +++ b/core/frontend/src/components/widget/deWidget/DeSelectTree.vue @@ -275,7 +275,8 @@ export default { this.value = this.fillValueDerfault() this.data = [] this.initOptions() - if (this.element.options.value) { + const existLastValidFilters = this.$store.state.lastValidFilters && this.$store.state.lastValidFilters[this.element.id]?.length + if (this.element.options.value || existLastValidFilters) { this.value = this.fillValueDerfault() this.changeValue(this.value) }