|
|
@ -32,12 +32,13 @@ const Header = (props) => { |
|
|
|
modalRole = headerItems?.filter(v => modal.includes(v.itemKey)) |
|
|
|
if (userRole?.includes('SuperAdmin') || userRole?.includes('admin')) modalRole = headerItems |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
if (JSON.parse(sessionStorage.getItem('pomsUser'))?.token) { |
|
|
|
dispatch(install.getProjectPoms({ global: 1 })).then((res) => { //获取已绑定项目 |
|
|
|
if (res.success) { |
|
|
|
setPomsList(res.payload.data?.rows?.filter(v => v.pepProjectIsDelete == 0)) |
|
|
|
let data = res.payload.data?.rows?.filter(v => v.pepProjectIsDelete !== 1)?.map(v => ({ pepProjectId: v.id, pepProjectName: v.pepProjectName || v.name })) |
|
|
|
setPomsList(data) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
@ -57,7 +58,6 @@ const Header = (props) => { |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
dispatch(pepProject(pepProjectId)) |
|
|
|
console.log(); |
|
|
|
}, [pepProjectId]) |
|
|
|
|
|
|
|
|
|
|
@ -95,6 +95,7 @@ const Header = (props) => { |
|
|
|
<Dropdown |
|
|
|
onVisibleChange={(v) => { |
|
|
|
setScrollbar(!Scrollbar) |
|
|
|
setKeyword('') |
|
|
|
}} |
|
|
|
render={ |
|
|
|
<Dropdown.Menu style={{ minWidth: 270, maxWidth: 714, padding: 20, fontSize: 12 }}> |
|
|
@ -106,7 +107,7 @@ const Header = (props) => { |
|
|
|
{pomsList?.length > 0 ? |
|
|
|
pomsList.filter(u => u.pepProjectName?.includes(keyword))?.map(v => { |
|
|
|
return <Dropdown.Item |
|
|
|
key={'pomsList' + v.id} |
|
|
|
key={'pomsList' + v.pepProjectId} |
|
|
|
style={{ width: 224, overflow: 'hidden', borderBottom: '', display: "inline-block", whiteSpace: 'nowrap', color: 'rgb(0, 90, 189)' }}> |
|
|
|
|
|
|
|
{ |
|
|
@ -115,14 +116,13 @@ const Header = (props) => { |
|
|
|
<div onClick={() => { |
|
|
|
console.log(v.pepProjectId); |
|
|
|
setPomsName(v.pepProjectName) |
|
|
|
setPepProjectId(v.pepProjectId) |
|
|
|
setPepProjectId(v.id) |
|
|
|
}}> |
|
|
|
{v.pepProjectName?.length > 15 ? `${v.pepProjectName?.substr(0, 15)}` : v.pepProjectName} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</Tooltip> |
|
|
|
: <div onClick={() => { |
|
|
|
console.log(v.pepProjectId); |
|
|
|
setPomsName(v.pepProjectName) |
|
|
|
setPepProjectId(v.pepProjectId) |
|
|
|
}}>{v.pepProjectName}</div> |
|
|
|