diff --git a/backend/src/main/java/io/dataease/ext/ExtDataSetTableMapper.xml b/backend/src/main/java/io/dataease/ext/ExtDataSetTableMapper.xml index 205a1b42f2..bc18c27b76 100644 --- a/backend/src/main/java/io/dataease/ext/ExtDataSetTableMapper.xml +++ b/backend/src/main/java/io/dataease/ext/ExtDataSetTableMapper.xml @@ -159,7 +159,7 @@ select - ds.id, + ifnull(ds.id,'') `id`, ds.name, ds_auth.auths, 'link' `type`, diff --git a/frontend/src/views/dataset/group/Group.vue b/frontend/src/views/dataset/group/Group.vue index 37f73f80fa..bcdaf184a8 100644 --- a/frontend/src/views/dataset/group/Group.vue +++ b/frontend/src/views/dataset/group/Group.vue @@ -924,22 +924,21 @@ export default { } } - const { queryType = 'dataset', name: label, id } = data - await this.getDatasetRelationship({ queryType, label, id }) - if (this.treeData.length) { - options.title = this.$t('datasource.delete_this_dataset') - options.link = this.$t('datasource.click_to_check') - options.content = this.$t('datasource.cannot_be_deleted_dataset') - options.templateDel = msgContent - options.confirmButtonText = undefined - options.type = 'danger' - - - options.linkTo = this.linkTo.bind(this, { queryType, id }) - this.withLink(options, this.$t('commons.delete')) - return - } - this.handlerConfirm(options) + const { queryType = 'dataset', id } = data + getDatasetRelationship(id).then((res) => { + if (res.data.subRelation?.length) { + options.title = this.$t('datasource.delete_this_dataset') + options.link = this.$t('datasource.click_to_check') + options.content = this.$t('datasource.cannot_be_deleted_dataset') + options.templateDel = msgContent + options.confirmButtonText = undefined + options.type = 'danger' + options.linkTo = this.linkTo.bind(this, { queryType, id }) + this.withLink(options, this.$t('commons.delete')) + return + } + this.handlerConfirm(options) + }) }, linkTo(query) { window.open(this.$router.resolve({ diff --git a/frontend/src/views/system/datasource/DsTree.vue b/frontend/src/views/system/datasource/DsTree.vue index 7d5de21f87..2b5c2eb205 100644 --- a/frontend/src/views/system/datasource/DsTree.vue +++ b/frontend/src/views/system/datasource/DsTree.vue @@ -758,9 +758,8 @@ export default { if (this.treeData.length) { params.title = this.$t('datasource.this_data_source') params.link = this.$t('datasource.click_to_check') - params.content = this.$t('datasource.cannot_be_deleted_dataset') + params.content = this.$t('datasource.cannot_be_deleted_datasource') params.templateDel = msgContent - params.linkTo = this.linkTo.bind(this, { queryType, id }) this.withLink(params) return