From 2591e298a3fd1332ad0ca33059f6ba0b7d426f51 Mon Sep 17 00:00:00 2001 From: pengwei <2071057782@qq.com> Date: 星期四, 20 三月 2025 10:08:00 +0800 Subject: [PATCH] 最新代码提交 --- 项目代码/client/src/views/system/Permission.vue | 27 +++++++++------------------ 1 files changed, 9 insertions(+), 18 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/client/src/views/system/Permission.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/client/src/views/system/Permission.vue" index fdc683e..c2795d9 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/client/src/views/system/Permission.vue" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/client/src/views/system/Permission.vue" @@ -34,11 +34,7 @@ class="role-tree-right flex-col" > <div class="title" style="display: flex; justify-content: space-between"> - <div> - 瑙掕壊鏉冮檺绠$悊锛坽{ - userInfo.userName ? userInfo.userName : "瓒呯骇绠$悊鍛�" - }}锛� - </div> + <div>瑙掕壊鏉冮檺绠$悊锛坽{ info.roleName }}锛�</div> <el-icon @click="goBack" size="25"><CloseBold /></el-icon> </div> <div class="title"> @@ -107,6 +103,9 @@ const route = useRoute(); const router = useRouter(); const userInfo = reactive({}); + const info = ref({}); + info.value = JSON.parse(history.state?.info); + const leftCheckChange = (node, selected) => { node.actions.forEach((x, index) => { x.checked = selected; @@ -188,13 +187,12 @@ getUserRole(node); }; const getUserRole = (item) => { - selectId.value = item.id; roleList.forEach((x) => { x.actions.forEach((a) => { a.checked = false; }); }); - let url = `/api/Sys_Role/getUserTreePermission?roleId=${item.id}`; + let url = `/api/Sys_Role/getUserTreePermission?roleId=${info.value.roleId}`; http.post(url, {}, true).then((result) => { if (!result.status) return; result.data.forEach((item) => { @@ -250,9 +248,6 @@ let $message = getCurrentInstance().appContext.config.globalProperties.$message; const save = () => { - if (selectId.value <= 0) { - return $message.error("璇烽�夋嫨瑙掕壊!"); - } let userPermissions = []; roleList.forEach((x) => { let checkedPermission = x.actions.filter((f) => { @@ -268,7 +263,7 @@ }); } }); - let url = `api/Sys_Role/SavePermission?roleId=${selectId.value}`; + let url = `api/Sys_Role/SavePermission?roleId=${info.value.roleId}`; http.post(url, userPermissions, true).then((result) => { $message[result.status ? "success" : "error"](result.message); }); @@ -276,12 +271,8 @@ load(); getCurrentTreePermission(); - - onActivated(() => { - let detail = history.state.info; - userInfo.value = JSON.parse(detail || {}); - }); - console.log(userInfo.value); + getUserRole(); + console.log("123", info.value); return { list, @@ -303,7 +294,7 @@ route, goBack, router, - userInfo, + info, }; }, }); -- Gitblit v1.9.3