|
|
@ -37,7 +37,7 @@ const Roles = (props) => { |
|
|
|
</div> |
|
|
|
{ |
|
|
|
row.departments.length > 1 ? ( |
|
|
|
<Tooltip content={departmentsArr.join(',')} trigger="click"> |
|
|
|
<Tooltip content={departmentsArr.join(',')} trigger="click" style={{ lineHeight: 2 }}> |
|
|
|
<div style={{ fontSize: 14, color: '#005ABD', marginLeft: 8, cursor: "pointer", }}> |
|
|
|
+{row.departments.length - 1} |
|
|
|
</div> |
|
|
@ -70,7 +70,7 @@ const Roles = (props) => { |
|
|
|
title: ( |
|
|
|
<div style={{ display: 'flex', alignItems: 'center' }}> |
|
|
|
数据分析师 |
|
|
|
<Tooltip content={'拥有分析、工单、资料的权限'}> |
|
|
|
<Tooltip content={'拥有数据分析、工单管理的权限、资料相关的权限'} style={{ lineHeight: 2 }}> |
|
|
|
<img src="/assets/images/install/table_question.png" alt="" style={{ height: 14, width: 14, marginLeft: 4 }} /> |
|
|
|
</Tooltip> |
|
|
|
</div> |
|
|
@ -103,7 +103,7 @@ const Roles = (props) => { |
|
|
|
title: ( |
|
|
|
<div style={{ display: 'flex', alignItems: 'center' }}> |
|
|
|
售后运维 |
|
|
|
<Tooltip content={'拥有问题、设备、工单、资料、一期控制台的权限'}> |
|
|
|
<Tooltip content={'拥有设备、问题、工单、资料相关的权限'} style={{ lineHeight: 2 }}> |
|
|
|
<img src="/assets/images/install/table_question.png" alt="" style={{ height: 14, width: 14, marginLeft: 4 }} /> |
|
|
|
</Tooltip> |
|
|
|
</div> |
|
|
@ -135,8 +135,8 @@ const Roles = (props) => { |
|
|
|
}, { |
|
|
|
title: ( |
|
|
|
<div style={{ display: 'flex', alignItems: 'center' }}> |
|
|
|
资源管理员 |
|
|
|
<Tooltip content={'拥有资料、工单的权限'}> |
|
|
|
资源管理者 |
|
|
|
<Tooltip content={'拥有资料、设备、工单相关的权限'} style={{ lineHeight: 2 }}> |
|
|
|
<img src="/assets/images/install/table_question.png" alt="" style={{ height: 14, width: 14, marginLeft: 4 }} /> |
|
|
|
</Tooltip> |
|
|
|
</div> |
|
|
@ -169,7 +169,7 @@ const Roles = (props) => { |
|
|
|
title: ( |
|
|
|
<div style={{ display: 'flex', alignItems: 'center' }}> |
|
|
|
客户服务 |
|
|
|
<Tooltip content={'拥有服务、工单的权限'}> |
|
|
|
<Tooltip content={'拥有服务、工单、资料相关的权限'} style={{ lineHeight: 2 }}> |
|
|
|
<img src="/assets/images/install/table_question.png" alt="" style={{ height: 14, width: 14, marginLeft: 4 }} /> |
|
|
|
</Tooltip> |
|
|
|
</div> |
|
|
@ -209,11 +209,12 @@ const Roles = (props) => { |
|
|
|
{row?.disabled ? ( |
|
|
|
<Button |
|
|
|
theme="borderless" |
|
|
|
style={{ color: '#F31C1C' }} |
|
|
|
onClick={() => { |
|
|
|
dispatch(install.putOrganizationUser({ pomsUserId: row?.id, disabled: !row?.disabled })).then(() => getUserList()) |
|
|
|
dispatch(install.putOrganizationUser({ pomsUserId: row?.id, disabled: !row?.disabled,msg:'更新成员状态' })).then(() => getUserList()) |
|
|
|
}} |
|
|
|
> |
|
|
|
启用 |
|
|
|
已禁用 |
|
|
|
</Button> |
|
|
|
) : ( |
|
|
|
<Popconfirm |
|
|
@ -222,12 +223,12 @@ const Roles = (props) => { |
|
|
|
showArrow={true} |
|
|
|
position="topRight" |
|
|
|
onConfirm={() => { |
|
|
|
dispatch(install.putOrganizationUser({ pomsUserId: row?.id, disabled: !row?.disabled })).then(() => { |
|
|
|
dispatch(install.putOrganizationUser({ pomsUserId: row?.id, disabled: !row?.disabled,msg:'更新成员状态' })).then(() => { |
|
|
|
getUserList(); |
|
|
|
}) |
|
|
|
}} |
|
|
|
> |
|
|
|
<Button theme="borderless">禁用</Button> |
|
|
|
<Button theme="borderless">已启用</Button> |
|
|
|
</Popconfirm> |
|
|
|
)} |
|
|
|
<Button |
|
|
@ -246,8 +247,8 @@ const Roles = (props) => { |
|
|
|
showArrow={true} |
|
|
|
position="topRight" |
|
|
|
onConfirm={() => { |
|
|
|
dispatch(install.putOrganizationUser({ pomsUserId: row?.id, deleted: true })).then(() => { |
|
|
|
if (page.current > 0 && limits.current < 2) { |
|
|
|
dispatch(install.putOrganizationUser({ pomsUserId: row?.id, deleted: true,msg:'删除成员' })).then(() => { |
|
|
|
if (page.current > 0 && mylimits.current < 2) { |
|
|
|
setQuery({ limit: 10, page: page.current - 1 }) |
|
|
|
} else { |
|
|
|
setQuery({ limit: 10, page: page.current }) |
|
|
@ -265,7 +266,8 @@ const Roles = (props) => { |
|
|
|
// const [data, setdata] = useState([])//表格数据 |
|
|
|
const tableData = useRef([]); //每页实际条数 |
|
|
|
const page = useRef(query.page);//哪一页 |
|
|
|
const limits = useRef(); //每页实际条数 |
|
|
|
const [limits, setLimits] = useState()//每页实际条数 |
|
|
|
const mylimits = useRef(); //每页实际条数 |
|
|
|
const [pepList, setPepList] = useState([])//角色分配 |
|
|
|
useEffect(() => { |
|
|
|
getUserList(); |
|
|
@ -274,11 +276,11 @@ const Roles = (props) => { |
|
|
|
dispatch(install.getOrganizationDeps()).then((res) => {//获取项企(PEP)全部部门及其下用户 |
|
|
|
setPepList(res.payload.data) |
|
|
|
}) |
|
|
|
getUserList() |
|
|
|
}, []) |
|
|
|
function getUserList () { |
|
|
|
let searchData = { ...query, role: roleChoose } |
|
|
|
dispatch(install.getOrganizationUser(searchData)).then((res) => {//获取成员列表 |
|
|
|
if (res.success) { |
|
|
|
tableData.current = res.payload.data.users.rows; |
|
|
|
let notCreatedArr = [] |
|
|
|
let notCreatedNum = 5 - res.payload.data.admin.length |
|
|
@ -286,7 +288,9 @@ const Roles = (props) => { |
|
|
|
notCreatedArr.push('') |
|
|
|
} |
|
|
|
setRoleAssignment(res.payload.data.admin.concat(notCreatedArr)) |
|
|
|
limits.current = res.payload.data.users.count |
|
|
|
setLimits(res.payload.data.users.count) |
|
|
|
mylimits.current = res.payload.data.users.rows.length |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
function handleRow (record, index) {//斑马条纹 |
|
|
@ -317,8 +321,8 @@ const Roles = (props) => { |
|
|
|
{ |
|
|
|
roleAssignment.map((item, index) => { |
|
|
|
return ( |
|
|
|
<div key={index} style={{ |
|
|
|
width: 312, height: 127, boxShadow: '0px 0px 12px 2px rgba(220,222,224,0.2)', |
|
|
|
<div key={index} className='adminTop' style={{ |
|
|
|
width: 312, height: 127, |
|
|
|
borderRadius: 2, background: "url(/assets/images/install/cardBackground0" + (index + 1) + '.png)', |
|
|
|
backgroundSize: "100% 100%", marginRight: 20, marginBottom: 20, |
|
|
|
}}> |
|
|
@ -327,7 +331,7 @@ const Roles = (props) => { |
|
|
|
<div style={{ display: 'flex', marginLeft: 21, }}> |
|
|
|
{ |
|
|
|
item.departments?.map((itm, idx) => { |
|
|
|
let mydepartmentsArr=[] |
|
|
|
let mydepartmentsArr = [] |
|
|
|
for (let index = 0; index < item.departments.length; index++) { |
|
|
|
mydepartmentsArr.push(item.departments[index].name) |
|
|
|
} |
|
|
@ -335,11 +339,11 @@ const Roles = (props) => { |
|
|
|
<div key={idx} style={{ |
|
|
|
background: '#52A4F6', borderRadius: 2, height: 18, padding: '2px 4px', |
|
|
|
fontSize: 10, marginTop: 17, width: 'max-content', color: '#FFFFFF', |
|
|
|
display: 'flex', alignItems: 'center', marginRight: 4, |
|
|
|
alignItems: 'center', marginRight: 4,display:idx>3?'none':'flex' |
|
|
|
}}> |
|
|
|
{ |
|
|
|
idx > 2 ? ( |
|
|
|
<Tooltip content={mydepartmentsArr.join(',')}> |
|
|
|
<Tooltip content={mydepartmentsArr.join(',')} style={{ lineHeight: 2 }}> |
|
|
|
<div style={{ fontSize: 14, cursor: "pointer", }}> |
|
|
|
... |
|
|
|
</div> |
|
|
@ -396,7 +400,7 @@ const Roles = (props) => { |
|
|
|
showArrow={true} |
|
|
|
position="topRight" |
|
|
|
onConfirm={() => { |
|
|
|
dispatch(install.deteleOrganizationAdmin(item?.id)).then(() => getUserList()) |
|
|
|
dispatch(install.deteleOrganizationAdmin({id:item.id,msg:'删除管理员'})).then(() => getUserList()) |
|
|
|
}} |
|
|
|
> |
|
|
|
<div style={{ marginLeft: 4, cursor: "pointer", }}> |
|
|
@ -482,11 +486,11 @@ const Roles = (props) => { |
|
|
|
}} |
|
|
|
> |
|
|
|
<span style={{ lineHeight: "30px", fontSize: 13, color: 'rgba(0,90,189,0.8)' }}> |
|
|
|
共{limits.current}条信息 |
|
|
|
共{limits}条信息 |
|
|
|
</span> |
|
|
|
<Pagination |
|
|
|
className="22" |
|
|
|
total={limits.current} |
|
|
|
total={limits} |
|
|
|
showSizeChanger |
|
|
|
currentPage={query.page + 1} |
|
|
|
pageSizeOpts={[10, 20, 30, 40]} |
|
|
|