fix(查询组件): 数据集没有被图表使用的情况下,无法设置跨数据集级联

This commit is contained in:
dataeaseShu 2024-07-04 15:57:48 +08:00
parent 9f9c665975
commit 86daf12f24
2 changed files with 10 additions and 3 deletions

View File

@ -209,7 +209,7 @@ defineExpose({
<el-icon style="font-size: 16px"> <el-icon style="font-size: 16px">
<Icon name="icon_info_colorful"></Icon> <Icon name="icon_info_colorful"></Icon>
</el-icon> </el-icon>
基于当前查询组件的查询条件如果需要进行级联配置需要满足以下条件<br /> 基于当前查询组件的查询条件如果需要进行级联配置需要满足以下条件<br />
1. 展示类型文本下拉组件和数字下拉组件2. 选项值来源选择数据集<br /> 1. 展示类型文本下拉组件和数字下拉组件2. 选项值来源选择数据集<br />
</div> </div>
<el-button text @click="addCascadeBlock"> <el-button text @click="addCascadeBlock">

View File

@ -540,14 +540,20 @@ const CascadeDialog = defineAsyncComponent(() => import('./QueryCascade.vue'))
const cascadeDialog = ref() const cascadeDialog = ref()
const openCascadeDialog = () => { const openCascadeDialog = () => {
const cascadeMap = conditions.value const cascadeMap = conditions.value
.filter(ele => [0, 2, 5].includes(+ele.displayType) && ele.optionValueSource === 1) .filter(
ele =>
[0, 2, 5].includes(+ele.displayType) &&
ele.optionValueSource === 1 &&
!!ele.checkedFields?.length &&
!!Object.values(ele.checkedFieldsMap).filter(item => !!item).length
)
.reduce((pre, next) => { .reduce((pre, next) => {
pre[next.id] = { pre[next.id] = {
datasetId: next.dataset.id, datasetId: next.dataset.id,
name: next.name, name: next.name,
queryId: next.id, queryId: next.id,
fieldId: next.field.id, fieldId: next.field.id,
deType: datasetMap[next.dataset.id].fields?.dimensionList.find( deType: (datasetMap[next.dataset.id]?.fields?.dimensionList || next.dataset.fields).find(
ele => ele.id === next.field.id ele => ele.id === next.field.id
)?.deType )?.deType
} }
@ -1417,6 +1423,7 @@ defineExpose({
</div> </div>
</el-option> </el-option>
</el-select> </el-select>
<span style="width: 172px; margin-left: 12px" v-else></span>
</div> </div>
</el-checkbox-group> </el-checkbox-group>
</div> </div>