|
|
@ -48,28 +48,31 @@ const Inspection = ({ dispatch, actions, user, route, statistic }) => { |
|
|
|
useEffect(() => { |
|
|
|
if (projectScrollbar) projectScrollbar.destroy() |
|
|
|
const domEquipment = document.getElementById("inspection"); |
|
|
|
if (unfold) { |
|
|
|
projectScrollbar = new PerfectScrollbar("#inspection", { |
|
|
|
suppressScrollY: true, |
|
|
|
}); |
|
|
|
if (domEquipment && projectScrollbar) projectScrollbar.update() |
|
|
|
} else { |
|
|
|
projectScrollbar = new PerfectScrollbar("#inspection", { |
|
|
|
suppressScrollX: true, |
|
|
|
}) |
|
|
|
if (domEquipment && projectScrollbar) projectScrollbar.update() |
|
|
|
if (domEquipment) { |
|
|
|
if (unfold) { |
|
|
|
projectScrollbar = new PerfectScrollbar("#inspection", { |
|
|
|
suppressScrollY: true, |
|
|
|
}); |
|
|
|
if (domEquipment && projectScrollbar) projectScrollbar.update() |
|
|
|
} else { |
|
|
|
projectScrollbar = new PerfectScrollbar("#inspection", { |
|
|
|
suppressScrollX: true, |
|
|
|
}) |
|
|
|
if (domEquipment && projectScrollbar) projectScrollbar.update() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
dispatch(problem.getAlarmLnspection(checkPatrol)).then((res) => { |
|
|
|
// console.log(res.payload.data); |
|
|
|
// console.log(res.payload.data) |
|
|
|
if (res.success) { |
|
|
|
setPatrolAbnormal(res.payload.data) |
|
|
|
setNotRead(res.payload.data.filter(v => !v.notedTime).length) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, [checkPatrol]); |
|
|
|
}, [checkPatrol]) |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
@ -91,7 +94,7 @@ const Inspection = ({ dispatch, actions, user, route, statistic }) => { |
|
|
|
|
|
|
|
return ( |
|
|
|
|
|
|
|
<div style={{ width: 'clac(100%)', backgroundColor: 'white', margin: "8px 12px", padding: "20px 20px 0" }}> |
|
|
|
<div style={{ width: 'clac(100%)', height: unfold ? 420 : 760, backgroundColor: 'white', margin: "8px 12px", padding: "20px 20px 0" }}> |
|
|
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', marginLeft: 10 }}> |
|
|
|
<div style={{ width: 450, }}> |
|
|
|
<span style={{ width: 0, height: 20, display: "inline-block", margin: "0 8px 0 0", borderLeft: '3px solid #005ABD', borderTop: '3px solid transparent', borderBottom: '3px solid transparent' }}></span> |
|
|
@ -192,118 +195,132 @@ const Inspection = ({ dispatch, actions, user, route, statistic }) => { |
|
|
|
</Form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div |
|
|
|
onMouseMove={() => document.getElementById('unfold').style.display = 'none'} |
|
|
|
onMouseOut={() => document.getElementById('unfold').style.display = 'block'} |
|
|
|
id="inspection" style={{ width: 'calc(100% - 20px)', marginLeft: 10, height: unfold ? 280 : 600, whiteSpace: unfold ? 'nowrap' : '', position: "relative", }}> |
|
|
|
{patrolAbnormal?.map((v, i) => |
|
|
|
<div key={'name' + v.id} |
|
|
|
style={{ |
|
|
|
width: 400, height: 238, |
|
|
|
display: 'inline-block', |
|
|
|
margin: '8px 20px 8px 0', |
|
|
|
boxShadow: ' 0px 2px 12px 1px #F2F3F5', |
|
|
|
borderRadius: 2, border: '1px solid rgba(220,222,224,0.2)', |
|
|
|
position: 'relative', |
|
|
|
}} |
|
|
|
onClick={() => { |
|
|
|
setPicturePop(true) |
|
|
|
setPictureId(i); |
|
|
|
setPictureData(patrolAbnormal[i]) |
|
|
|
}} |
|
|
|
> |
|
|
|
<img src={`/_file-server/${v.screenshot}`} style={{ width: 400, height: 182 }} /> |
|
|
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end', margin: '10px 6px 0', color: '#005ABD' }}> |
|
|
|
<span style={{ fontSize: 12 }}>获取时间:{moment(v.createTime).format("YYYY-MM-DD HH:mm:ss")}</span> |
|
|
|
<span style={{ color: '#4A4A4A', fontWeight: 500 }}>{v.app?.name}</span> |
|
|
|
</div> |
|
|
|
{v.notedPepUser ? <img src="/assets/images/problem/tick.png" style={{ width: 19, position: "absolute", top: -6, right: -10 }} /> : ""} |
|
|
|
</div>)} |
|
|
|
{patrolAbnormal?.length > 0 ? |
|
|
|
<div |
|
|
|
onMouseMove={() => document.getElementById('unfold').style.display = 'none'} |
|
|
|
onMouseOut={() => document.getElementById('unfold').style.display = 'block'} |
|
|
|
id="inspection" style={{ width: 'calc(100% - 20px)', marginLeft: 10, height: unfold ? 280 : 600, whiteSpace: unfold ? 'nowrap' : '', position: "relative", }}> |
|
|
|
{patrolAbnormal?.map((v, i) => |
|
|
|
<div key={'name' + v.id} |
|
|
|
style={{ |
|
|
|
width: 400, height: 238, |
|
|
|
display: 'inline-block', |
|
|
|
margin: '8px 20px 8px 0', |
|
|
|
boxShadow: ' 0px 2px 12px 1px #F2F3F5', |
|
|
|
borderRadius: 2, border: '1px solid rgba(220,222,224,0.2)', |
|
|
|
position: 'relative', |
|
|
|
}} |
|
|
|
onClick={() => { |
|
|
|
setPicturePop(true) |
|
|
|
setPictureId(i); |
|
|
|
setPictureData(patrolAbnormal[i]) |
|
|
|
}} |
|
|
|
> |
|
|
|
<img src={`/_file-server/${v.screenshot}`} style={{ width: 400, height: 182 }} /> |
|
|
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end', margin: '10px 6px 0', color: '#005ABD' }}> |
|
|
|
<span style={{ fontSize: 12 }}>获取时间:{moment(v.createTime).format("YYYY-MM-DD HH:mm:ss")}</span> |
|
|
|
<span style={{ color: '#4A4A4A', fontWeight: 500 }}>{v.app?.name}</span> |
|
|
|
</div> |
|
|
|
{v.notedPepUser ? <img src="/assets/images/problem/tick.png" style={{ width: 19, position: "absolute", top: -6, right: -10 }} /> : ""} |
|
|
|
</div>)} |
|
|
|
|
|
|
|
</div> |
|
|
|
<div id="unfold" |
|
|
|
onMouseMove={(e) => e.stopPropagation()} |
|
|
|
onMouseOut={(e) => e.stopPropagation()} |
|
|
|
onClick={() => setUnfold(!unfold)} |
|
|
|
style={{ |
|
|
|
width: 'calc(100% - 20px)', marginLeft: 10, height: 24, |
|
|
|
background: unfold ? 'linear-gradient(180deg, rgba(36,139,255,0) 0%, rgba(36,139,255,0.09) 100%)' : 'linear-gradient(180deg, rgba(218,218,218,0) 0%, rgba(212,212,212,0.38) 100%)', |
|
|
|
borderRadius: 3, |
|
|
|
lineHeight: '24px', |
|
|
|
fontSize: 12, |
|
|
|
zIndex: 100, |
|
|
|
position: 'relative', |
|
|
|
top: unfold ? -20 : 6, |
|
|
|
left: 0, |
|
|
|
textAlign: 'center', |
|
|
|
color: unfold ? 'rgba(0,90,189,0.7)' : '#969799', |
|
|
|
cursor: 'pointer', |
|
|
|
}}>{unfold ? '展开更多' : '收起'}<img style={{ width: 17, paddingTop: 8, marginLeft: 3 }} src={`/assets/images/problem/${unfold ? "dropDown" : 'pullUp'}.png`} /> |
|
|
|
</div> |
|
|
|
{picturePop ? <Modal |
|
|
|
title={<div style={{}}>{pictureData?.app?.name} |
|
|
|
<span style={{ |
|
|
|
width: 80, height: 20, display: 'inline-block', |
|
|
|
background: 'url(/assets/images/problem/preview.png)', |
|
|
|
backgroundRepeat: 'no-repeat', |
|
|
|
backgroundSize: '100% 100%', |
|
|
|
color: '#FFFFFF', fontSize: 12, |
|
|
|
textAlign: 'center', lineHeight: '20px', marginLeft: 10, |
|
|
|
}}> |
|
|
|
未阅 {notRead}/{patrolAbnormal.length} |
|
|
|
</span> |
|
|
|
</div>} |
|
|
|
hasCancel={false} |
|
|
|
footer={<div style={{ width: 425, margin: 'auto', display: "flex", justifyContent: 'space-around', }}> |
|
|
|
<Button style={{ width: 92, height: 32, border: '1px solid rgba(0,0,0,0.15)', borderRadius: 2 }} |
|
|
|
onClick={() => { |
|
|
|
if (!pictureId == 0) setPictureId(pictureId - 1) |
|
|
|
}} |
|
|
|
>上一张</Button> |
|
|
|
<a href={`/_file-server/${pictureData.screenshot + '?filename=' + encodeURIComponent(pictureData.app?.name)}.png`}> |
|
|
|
<Button style={{ width: 92, height: 32, color: '#005ABD', border: '1px solid #005ABD', borderRadius: 2 }}>图片下载</Button> |
|
|
|
</a> |
|
|
|
<a href={pictureData.app?.url} target="_blank"> |
|
|
|
<Button style={{ width: 92, height: 32, color: '#FFFFFF', background: '#005ABD', border: '1px solid rgba(0,0,0,0.15)', borderRadius: 2 }}>进入系统</Button> |
|
|
|
</a> |
|
|
|
<Button style={{ width: 92, height: 32, border: '1px solid rgba(0,0,0,0.15)', borderRadius: 2 }} |
|
|
|
onClick={() => { |
|
|
|
if (pictureId < patrolAbnormal.length - 1) setPictureId(pictureId + 1) |
|
|
|
}} |
|
|
|
>下一张</Button> |
|
|
|
</div>} |
|
|
|
visible={true} |
|
|
|
onOk={() => { |
|
|
|
</div> |
|
|
|
: <div style={{ |
|
|
|
width: 'calc(100% - 20px)', marginLeft: 10, height: 280, |
|
|
|
background: 'url(/assets/images/problem/banner.gif)', |
|
|
|
backgroundSize: '100% 100%', |
|
|
|
fontSize: 32, fontFamily: 'YouSheBiaoTiHei', |
|
|
|
fontWeight: 500, color: '#005ABD', textIndent: 80, |
|
|
|
lineHeight: "260px" |
|
|
|
}}> |
|
|
|
当前应用暂无自动巡检计划 |
|
|
|
</div> |
|
|
|
} |
|
|
|
{patrolAbnormal?.length > 0 ? |
|
|
|
<div id="unfold" |
|
|
|
onMouseMove={(e) => e.stopPropagation()} |
|
|
|
onMouseOut={(e) => e.stopPropagation()} |
|
|
|
onClick={() => setUnfold(!unfold)} |
|
|
|
style={{ |
|
|
|
width: 'calc(100% - 20px)', marginLeft: 10, height: 24, |
|
|
|
background: unfold ? 'linear-gradient(180deg, rgba(36,139,255,0) 0%, rgba(36,139,255,0.09) 100%)' : 'linear-gradient(180deg, rgba(218,218,218,0) 0%, rgba(212,212,212,0.38) 100%)', |
|
|
|
borderRadius: 3, |
|
|
|
lineHeight: '24px', |
|
|
|
fontSize: 12, |
|
|
|
zIndex: 100, |
|
|
|
position: 'relative', |
|
|
|
top: unfold ? -20 : 14, |
|
|
|
left: 0, |
|
|
|
textAlign: 'center', |
|
|
|
color: unfold ? 'rgba(0,90,189,0.7)' : '#969799', |
|
|
|
cursor: 'pointer', |
|
|
|
}}>{unfold ? '展开更多' : '收起'}<img style={{ width: 17, paddingTop: 8, marginLeft: 3 }} src={`/assets/images/problem/${unfold ? "dropDown" : 'pullUp'}.png`} /> |
|
|
|
</div> : ""} |
|
|
|
{ |
|
|
|
picturePop ? <Modal |
|
|
|
title={<div style={{}}>{pictureData?.app?.name} |
|
|
|
<span style={{ |
|
|
|
width: 80, height: 20, display: 'inline-block', |
|
|
|
background: 'url(/assets/images/problem/preview.png)', |
|
|
|
backgroundRepeat: 'no-repeat', |
|
|
|
backgroundSize: '100% 100%', |
|
|
|
color: '#FFFFFF', fontSize: 12, |
|
|
|
textAlign: 'center', lineHeight: '20px', marginLeft: 10, |
|
|
|
}}> |
|
|
|
未阅 {notRead}/{patrolAbnormal.length} |
|
|
|
</span> |
|
|
|
</div>} |
|
|
|
hasCancel={false} |
|
|
|
footer={<div style={{ width: 425, margin: 'auto', display: "flex", justifyContent: 'space-around', }}> |
|
|
|
<Button style={{ width: 92, height: 32, border: '1px solid rgba(0,0,0,0.15)', borderRadius: 2 }} |
|
|
|
onClick={() => { |
|
|
|
if (!pictureId == 0) setPictureId(pictureId - 1) |
|
|
|
}} |
|
|
|
>上一张</Button> |
|
|
|
<a href={`/_file-server/${pictureData.screenshot + '?filename=' + encodeURIComponent(pictureData.app?.name)}.png`}> |
|
|
|
<Button style={{ width: 92, height: 32, color: '#005ABD', border: '1px solid #005ABD', borderRadius: 2 }}>图片下载</Button> |
|
|
|
</a> |
|
|
|
<a href={pictureData.app?.url} target="_blank"> |
|
|
|
<Button style={{ width: 92, height: 32, color: '#FFFFFF', background: '#005ABD', border: '1px solid rgba(0,0,0,0.15)', borderRadius: 2 }}>进入系统</Button> |
|
|
|
</a> |
|
|
|
<Button style={{ width: 92, height: 32, border: '1px solid rgba(0,0,0,0.15)', borderRadius: 2 }} |
|
|
|
onClick={() => { |
|
|
|
if (pictureId < patrolAbnormal.length - 1) setPictureId(pictureId + 1) |
|
|
|
}} |
|
|
|
>下一张</Button> |
|
|
|
</div>} |
|
|
|
visible={true} |
|
|
|
onOk={() => { |
|
|
|
|
|
|
|
}} |
|
|
|
width={837} |
|
|
|
onCancel={() => { |
|
|
|
setPicturePop(false) |
|
|
|
setPictureId('') |
|
|
|
if (timer) clearTimeout(timer) |
|
|
|
}} |
|
|
|
> |
|
|
|
<div style={{ marginBottom: 12 }}> |
|
|
|
{pictureData.notedTime ? <span style={{ marginRight: 14 }}>核验信息:{pictureData.notedPepUser} {moment(pictureData.notedTime).format("YYYY-MM-DD HH:mm:ss")}</span> : ""} |
|
|
|
<span>截取时间:{moment(pictureData.createTime).format("YYYY-MM-DD HH:mm:ss")}</span> |
|
|
|
<img src={`/assets/images/problem/link.png`} |
|
|
|
style={{ width: 16, height: 16, marginLeft: 6 }} |
|
|
|
onClick={() => { |
|
|
|
console.log(pictureData); |
|
|
|
copy(pictureData?.router || "无相关地址"); |
|
|
|
Notification.success({ |
|
|
|
content: "复制成功", |
|
|
|
duration: 2, |
|
|
|
}) |
|
|
|
}} |
|
|
|
}} |
|
|
|
width={837} |
|
|
|
onCancel={() => { |
|
|
|
setPicturePop(false) |
|
|
|
setPictureId('') |
|
|
|
if (timer) clearTimeout(timer) |
|
|
|
}} |
|
|
|
> |
|
|
|
<div style={{ marginBottom: 12 }}> |
|
|
|
{pictureData.notedTime ? <span style={{ marginRight: 14 }}>核验信息:{pictureData.notedPepUser} {moment(pictureData.notedTime).format("YYYY-MM-DD HH:mm:ss")}</span> : ""} |
|
|
|
<span>截取时间:{moment(pictureData.createTime).format("YYYY-MM-DD HH:mm:ss")}</span> |
|
|
|
<img src={`/assets/images/problem/link.png`} |
|
|
|
style={{ width: 16, height: 16, marginLeft: 6 }} |
|
|
|
onClick={() => { |
|
|
|
console.log(pictureData); |
|
|
|
copy(pictureData?.router || "无相关地址"); |
|
|
|
Notification.success({ |
|
|
|
content: "复制成功", |
|
|
|
duration: 2, |
|
|
|
}) |
|
|
|
}} |
|
|
|
/> |
|
|
|
</div> |
|
|
|
<img src={`/_file-server/${pictureData.screenshot}`} |
|
|
|
style={{ width: 789, height: 359 }} |
|
|
|
/> |
|
|
|
</div> |
|
|
|
<img src={`/_file-server/${pictureData.screenshot}`} |
|
|
|
style={{ width: 789, height: 359 }} |
|
|
|
/> |
|
|
|
|
|
|
|
</Modal> |
|
|
|
: "" |
|
|
|
</Modal> |
|
|
|
: "" |
|
|
|
|
|
|
|
} |
|
|
|
</div > |
|
|
|