Browse Source

选择多个项目

dev
wenlele 2 years ago
parent
commit
4fffb881b9
  1. 2
      web/client/src/sections/problem/components/tableData.jsx
  2. 4
      web/client/src/sections/service/components/pushModal.jsx
  3. 38
      web/client/src/sections/service/containers/emPush.jsx

2
web/client/src/sections/problem/components/tableData.jsx

@ -379,7 +379,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
placeholder={SkeletonScreen()} placeholder={SkeletonScreen()}
> >
{(() => { {(() => {
// console.log(tableData); // console.log(route);
return <Table return <Table
columns={exhibition} columns={exhibition}
dataSource={route == 'useAbnormal' || route == 'videoAbnormal' ? tableData.slice(query.page * query.limit, (query.page + 1) * query.limit) || [] : tableData} dataSource={route == 'useAbnormal' || route == 'videoAbnormal' ? tableData.slice(query.page * query.limit, (query.page + 1) * query.limit) || [] : tableData}

4
web/client/src/sections/service/components/pushModal.jsx

@ -74,7 +74,7 @@ function pushModal (props) {
}) })
} }
function getProjectStructureList (value) {// function getProjectStructureList (value) {//
dispatch(service.getProjectStructure({ pomsProjectId: value })).then((res) => { dispatch(service.getProjectStructure({ pomsProjectId:value.join(',') })).then((res) => {
if (res.success) { if (res.success) {
let mylist = [] let mylist = []
for (let i = 0; i < res.payload?.data.length; i++) { for (let i = 0; i < res.payload?.data.length; i++) {
@ -188,6 +188,7 @@ function pushModal (props) {
} }
} }
if (key == 'pomsProjectId') { if (key == 'pomsProjectId') {
getProjectStructureList(values.pomsProjectId)// getProjectStructureList(values.pomsProjectId)//
for (let i = 0; i < projectPoms.length; i++) { for (let i = 0; i < projectPoms.length; i++) {
if (values.pomsProjectId == projectPoms[i].id) { if (values.pomsProjectId == projectPoms[i].id) {
@ -232,6 +233,7 @@ function pushModal (props) {
style={{ width: 695 }} style={{ width: 695 }}
rules={[{ required: true, message: "请选择项目" }]} rules={[{ required: true, message: "请选择项目" }]}
initValue={editObj?.pomsProjectId || ""} initValue={editObj?.pomsProjectId || ""}
multiple
filter filter
> >
{ {

38
web/client/src/sections/service/containers/emPush.jsx

@ -245,17 +245,27 @@ const EmPush = (props) => {
dataIndex: "projectName", dataIndex: "projectName",
key: "projectName", key: "projectName",
render: (_, row) => { render: (_, row) => {
let projectData = []
row.pomsProject?.map(v => {
projectData.push({
projectName: v.pepProject?.projectName,
name: v.name,
anxinerror: v.del,
constructionStatus: v.pepProject?.constructionStatus,
})
})
let anxinerror = false let anxinerror = false
let anxinerrorArr = '' let anxinerrorArr = ''
if (row.pomsProject.del == true) { if (row.pomsProject.del == true) {
anxinerror = true anxinerror = true
anxinerrorArr = row.pomsProject.pepProject?.projectName || row.pomsProject.name anxinerrorArr = row.pomsProject.pepProject?.projectName || row.pomsProject.name
} }
return ( return (
<div style={{ display: 'flex', alignItems: 'center' }}> projectData.map((u, index) => <div style={{ display: 'flex', alignItems: 'center' }}>
{ {
anxinerror ? ( u.anxinerror ? (
<Tooltip content={anxinerrorArr + ',项目已在【项企PEP】或【映射关系】中被删除,请重选项目!'}> <Tooltip content={(u.projectName || u.name) + ',项目已在【项企PEP】或【映射关系】中被删除,请重选项目!'}>
<div style={{ marginRight: 5 }}> <div style={{ marginRight: 5 }}>
<img src="/assets/images/install/risk.png" alt="" style={{ height: 24, width: 24, }} /> <img src="/assets/images/install/risk.png" alt="" style={{ height: 24, width: 24, }} />
</div> </div>
@ -263,17 +273,17 @@ const EmPush = (props) => {
} }
{ {
<div className='myseparator' style={{ display: 'flex', alignItems: 'center' }}> <div className='myseparator' style={{ display: 'flex', alignItems: 'center' }}>
<Tooltip content={row.pomsProject.pepProject?.projectName || row.pomsProject.name}> <Tooltip content={(u.projectName || u.name)}>
<div style={{ width: row.pomsProject?.pepProject?.projectName?.length > 7 || row.pomsProject?.name?.length > 7 ? '112px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', color: row.pomsProject.del ? '#F93920' : '' }}> <div style={{ width: u.projectName?.length > 7 || u.name?.length > 7 ? '112px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', color: row.pomsProject.del ? '#F93920' : '' }}>
{row.pomsProject.pepProject?.projectName || row.pomsProject.name} {u.projectName || u.name}
</div> </div>
</Tooltip> </Tooltip>
</div> </div>
} }
{ {
row.pomsProject?.pepProject?.projectName ? ( u.projectName ? (
<div style={{ <div style={{
height: 18, marginLeft: 4, height: 18, marginLeft: 4, width: 76,
background: 'linear-gradient(180deg, #EBF5FF 0%, #EBF5FF 0%, #D3E8FF 100%)', background: 'linear-gradient(180deg, #EBF5FF 0%, #EBF5FF 0%, #D3E8FF 100%)',
borderRadius: 2, display: 'flex', alignItems: 'center' borderRadius: 2, display: 'flex', alignItems: 'center'
}}> }}>
@ -281,15 +291,7 @@ const EmPush = (props) => {
<img src="/assets/images/install/icon_zhengque.png" alt="" style={{ height: 10, width: 10, marginLeft: 4, marginRight: 9 }} /> <img src="/assets/images/install/icon_zhengque.png" alt="" style={{ height: 10, width: 10, marginLeft: 4, marginRight: 9 }} />
</div> </div>
<div style={{ color: '#0F7EFB', fontSize: 11, marginRight: 12 }}> <div style={{ color: '#0F7EFB', fontSize: 11, marginRight: 12 }}>
{ {u.constructionStatus}
val.map((ite, idx) => {
return (
<div key={idx}>
{ite.id == row.pomsProject?.pepProject.constructionStatusId ? ite.construction_status : ''}
</div>
)
})
}
</div> </div>
</div> </div>
) : ( ) : (
@ -307,7 +309,7 @@ const EmPush = (props) => {
</div> </div>
) )
} }
</div> </div>)
) )
} }
}, },

Loading…
Cancel
Save