mirror of
https://github.com/dataease/dataease.git
synced 2026-05-15 13:32:18 +08:00
fix(查询组件): 下拉树组件在切换组件类型时,清除其他层级设置
This commit is contained in:
committed by
xuwei-fit2cloud
parent
12bceb7bc1
commit
85ba1f3951
@@ -764,6 +764,27 @@ const setType = () => {
|
||||
}
|
||||
}
|
||||
|
||||
let oldDisplayType
|
||||
|
||||
const handleSetTypeChange = () => {
|
||||
let displayType = curComponent.value.displayType
|
||||
if (oldDisplayType === '9' && ['0', '8'].includes(displayType)) {
|
||||
curComponent.value.displayType = '9'
|
||||
ElMessageBox.confirm(t('common.changing_the_display'), {
|
||||
confirmButtonType: 'primary',
|
||||
type: 'warning',
|
||||
cancelButtonText: t('common.cancel'),
|
||||
autofocus: false,
|
||||
showClose: false
|
||||
}).then(() => {
|
||||
curComponent.value.displayType = displayType
|
||||
setTypeChange()
|
||||
})
|
||||
} else {
|
||||
setTypeChange()
|
||||
}
|
||||
}
|
||||
|
||||
const setTypeChange = () => {
|
||||
handleDialogClick()
|
||||
nextTick(() => {
|
||||
@@ -779,6 +800,11 @@ const setTypeChange = () => {
|
||||
}
|
||||
setTreeDefault()
|
||||
setRelationBack()
|
||||
if (curComponent.value.displayType === '0' && curComponent.value.treeFieldList?.length) {
|
||||
curComponent.value.treeFieldList = []
|
||||
curComponent.value.treeCheckedList = []
|
||||
}
|
||||
oldDisplayType = curComponent.value.displayType
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1827,6 +1853,7 @@ const handleCondition = (item, idx = 0) => {
|
||||
}
|
||||
nextTick(() => {
|
||||
if (curComponent.value.displayType === '9') {
|
||||
oldDisplayType = '9'
|
||||
handleRelationshipChart(idx)
|
||||
if (!curComponent.value.treeDatasetId && fields.value?.length) {
|
||||
nextTick(() => {
|
||||
@@ -2808,7 +2835,7 @@ defineExpose({
|
||||
<div class="value">
|
||||
<el-select
|
||||
@focus="handleDialogClick"
|
||||
@change="setTypeChange"
|
||||
@change="handleSetTypeChange"
|
||||
v-model="curComponent.displayType"
|
||||
>
|
||||
<el-option
|
||||
|
||||
@@ -3,6 +3,8 @@ export default {
|
||||
empty: ' ',
|
||||
associated_chart: 'Associated chart',
|
||||
associated_chart_first: 'First level associated chart',
|
||||
changing_the_display:
|
||||
'Changing the display type will clear the drop-down tree related settings. Are you sure?',
|
||||
other_levels:
|
||||
'Except for level 1, no query condition configuration is required for other levels',
|
||||
tree_structure: 'The drop-down tree structure cannot be empty',
|
||||
@@ -2911,7 +2913,6 @@ export default {
|
||||
small: 'Small',
|
||||
middle: 'Medium',
|
||||
large: 'Large',
|
||||
custom: 'Custom',
|
||||
no_details: 'No Data',
|
||||
sync_pc_design: 'Synchronize PC Design',
|
||||
title_background: 'Title Background',
|
||||
|
||||
@@ -4,6 +4,7 @@ export default {
|
||||
other_levels: '除層級一外,其他層級無須進行查詢條件配置',
|
||||
tree_structure: '下拉樹的結構不能為空',
|
||||
associated_chart: '關聯圖表',
|
||||
changing_the_display: '更改展示類型將會清除下拉樹相關設定,是否確定?',
|
||||
associated_chart_first: '第一層級已關聯圖表',
|
||||
component: {
|
||||
input: '單行輸入',
|
||||
|
||||
@@ -11,6 +11,7 @@ export default {
|
||||
watermarkManagement: '水印管理',
|
||||
list_selection: '列表选择',
|
||||
date_setting: '日期设置',
|
||||
changing_the_display: '更改展示类型将会清除下拉树相关设置,是否确定?',
|
||||
component: {
|
||||
input: '单行输入',
|
||||
textarea: '多行输入',
|
||||
|
||||
@@ -433,7 +433,9 @@ const getSQLPreview = () => {
|
||||
|
||||
let tableList = []
|
||||
watch(searchTable, val => {
|
||||
datasourceTableData.value = tableList.filter(ele => ele.tableName.includes(val))
|
||||
datasourceTableData.value = tableList.filter(ele =>
|
||||
ele.tableName.toLowerCase().includes(val.toLowerCase())
|
||||
)
|
||||
})
|
||||
|
||||
const getIconName = (type: string) => {
|
||||
|
||||
Reference in New Issue
Block a user