|
|
@ -8,7 +8,6 @@ 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; |
|
|
@ -43,7 +42,7 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject |
|
|
|
const [videoBI, setVideoBI] = useState([]); //查询BI分析数据-视频 |
|
|
|
const [appBI, setAppBI] = useState([]); //查询BI分析数据-应用 |
|
|
|
const [efficiencyBI, setEfficiencyBI] = useState({}); //查询BI分析数据-问题处置 |
|
|
|
const [query, setQuery] = useState({ limit: 10, page: 0, projectCorrelationId: '', types: '1' }); //最新动态 |
|
|
|
const [query, setQuery] = useState({ limit: 23, page: 0, projectCorrelationId: '', types: '1' }); //最新动态 |
|
|
|
const [querydata1, setQueryData1] = useState([]); //最新动态数据 |
|
|
|
const [long, setLong] = useState(''); //最新动态设置 |
|
|
|
const [pomsList, setPomsList] = useState([]); //项目 |
|
|
@ -184,7 +183,7 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject |
|
|
|
newest.sort((a, b) => (moment(a.time).isBefore(b.time) ? 1 : -1)) |
|
|
|
querydata.current = [...newest, ...querydata.current] |
|
|
|
setQueryData1([...querydata.current]) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
}, [socketData]) |
|
|
|
useEffect(() => { |
|
|
@ -398,6 +397,7 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject |
|
|
|
})) |
|
|
|
} |
|
|
|
if (exhibition?.current?.dynamic?.find(v => v.key == 'notice')) { |
|
|
|
// EM 推送 |
|
|
|
res.payload.data?.notice?.map(v => data.push({ |
|
|
|
seed: 'notice', |
|
|
|
time: v.time, |
|
|
@ -444,14 +444,26 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject |
|
|
|
const line = document.getElementById("line") |
|
|
|
const news = document.getElementById("news") |
|
|
|
if (line && news) { |
|
|
|
news.onscroll = () => { |
|
|
|
news.onscroll = (e) => { |
|
|
|
e.stopPropagation(); |
|
|
|
if ((line.clientHeight - 578) < news.scrollTop + 10) { |
|
|
|
setQuery({ ...query, page: query.page + 1 }) |
|
|
|
if (exhibition?.current?.dynamic?.length > 0) { |
|
|
|
dispatch(control.getLatestDynamic({ ...query, projectCorrelationId: pepProjectId, page: query.page + 1 })).then(res => { |
|
|
|
news.scrollTop = news.scrollTop - 640 |
|
|
|
// news.scrollTop = news.scrollTop - 640 |
|
|
|
let data = querydata.current |
|
|
|
if (res.success) { |
|
|
|
let returnJudge = true |
|
|
|
for (let k in res.payload.data) { |
|
|
|
if (res.payload.data[k].length) { |
|
|
|
returnJudge = false |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
if (returnJudge) { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (exhibition?.current?.dynamic?.find(v => v.key == 'discovery')) { |
|
|
|
res.payload.data?.appear?.map(v => data.push({ |
|
|
|
seed: 'discovery', |
|
|
@ -503,9 +515,6 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject |
|
|
|
|
|
|
|
const domProject = document.getElementById("news"); |
|
|
|
if (domProject) { |
|
|
|
// newScrollbar = new PerfectScrollbar("#news", { |
|
|
|
// suppressScrollX: true, |
|
|
|
// }); |
|
|
|
if (domProject && newScrollbar) { |
|
|
|
newScrollbar.update(); |
|
|
|
} |
|
|
@ -513,9 +522,6 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject |
|
|
|
|
|
|
|
const pomsList = document.getElementById("pomsList"); |
|
|
|
if (pomsList) { |
|
|
|
// pomsListScrollbar = new PerfectScrollbar("#pomsList", { |
|
|
|
// suppressScrollX: true, |
|
|
|
// }); |
|
|
|
if (pomsList && pomsListScrollbar) { |
|
|
|
pomsListScrollbar.update(); |
|
|
|
} |
|
|
@ -523,9 +529,6 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject |
|
|
|
|
|
|
|
const domProject1 = document.getElementById("overviewCalc"); |
|
|
|
if (domProject1) { |
|
|
|
// overviewScrollbar = new PerfectScrollbar("#overviewCalc", { |
|
|
|
// suppressScrollY: true, |
|
|
|
// }); |
|
|
|
if (domProject1 && overviewScrollbar) { |
|
|
|
overviewScrollbar.update(); |
|
|
|
} |
|
|
@ -533,9 +536,6 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject |
|
|
|
|
|
|
|
const domProject2 = document.getElementById("member"); |
|
|
|
if (domProject2) { |
|
|
|
// memberScrollbar = new PerfectScrollbar("#member", { |
|
|
|
// suppressScrollX: true, |
|
|
|
// }); |
|
|
|
if (domProject2 && memberScrollbar) { |
|
|
|
memberScrollbar.update(); |
|
|
|
} |
|
|
@ -543,9 +543,6 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject |
|
|
|
|
|
|
|
const domProject3 = document.getElementById("equipment"); |
|
|
|
if (domProject3) { |
|
|
|
// equipmentScrollbar = new PerfectScrollbar("#equipment", { |
|
|
|
// suppressScrollX: true, |
|
|
|
// }); |
|
|
|
if (domProject3 && equipmentScrollbar) { |
|
|
|
equipmentScrollbar.update(); |
|
|
|
} |
|
|
@ -553,9 +550,6 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject |
|
|
|
|
|
|
|
const domProject4 = document.getElementById("web"); |
|
|
|
if (domProject4) { |
|
|
|
// webScrollbar = new PerfectScrollbar("#web", { |
|
|
|
// suppressScrollX: true, |
|
|
|
// }) |
|
|
|
if (domProject4 && webScrollbar) { |
|
|
|
webScrollbar.update(); |
|
|
|
} |
|
|
@ -563,9 +557,6 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject |
|
|
|
|
|
|
|
const domProject5 = document.getElementById("problems"); |
|
|
|
if (domProject5) { |
|
|
|
// problemsScrollbar = new PerfectScrollbar("#problems", { |
|
|
|
// suppressScrollX: true, |
|
|
|
// }); |
|
|
|
if (domProject5 && problemsScrollbar) { |
|
|
|
problemsScrollbar.update(); |
|
|
|
} |
|
|
@ -573,17 +564,11 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject |
|
|
|
|
|
|
|
const domProject6 = document.getElementById("alarm"); |
|
|
|
if (domProject6) { |
|
|
|
// alarmScrollbar = new PerfectScrollbar("#alarm", { |
|
|
|
// suppressScrollY: true, |
|
|
|
// }); |
|
|
|
if (domProject6 && alarmScrollbar) { |
|
|
|
alarmScrollbar.update(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// ACTION 示例 |
|
|
|
// dispatch(actions.example.getMembers(user.orgId)) |
|
|
|
}) |
|
|
|
|
|
|
|
const consoleToollink = () => { |
|
|
@ -625,8 +610,6 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let Select = { |
|
|
|
overall: ['workbench', 'statistical', 'analyse', 'dynamic', 'tool'], |
|
|
|
workbench: ['project', 'data', 'app', 'device'], |
|
|
@ -672,8 +655,6 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject |
|
|
|
{ name: 'BI分析模块', sort: 3, key: 'analyse', }, |
|
|
|
{ name: '最新动态', sort: 4, key: 'dynamic', }, |
|
|
|
{ name: '我常用的工具', sort: 5, key: 'tool', }, |
|
|
|
|
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
@ -1245,8 +1226,8 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject |
|
|
|
}} /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div id='news' style={{ height: 578, position: 'relative', marginTop: 10, }}> |
|
|
|
<div id='line' style={{ width: '100%' }}> |
|
|
|
<div id='news' style={{ height: 578, position: 'relative', marginTop: 10, overscrollBehavior: 'contain', }}> |
|
|
|
<div id='line' style={{ width: '100%', }}> |
|
|
|
<Timeline mode="center" style={{ marginLeft: '-56px', width: 400 }}> |
|
|
|
{querydata.current?.map((v, index) => { |
|
|
|
let title = '' |
|
|
@ -1256,8 +1237,13 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject |
|
|
|
title = v.userName ? (v.userName + '确认并关闭' + v.project + '【' + v.sources + '】' + v.type + '的问题') : |
|
|
|
v.project + '【' + v.sources + '】' + v.type + '已恢复' |
|
|
|
} else { |
|
|
|
title = '【信鸽-' + v.alarmPushConfig + '】已邮件通知' + |
|
|
|
v.userName?.map((u, i) => (i > 0 ? ',' + u : u)) + '【' + v.project + '】【' + |
|
|
|
title = |
|
|
|
'【信鸽-' + v.alarmPushConfig + '】已邮件通知' |
|
|
|
+ |
|
|
|
v.userName?.map((u, i) => (i > 0 ? ',' + u : u)) |
|
|
|
+ '【' + v.project |
|
|
|
+ '】【' |
|
|
|
+ |
|
|
|
(v.tactics == 'immediately' ? |
|
|
|
'发现在' + v.interval + '分钟内,有告警源新增' : |
|
|
|
(v.tactics == 'continue' ? '告警源持续产生时间超过' + v.interval + '分钟' : '异常设备数量达到项目或结构物内设备总数量的' + |
|
|
|