|
@ -70,7 +70,7 @@ const Roles = (props) => { |
|
|
title: ( |
|
|
title: ( |
|
|
<div style={{ display: 'flex', alignItems: 'center' }}> |
|
|
<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 }} /> |
|
|
<img src="/assets/images/install/table_question.png" alt="" style={{ height: 14, width: 14, marginLeft: 4 }} /> |
|
|
</Tooltip> |
|
|
</Tooltip> |
|
|
</div> |
|
|
</div> |
|
@ -103,7 +103,7 @@ const Roles = (props) => { |
|
|
title: ( |
|
|
title: ( |
|
|
<div style={{ display: 'flex', alignItems: 'center' }}> |
|
|
<div style={{ display: 'flex', alignItems: 'center' }}> |
|
|
售后运维 |
|
|
售后运维 |
|
|
<Tooltip content={'拥有问题、设备、工单、资料、一期控制台的权限'}> |
|
|
<Tooltip content={'拥有设备、问题、工单、资料相关的权限'}> |
|
|
<img src="/assets/images/install/table_question.png" alt="" style={{ height: 14, width: 14, marginLeft: 4 }} /> |
|
|
<img src="/assets/images/install/table_question.png" alt="" style={{ height: 14, width: 14, marginLeft: 4 }} /> |
|
|
</Tooltip> |
|
|
</Tooltip> |
|
|
</div> |
|
|
</div> |
|
@ -135,8 +135,8 @@ const Roles = (props) => { |
|
|
}, { |
|
|
}, { |
|
|
title: ( |
|
|
title: ( |
|
|
<div style={{ display: 'flex', alignItems: 'center' }}> |
|
|
<div style={{ display: 'flex', alignItems: 'center' }}> |
|
|
资源管理员 |
|
|
资源管理者 |
|
|
<Tooltip content={'拥有资料、工单的权限'}> |
|
|
<Tooltip content={'拥有资料、设备、工单相关的权限'}> |
|
|
<img src="/assets/images/install/table_question.png" alt="" style={{ height: 14, width: 14, marginLeft: 4 }} /> |
|
|
<img src="/assets/images/install/table_question.png" alt="" style={{ height: 14, width: 14, marginLeft: 4 }} /> |
|
|
</Tooltip> |
|
|
</Tooltip> |
|
|
</div> |
|
|
</div> |
|
@ -169,7 +169,7 @@ const Roles = (props) => { |
|
|
title: ( |
|
|
title: ( |
|
|
<div style={{ display: 'flex', alignItems: 'center' }}> |
|
|
<div style={{ display: 'flex', alignItems: 'center' }}> |
|
|
客户服务 |
|
|
客户服务 |
|
|
<Tooltip content={'拥有服务、工单的权限'}> |
|
|
<Tooltip content={'拥有服务、工单、资料相关的权限'}> |
|
|
<img src="/assets/images/install/table_question.png" alt="" style={{ height: 14, width: 14, marginLeft: 4 }} /> |
|
|
<img src="/assets/images/install/table_question.png" alt="" style={{ height: 14, width: 14, marginLeft: 4 }} /> |
|
|
</Tooltip> |
|
|
</Tooltip> |
|
|
</div> |
|
|
</div> |
|
@ -209,11 +209,12 @@ const Roles = (props) => { |
|
|
{row?.disabled ? ( |
|
|
{row?.disabled ? ( |
|
|
<Button |
|
|
<Button |
|
|
theme="borderless" |
|
|
theme="borderless" |
|
|
|
|
|
style={{ color: '#F31C1C' }} |
|
|
onClick={() => { |
|
|
onClick={() => { |
|
|
dispatch(install.putOrganizationUser({ pomsUserId: row?.id, disabled: !row?.disabled })).then(() => getUserList()) |
|
|
dispatch(install.putOrganizationUser({ pomsUserId: row?.id, disabled: !row?.disabled })).then(() => getUserList()) |
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
启用 |
|
|
已禁用 |
|
|
</Button> |
|
|
</Button> |
|
|
) : ( |
|
|
) : ( |
|
|
<Popconfirm |
|
|
<Popconfirm |
|
@ -227,7 +228,7 @@ const Roles = (props) => { |
|
|
}) |
|
|
}) |
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
<Button theme="borderless">禁用</Button> |
|
|
<Button theme="borderless">已启用</Button> |
|
|
</Popconfirm> |
|
|
</Popconfirm> |
|
|
)} |
|
|
)} |
|
|
<Button |
|
|
<Button |
|
@ -247,7 +248,7 @@ const Roles = (props) => { |
|
|
position="topRight" |
|
|
position="topRight" |
|
|
onConfirm={() => { |
|
|
onConfirm={() => { |
|
|
dispatch(install.putOrganizationUser({ pomsUserId: row?.id, deleted: true })).then(() => { |
|
|
dispatch(install.putOrganizationUser({ pomsUserId: row?.id, deleted: true })).then(() => { |
|
|
if (page.current > 0 && limits.current < 2) { |
|
|
if (page.current > 0 && mylimits.current < 2) { |
|
|
setQuery({ limit: 10, page: page.current - 1 }) |
|
|
setQuery({ limit: 10, page: page.current - 1 }) |
|
|
} else { |
|
|
} else { |
|
|
setQuery({ limit: 10, page: page.current }) |
|
|
setQuery({ limit: 10, page: page.current }) |
|
@ -265,7 +266,8 @@ const Roles = (props) => { |
|
|
// const [data, setdata] = useState([])//表格数据 |
|
|
// const [data, setdata] = useState([])//表格数据 |
|
|
const tableData = useRef([]); //每页实际条数 |
|
|
const tableData = useRef([]); //每页实际条数 |
|
|
const page = useRef(query.page);//哪一页 |
|
|
const page = useRef(query.page);//哪一页 |
|
|
const limits = useRef(); //每页实际条数 |
|
|
const [limits, setLimits] = useState()//每页实际条数 |
|
|
|
|
|
const mylimits = useRef(); //每页实际条数 |
|
|
const [pepList, setPepList] = useState([])//角色分配 |
|
|
const [pepList, setPepList] = useState([])//角色分配 |
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
getUserList(); |
|
|
getUserList(); |
|
@ -279,6 +281,7 @@ const Roles = (props) => { |
|
|
function getUserList () { |
|
|
function getUserList () { |
|
|
let searchData = { ...query, role: roleChoose } |
|
|
let searchData = { ...query, role: roleChoose } |
|
|
dispatch(install.getOrganizationUser(searchData)).then((res) => {//获取成员列表 |
|
|
dispatch(install.getOrganizationUser(searchData)).then((res) => {//获取成员列表 |
|
|
|
|
|
if (res.success) { |
|
|
tableData.current = res.payload.data.users.rows; |
|
|
tableData.current = res.payload.data.users.rows; |
|
|
let notCreatedArr = [] |
|
|
let notCreatedArr = [] |
|
|
let notCreatedNum = 5 - res.payload.data.admin.length |
|
|
let notCreatedNum = 5 - res.payload.data.admin.length |
|
@ -286,7 +289,9 @@ const Roles = (props) => { |
|
|
notCreatedArr.push('') |
|
|
notCreatedArr.push('') |
|
|
} |
|
|
} |
|
|
setRoleAssignment(res.payload.data.admin.concat(notCreatedArr)) |
|
|
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) {//斑马条纹 |
|
|
function handleRow (record, index) {//斑马条纹 |
|
@ -327,7 +332,7 @@ const Roles = (props) => { |
|
|
<div style={{ display: 'flex', marginLeft: 21, }}> |
|
|
<div style={{ display: 'flex', marginLeft: 21, }}> |
|
|
{ |
|
|
{ |
|
|
item.departments?.map((itm, idx) => { |
|
|
item.departments?.map((itm, idx) => { |
|
|
let mydepartmentsArr=[] |
|
|
let mydepartmentsArr = [] |
|
|
for (let index = 0; index < item.departments.length; index++) { |
|
|
for (let index = 0; index < item.departments.length; index++) { |
|
|
mydepartmentsArr.push(item.departments[index].name) |
|
|
mydepartmentsArr.push(item.departments[index].name) |
|
|
} |
|
|
} |
|
@ -482,11 +487,11 @@ const Roles = (props) => { |
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
<span style={{ lineHeight: "30px", fontSize: 13, color: 'rgba(0,90,189,0.8)' }}> |
|
|
<span style={{ lineHeight: "30px", fontSize: 13, color: 'rgba(0,90,189,0.8)' }}> |
|
|
共{limits.current}条信息 |
|
|
共{limits}条信息 |
|
|
</span> |
|
|
</span> |
|
|
<Pagination |
|
|
<Pagination |
|
|
className="22" |
|
|
className="22" |
|
|
total={limits.current} |
|
|
total={limits} |
|
|
showSizeChanger |
|
|
showSizeChanger |
|
|
currentPage={query.page + 1} |
|
|
currentPage={query.page + 1} |
|
|
pageSizeOpts={[10, 20, 30, 40]} |
|
|
pageSizeOpts={[10, 20, 30, 40]} |
|
|