|
|
@ -18,6 +18,8 @@ const Roles = (props) => { |
|
|
|
const [editObj, setEditObj] = useState({});//管理员弹框修改内容 |
|
|
|
const [memberModal, setMemberModal] = useState(false);//成员弹框 |
|
|
|
const [memberEdit, setMemberEdit] = useState(false);//成员弹框是否修改 |
|
|
|
const [anxincloudArr, setAnxincloudArr] = useState([]) //修改时已经选择的安心云列表 |
|
|
|
const [anxinDelete, setAnxinDelete] = useState([]) //修改时安心云项目有删除,显示提示信息 |
|
|
|
|
|
|
|
const [columns, setColumns] = useState([//表格属性 |
|
|
|
{ |
|
|
@ -33,7 +35,7 @@ const Roles = (props) => { |
|
|
|
{row.name} |
|
|
|
</div> |
|
|
|
<div style={{ padding: '2px 4px', background: '#E8F3FF', borderRadius: 2, fontSize: 12, color: '#005ABD', marginLeft: 4 }}> |
|
|
|
{row.departments[0].name} |
|
|
|
{row?.departments[0]?.name || ''} |
|
|
|
</div> |
|
|
|
{ |
|
|
|
row.departments.length > 1 ? ( |
|
|
@ -51,18 +53,76 @@ const Roles = (props) => { |
|
|
|
{ |
|
|
|
title: '项目名称', |
|
|
|
render: (_, row) => { |
|
|
|
let anxinerror = false |
|
|
|
let anxinerrorArr = [] |
|
|
|
for (let i = 0; i < row.correlationProject.length; i++) { |
|
|
|
if (row.correlationProject[i].del == -1) { |
|
|
|
anxinerror = true |
|
|
|
anxinerrorArr.push(row.correlationProject[i].pepProjectName) |
|
|
|
} |
|
|
|
} |
|
|
|
return ( |
|
|
|
<div> |
|
|
|
<div style={{ display: 'flex', alignItems: 'center' }}> |
|
|
|
{ |
|
|
|
anxinerror ? ( |
|
|
|
<Tooltip content={anxinerrorArr.join(',') + ',项目已在【项企PEP】中被删除!'}> |
|
|
|
<div style={{ marginRight: 5 }}> |
|
|
|
<img src="/assets/images/install/risk.png" alt="" style={{ height: 24, width: 24, }} /> |
|
|
|
</div> |
|
|
|
</Tooltip>) : ('') |
|
|
|
} |
|
|
|
{ |
|
|
|
row.correlationProject.map((item, index) => { |
|
|
|
return ( |
|
|
|
<div className='myseparator' key={index} style={{ display: 'flex', alignItems: 'center' }}> |
|
|
|
{ |
|
|
|
row.correlationProject.length >= 3 ? ( |
|
|
|
<Tooltip content={item.pepProjectName}> |
|
|
|
<div style={{ width: item.pepProjectName.length > 7 ? '112px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', display: index > 2 ? 'none' : '', color: item.del ? '#F93920' : '' }}> |
|
|
|
{item.pepProjectName} |
|
|
|
</div> |
|
|
|
</Tooltip> |
|
|
|
) : row.correlationProject.length == 2 ? ( |
|
|
|
<Tooltip content={item.pepProjectName}> |
|
|
|
<div style={{ width: item.pepProjectName.length > 12 ? '173.5px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', color: item.del ? '#F93920' : '' }}> |
|
|
|
{item.pepProjectName} |
|
|
|
</div> |
|
|
|
</Tooltip> |
|
|
|
) : ( |
|
|
|
<Tooltip content={item.pepProjectName}> |
|
|
|
<div style={{ width: item.pepProjectName.length > 25 ? '358px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', color: item.del ? '#F93920' : '' }}> |
|
|
|
{item.pepProjectName} |
|
|
|
</div> |
|
|
|
</Tooltip> |
|
|
|
) |
|
|
|
} |
|
|
|
<div className='separator' style={{ width: 1, height: 12, border: '1px solid #DCDEE0', margin: '0px 10px', display: index > 1 ? 'none' : '' }}></div> |
|
|
|
</div> |
|
|
|
) |
|
|
|
}) |
|
|
|
} |
|
|
|
{ |
|
|
|
row.correlationProject.length > 3 ? ( |
|
|
|
<Tooltip content={ |
|
|
|
<div style={{ display: 'flex', flexWrap: 'wrap', width: '100%' }}> |
|
|
|
{ |
|
|
|
row.correlationProject.map((item, index) => { |
|
|
|
return ( |
|
|
|
<div key={index}> |
|
|
|
{item} |
|
|
|
<div key={index} style={{ color: item.del ? '#F93920' : '' }}> |
|
|
|
{item.pepProjectName}<span style={{ color: '#FFFFFF' }}>,</span> |
|
|
|
</div> |
|
|
|
) |
|
|
|
}) |
|
|
|
} |
|
|
|
</div> |
|
|
|
} trigger="click" style={{ lineHeight: 2 }}> |
|
|
|
<div style={{ fontSize: 14, color: '#005ABD', marginLeft: 8, cursor: "pointer", }}> |
|
|
|
+{row.correlationProject.length - 3} |
|
|
|
</div> |
|
|
|
</Tooltip> |
|
|
|
) : ('') |
|
|
|
} |
|
|
|
</div> |
|
|
|
) |
|
|
|
} |
|
|
|
}, |
|
|
@ -211,7 +271,7 @@ const Roles = (props) => { |
|
|
|
theme="borderless" |
|
|
|
style={{ color: '#F31C1C' }} |
|
|
|
onClick={() => { |
|
|
|
dispatch(install.putOrganizationUser({ pomsUserId: row?.id, disabled: !row?.disabled,msg:'更新成员状态' })).then(() => { |
|
|
|
dispatch(install.putOrganizationUser({ pomsUserId: row?.id, disabled: !row?.disabled, msg: '更新成员状态' })).then(() => { |
|
|
|
setQuery({ limit: 10, page: page.current }) |
|
|
|
}) |
|
|
|
}} |
|
|
@ -225,7 +285,7 @@ const Roles = (props) => { |
|
|
|
showArrow={true} |
|
|
|
position="topRight" |
|
|
|
onConfirm={() => { |
|
|
|
dispatch(install.putOrganizationUser({ pomsUserId: row?.id, disabled: !row?.disabled,msg:'更新成员状态' })).then(() => { |
|
|
|
dispatch(install.putOrganizationUser({ pomsUserId: row?.id, disabled: !row?.disabled, msg: '更新成员状态' })).then(() => { |
|
|
|
setQuery({ limit: 10, page: page.current }) |
|
|
|
}) |
|
|
|
}} |
|
|
@ -236,6 +296,18 @@ const Roles = (props) => { |
|
|
|
<Button |
|
|
|
theme="borderless" |
|
|
|
onClick={() => { |
|
|
|
let myanxinArr = [] |
|
|
|
let anxinErrorList = [] |
|
|
|
for (let i = 0; i < row.correlationProject.length; i++) { |
|
|
|
if (row.correlationProject[i].del) { |
|
|
|
anxinErrorList.push(row.correlationProject[i].pepProjectName) |
|
|
|
} |
|
|
|
else { |
|
|
|
myanxinArr.push(row.correlationProject[i].id) |
|
|
|
} |
|
|
|
} |
|
|
|
setAnxinDelete(anxinErrorList) |
|
|
|
setAnxincloudArr(myanxinArr) |
|
|
|
setMemberModal(true); |
|
|
|
setEditObj(row) |
|
|
|
setMemberEdit(true) |
|
|
@ -249,7 +321,7 @@ const Roles = (props) => { |
|
|
|
showArrow={true} |
|
|
|
position="topRight" |
|
|
|
onConfirm={() => { |
|
|
|
dispatch(install.putOrganizationUser({ pomsUserId: row?.id, deleted: true,msg:'删除成员' })).then(() => { |
|
|
|
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 { |
|
|
@ -271,6 +343,7 @@ const Roles = (props) => { |
|
|
|
const [limits, setLimits] = useState()//每页实际条数 |
|
|
|
const mylimits = useRef(); //每页实际条数 |
|
|
|
const [pepList, setPepList] = useState([])//角色分配 |
|
|
|
const [pomsList, setPomsList] = useState([])//已绑定项目列表 |
|
|
|
useEffect(() => { |
|
|
|
getUserList(); |
|
|
|
}, [query, roleChoose]); |
|
|
@ -278,6 +351,11 @@ const Roles = (props) => { |
|
|
|
dispatch(install.getOrganizationDeps()).then((res) => {//获取项企(PEP)全部部门及其下用户 |
|
|
|
setPepList(res.payload.data) |
|
|
|
}) |
|
|
|
dispatch(install.getProjectPoms()).then((res) => {//获取已绑定项目 |
|
|
|
if (res.success) { |
|
|
|
setPomsList(res.payload.data.rows) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, []) |
|
|
|
function getUserList () { |
|
|
|
let searchData = { ...query, role: roleChoose } |
|
|
@ -341,7 +419,7 @@ 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', |
|
|
|
alignItems: 'center', marginRight: 4,display:idx>3?'none':'flex' |
|
|
|
alignItems: 'center', marginRight: 4, display: idx > 3 ? 'none' : 'flex' |
|
|
|
}}> |
|
|
|
{ |
|
|
|
idx > 2 ? ( |
|
|
@ -402,7 +480,7 @@ const Roles = (props) => { |
|
|
|
showArrow={true} |
|
|
|
position="topRight" |
|
|
|
onConfirm={() => { |
|
|
|
dispatch(install.deteleOrganizationAdmin({id:item.id,msg:'删除管理员'})).then(() => getUserList()) |
|
|
|
dispatch(install.deteleOrganizationAdmin({ id: item.id, msg: '删除管理员' })).then(() => getUserList()) |
|
|
|
}} |
|
|
|
> |
|
|
|
<div style={{ marginLeft: 4, cursor: "pointer", }}> |
|
|
@ -459,6 +537,8 @@ const Roles = (props) => { |
|
|
|
setEditObj({}) |
|
|
|
setMemberEdit(false) |
|
|
|
setMemberModal(true); |
|
|
|
setAnxinDelete() |
|
|
|
setAnxincloudArr() |
|
|
|
}} |
|
|
|
> |
|
|
|
添加成员 |
|
|
@ -523,6 +603,9 @@ const Roles = (props) => { |
|
|
|
pepList={pepList} |
|
|
|
memberEdit={memberEdit} |
|
|
|
editObj={editObj} |
|
|
|
pomsList={pomsList} |
|
|
|
anxinDelete={anxinDelete} |
|
|
|
anxincloudArr={anxincloudArr} |
|
|
|
close={() => { |
|
|
|
setMemberModal(false); |
|
|
|
getUserList() |
|
|
|