优化顶部菜单配置接口

dev
smallchill 6 years ago
parent 4739ae51b8
commit 1d5c83e7e8
  1. 2
      src/api/system/topmenu.js
  2. 11
      src/views/system/topmenu.vue

@ -69,7 +69,7 @@ export const grant = (topMenuIds, menuIds) => {
return request({ return request({
url: '/api/blade-system/topmenu/grant', url: '/api/blade-system/topmenu/grant',
method: 'post', method: 'post',
params: { data: {
topMenuIds, topMenuIds,
menuIds, menuIds,
} }

@ -168,12 +168,19 @@
ids.push(ele.id); ids.push(ele.id);
}); });
return ids.join(","); return ids.join(",");
},
idsArray() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids;
} }
}, },
methods: { methods: {
submit() { submit() {
const menuList = this.$refs.treeMenu.getCheckedKeys().join(","); const menuList = this.$refs.treeMenu.getCheckedKeys();
grant(this.ids, menuList).then(() => { grant(this.idsArray, menuList).then(() => {
this.box = false; this.box = false;
this.$message({ this.$message({
type: "success", type: "success",

Loading…
Cancel
Save