diff --git a/api/app/lib/controllers/control/data.js b/api/app/lib/controllers/control/data.js index f894575..a52223b 100644 --- a/api/app/lib/controllers/control/data.js +++ b/api/app/lib/controllers/control/data.js @@ -336,7 +336,7 @@ async function getLatestDynamic(ctx) { } if (d.emailSendId) { notice.push({ - userName: userPepRes.find(u => d.emailSendLog.toPepUserIds.indexOf(u.id) != -1), + userName: userPepRes.filter(u => d.emailSendLog.toPepUserIds.indexOf(u.id) != -1), projectName, ...d.emailSendLog.dataValues }); diff --git a/web/client/src/sections/control/containers/control.jsx b/web/client/src/sections/control/containers/control.jsx index 92072cc..54e12db 100644 --- a/web/client/src/sections/control/containers/control.jsx +++ b/web/client/src/sections/control/containers/control.jsx @@ -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,31 +941,42 @@ const Control = (props) => {