From 6a86f3d717a482ef77484d44e33fab6ec69dba53 Mon Sep 17 00:00:00 2001 From: ww664853070 Date: Mon, 10 Jul 2023 09:02:16 +0800 Subject: [PATCH] =?UTF-8?q?(*)=E8=A1=A8=E5=A4=B4=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../humanAffairs/containers/employeeAuth.jsx | 38 +++++++------------ 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/web/client/src/sections/humanAffairs/containers/employeeAuth.jsx b/web/client/src/sections/humanAffairs/containers/employeeAuth.jsx index fe56421..d35a4f6 100644 --- a/web/client/src/sections/humanAffairs/containers/employeeAuth.jsx +++ b/web/client/src/sections/humanAffairs/containers/employeeAuth.jsx @@ -25,10 +25,6 @@ const EmployeeAuth = (props) => { dispatch(actions.humanAffairs.getResource()) }, []) let hrUser = JSON.parse(sessionStorage.getItem('hrUser')) - console.log(hrUser, '登录返回'); - console.log(roleList, '角色列表'); - console.log(userRoleList, '用户角色关联'); - console.log(resourceList, '权限列表'); const button = ( { children: children }) }) - console.log(roleAndUser, 'zuihoushuju '); let roleLists = [] if (roleAndUser.length) { roleAndUser.forEach(e => { @@ -147,9 +142,7 @@ const EmployeeAuth = (props) => { setTwo(twos) } } - console.log(treeList, '权限树形结构') const onCheckAllChange = (value, recod) => { - console.log(value.target, '第二阶', recod); let selList = [] recod.child.forEach(i => { if (i.id == value.target.value) { @@ -179,7 +172,6 @@ const EmployeeAuth = (props) => { if (e.target.checked) { setCheckedList([...checkedList, ...check]) resourceList.rows.forEach(e => { - console.log(e, '==============', check[0]); if (e.id == check[0]) { twosid = e.parentId } @@ -191,7 +183,6 @@ const EmployeeAuth = (props) => { setCheckedList(getDiffer(checkedList, check)); } } - console.log(two, 'two'); const getDiffer = (arr1, arr2) => { let arr = arr1.filter(e => { return !arr2.includes(e) @@ -227,14 +218,13 @@ const EmployeeAuth = (props) => { let two = {} let checkList = [] if (res.payload.data && res.payload.data.rows.length) { - console.log(res.payload.data, '-------'); checkList = res.payload.data.rows.map(e => { two[e.resId] = true return e.resId }) setCheckedList(checkList) setTwo(two) - }else{ + } else { setCheckedList([]) setTwo(two) } @@ -243,9 +233,6 @@ const EmployeeAuth = (props) => { }) } const handlOk = () => { - console.log(roleId, '请求的角色id'); - console.log(checkedList, '请求三阶参数'); - console.log(two, '请求一二阶参数'); let resourceId = []; for (let item in two) { if (two[item]) { @@ -259,6 +246,8 @@ const EmployeeAuth = (props) => { dispatch(actions.humanAffairs.addRoleResource({ roleId, resourceId })) } } + + return ( <>
@@ -283,16 +272,17 @@ const EmployeeAuth = (props) => { 平台管理员由项企统一认证平台授权,拥有对本系统所有功能进行设置和管理。
-
- 人力资源部 -

姜珍

-

角色说明:拥有全平台的权限

-
-
- 人力资源部 -

郭菲

-

角色说明:拥有全平台的权限

-
+ { + hrUser && hrUser.adminHr && hrUser.adminHr.map(e => { + return ( +
+ 人力资源部 +

{e.name}

+

角色说明:拥有全平台的权限

+
+ ) + }) + }

角色授权