mirror of
https://github.com/dataease/dataease.git
synced 2026-05-18 17:58:11 +08:00
refactor: 针对过滤组件中查询与现实字段不一致情况,跳转维度可以自动匹配转换 (#17132)
This commit is contained in:
@@ -1275,6 +1275,7 @@ export const dvMainStore = defineStore('dataVisualization', {
|
||||
const queryMapFlag = optionValueSource === 1 && field.id !== displayId
|
||||
let queryMapParams = queryParams
|
||||
if (queryMapFlag) {
|
||||
queryParams = filterEnumParamsReduce(queryParams, field.id)
|
||||
queryMapParams = filterEnumParams(queryParams, field.id)
|
||||
}
|
||||
// 0 文本类型 1 数字类型
|
||||
|
||||
@@ -30,10 +30,9 @@ export const filterEnumParams = (queryParams, fieldId: string) => {
|
||||
export const filterEnumParamsReduce = (queryParams, fieldId: string) => {
|
||||
const resultMap = filterEnumMap[fieldId]
|
||||
if (resultMap) {
|
||||
const resultMapReduce = Object.entries(params1).reduce((acc, [key, value]) => {
|
||||
acc[value] = key
|
||||
return acc
|
||||
}, {})
|
||||
const resultMapReduce = Object.fromEntries(
|
||||
Object.entries(resultMap).map(([key, value]) => [value, key])
|
||||
)
|
||||
const resultParams = []
|
||||
queryParams.forEach(param => {
|
||||
resultParams.push(resultMapReduce[param] || param)
|
||||
|
||||
Reference in New Issue
Block a user