|
@ -4,6 +4,8 @@ import { connect } from "react-redux"; |
|
|
import { Button, Form, Modal, Skeleton, Pagination, Table } from "@douyinfe/semi-ui"; |
|
|
import { Button, Form, Modal, Skeleton, Pagination, Table } from "@douyinfe/semi-ui"; |
|
|
import moment from "moment"; |
|
|
import moment from "moment"; |
|
|
import PerfectScrollbar from "perfect-scrollbar"; |
|
|
import PerfectScrollbar from "perfect-scrollbar"; |
|
|
|
|
|
import './inspection.less' |
|
|
|
|
|
import { log } from "ezuikit-js"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let projectScrollbar; |
|
|
let projectScrollbar; |
|
@ -12,12 +14,19 @@ const Inspection = ({ dispatch, actions, route, statistic }) => { |
|
|
const [selectProject, setSelectProject] = useState([]) //所选项目 |
|
|
const [selectProject, setSelectProject] = useState([]) //所选项目 |
|
|
const [applyFilter, setApplyFilter] = useState([]) //应用筛选 |
|
|
const [applyFilter, setApplyFilter] = useState([]) //应用筛选 |
|
|
const [patrolAbnormal, setPatrolAbnormal] = useState([]) //巡检异常信息 |
|
|
const [patrolAbnormal, setPatrolAbnormal] = useState([]) //巡检异常信息 |
|
|
|
|
|
const [checkPatrol, setCheckPatrol] = useState({}) //巡检异常查询 |
|
|
|
|
|
const [unfold, setUnfold] = useState(true) //展开收起 |
|
|
|
|
|
const [picturePop, setPicturePop] = useState(false) //图片弹窗 |
|
|
|
|
|
const [pictureId, setPictureId] = useState() //图片id |
|
|
|
|
|
const [pictureData, setPictureData] = useState({}) //图片数据 |
|
|
|
|
|
|
|
|
const api = useRef(); |
|
|
const api = useRef(); |
|
|
|
|
|
const unfoldApi = useRef(false); |
|
|
|
|
|
|
|
|
// console.log(actions); |
|
|
// console.log(actions); |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
|
|
|
|
|
|
dispatch(problem.getProjectPoms()).then((res) => { |
|
|
dispatch(problem.getProjectPoms()).then((res) => { |
|
|
// console.log(res.payload.data); |
|
|
// console.log(res.payload.data); |
|
|
if (res.success) { |
|
|
if (res.success) { |
|
@ -25,67 +34,101 @@ const Inspection = ({ dispatch, actions, route, statistic }) => { |
|
|
let apply = [] |
|
|
let apply = [] |
|
|
res.payload.data?.rows?.map(v => { |
|
|
res.payload.data?.rows?.map(v => { |
|
|
project.push({ name: v.pepProjectName || v.name || v.id, value: v.id }) |
|
|
project.push({ name: v.pepProjectName || v.name || v.id, value: v.id }) |
|
|
v.projectApps.map(app => apply.push({ name: app.name, value: app.id })) |
|
|
v.apps.map(app => apply.push({ name: app.name, value: app.id })) |
|
|
}) |
|
|
}) |
|
|
setSelectProject(project) |
|
|
setSelectProject(project) |
|
|
setApplyFilter(apply) |
|
|
setApplyFilter(apply) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
dispatch(problem.getAlarmLnspection({})).then((res) => { |
|
|
}, []) |
|
|
|
|
|
|
|
|
|
|
|
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() |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|
dispatch(problem.getAlarmLnspection(checkPatrol)).then((res) => { |
|
|
console.log(res.payload.data); |
|
|
console.log(res.payload.data); |
|
|
if (res.success) { |
|
|
if (res.success) { |
|
|
setPatrolAbnormal(res.payload.data) |
|
|
setPatrolAbnormal(res.payload.data) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
}, [checkPatrol]); |
|
|
projectScrollbar = new PerfectScrollbar("#inspection", { |
|
|
|
|
|
suppressScrollY: true, |
|
|
|
|
|
}); |
|
|
|
|
|
}, []) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
|
|
|
if (patrolAbnormal && pictureId) { |
|
|
const domEquipment = document.getElementById("inspection"); |
|
|
console.log(patrolAbnormal.find(v => v.id == pictureId)); |
|
|
if (domEquipment && projectScrollbar) { |
|
|
setPictureData(patrolAbnormal.find(v => v.id == pictureId)) |
|
|
projectScrollbar.update(); |
|
|
|
|
|
} |
|
|
} |
|
|
}); |
|
|
}, [pictureId]); |
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
|
|
|
|
|
|
<div style={{ width: '100%', height: 250, backgroundColor: 'white', marginBottom: 20 }}> |
|
|
<div style={{ width: '100%', backgroundColor: 'white', marginBottom: 20 }}> |
|
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}> |
|
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start' }}> |
|
|
<div style={{ width: 400, }}> |
|
|
<div style={{ width: 400, }}> |
|
|
<span style={{ width: 3, height: 20, background: '#005ABD', display: 'inline-block', margin: "0 10px 0 20px" }}></span> |
|
|
<span style={{ width: 3, height: 20, background: '#005ABD', display: 'inline-block', margin: "0 10px 0 20px" }}></span> |
|
|
<span style={{ fontSize: 24, fontFamily: 'YouSheBiaoTiHei', color: '#101531', marginRight: 10 }}>{statistic[route]}</span> |
|
|
<span style={{ fontSize: 24, fontFamily: 'YouSheBiaoTiHei', color: '#101531', marginRight: 10 }}>{statistic[route]}</span> |
|
|
<span style={{ fontSize: 12 }}>APPLY SEMI-AUTOMATIC INSPECTION</span> |
|
|
<span style={{ fontSize: 12 }}>APPLY SEMI-AUTOMATIC INSPECTION</span> |
|
|
<div style={{ fontSize: 12 }}>仅保留48小时内的图片数据,每小时覆盖执行一次 <span style={{ fontWeight: 500, color: '#005ABD', fontSize: 12 }}>03专项2期:已阅共123个</span></div> |
|
|
<div style={{ fontSize: 12 }}>仅保留48小时内的图片数据,每小时覆盖执行一次 <span style={{ fontWeight: 500, color: '#005ABD', fontSize: 12 }}>03专项2期:已阅共123个</span></div> |
|
|
</div> |
|
|
</div> |
|
|
<div style={{}}> |
|
|
<div style={{ flex: 1, position: 'relative' }}> |
|
|
<Form |
|
|
<Form |
|
|
onSubmit={(values) => console.log(values)} |
|
|
onSubmit={(v) => { |
|
|
// onValueChange={values=>console.log(values)} |
|
|
setCheckPatrol({ |
|
|
|
|
|
appId: v.appId, |
|
|
|
|
|
noted: v.noted, |
|
|
|
|
|
projectId: v.projectId, |
|
|
|
|
|
timeStart: v.time == 'true' ? |
|
|
|
|
|
moment().startOf('day').format('YYYY-MM-DD HH:mm:ss') : |
|
|
|
|
|
v.time == 'false' ? |
|
|
|
|
|
moment().day(moment().day() - 1).startOf('day').format('YYYY-MM-DD HH:mm:ss') : "", |
|
|
|
|
|
timeEnd: v.time == 'true' ? |
|
|
|
|
|
moment().endOf('day').format('YYYY-MM-DD HH:mm:ss') : |
|
|
|
|
|
v.time == 'false' ? |
|
|
|
|
|
moment().day(moment().day() - 1).endOf('day').format('YYYY-MM-DD HH:mm:ss') : "", |
|
|
|
|
|
}) |
|
|
|
|
|
}} |
|
|
getFormApi={(formApi) => (api.current = formApi)} |
|
|
getFormApi={(formApi) => (api.current = formApi)} |
|
|
layout="horizontal" |
|
|
layout="horizontal" |
|
|
style={{ position: "relative", width: "100%", flex: 1 }} |
|
|
|
|
|
> |
|
|
> |
|
|
<Form.DatePicker |
|
|
<Form.Select |
|
|
type="dateRange" |
|
|
|
|
|
labelPosition="left" |
|
|
labelPosition="left" |
|
|
style={{ width: 242 }} |
|
|
style={{ width: 80, marginBottom: 10 }} |
|
|
|
|
|
// new Date(new Date().setHours(00, 00, 00).getTime()), timeEnd: new Date(new Date().setHours(23, 59, 59).getTime()) |
|
|
label='时间筛选:' |
|
|
label='时间筛选:' |
|
|
field='time' |
|
|
field='time' |
|
|
key='time' |
|
|
key='time' |
|
|
initValue={[new Date('2022-08-08'), new Date()]} |
|
|
placeholder="全部" |
|
|
onChange={(v) => console.log(v)} |
|
|
showClear |
|
|
/> |
|
|
> |
|
|
|
|
|
{[{ name: '今日', value: 'true' }, { name: '昨日', value: 'false' }].map((item) => { |
|
|
|
|
|
return ( |
|
|
|
|
|
<Form.Select.Option key={item.value} value={item.value}> |
|
|
|
|
|
{item.name} |
|
|
|
|
|
</Form.Select.Option> |
|
|
|
|
|
); |
|
|
|
|
|
})} |
|
|
|
|
|
</Form.Select> |
|
|
<Form.Select |
|
|
<Form.Select |
|
|
label='所选项目:' |
|
|
label='所选项目:' |
|
|
labelPosition="left" |
|
|
labelPosition="left" |
|
|
field='projectId' |
|
|
field='projectId' |
|
|
key='projectId' |
|
|
key='projectId' |
|
|
style={{ width: 116, marginRight: 10, color: "#F9F9F9", }} |
|
|
style={{ width: 116, marginRight: 10, color: "#F9F9F9", marginBottom: 10 }} |
|
|
placeholder="全部" |
|
|
placeholder="全部" |
|
|
showClear |
|
|
showClear |
|
|
> |
|
|
> |
|
@ -102,7 +145,7 @@ const Inspection = ({ dispatch, actions, route, statistic }) => { |
|
|
labelPosition="left" |
|
|
labelPosition="left" |
|
|
field='appId' |
|
|
field='appId' |
|
|
key='appId' |
|
|
key='appId' |
|
|
style={{ width: 116, marginRight: 10, color: "#F9F9F9", }} |
|
|
style={{ width: 116, marginRight: 10, color: "#F9F9F9", marginBottom: 10 }} |
|
|
placeholder="全部" |
|
|
placeholder="全部" |
|
|
showClear |
|
|
showClear |
|
|
> |
|
|
> |
|
@ -119,7 +162,7 @@ const Inspection = ({ dispatch, actions, route, statistic }) => { |
|
|
labelPosition="left" |
|
|
labelPosition="left" |
|
|
field='noted' |
|
|
field='noted' |
|
|
key='noted' |
|
|
key='noted' |
|
|
style={{ width: 116, marginRight: 10, color: "#F9F9F9", }} |
|
|
style={{ width: 116, marginRight: 54, color: "#F9F9F9", marginBottom: 10 }} |
|
|
placeholder="全部" |
|
|
placeholder="全部" |
|
|
showClear |
|
|
showClear |
|
|
> |
|
|
> |
|
@ -131,20 +174,94 @@ const Inspection = ({ dispatch, actions, route, statistic }) => { |
|
|
); |
|
|
); |
|
|
})} |
|
|
})} |
|
|
</Form.Select> |
|
|
</Form.Select> |
|
|
|
|
|
<Button theme="solid" type="primary" htmlType='submit' style={{ width: 65, height: 30, borderRadius: 3, position: 'absolute', right: 2, bottom: 12 }}>查询</Button> |
|
|
</Form> |
|
|
</Form> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div |
|
|
<div id="inspection" style={{ width: "100%", whiteSpace: 'nowrap', textOverflow: 'ellipsis' }}> |
|
|
onMouseMove={() => document.getElementById('unfold').style.display = 'none'} |
|
|
{patrolAbnormal?.map(v => <div style={{ width: 400, height: 238, display: 'inline-block' }}> |
|
|
onMouseOut={() => document.getElementById('unfold').style.display = 'block'} |
|
|
<img src={`/_file-server/${v.screenshot}`} style={{ width: 400, height: 182 }} /> |
|
|
id="inspection" style={{ width: 'calc(100% - 20px)', marginLeft: 10, height: unfold ? 280 : 600, whiteSpace: unfold ? 'nowrap' : '', position: "relative", }}> |
|
|
<div><span>获取时间:{moment(v.createTime).format("YYYY-MM-DD HH:MM:SS")}</span><span></span></div> |
|
|
{patrolAbnormal?.map(v => |
|
|
</div>)} |
|
|
<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)' |
|
|
|
|
|
}} |
|
|
|
|
|
onClick={() => { |
|
|
|
|
|
console.log(v.id); |
|
|
|
|
|
setPicturePop(true) |
|
|
|
|
|
setPictureId(v.id); |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
<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 >{v.app?.name}</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div>)} |
|
|
|
|
|
|
|
|
</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.38) 100%)' : 'linear-gradient(180deg, rgba(218,218,218,0) 0%, rgba(212,212,212,0.38) 100%)', |
|
|
|
|
|
borderRadius: 3, |
|
|
|
|
|
lineHeight: '24px', |
|
|
|
|
|
fontSize: 14, |
|
|
|
|
|
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: 20, height: 20, paddingTop: 8 }} src={`/assets/images/problem/${unfold ? "dropDown" : 'pullUp'}.png`} /> |
|
|
|
|
|
</div> |
|
|
|
|
|
{picturePop ? <Modal |
|
|
|
|
|
title={<div>{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, |
|
|
|
|
|
}}> |
|
|
|
|
|
未读 { }/{patrolAbnormal.length} |
|
|
|
|
|
</span> |
|
|
|
|
|
</div>} |
|
|
|
|
|
hasCancel={false} |
|
|
|
|
|
footer={<div> |
|
|
|
|
|
<Button style={{ borderRadius: 2 }}>上一张</Button> |
|
|
|
|
|
<Button>下载地址</Button> |
|
|
|
|
|
<Button>进入系统</Button> |
|
|
|
|
|
<Button>下一张</Button> |
|
|
|
|
|
</div>} |
|
|
|
|
|
visible={true} |
|
|
|
|
|
onOk={() => { |
|
|
|
|
|
|
|
|
|
|
|
}} |
|
|
|
|
|
width={837} |
|
|
|
|
|
onCancel={() => setPicturePop(false)} |
|
|
|
|
|
> |
|
|
|
|
|
<div> |
|
|
|
|
|
{pictureData.notedTime ? <span>核验信息:{pictureData.notedPepUser} {pictureData.notedTime}</span>:""} |
|
|
|
|
|
<span>截取时间:{moment(pictureData.createTime).format("YYYY-MM-DD HH:MM:SS")}</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
<img src={`/_file-server/${pictureData.screenshot}`} |
|
|
|
|
|
style={{ width: 789, height: 359 }} |
|
|
|
|
|
/> |
|
|
|
|
|
</Modal> |
|
|
|
|
|
: "" |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
</div > |
|
|
</div > |
|
|
) |
|
|
) |
|
|
} |
|
|
} |
|
|