|
|
@ -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 = ( |
|
|
|
<ButtonGroup |
|
|
|
size="small" |
|
|
@ -58,7 +54,6 @@ const EmployeeAuth = (props) => { |
|
|
|
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 ( |
|
|
|
<> |
|
|
|
<div style={{ padding: '0px 12px' }}> |
|
|
@ -283,16 +272,17 @@ const EmployeeAuth = (props) => { |
|
|
|
<span>平台管理员由项企统一认证平台授权,拥有对本系统所有功能进行设置和管理。</span> |
|
|
|
</div> |
|
|
|
<div className='authorityAdminList'> |
|
|
|
{ |
|
|
|
hrUser && hrUser.adminHr && hrUser.adminHr.map(e => { |
|
|
|
return ( |
|
|
|
<div > |
|
|
|
<span>人力资源部</span> |
|
|
|
<h2>姜珍</h2> |
|
|
|
<h4>角色说明:拥有全平台的权限</h4> |
|
|
|
</div> |
|
|
|
<div > |
|
|
|
<span>人力资源部</span> |
|
|
|
<h2>郭菲</h2> |
|
|
|
<h2>{e.name}</h2> |
|
|
|
<h4>角色说明:拥有全平台的权限</h4> |
|
|
|
</div> |
|
|
|
) |
|
|
|
}) |
|
|
|
} |
|
|
|
</div> |
|
|
|
<div className='authorityTit'> |
|
|
|
<h2><b></b>角色授权</h2> |
|
|
|