From 4e59070260c578a0923902ba9ec60b61acd09765 Mon Sep 17 00:00:00 2001 From: wenlele Date: Mon, 7 Nov 2022 16:41:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=80=E6=96=B0=E5=8A=A8=E6=80=81=E5=8B=BE?= =?UTF-8?q?=E9=80=89=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sections/control/containers/control.jsx | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/web/client/src/sections/control/containers/control.jsx b/web/client/src/sections/control/containers/control.jsx index 9d17166..4f6f71b 100644 --- a/web/client/src/sections/control/containers/control.jsx +++ b/web/client/src/sections/control/containers/control.jsx @@ -48,7 +48,7 @@ const Control = (props) => { 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,2,3,4' }); //最新动态 + const [query, setQuery] = useState({ limit: 10, page: 0, projectCorrelationId: '', types: '1' }); //最新动态 const [querydata1, setQueryData1] = useState([]); //最新动态数据 const [long, setLong] = useState(''); //最新动态设置 const [pomsList, setPomsList] = useState([]); //项目 @@ -61,7 +61,6 @@ const Control = (props) => { const exhibition = useRef({ workbench: [], statistical: [] }) //页面结构 const FormApi = useRef() const querydata = useRef([])//最新动态数据 - // const query={ limit: 10, page: 0, projectCorrelationId: '', types: '1,2,3,4' } //最新动态 // websocket 使用测试 useEffect(() => { @@ -130,7 +129,6 @@ const Control = (props) => { }) } concentration1() - }, [pepProjectId]) @@ -211,14 +209,16 @@ const Control = (props) => { concentration4() }, [projectId]) - // console.log(exhibition?.current?.dynamic); useEffect(() => { //查询最新动态 async function concentration3 () { if (exhibition?.current?.dynamic?.length > 0) { - // console.log(query?.page); - await dispatch(control.getLatestDynamic({ ...query, projectCorrelationId: pepProjectId })).then(res => { - // console.log(res.payload.data); + let type = [] + if (exhibition?.current?.dynamic?.find(v => v.key == 'discovery')) type.push(1) + if (exhibition?.current?.dynamic?.find(v => v.key == 'confirm')) type.push(4) + if (exhibition?.current?.dynamic?.find(v => v.key == 'notice')) type.push(2) + setQuery({ ...query, page: 0 }) + await dispatch(control.getLatestDynamic({ ...query, projectCorrelationId: pepProjectId, page: 0, types: type.join(','), })).then(res => { if (res.payload.data?.appear?.length || 0 + res.payload.data?.confirm?.length + res.payload.data?.notice?.length < 10) setASk(false) let data = [] if (res.success) { @@ -278,14 +278,10 @@ const Control = (props) => { const news = document.getElementById("news") if (line && news) { news.onscroll = () => { - // console.log(line.clientHeight) - // console.log(news.clientHeight) - // console.log(news.scrollTop) 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 => { - // console.log(res.payload.data) news.scrollTop = news.scrollTop - 640 let data = querydata.current if (res.success) { @@ -330,7 +326,6 @@ const Control = (props) => { return -1 } }) - // console.log(data) querydata.current = data setQueryData1(data) }