fix(查询组件): 组件中 “选择关联图表及字段” 的“维度”和“参数”混淆,选择“维度”后显示的仍然是“参数”的过滤数据 #12236

This commit is contained in:
dataeaseShu 2024-09-19 14:30:02 +08:00
parent 21d252c104
commit 8184fcd9be
5 changed files with 25 additions and 16 deletions

View File

@ -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>

View File

@ -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 }

View File

@ -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>

View File

@ -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[

View File

@ -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
}) })
} }