forked from github/dataease
fix(仪表板): tab组件中过滤组件数值规则可以过滤tab组件外的图表
This commit is contained in:
parent
058f630956
commit
ad79d63dc5
@ -69,32 +69,22 @@ const datasetMap = {}
|
||||
const snapshotStore = snapshotStoreWithOut()
|
||||
|
||||
const dfsComponentData = () => {
|
||||
const isMain = componentData.value.some(ele => ele.id === queryElement.value.id)
|
||||
let isGroup = false
|
||||
let arr = componentData.value.filter(
|
||||
com => !['VQuery', 'DeTabs'].includes(com.innerType) && com.component !== 'Group'
|
||||
)
|
||||
let tabArr = []
|
||||
let groupArr = []
|
||||
componentData.value.forEach(ele => {
|
||||
if (ele.innerType === 'DeTabs') {
|
||||
ele.propValue.forEach(itx => {
|
||||
if (itx.componentData.some(item => item.id === queryElement.value.id) && !isMain) {
|
||||
tabArr = itx.componentData.filter(
|
||||
arr = [
|
||||
...arr,
|
||||
...itx.componentData.filter(
|
||||
com => !['VQuery', 'DeTabs'].includes(com.innerType) && com.component !== 'Group'
|
||||
)
|
||||
} else {
|
||||
arr = [
|
||||
...arr,
|
||||
...itx.componentData.filter(
|
||||
com => !['VQuery', 'DeTabs'].includes(com.innerType) && com.component !== 'Group'
|
||||
)
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
} else if (ele.component === 'Group') {
|
||||
isGroup = ele.propValue.some(item => item.id === queryElement.value.id)
|
||||
groupArr = [
|
||||
arr = [
|
||||
...arr,
|
||||
ele.propValue.filter(
|
||||
com => !['VQuery', 'DeTabs'].includes(com.innerType) && com.component !== 'Group'
|
||||
)
|
||||
@ -102,25 +92,19 @@ const dfsComponentData = () => {
|
||||
ele.propValue.forEach(element => {
|
||||
if (element.innerType === 'DeTabs') {
|
||||
element.propValue.forEach(itx => {
|
||||
if (itx.componentData.some(item => item.id === queryElement.value.id) && !isMain) {
|
||||
tabArr = itx.componentData.filter(
|
||||
arr = [
|
||||
...arr,
|
||||
...itx.componentData.filter(
|
||||
com => !['VQuery', 'DeTabs'].includes(com.innerType) && com.component !== 'Group'
|
||||
)
|
||||
} else {
|
||||
groupArr = [
|
||||
...groupArr,
|
||||
...itx.componentData.filter(
|
||||
com => !['VQuery', 'DeTabs'].includes(com.innerType) && com.component !== 'Group'
|
||||
)
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
return isMain || isGroup ? [...arr, ...groupArr].flat() : tabArr
|
||||
return arr.flat()
|
||||
}
|
||||
|
||||
const datasetFieldList = computed(() => {
|
||||
|
@ -473,6 +473,7 @@ const queryAnswer = () => {
|
||||
.label-tooltip {
|
||||
margin-left: 5.33px;
|
||||
width: 70%;
|
||||
font-size: 14px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
|
Loading…
Reference in New Issue
Block a user