|
|
@ -8,6 +8,7 @@ import repairFQA from '../../means/containers/repairFQA'; |
|
|
|
import { Setup, OutHidden } from "$components"; |
|
|
|
import ReactECharts from 'echarts-for-react'; |
|
|
|
import moment from "moment"; |
|
|
|
import { log } from 'ezuikit-js'; |
|
|
|
|
|
|
|
let newScrollbar; |
|
|
|
let overviewScrollbar; |
|
|
@ -52,6 +53,7 @@ const Control = (props) => { |
|
|
|
|
|
|
|
const exhibition = useRef({ workbench: [], statistical: [] }) //页面结构 |
|
|
|
const FormApi = useRef() |
|
|
|
// const query={ limit: 10, page: 0, projectCorrelationId: '', types: '1,2,3,4' } //最新动态 |
|
|
|
|
|
|
|
// websocket 使用测试 |
|
|
|
useEffect(() => { |
|
|
@ -87,7 +89,6 @@ const Control = (props) => { |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, []) |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
@ -154,13 +155,12 @@ const Control = (props) => { |
|
|
|
}) |
|
|
|
}, [pepProjectId, projectId]) |
|
|
|
|
|
|
|
|
|
|
|
// console.log(exhibition?.current?.dynamic); |
|
|
|
useEffect(() => { |
|
|
|
//查询最新动态 |
|
|
|
if (exhibition?.current?.dynamic?.length > 0) { |
|
|
|
dispatch(control.getLatestDynamic({ ...query, projectCorrelationId: pepProjectId })).then(res => { |
|
|
|
console.log(res.payload.data); |
|
|
|
let data = [] |
|
|
|
let data = querydata |
|
|
|
if (res.success) { |
|
|
|
if (exhibition?.current?.dynamic?.find(v => v.key == 'discovery')) { |
|
|
|
res.payload.data?.appear?.map(v => data.push({ |
|
|
@ -182,6 +182,18 @@ const Control = (props) => { |
|
|
|
// confirmContent:v.confirmContent, |
|
|
|
})) |
|
|
|
} |
|
|
|
if (exhibition?.current?.dynamic?.find(v => v.key == 'notice')) { |
|
|
|
res.payload.data?.notice?.map(v => data.push({ |
|
|
|
seed: 'notice', |
|
|
|
time: v.time, |
|
|
|
project: v.projectName, |
|
|
|
userName: v.userName?.map(u => u.name), |
|
|
|
alarmPushConfig: v.alarmPushConfig?.name, |
|
|
|
tactics: v.tactics, |
|
|
|
interval: v.tacticsParams?.interval, |
|
|
|
deviceProportion: v.tacticsParams?.deviceProportion, |
|
|
|
})) |
|
|
|
} |
|
|
|
data.sort((a, b) => { |
|
|
|
if (moment(a.time).isBefore(b.time)) { |
|
|
|
return 1 |
|
|
@ -189,12 +201,21 @@ const Control = (props) => { |
|
|
|
return -1 |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log(data); |
|
|
|
setQueryData(data) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
setQueryData([]) |
|
|
|
} |
|
|
|
|
|
|
|
const line = document.getElementById("line") |
|
|
|
const news = document.getElementById("news") |
|
|
|
if (line && news) { |
|
|
|
news.onscroll = () => { |
|
|
|
// console.log(news.scrollTop) |
|
|
|
// console.log(line.clientHeight) |
|
|
|
if ((line.clientHeight - 600) < news.scrollTop) { |
|
|
|
setQuery({ ...query, page: query.page + 1 }) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, [pepProjectId, query, exhibition.current]) |
|
|
|
|
|
|
@ -388,7 +409,7 @@ const Control = (props) => { |
|
|
|
exhibition.current = { ...exhibition.current, [title]: TableDisplay } |
|
|
|
setTableSetup([{ list: data }]) |
|
|
|
} |
|
|
|
console.log(memberList) |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
<> |
|
|
@ -920,12 +941,22 @@ const Control = (props) => { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div id='news' style={{ height: 578, position: 'relative', marginTop: 10, }}> |
|
|
|
<div id='line' style={{ width: '100%' }}> |
|
|
|
<Timeline mode="center" style={{ marginLeft: '-56px', width: 400 }}> |
|
|
|
{querydata?.map((v, index) => { |
|
|
|
let title = v.seed == 'discovery' ? |
|
|
|
v.project + '项目' + v.sources + v.type : |
|
|
|
v.seed == 'confirm' ? |
|
|
|
v.userName + '确认并关闭' + v.project + v.sources + v.type + '的问题' : "" |
|
|
|
let title = '' |
|
|
|
if (v.seed == 'discovery') { |
|
|
|
title = v.project + v.sources + ',诊断为' + v.type |
|
|
|
} else if (v.seed == 'confirm') { |
|
|
|
title = v.userName + '确认并关闭' + v.project + v.sources + v.type + '的问题' |
|
|
|
} else { |
|
|
|
title = '【信鸽-' + v.alarmPushConfig + '】已邮件通知' + |
|
|
|
v.userName?.map((u, i) => (i > 0 ? ',' + u : u)) + '【' + v.project + '】【' + |
|
|
|
(v.tactics == 'immediately' ? |
|
|
|
'发现在' + v.interval + '分钟内,有告警源新增' : |
|
|
|
(v.tactics == 'continue' ? '告警源持续产生时间超过' + v.interval + '分钟' : '异常设备数量达到项目或结构物内设备总数量的' + |
|
|
|
v.deviceProportion + '%,且持续时长超过' + v.interval + '小时' + '】-【' + v.time + '】')) |
|
|
|
} |
|
|
|
return ( |
|
|
|
<Timeline.Item key={index + 'time'} position='left' time={moment(v.time).format("YYYY-MM-DD HH:mm:ss")} className={index % 2 == 0 ? 'even' : 'odd'} > |
|
|
|
<Tooltip content={title}> |
|
|
@ -947,6 +978,7 @@ const Control = (props) => { |
|
|
|
</Timeline> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
{/* 我常用的工具 */} |
|
|
|
{exhibition.current?.overall?.find(v => v.key == 'tool') ? |
|
|
|
<div style={{ marginTop: 20, background: '#FFFFFF', boxShadow: '0px 0px 12px 2px rgba(220,222,224,0.2)', borderRadius: 2, padding: 20 }}> |
|
|
|