fix: 创建关联数据集时,去掉空目录

This commit is contained in:
taojinlong
2022-03-02 17:49:14 +08:00
parent a89fe306c9
commit 3d4e33c8ca
4 changed files with 11 additions and 22 deletions

View File

@@ -60,7 +60,7 @@
<!--选择数据集-->
<el-dialog v-if="selectDsDialog" v-dialogDrag :title="$t('chart.select_dataset')" :visible="selectDsDialog" :show-close="false" width="400px" class="dialog-css">
<dataset-group-selector-tree :fix-height="true" show-mode="union" :custom-type="customType" @getTable="firstDs" />
<dataset-group-selector-tree :fix-height="true" show-mode="union" :custom-type="customType" clear-empty-dir="true" @getTable="firstDs" />
<div slot="footer" class="dialog-footer">
<el-button size="mini" @click="closeSelectDs()">{{ $t('dataset.cancel') }}</el-button>
<el-button :disabled="!tempDs.id" type="primary" size="mini" @click="confirmSelectDs()">{{ $t('dataset.confirm') }}</el-button>
@@ -185,7 +185,7 @@ export default {
mode: this.dataset[0].currentDs.mode,
info: '{"union":' + JSON.stringify(this.dataset) + '}'
}
post('/dataset/table/update', table).then(response => {
post('/dataset/table/updateUnion', table).then(response => {
this.$emit('saveSuccess', table)
this.cancel()
})

View File

@@ -29,7 +29,7 @@
<!--选择数据集-->
<el-dialog v-if="selectDsDialog" v-dialogDrag :title="$t('chart.select_dataset')" :visible="selectDsDialog" :show-close="false" width="400px" class="dialog-css">
<dataset-group-selector-tree :fix-height="true" show-mode="union" :custom-type="customType" :mode="currentNode.currentDs.mode" @getTable="firstDs" />
<dataset-group-selector-tree :fix-height="true" show-mode="union" :custom-type="customType" clear-empty-dir="true" :mode="currentNode.currentDs.mode" @getTable="firstDs" />
<div slot="footer" class="dialog-footer">
<el-button size="mini" @click="closeSelectDs()">{{ $t('dataset.cancel') }}</el-button>
<el-button :disabled="!tempDs.id" type="primary" size="mini" @click="confirmSelectDs()">{{ $t('dataset.confirm') }}</el-button>
@@ -79,7 +79,7 @@ export default {
},
allChildCount: 0
},
customType: ['db', 'sql', 'excel'],
customType: ['db', 'sql', 'excel', 'api'],
selectDsDialog: false,
// 弹框临时选中的数据集
tempDs: {},
@@ -129,7 +129,7 @@ export default {
selectDs() {
// 根据父级node过滤不同的数据集
if (this.currentNode.currentDs.mode === 1) {
this.customType = ['db', 'sql', 'excel']
this.customType = ['db', 'sql', 'excel', 'api']
} else if (this.currentNode.currentDs.mode === 0) {
if (this.currentNode.currentDs.modelInnerType === 'db') {
this.customType = ['db']

View File

@@ -340,7 +340,7 @@ export default {
{ required: true, message: this.$t('dataset.required'), trigger: 'change' }
]
},
customType: ['db', 'sql']
customType: ['db', 'sql', 'api']
}
},
computed: {