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

feat: 完善数据源基本功能

上级 fb0d195a
<template>
<de-container>
<de-aside-container style="padding: 0 10px;">
<ds-tree @switch-main="switchMain" />
<de-aside-container style="padding: 20px 10px 0;">
<ds-tree ref="dsTree" @switch-main="switchMain" />
</de-aside-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-container>
</template>
......@@ -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()
}
}
}
......
......@@ -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({
......
......@@ -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')
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论