diff --git a/backend/src/main/java/io/dataease/datasource/controller/DatasourceController.java b/backend/src/main/java/io/dataease/datasource/controller/DatasourceController.java
index c04b3fc470..a234522869 100644
--- a/backend/src/main/java/io/dataease/datasource/controller/DatasourceController.java
+++ b/backend/src/main/java/io/dataease/datasource/controller/DatasourceController.java
@@ -41,7 +41,7 @@ public class DatasourceController {
return PageUtils.setPageInfo(page, datasourceService.gridQuery(request));
}
- @GetMapping("/delete/{datasourceID}")
+ @PostMapping("/delete/{datasourceID}")
public void deleteDatasource(@PathVariable(value = "datasourceID") String datasourceID) {
datasourceService.deleteDatasource(datasourceID);
}
diff --git a/frontend/src/layout/components/Topbar.vue b/frontend/src/layout/components/Topbar.vue
index 0a5f5ddeab..e827dbefcf 100644
--- a/frontend/src/layout/components/Topbar.vue
+++ b/frontend/src/layout/components/Topbar.vue
@@ -187,12 +187,20 @@ export default {
},
// 设置侧边栏的显示和隐藏
setSidebarHide(route) {
- if (!route.children || route.children.length === 1) {
+ // if (!route.children || route.children.length === 1) {
+ if (!route.children || this.showChildLength(route) === 1) {
this.$store.dispatch('app/toggleSideBarHide', true)
} else {
this.$store.dispatch('app/toggleSideBarHide', false)
}
},
+ // 获取非隐藏子路由的个数
+ showChildLength(route) {
+ if (!route || !route.children) {
+ return 0
+ }
+ return route.children.filter(kid => !kid.hidden).length
+ },
async logout() {
await this.$store.dispatch('user/logout')
this.$router.push(`/login?redirect=${this.$route.fullPath}`)
diff --git a/frontend/src/views/system/datasource/form.vue b/frontend/src/views/system/datasource/form.vue
new file mode 100644
index 0000000000..151babff7b
--- /dev/null
+++ b/frontend/src/views/system/datasource/form.vue
@@ -0,0 +1,135 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 保存
+ {{ $t('commons.validate') }}
+ 重置
+
+
+
+
+
+
+
diff --git a/frontend/src/views/system/datasource/index.vue b/frontend/src/views/system/datasource/index.vue
index f6f63e7702..6ae8bed3b2 100644
--- a/frontend/src/views/system/datasource/index.vue
+++ b/frontend/src/views/system/datasource/index.vue
@@ -125,7 +125,7 @@ export default {
label: this.$t('commons.edit'), icon: 'el-icon-edit', click: this.edit,
show: checkPermission(['datasource:edit'])
}, {
- label: this.$t('commons.delete'), icon: 'el-icon-delete', type: 'danger', click: this.del,
+ label: this.$t('commons.delete'), icon: 'el-icon-delete', type: 'danger', click: this._handleDelete,
show: checkPermission(['datasource:del'])
}
],
@@ -161,16 +161,22 @@ export default {
select(selection) {
console.log(selection)
},
+ // create() {
+ // this.formType = 'add'
+ // this.dialogVisible = true
+ // },
create() {
- this.formType = 'add'
- this.dialogVisible = true
+ this.$router.push({ name: '数据源表单' })
},
+ // edit(row) {
+ // this.formType = 'modify'
+ // this.dialogVisible = true
+ // this.form = Object.assign({}, row)
+ // this.form.configuration = JSON.parse(this.form.configuration)
+ // },
edit(row) {
- this.formType = 'modify'
- this.dialogVisible = true
- this.form = Object.assign({}, row)
- this.form.configuration = JSON.parse(this.form.configuration)
+ this.$router.push({ name: '数据源表单', params: row })
},
_handleDelete(datasource) {