Merge pull request #7090 from dataease/pr@dev@perf_filter_first_selector

fix: 查询按钮设置关联范围失效
This commit is contained in:
fit2cloud-chenyw 2023-12-08 17:29:29 +08:00 committed by GitHub
commit 57646cb6a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -569,7 +569,23 @@ export default {
result.relationFilterIds = matchFilters.map(item => item.id)
let matchViewIds = []
matchFilters.forEach(item => {
if (!item.options.attrs.viewIds?.length) {
matchViewIds = null
return false
}
matchViewIds = matchViewIds.concat(item.options.attrs.viewIds)
})
let viewKeyMap = buildViewKeyMap(panelItems)
if (matchViewIds) {
matchViewIds = [...new Set(matchViewIds)]
const keys = Object.keys(viewKeyMap).filter(key => !matchViewIds.includes(key))
keys.forEach(key => {
delete viewKeyMap[key]
})
}
viewKeyMap = this.buildViewKeyFilters(matchFilters, viewKeyMap, isClear)
result.filterMap = viewKeyMap
return result