Merge pull request #8651 from dataease/pr@dev@fix_panel

fix(仪表板): 修复当仪表板存在查询按钮时,变动窗口大小会导致视图重新加载且未加过滤条件问题
This commit is contained in:
王嘉豪 2024-03-22 15:58:38 +08:00 committed by GitHub
commit 1fe7ea63f4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 1 deletions

View File

@ -313,7 +313,7 @@ export default {
scaleWidth: '100',
scaleHeight: '100',
timer: null,
componentDataShow: null,
componentDataShow: [],
mainWidth: '100%',
mainHeight: '100%',
searchCount: 0,

View File

@ -946,6 +946,7 @@ export default {
}
if (this.isFirstLoad) {
this.element.filters = this.filter.filter?.length ? JSON.parse(JSON.stringify(this.filter.filter)) : []
this.$store.commit('setViewInitFilter', this.element)
}
method(id, this.panelInfo.id, requestInfo).then(response => {
try {

View File

@ -938,6 +938,15 @@ const data = {
if (state.lastValidFilters[id]) {
delete state.lastValidFilters[id]
}
},
setViewInitFilter(state, viewInfo) {
if (viewInfo) {
state.componentData.forEach(component => {
if (viewInfo.id === component.id) {
component.filters = viewInfo.filters
}
})
}
}
},
modules: {