提交 54057d5d authored 作者: fit2cloud-chenyw's avatar fit2cloud-chenyw

feat: 完善数据源基本功能

上级 fb0d195a
<template> <template>
<de-container> <de-container>
<de-aside-container style="padding: 0 10px;"> <de-aside-container style="padding: 20px 10px 0;">
<ds-tree @switch-main="switchMain" /> <ds-tree ref="dsTree" @switch-main="switchMain" />
</de-aside-container> </de-aside-container>
<de-main-container> <de-main-container>
<component :is="component" v-if="!!component" :params="param" @switch-component="switchMain" /> <component :is="component" v-if="!!component" :params="param" @refresh-left-tree="refreshTree" @switch-component="switchMain" />
</de-main-container> </de-main-container>
</de-container> </de-container>
</template> </template>
...@@ -38,17 +38,23 @@ export default { ...@@ -38,17 +38,23 @@ export default {
// 切换main区内容 // 切换main区内容
switchMain(param) { switchMain(param) {
const { component, componentParam } = param const { component, componentParam } = param
this.component = DataHome
switch (component) { this.param = null
case 'DsForm': this.$nextTick(() => {
this.component = DsForm switch (component) {
this.param = componentParam case 'DsForm':
break this.component = DsForm
default: this.param = componentParam
this.component = DataHome break
this.param = null default:
break this.component = DataHome
} this.param = null
break
}
})
},
refreshTree() {
this.$refs.dsTree && this.$refs.dsTree.queryTreeDatas()
} }
} }
} }
......
...@@ -144,7 +144,7 @@ export default { ...@@ -144,7 +144,7 @@ export default {
}).then(() => { }).then(() => {
delDs(datasource.id).then(res => { delDs(datasource.id).then(res => {
this.$success(this.$t('commons.delete_success')) this.$success(this.$t('commons.delete_success'))
this.search() this.queryTreeDatas()
}) })
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
......
...@@ -124,6 +124,7 @@ export default { ...@@ -124,6 +124,7 @@ export default {
form.configuration = JSON.stringify(form.configuration) form.configuration = JSON.stringify(form.configuration)
method(form).then(res => { method(form).then(res => {
this.$success(this.$t('commons.save_success')) this.$success(this.$t('commons.save_success'))
this.refreshTree()
this.backToList() this.backToList()
}) })
} else { } else {
...@@ -155,6 +156,9 @@ export default { ...@@ -155,6 +156,9 @@ export default {
backToList() { backToList() {
this.$emit('switch-component', { }) this.$emit('switch-component', { })
// this.$router.push({ name: 'datasource' }) // this.$router.push({ name: 'datasource' })
},
refreshTree() {
this.$emit('refresh-left-tree')
} }
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论