diff --git a/frontend/src/views/system/datasource/DsMain.vue b/frontend/src/views/system/datasource/DsMain.vue index 3e96792543..bf6f188c75 100644 --- a/frontend/src/views/system/datasource/DsMain.vue +++ b/frontend/src/views/system/datasource/DsMain.vue @@ -1,10 +1,10 @@ @@ -38,17 +38,23 @@ export default { // 切换main区内容 switchMain(param) { const { component, componentParam } = param - - switch (component) { - case 'DsForm': - this.component = DsForm - this.param = componentParam - break - default: - this.component = DataHome - this.param = null - break - } + this.component = DataHome + this.param = null + this.$nextTick(() => { + switch (component) { + case 'DsForm': + this.component = DsForm + this.param = componentParam + break + default: + this.component = DataHome + this.param = null + break + } + }) + }, + refreshTree() { + this.$refs.dsTree && this.$refs.dsTree.queryTreeDatas() } } } diff --git a/frontend/src/views/system/datasource/DsTree.vue b/frontend/src/views/system/datasource/DsTree.vue index dfb31454e2..085cacbca5 100644 --- a/frontend/src/views/system/datasource/DsTree.vue +++ b/frontend/src/views/system/datasource/DsTree.vue @@ -144,7 +144,7 @@ export default { }).then(() => { delDs(datasource.id).then(res => { this.$success(this.$t('commons.delete_success')) - this.search() + this.queryTreeDatas() }) }).catch(() => { this.$message({ diff --git a/frontend/src/views/system/datasource/form.vue b/frontend/src/views/system/datasource/form.vue index eb7048d481..ad8cb70cb0 100644 --- a/frontend/src/views/system/datasource/form.vue +++ b/frontend/src/views/system/datasource/form.vue @@ -124,6 +124,7 @@ export default { form.configuration = JSON.stringify(form.configuration) method(form).then(res => { this.$success(this.$t('commons.save_success')) + this.refreshTree() this.backToList() }) } else { @@ -155,6 +156,9 @@ export default { backToList() { this.$emit('switch-component', { }) // this.$router.push({ name: 'datasource' }) + }, + refreshTree() { + this.$emit('refresh-left-tree') } } }