巴林闲侠 2 years ago
parent
commit
f25a991ba2
  1. 44
      web/client/src/sections/install/components/memberModal.jsx
  2. 12
      web/client/src/sections/install/components/systemModal.jsx
  3. 111
      web/client/src/sections/install/containers/roles.jsx
  4. 4
      web/client/src/sections/install/containers/system.jsx

44
web/client/src/sections/install/components/memberModal.jsx

@ -13,6 +13,9 @@ function memberModal (props) {
actions, actions,
editObj, editObj,
memberEdit, memberEdit,
pomsList,
anxinDelete,
anxincloudArr
} = props; } = props;
const { install } = actions; const { install } = actions;
const form = useRef();// const form = useRef();//
@ -40,6 +43,7 @@ function memberModal (props) {
]); // ]); //
// //
useEffect(() => { useEffect(() => {
console.log('editObj',editObj);
if (editObj.id) { if (editObj.id) {
let departmentList = [] let departmentList = []
for (let i = 0; i < pepList.length; i++) { for (let i = 0; i < pepList.length; i++) {
@ -62,14 +66,14 @@ function memberModal (props) {
roleArr.splice(roleArr.indexOf('admin'), 1) roleArr.splice(roleArr.indexOf('admin'), 1)
} }
if (memberEdit) { if (memberEdit) {
dispatch(install.postOrganizationUser({ role: roleArr,pomsUserId: editObj.id, pepUserId: values.pepUserId, msg: '修改成员' })).then((res) => {//(PEP) dispatch(install.postOrganizationUser({ role: roleArr, correlationProject: values.correlationProject, pomsUserId: editObj.id, pepUserId: values.pepUserId, msg: '修改成员' })).then((res) => {//(PEP)
if (res.success) { if (res.success) {
close(); close();
} }
}) })
} }
else{ else {
dispatch(install.postOrganizationUser({ role: roleArr, pepUserId: values.pepUserId, msg: '新增成员' })).then((res) => {//(PEP) dispatch(install.postOrganizationUser({ role: roleArr, correlationProject: values.correlationProject, pepUserId: values.pepUserId, msg: '新增成员' })).then((res) => {//(PEP)
if (res.success) { if (res.success) {
close(); close();
} }
@ -201,22 +205,40 @@ function memberModal (props) {
label="关联项目:" label="关联项目:"
field="correlationProject" field="correlationProject"
multiple multiple
// placeholder="" placeholder="请选择关联项目"
initValue={anxincloudArr}
style={{ width: 417 }} style={{ width: 417 }}
// rules={[{ required: true, message: "" }]}
showClear showClear
> >
{/* { {
pepList.map((item, index) => { pomsList.map((item, index) => {
return ( return (
<Form.Select.Option key={item.id} value={index}> item.pepProjectIsDelete !== 1 ? (
{item.name} <Form.Select.Option key={index} value={item.id}>
</Form.Select.Option> {item.pepProjectName || item.name}
</Form.Select.Option>
) : ('')
) )
}) })
} */} }
</Form.Select> </Form.Select>
</div> </div>
{
anxinDelete?.length > 0 ? (
<div style={{ display: 'flex' }}>
<div style={{ marginTop: 3 }}>
<img src="/assets/images/install/risk.png" alt="" style={{ height: 24, width: 24, }} />
</div>
<div style={{
background: 'rgba(255, 51, 0, 0.28)', color: '#FF3300',
fontSize: 12, marginLeft: 8, lineHeight: 2, padding: '0px 5px',
border: '1px solid rgba(255,51,0,0.3)', width: 515
}}>
确定后{anxinDelete.join('、')}将被系统移除原因是项目已在项企中被删除
</div>
</div>
) : ('')
}
</Form> </Form>
</div> </div>
</Modal> </Modal>

12
web/client/src/sections/install/components/systemModal.jsx

@ -31,18 +31,6 @@ function adminModal (props) {
setCustom(true) setCustom(true)
setMyprojectType('axy') setMyprojectType('axy')
} }
// if (editObj.id) {
// let departmentList = []
// for (let i = 0; i < pepList.length; i++) {
// if (pepList[i].id == editObj.departments[0].id) {
// departmentList = pepList[i].users
// }
// }
// setPeopleList(departmentList)
// setDepartmentId(editObj.departments[0].id)
// setPeopleId(editObj.pepUserId)
// setDisablePeople(false)
// }
}, []); }, []);
function handleOk () { function handleOk () {

111
web/client/src/sections/install/containers/roles.jsx

@ -18,6 +18,8 @@ const Roles = (props) => {
const [editObj, setEditObj] = useState({});// const [editObj, setEditObj] = useState({});//
const [memberModal, setMemberModal] = useState(false);// const [memberModal, setMemberModal] = useState(false);//
const [memberEdit, setMemberEdit] = useState(false);// const [memberEdit, setMemberEdit] = useState(false);//
const [anxincloudArr, setAnxincloudArr] = useState([]) //
const [anxinDelete, setAnxinDelete] = useState([]) //,
const [columns, setColumns] = useState([// const [columns, setColumns] = useState([//
{ {
@ -33,11 +35,11 @@ const Roles = (props) => {
{row.name} {row.name}
</div> </div>
<div style={{ padding: '2px 4px', background: '#E8F3FF', borderRadius: 2, fontSize: 12, color: '#005ABD', marginLeft: 4 }}> <div style={{ padding: '2px 4px', background: '#E8F3FF', borderRadius: 2, fontSize: 12, color: '#005ABD', marginLeft: 4 }}>
{row.departments[0].name} {row?.departments[0]?.name || ''}
</div> </div>
{ {
row.departments.length > 1 ? ( row.departments.length > 1 ? (
<Tooltip content={departmentsArr.join(',')} trigger="click" style={{ lineHeight: 2 }}> <Tooltip content={departmentsArr.join(',')} trigger="click" style={{ lineHeight: 2 }}>
<div style={{ fontSize: 14, color: '#005ABD', marginLeft: 8, cursor: "pointer", }}> <div style={{ fontSize: 14, color: '#005ABD', marginLeft: 8, cursor: "pointer", }}>
+{row.departments.length - 1} +{row.departments.length - 1}
</div> </div>
@ -51,17 +53,75 @@ const Roles = (props) => {
{ {
title: '项目名称', title: '项目名称',
render: (_, row) => { 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 ( 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) => { row.correlationProject.map((item, index) => {
return ( return (
<div key={index}> <div className='myseparator' key={index} style={{ display: 'flex', alignItems: 'center' }}>
{item} {
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> </div>
) )
}) })
} }
{
row.correlationProject.length > 3 ? (
<Tooltip content={
<div style={{ display: 'flex', flexWrap: 'wrap', width: '100%' }}>
{
row.correlationProject.map((item, index) => {
return (
<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> </div>
) )
} }
@ -103,7 +163,7 @@ const Roles = (props) => {
title: ( title: (
<div style={{ display: 'flex', alignItems: 'center' }}> <div style={{ display: 'flex', alignItems: 'center' }}>
售后运维 售后运维
<Tooltip content={'拥有设备、问题、工单、资料相关的权限'} style={{ lineHeight: 2 }}> <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>
@ -136,7 +196,7 @@ const Roles = (props) => {
title: ( title: (
<div style={{ display: 'flex', alignItems: 'center' }}> <div style={{ display: 'flex', alignItems: 'center' }}>
资源管理者 资源管理者
<Tooltip content={'拥有资料、设备、工单相关的权限'} style={{ lineHeight: 2 }}> <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>
@ -169,7 +229,7 @@ const Roles = (props) => {
title: ( title: (
<div style={{ display: 'flex', alignItems: 'center' }}> <div style={{ display: 'flex', alignItems: 'center' }}>
客户服务 客户服务
<Tooltip content={'拥有服务、工单、资料相关的权限'} style={{ lineHeight: 2 }}> <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>
@ -211,7 +271,7 @@ const Roles = (props) => {
theme="borderless" theme="borderless"
style={{ color: '#F31C1C' }} style={{ color: '#F31C1C' }}
onClick={() => { 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 }) setQuery({ limit: 10, page: page.current })
}) })
}} }}
@ -225,7 +285,7 @@ const Roles = (props) => {
showArrow={true} showArrow={true}
position="topRight" position="topRight"
onConfirm={() => { 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 }) setQuery({ limit: 10, page: page.current })
}) })
}} }}
@ -236,6 +296,18 @@ const Roles = (props) => {
<Button <Button
theme="borderless" theme="borderless"
onClick={() => { 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); setMemberModal(true);
setEditObj(row) setEditObj(row)
setMemberEdit(true) setMemberEdit(true)
@ -249,7 +321,7 @@ const Roles = (props) => {
showArrow={true} showArrow={true}
position="topRight" position="topRight"
onConfirm={() => { 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) { if (page.current > 0 && mylimits.current < 2) {
setQuery({ limit: 10, page: page.current - 1 }) setQuery({ limit: 10, page: page.current - 1 })
} else { } else {
@ -271,6 +343,7 @@ const Roles = (props) => {
const [limits, setLimits] = useState()// const [limits, setLimits] = useState()//
const mylimits = useRef(); // const mylimits = useRef(); //
const [pepList, setPepList] = useState([])// const [pepList, setPepList] = useState([])//
const [pomsList, setPomsList] = useState([])//
useEffect(() => { useEffect(() => {
getUserList(); getUserList();
}, [query, roleChoose]); }, [query, roleChoose]);
@ -278,6 +351,11 @@ const Roles = (props) => {
dispatch(install.getOrganizationDeps()).then((res) => {//(PEP) dispatch(install.getOrganizationDeps()).then((res) => {//(PEP)
setPepList(res.payload.data) setPepList(res.payload.data)
}) })
dispatch(install.getProjectPoms()).then((res) => {//
if (res.success) {
setPomsList(res.payload.data.rows)
}
})
}, []) }, [])
function getUserList () { function getUserList () {
let searchData = { ...query, role: roleChoose } let searchData = { ...query, role: roleChoose }
@ -341,11 +419,11 @@ const Roles = (props) => {
<div key={idx} style={{ <div key={idx} style={{
background: '#52A4F6', borderRadius: 2, height: 18, padding: '2px 4px', background: '#52A4F6', borderRadius: 2, height: 18, padding: '2px 4px',
fontSize: 10, marginTop: 17, width: 'max-content', color: '#FFFFFF', 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 ? ( idx > 2 ? (
<Tooltip content={mydepartmentsArr.join(',')} style={{ lineHeight: 2 }}> <Tooltip content={mydepartmentsArr.join(',')} style={{ lineHeight: 2 }}>
<div style={{ fontSize: 14, cursor: "pointer", }}> <div style={{ fontSize: 14, cursor: "pointer", }}>
... ...
</div> </div>
@ -402,7 +480,7 @@ const Roles = (props) => {
showArrow={true} showArrow={true}
position="topRight" position="topRight"
onConfirm={() => { 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", }}> <div style={{ marginLeft: 4, cursor: "pointer", }}>
@ -459,6 +537,8 @@ const Roles = (props) => {
setEditObj({}) setEditObj({})
setMemberEdit(false) setMemberEdit(false)
setMemberModal(true); setMemberModal(true);
setAnxinDelete()
setAnxincloudArr()
}} }}
> >
添加成员 添加成员
@ -523,6 +603,9 @@ const Roles = (props) => {
pepList={pepList} pepList={pepList}
memberEdit={memberEdit} memberEdit={memberEdit}
editObj={editObj} editObj={editObj}
pomsList={pomsList}
anxinDelete={anxinDelete}
anxincloudArr={anxincloudArr}
close={() => { close={() => {
setMemberModal(false); setMemberModal(false);
getUserList() getUserList()

4
web/client/src/sections/install/containers/system.jsx

@ -63,7 +63,7 @@ const Example = (props) => {
}, [query]); }, [query]);
function getProjectPomsList () { function getProjectPomsList () {
dispatch(install.getProjectPoms(query)).then((res) => {// dispatch(install.getProjectPoms(query)).then((res) => {//
if (res.success) { if (res.success) {
let mytableData = JSON.parse(JSON.stringify(res.payload.data.rows)); let mytableData = JSON.parse(JSON.stringify(res.payload.data.rows));
let mytableKey = [] let mytableKey = []
@ -182,7 +182,7 @@ const Example = (props) => {
</Tooltip>) : ('') </Tooltip>) : ('')
} }
<Tooltip content={row.pepProjectName || row.name}> <Tooltip content={row.pepProjectName || row.name}>
<div style={{ width: row?.pepProjectName?.length > 7 || row?.name?.length > 7 ? '112px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}> <div style={{ color: row.pepProjectIsDelete == 1 ? 'rgb(249, 57, 32)' : '', width: row?.pepProjectName?.length > 7 || row?.name?.length > 7 ? '112px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>
{row.pepProjectName || row.name} {row.pepProjectName || row.name}
</div> </div>
</Tooltip> </Tooltip>

Loading…
Cancel
Save