mirror of
https://github.com/dataease/dataease.git
synced 2025-02-24 11:32:57 +08:00
fix(图表): 修复外部参数跳转,级联条件容易受初始条件影响而不准确问题 #14656 #14352
Some checks are pending
Typos Check / Spell Check with Typos (push) Waiting to run
Some checks are pending
Typos Check / Spell Check with Typos (push) Waiting to run
This commit is contained in:
parent
586b47a731
commit
9f6744ef4b
@ -1202,6 +1202,7 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
preActiveComponentIds.push(element.id)
|
preActiveComponentIds.push(element.id)
|
||||||
}
|
}
|
||||||
if (element.component === 'VQuery') {
|
if (element.component === 'VQuery') {
|
||||||
|
const defaultValueMap = {}
|
||||||
element.propValue.forEach(filterItem => {
|
element.propValue.forEach(filterItem => {
|
||||||
if (filterItem.id === targetViewId) {
|
if (filterItem.id === targetViewId) {
|
||||||
let queryParams = paramValue
|
let queryParams = paramValue
|
||||||
@ -1245,8 +1246,30 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
filterItem['conditionValueF'] = null
|
filterItem['conditionValueF'] = null
|
||||||
filterItem['defaultConditionValueF'] = null
|
filterItem['defaultConditionValueF'] = null
|
||||||
}
|
}
|
||||||
|
if (filterItem['defaultValue']) {
|
||||||
|
defaultValueMap[filterItem.id] = filterItem['defaultValue']
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
// 级联条件处理
|
||||||
|
if (element.cascade?.length && Object.keys(defaultValueMap).length) {
|
||||||
|
element.cascade.forEach(cascadeItem => {
|
||||||
|
Object.keys(defaultValueMap).forEach(key => {
|
||||||
|
const curDefaultValue = defaultValueMap[key]
|
||||||
|
if (cascadeItem.length) {
|
||||||
|
cascadeItem.forEach(itemInner => {
|
||||||
|
if (itemInner.datasetId.includes(key) && curDefaultValue) {
|
||||||
|
itemInner['currentSelectValue'] = Array.isArray(curDefaultValue)
|
||||||
|
? curDefaultValue
|
||||||
|
: [curDefaultValue]
|
||||||
|
} else {
|
||||||
|
itemInner['currentSelectValue'] = []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user