Merge pull request #7240 from dataease/pr@dev@fix_linkage-search-button

fix(仪表板): 修复画布中存在查询按钮时,设置联动初次查询时没有带过滤条件问题 #7061
This commit is contained in:
王嘉豪 2023-12-20 18:38:07 +08:00 committed by GitHub
commit 2efb8b2ed1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -367,7 +367,9 @@ export default {
show: 0
},
view: {},
cancelTime: null
cancelTime: null,
// true
searchButtonReady: true
}
},
@ -422,7 +424,7 @@ export default {
},
filter() {
const filter = {}
filter.filter = this.initLoad && this.cfilters?.length === 0 ? this.filters : this.cfilters
filter.filter = (this.initLoad && this.cfilters?.length === 0) || !this.searchButtonReady ? this.filters : this.cfilters
filter.linkageFilters = this.element.linkageFilters
filter.outerParamsFilters = this.element.outerParamsFilters
filter.drill = this.drillClickDimensionList
@ -585,7 +587,13 @@ export default {
},
mounted() {
bus.$on('tab-canvas-change', this.tabSwitch)
bus.$on('trigger-search-button', this.triggerSearchButton)
this.bindPluginEvent()
this.$nextTick(() => {
if (this.filters && this.filters.length > 0) {
this.searchButtonReady = false
}
})
},
beforeDestroy() {
@ -624,6 +632,9 @@ export default {
}
},
methods: {
triggerSearchButton() {
this.searchButtonReady = true
},
groupFilter(filters) {
const result = {
ready: [],