feat: 完善数据源基本功能
This commit is contained in:
parent
fb0d195aa3
commit
54057d5dab
@ -1,10 +1,10 @@
|
||||
<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')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user