From 54057d5dab21a788f78ecc100cf25f85db6590dc Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 17 Jun 2021 19:34:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=8C=E5=96=84=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=BA=90=E5=9F=BA=E6=9C=AC=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/system/datasource/DsMain.vue | 34 +++++++++++-------- .../src/views/system/datasource/DsTree.vue | 2 +- frontend/src/views/system/datasource/form.vue | 4 +++ 3 files changed, 25 insertions(+), 15 deletions(-) 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') } } }