forked from github/dataease
Merge pull request #9083 from dataease/pr@dev-v2@feat_outer-params2
refactor(仪表板): 优化外部参数,兼容当前过滤组件
This commit is contained in:
commit
a28aefe164
@ -828,6 +828,7 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
// 获取外部参数的值 sourceInfo 是外部参数名称 支持数组传入
|
// 获取外部参数的值 sourceInfo 是外部参数名称 支持数组传入
|
||||||
let paramValue = params[sourceInfo]
|
let paramValue = params[sourceInfo]
|
||||||
let paramValueStr = params[sourceInfo]
|
let paramValueStr = params[sourceInfo]
|
||||||
|
const parmaValueSource = params[sourceInfo]
|
||||||
let operator = 'in'
|
let operator = 'in'
|
||||||
if (paramValue && !Array.isArray(paramValue)) {
|
if (paramValue && !Array.isArray(paramValue)) {
|
||||||
paramValue = [paramValue]
|
paramValue = [paramValue]
|
||||||
@ -872,8 +873,19 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
if (element.component === 'VQuery') {
|
if (element.component === 'VQuery') {
|
||||||
element.propValue.forEach(filterItem => {
|
element.propValue.forEach(filterItem => {
|
||||||
if (filterItem.id === targetViewId) {
|
if (filterItem.id === targetViewId) {
|
||||||
filterItem.selectValue = paramValueStr
|
filterItem.defaultValueCheck = true
|
||||||
filterItem.defaultValue = paramValueStr
|
if (filterItem.displayType === '0' && filterItem.multiple) {
|
||||||
|
filterItem.selectValue = paramValue
|
||||||
|
filterItem.defaultValue = paramValue
|
||||||
|
} else if (filterItem.displayType === '0' && !filterItem.multiple) {
|
||||||
|
filterItem.selectValue = paramValue[0]
|
||||||
|
filterItem.defaultValue = paramValue[0]
|
||||||
|
} else if (filterItem.displayType === '8') {
|
||||||
|
filterItem.conditionValueF = parmaValueSource
|
||||||
|
} else {
|
||||||
|
filterItem.selectValue = paramValue[0]
|
||||||
|
filterItem.defaultValue = paramValue[0]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user