forked from github/dataease
fix(查询组件): 组件中 “选择关联图表及字段” 的“维度”和“参数”混淆,选择“维度”后显示的仍然是“参数”的过滤数据 #12236
This commit is contained in:
parent
21d252c104
commit
8184fcd9be
@ -1,5 +1,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useAttrs, computed } from 'vue'
|
import { useAttrs, computed } from 'vue'
|
||||||
|
import icon_visible_outlined from '@/assets/svg/icon_visible_outlined.svg'
|
||||||
|
import icon_invisible_outlined from '@/assets/svg/icon_invisible_outlined.svg'
|
||||||
import { hIcon } from '@/components/icon-custom'
|
import { hIcon } from '@/components/icon-custom'
|
||||||
const attrs = useAttrs()
|
const attrs = useAttrs()
|
||||||
const props = defineProps(['modelValue'])
|
const props = defineProps(['modelValue'])
|
||||||
@ -13,8 +15,8 @@ const value = computed({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const iconView = hIcon('icon_visible_outlined')
|
const iconView = hIcon(icon_visible_outlined)
|
||||||
const iconHide = hIcon('icon_invisible_outlined')
|
const iconHide = hIcon(icon_invisible_outlined)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -3,7 +3,7 @@ import { ElIcon } from 'element-plus-secondary'
|
|||||||
import Icon from './src/Icon.vue'
|
import Icon from './src/Icon.vue'
|
||||||
const hIcon = (name: string) => {
|
const hIcon = (name: string) => {
|
||||||
return h(ElIcon, null, {
|
return h(ElIcon, null, {
|
||||||
default: () => h(Icon, { name })
|
default: () => h(name)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
export { Icon, hIcon }
|
export { Icon, hIcon }
|
||||||
|
@ -379,7 +379,7 @@
|
|||||||
<Icon
|
<Icon
|
||||||
><component
|
><component
|
||||||
class="svg-icon"
|
class="svg-icon"
|
||||||
:className="`field-icon-${fieldType[item.sourceDeType]}`"
|
:class="`field-icon-${fieldType[item.sourceDeType]}`"
|
||||||
:is="iconFieldMap[fieldType[item.sourceDeType]]"
|
:is="iconFieldMap[fieldType[item.sourceDeType]]"
|
||||||
></component
|
></component
|
||||||
></Icon>
|
></Icon>
|
||||||
|
@ -1574,15 +1574,15 @@ defineExpose({
|
|||||||
<template v-if="curComponent.checkedFieldsMap[field.componentId]" #prefix>
|
<template v-if="curComponent.checkedFieldsMap[field.componentId]" #prefix>
|
||||||
<el-icon>
|
<el-icon>
|
||||||
<Icon
|
<Icon
|
||||||
:className="`field-icon-${
|
|
||||||
fieldType[
|
|
||||||
getDetype(
|
|
||||||
curComponent.checkedFieldsMap[field.componentId],
|
|
||||||
Object.values(field.fields)
|
|
||||||
)
|
|
||||||
]
|
|
||||||
}`"
|
|
||||||
><component
|
><component
|
||||||
|
:class="`field-icon-${
|
||||||
|
fieldType[
|
||||||
|
getDetype(
|
||||||
|
curComponent.checkedFieldsMap[field.componentId],
|
||||||
|
Object.values(field.fields)
|
||||||
|
)
|
||||||
|
]
|
||||||
|
}`"
|
||||||
:is="
|
:is="
|
||||||
iconFieldMap[
|
iconFieldMap[
|
||||||
fieldType[
|
fieldType[
|
||||||
|
@ -354,14 +354,21 @@ export const searchQuery = (queryComponentList, filter, curComponentId, firstLoa
|
|||||||
firstLoad
|
firstLoad
|
||||||
)
|
)
|
||||||
if (result?.length) {
|
if (result?.length) {
|
||||||
|
const fieldId = isTree
|
||||||
|
? getFieldId(treeFieldList, result)
|
||||||
|
: item.checkedFieldsMap[curComponentId]
|
||||||
|
const parametersFilter = parameters.reduce((pre, next) => {
|
||||||
|
if (next.id === fieldId && !pre.length) {
|
||||||
|
pre.push(next)
|
||||||
|
}
|
||||||
|
return pre
|
||||||
|
}, [])
|
||||||
filter.push({
|
filter.push({
|
||||||
componentId: ele.id,
|
componentId: ele.id,
|
||||||
fieldId: isTree
|
fieldId,
|
||||||
? getFieldId(treeFieldList, result)
|
|
||||||
: item.checkedFieldsMap[curComponentId],
|
|
||||||
operator,
|
operator,
|
||||||
value: result,
|
value: result,
|
||||||
parameters,
|
parameters: parametersFilter,
|
||||||
isTree
|
isTree
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user