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

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

@ -13,6 +13,9 @@ function memberModal (props) {
actions,
editObj,
memberEdit,
pomsList,
anxinDelete,
anxincloudArr
} = props;
const { install } = actions;
const form = useRef();//
@ -40,6 +43,7 @@ function memberModal (props) {
]); //
//
useEffect(() => {
console.log('editObj',editObj);
if (editObj.id) {
let departmentList = []
for (let i = 0; i < pepList.length; i++) {
@ -62,14 +66,14 @@ function memberModal (props) {
roleArr.splice(roleArr.indexOf('admin'), 1)
}
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) {
close();
}
})
}
else{
dispatch(install.postOrganizationUser({ role: roleArr, pepUserId: values.pepUserId, msg: '新增成员' })).then((res) => {//(PEP)
else {
dispatch(install.postOrganizationUser({ role: roleArr, correlationProject: values.correlationProject, pepUserId: values.pepUserId, msg: '新增成员' })).then((res) => {//(PEP)
if (res.success) {
close();
}
@ -201,22 +205,40 @@ function memberModal (props) {
label="关联项目:"
field="correlationProject"
multiple
// placeholder=""
placeholder="请选择关联项目"
initValue={anxincloudArr}
style={{ width: 417 }}
// rules={[{ required: true, message: "" }]}
showClear
>
{/* {
pepList.map((item, index) => {
{
pomsList.map((item, index) => {
return (
<Form.Select.Option key={item.id} value={index}>
{item.name}
item.pepProjectIsDelete !== 1 ? (
<Form.Select.Option key={index} value={item.id}>
{item.pepProjectName || item.name}
</Form.Select.Option>
) : ('')
)
})
} */}
}
</Form.Select>
</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>
</div>
</Modal>

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

@ -31,18 +31,6 @@ function adminModal (props) {
setCustom(true)
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 () {

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

@ -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()

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

@ -63,7 +63,7 @@ const Example = (props) => {
}, [query]);
function getProjectPomsList () {
dispatch(install.getProjectPoms(query)).then((res) => {//
dispatch(install.getProjectPoms(query)).then((res) => {//
if (res.success) {
let mytableData = JSON.parse(JSON.stringify(res.payload.data.rows));
let mytableKey = []
@ -182,7 +182,7 @@ const Example = (props) => {
</Tooltip>) : ('')
}
<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}
</div>
</Tooltip>

Loading…
Cancel
Save