fix(查询组件): 下拉树规则创建是切换使用字段第一个层级应该跟随发生变化

This commit is contained in:
dataeaseShu 2024-07-10 15:52:34 +08:00
parent 9e914b2b1b
commit 39fb90b0f1
3 changed files with 24 additions and 7 deletions

View File

@ -328,6 +328,9 @@ const setParameters = () => {
}
})
setType()
if (curComponent.value.displayType === '9') {
setTreeDefault()
}
}
const setType = () => {

View File

@ -110,7 +110,11 @@ const setCascadeValueBack = val => {
cascade.value.forEach(ele => {
ele.forEach(item => {
if (item.datasetId.split('--')[1] === config.value.id) {
if (props.isConfig) {
item.selectValue = Array.isArray(val) ? [...val] : val
} else {
item.currentSelectValue = Array.isArray(val) ? [...val] : val
}
}
})
})
@ -158,13 +162,23 @@ const getCascadeFieldId = () => {
}
filter.push(condition)
} else {
if (!!item.selectValue.length) {
if (props.isConfig) {
if (!!item.selectValue?.length) {
condition = {
fieldId: fieldId,
operator: 'in',
value: [...item.selectValue]
}
}
} else {
if (!!item.currentSelectValue?.length) {
condition = {
fieldId: fieldId,
operator: 'in',
value: [...item.currentSelectValue]
}
}
}
}
})
})

View File

@ -356,7 +356,7 @@ provide('quotaData', realQuota)
const startToMove = (e: DragEvent, item) => {
e.dataTransfer.setData(
'fields',
'dimension',
JSON.stringify(
item
.filter(ele => ele.id)