Merge pull request #13163 from dataease/pr@dev-v2@refactor_inject-params
refactor(仪表板、数据大屏): 嵌入式参数传参优化
This commit is contained in:
commit
e6ee3664b8
@ -1108,30 +1108,29 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
const targetInfoArray = targetInfo.split('#')
|
const targetInfoArray = targetInfo.split('#')
|
||||||
const targetViewId = targetInfoArray[0] // 目标图表
|
const targetViewId = targetInfoArray[0] // 目标图表
|
||||||
// DE_EMPTY 为清空条件标志
|
// DE_EMPTY 为清空条件标志
|
||||||
if (
|
if (element.component === 'UserView' && element.id === targetViewId) {
|
||||||
element.component === 'UserView' &&
|
if ('DE_EMPTY' !== paramValueStr) {
|
||||||
element.id === targetViewId &&
|
// 如果目标图表 和 当前循环组件id相等 则进行条件增减
|
||||||
'DE_EMPTY' !== paramValueStr
|
const targetFieldId = targetInfoArray[1] // 目标图表列ID
|
||||||
) {
|
const condition = {
|
||||||
// 如果目标图表 和 当前循环组件id相等 则进行条件增减
|
fieldId: targetFieldId,
|
||||||
const targetFieldId = targetInfoArray[1] // 目标图表列ID
|
operator: operator,
|
||||||
const condition = {
|
value: paramValue,
|
||||||
fieldId: targetFieldId,
|
viewIds: [targetViewId]
|
||||||
operator: operator,
|
|
||||||
value: paramValue,
|
|
||||||
viewIds: [targetViewId]
|
|
||||||
}
|
|
||||||
let j = currentFilters.length
|
|
||||||
while (j--) {
|
|
||||||
const filter = currentFilters[j]
|
|
||||||
// 兼容性准备 viewIds 只会存放一个值
|
|
||||||
if (targetFieldId === filter.fieldId && filter.viewIds.includes(targetViewId)) {
|
|
||||||
currentFilters.splice(j, 1)
|
|
||||||
}
|
}
|
||||||
|
let j = currentFilters.length
|
||||||
|
while (j--) {
|
||||||
|
const filter = currentFilters[j]
|
||||||
|
// 兼容性准备 viewIds 只会存放一个值
|
||||||
|
if (targetFieldId === filter.fieldId && filter.viewIds.includes(targetViewId)) {
|
||||||
|
currentFilters.splice(j, 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 不存在该条件 且 条件有效 直接保存该条件
|
||||||
|
// !filterExist && vValid && currentFilters.push(condition)
|
||||||
|
|
||||||
|
currentFilters.push(condition)
|
||||||
}
|
}
|
||||||
// 不存在该条件 且 条件有效 直接保存该条件
|
|
||||||
// !filterExist && vValid && currentFilters.push(condition)
|
|
||||||
currentFilters.push(condition)
|
|
||||||
preActiveComponentIds.push(element.id)
|
preActiveComponentIds.push(element.id)
|
||||||
}
|
}
|
||||||
if (element.component === 'VQuery') {
|
if (element.component === 'VQuery') {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user