From 141d7b3812457e18549a0f0c98db0ee0b5e83478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=B5=A9=E7=8E=AE?= Date: Wed, 30 Jun 2021 17:15:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=92=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/menu.js | 5 +++- src/components/FormMixin/index.js | 2 +- src/pages/system/view/role/RoleManagement.vue | 8 +++--- src/pages/system/view/role/form.vue | 25 ++++++++----------- 4 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/api/menu.js b/src/api/menu.js index 9b64f2d..11aad8d 100644 --- a/src/api/menu.js +++ b/src/api/menu.js @@ -1,4 +1,4 @@ -import { delReq, getReq, postReq } from '@/utils'; +import { delReq, getReq, postReq, putReq } from '@/utils'; export function delMenuApi(id) { return delReq(`/api/v1/menus/${id}`); @@ -15,3 +15,6 @@ export function addMenuApi(data) { export function addRoleApi(data) { return postReq('/api/v1/roles', data); } +export function updateRoleApi(data) { + return putReq('/api/v1/roles', data); +} diff --git a/src/components/FormMixin/index.js b/src/components/FormMixin/index.js index cb43e98..ec20166 100644 --- a/src/components/FormMixin/index.js +++ b/src/components/FormMixin/index.js @@ -27,7 +27,7 @@ export default { } }, setData(data, type) { - this.form = data; + this.form = { ...data }; this.type = type; }, }, diff --git a/src/pages/system/view/role/RoleManagement.vue b/src/pages/system/view/role/RoleManagement.vue index 3c1ab42..012b63a 100644 --- a/src/pages/system/view/role/RoleManagement.vue +++ b/src/pages/system/view/role/RoleManagement.vue @@ -3,9 +3,9 @@ - - - + + +