| | |
| | | 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"> |
| | |
| | | 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; |
| | |
| | | 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) => { |
| | |
| | | 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) => { |
| | |
| | | }); |
| | | } |
| | | }); |
| | | 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); |
| | | }); |
| | |
| | | |
| | | 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, |
| | |
| | | route, |
| | | goBack, |
| | | router, |
| | | userInfo, |
| | | info, |
| | | }; |
| | | }, |
| | | }); |