Merge pull request #7470 from dataease/pr@dev@refactor_public-filter
refactor: 优化公共链接过滤器参数匹配方式
This commit is contained in:
commit
1f41d5108f
@ -452,7 +452,11 @@ const data = {
|
|||||||
currentFilters.push(condition)
|
currentFilters.push(condition)
|
||||||
}
|
}
|
||||||
if (element.type === 'custom' && element.id === targetViewId) { // 过滤组件处理
|
if (element.type === 'custom' && element.id === targetViewId) { // 过滤组件处理
|
||||||
element.options.value = [dimension.value]
|
if (['de-select-tree'].includes(element.component)) {
|
||||||
|
element.options.value = dimension.value
|
||||||
|
} else {
|
||||||
|
element.options.value = [dimension.value]
|
||||||
|
}
|
||||||
// 去掉动态时间
|
// 去掉动态时间
|
||||||
if (element.options.manualModify) {
|
if (element.options.manualModify) {
|
||||||
element.options.manualModify = false
|
element.options.manualModify = false
|
||||||
@ -486,10 +490,20 @@ const data = {
|
|||||||
Object.keys(params).forEach(function(sourceInfo) {
|
Object.keys(params).forEach(function(sourceInfo) {
|
||||||
// 获取外部参数的值 sourceInfo 是外部参数名称 支持数组传入
|
// 获取外部参数的值 sourceInfo 是外部参数名称 支持数组传入
|
||||||
let paramValue = params[sourceInfo]
|
let paramValue = params[sourceInfo]
|
||||||
|
let paramValueStr = params[sourceInfo]
|
||||||
let operator = 'in'
|
let operator = 'in'
|
||||||
if (paramValue && !Array.isArray(paramValue)) {
|
if (paramValue && !Array.isArray(paramValue)) {
|
||||||
paramValue = [paramValue]
|
paramValue = [paramValue]
|
||||||
operator = 'eq'
|
operator = 'eq'
|
||||||
|
} else if (paramValue && Array.isArray(paramValue)) {
|
||||||
|
paramValueStr = ''
|
||||||
|
paramValue.forEach((innerValue, index) => {
|
||||||
|
if (index === 0) {
|
||||||
|
paramValueStr = innerValue
|
||||||
|
} else {
|
||||||
|
paramValueStr = paramValueStr + ',' + innerValue
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
// 获取所有目标联动信息
|
// 获取所有目标联动信息
|
||||||
const targetInfoList = trackInfo[sourceInfo] || []
|
const targetInfoList = trackInfo[sourceInfo] || []
|
||||||
@ -513,7 +527,11 @@ const data = {
|
|||||||
currentFilters.push(condition)
|
currentFilters.push(condition)
|
||||||
}
|
}
|
||||||
if (element.type === 'custom' && element.id === targetViewId) { // 过滤组件处理
|
if (element.type === 'custom' && element.id === targetViewId) { // 过滤组件处理
|
||||||
element.options.value = paramValue
|
if (['de-select-tree'].includes(element.component)) {
|
||||||
|
element.options.value = paramValueStr
|
||||||
|
} else {
|
||||||
|
element.options.value = paramValue
|
||||||
|
}
|
||||||
// 去掉动态时间
|
// 去掉动态时间
|
||||||
if (element.options.manualModify) {
|
if (element.options.manualModify) {
|
||||||
element.options.manualModify = false
|
element.options.manualModify = false
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user