From 18fcb8ad28f583e3e1b99b23e4f7d9e1833dcd83 Mon Sep 17 00:00:00 2001 From: pengwei <2071057782@qq.com> Date: 星期三, 12 三月 2025 14:16:30 +0800 Subject: [PATCH] 最新提交 --- 项目代码/client/src/views/system/Permission.vue | 95 ++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 76 insertions(+), 19 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 54e3e4a..fdc683e 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" @@ -1,6 +1,14 @@ <template> - <div style="width: 100%;height: 100%;display: flex;overflow: hidden;"> - <div class="role-tree-left flex-col"> + <div + style=" + width: 100%; + height: 100%; + display: flex; + flex-direction: row; + overflow: hidden; + " + > + <!-- <div class="role-tree-left flex-col"> <div class="title"><i class="el-icon-user"></i>瑙掕壊鍒楄〃</div> <el-scrollbar class="el-role-list"> <el-tree :data="tree" @node-click="nodeClick" node-key="id" :default-expanded-keys="openKeys" @@ -14,26 +22,59 @@ </template> </el-tree> </el-scrollbar> - </div> - <div style="height: calc(100vh - 6.5rem);flex: 1;overflow: hidden;background-color: white;" class="role-tree-right flex-col"> + </div> --> + + <div + style=" + height: calc(100vh - 6.5rem); + flex: 1; + overflow: hidden; + background-color: white; + " + class="role-tree-right flex-col" + > + <div class="title" style="display: flex; justify-content: space-between"> + <div> + 瑙掕壊鏉冮檺绠$悊锛坽{ + userInfo.userName ? userInfo.userName : "瓒呯骇绠$悊鍛�" + }}锛� + </div> + <el-icon @click="goBack" size="25"><CloseBold /></el-icon> + </div> <div class="title"> <div><i class="el-icon-folder-opened"></i>鑿滃崟鏉冮檺</div> <el-button type="primary" @click="save">淇濆瓨</el-button> </div> - <el-scrollbar class="el-role-list" style="height: 100%;"> - <el-tree @check-change="leftCheckChange" @check="nodeCheck" :data="roleTree" :show-checkbox="false" - style="padding: 15px" node-key="id" default-expand-all :expand-on-click-node="false"> + <el-scrollbar class="el-role-list" style="height: 100%"> + <el-tree + @check-change="leftCheckChange" + @check="nodeCheck" + :data="roleTree" + :show-checkbox="false" + style="padding: 15px" + node-key="id" + default-expand-all + :expand-on-click-node="false" + > <template #default="{ data }"> <div class="action-group"> - <div class="action-text" :style="{ width: (4 - data.lv) * 18 + 150 + 'px' }"> + <div + class="action-text" + :style="{ width: (4 - data.lv) * 18 + 150 + 'px' }" + > <el-checkbox v-model="data.leftCk" @change="allChange(data)">{{ // data.text + (data.isApp ? "(app)" : "") data.text }}</el-checkbox> </div> <div class="action-item"> - <el-checkbox v-for="(item, index) in data.actions" :key="index" v-model="item.checked" - @change="actionChange(data, item.checked)">{{ item.text }}</el-checkbox> + <el-checkbox + v-for="(item, index) in data.actions" + :key="index" + v-model="item.checked" + @change="actionChange(data, item.checked)" + >{{ item.text }}</el-checkbox + > </div> </div> </template> @@ -41,12 +82,18 @@ </el-scrollbar> </div> </div> - </template> <script> -import { defineComponent, ref, reactive, getCurrentInstance } from "vue"; +import { + defineComponent, + ref, + reactive, + getCurrentInstance, + onActivated, +} from "vue"; import http from "@/../src/api/http.js"; +import { useRoute, useRouter } from "vue-router"; export default defineComponent({ setup() { const selectId = ref(-1); @@ -57,7 +104,9 @@ const roleList = reactive([]); const roleTree = reactive([]); const openKeys = reactive([]); - + const route = useRoute(); + const router = useRouter(); + const userInfo = reactive({}); const leftCheckChange = (node, selected) => { node.actions.forEach((x, index) => { x.checked = selected; @@ -109,7 +158,6 @@ const load = () => { const url = "api/Sys_Role/getUserChildRoles"; http.post(url, {}, true).then((result) => { - if (!result.status) return; list.splice(0); list.push(...result.data); @@ -164,6 +212,9 @@ }); }; + const goBack = () => { + router.push("/Usermanagement"); + }; const getRoleTree = (id, data, isRootId) => { roleList.forEach((x) => { if (x.pid == id) { @@ -225,6 +276,13 @@ load(); getCurrentTreePermission(); + + onActivated(() => { + let detail = history.state.info; + userInfo.value = JSON.parse(detail || {}); + }); + console.log(userInfo.value); + return { list, nodeClick, @@ -242,12 +300,15 @@ allChange, actionChange, save, + route, + goBack, + router, + userInfo, }; }, }); </script> <style lang="less" scoped> - .flex-col { display: flex; flex-direction: column; @@ -265,8 +326,6 @@ } } } - - .title { display: flex; @@ -299,7 +358,6 @@ } } - .title { padding: 10px; background: rgb(246 250 255); @@ -313,7 +371,6 @@ height: 0; overflow-x: hidden; } - .role-tree-left ::v-deep(.el-tree-node__content) { cursor: pointer; -- Gitblit v1.9.3