diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue
index a029a89..0cad402 100644
--- a/src/views/system/menu/index.vue
+++ b/src/views/system/menu/index.vue
@@ -13,7 +13,7 @@
{{ node.label }}
-
+
@@ -68,13 +68,13 @@
//加载树数据
async getMenu(){
this.menuloading = true
- var res = await this.$api.system.index.get();
+ var res = await this.$http.get('system/menu');
this.menuloading = false
- this.menuList = res.data.menu;
+ this.menuList = res.data;
},
//树点击
menuClick(data, node){
- var pid = node.level==1?undefined:node.parent.data.id;
+ var pid = node.level==1 ? undefined : node.parent.data.id;
this.$refs.save.setData(data, pid)
this.$refs.main.$el.scrollTop = 0
},
@@ -93,8 +93,8 @@
async add(node, data){
var newMenuName = "未命名" + newMenuIndex++;
var newMenuData = {
- parentId: data ? data.id : "",
- name: newMenuName,
+ parentid: data ? data.id : 0,
+ name: "",
path: "",
component: "",
meta:{
@@ -103,13 +103,19 @@
}
}
this.menuloading = true
- var res = await this.$api.demo.post.post(newMenuData)
+ var res = await this.$http.post('system/menu/submit',newMenuData)
this.menuloading = false
- newMenuData.id = res.data
+ if(res.code !== 200){
+ this.$message.warning(res.message);
+ return false;
+ }
+
+
+ newMenuData.id = res.data
this.$refs.menu.append(newMenuData, node)
this.$refs.menu.setCurrentKey(newMenuData.id)
- var pid = node ? node.data.id : ""
+ var pid = node ? node.data.id : 0
this.$refs.save.setData(newMenuData, pid)
},
//删除菜单
@@ -133,7 +139,7 @@
var reqData = {
ids: CheckedNodes.map(item => item.id)
}
- var res = await this.$api.demo.post.post(reqData)
+ var res = await this.$http.post('system/menu/delete',reqData)
this.menuloading = false
if(res.code == 200){
diff --git a/src/views/system/menu/save.vue b/src/views/system/menu/save.vue
index 4983060..f8c84a9 100644
--- a/src/views/system/menu/save.vue
+++ b/src/views/system/menu/save.vue
@@ -10,8 +10,8 @@
-
-
+
+
@@ -29,13 +29,13 @@
-
+
-
+
-
-
+
+
子节点或详情页需要高亮的上级菜单路由地址
@@ -67,7 +67,7 @@
接口权限
-
+
@@ -99,7 +99,7 @@
return {
form: {
id: "",
- parentId: "",
+ parentid: "",
name: "",
path: "",
component: "",
@@ -113,7 +113,7 @@
fullpage: false,
tag: "",
},
- apiList: []
+ apilist: []
},
menuOptions: [],
menuProps: {
@@ -131,7 +131,7 @@
'#c71585'
],
rules: [],
- apiListAddTemplate: {
+ apilistAddTemplate: {
code: "",
url: ""
},
@@ -156,7 +156,7 @@
tree.forEach(item => {
var obj = {
id: item.id,
- parentId: item.parentId,
+ parentid: item.parentid,
title: item.meta.title,
children: item.children&&item.children.length>0 ? this.treeToMap(item.children) : null
}
@@ -167,7 +167,7 @@
//保存
async save(){
this.loading = true
- var res = await this.$api.demo.post.post(this.form)
+ var res = await this.$http.post('system/menu/submit',this.form)
this.loading = false
if(res.code == 200){
this.$message.success("保存成功")
@@ -178,8 +178,8 @@
//表单注入数据
setData(data, pid){
this.form = data
- this.form.apiList = data.apiList || []
- this.form.parentId = pid
+ this.form.apilist = data.apilist || []
+ this.form.parentid = pid
}
}
}
diff --git a/src/views/system/task/index.vue b/src/views/system/task/index.vue
index 4f3868d..ffc09ff 100644
--- a/src/views/system/task/index.vue
+++ b/src/views/system/task/index.vue
@@ -1,12 +1,3 @@
-
-
@@ -165,11 +156,9 @@
.task-item li h4 {font-size: 12px;font-weight: normal;color: #999;}
.task-item li p {margin-top: 5px;}
.task-item .bottom {border-top: 1px solid #EBEEF5;text-align: right;padding-top:10px;display: flex;justify-content: space-between;align-items: center;}
-
.task-add {display: flex;flex-direction: column;align-items: center;justify-content: center;text-align: center;cursor: pointer;color: #999;}
.task-add:hover {color: #409EFF;}
.task-add i {font-size: 30px;}
.task-add p {font-size: 12px;margin-top: 20px;}
-
.dark .task-item .bottom {border-color: var(--el-border-color-light);}