From 1a12cbf1cbedac9e72c6480e1c5659d79b8702af Mon Sep 17 00:00:00 2001 From: wenlele Date: Sun, 6 Nov 2022 22:41:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=B8=E7=94=A8=E5=B7=A5=E5=85=B7=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sections/control/containers/control.jsx | 69 +++++++++++++++---- 1 file changed, 57 insertions(+), 12 deletions(-) diff --git a/web/client/src/sections/control/containers/control.jsx b/web/client/src/sections/control/containers/control.jsx index c08386a..c0b87f6 100644 --- a/web/client/src/sections/control/containers/control.jsx +++ b/web/client/src/sections/control/containers/control.jsx @@ -138,7 +138,22 @@ const Control = (props) => { if (res.success) { if (res.payload.data?.length > 4) { setProblemsList([...res.payload.data, ...res.payload.data]) - startmarquee('problems') + let problems + let problemstop = 0 + let problemsId = document.getElementById('problems'); + if (problems) clearInterval(problems) + if (problemsId) { + function problemstart () { + problems = setInterval(() => { + problemstop += 5 + problemsId.scrollTop = problemstop + if (problemsId.scrollTop >= problemsId.scrollHeight / 2) problemstop = 0, problemsId.scrollTop = problemstop + }, 500); + problemsId.onmouseover = () => clearInterval(problems) + } + problemsId.onmouseout = () => problemstart() + setTimeout(problemstart(), 1000); + } } else { setProblemsList(res.payload.data) } @@ -149,13 +164,43 @@ const Control = (props) => { if (res.success) { if (res.payload.data?.personnel?.length > 5) { setMemberList([...res.payload.data?.personnel, ...res.payload.data?.personnel]) - startmarquee('member') + let member + let membertop = 0 + let memberId = document.getElementById('member'); + if (member) clearInterval(member) + if (memberId) { + function startmember () { + member = setInterval(() => { + membertop += 5 + memberId.scrollTop = membertop + if (memberId.scrollTop >= memberId.scrollHeight / 2) membertop = 0, memberId.scrollTop = membertop + }, 500); + memberId.onmouseover = () => clearInterval(member) + } + memberId.onmouseout = () => startmember() + setTimeout(startmember(), 1000); + } } else { setMemberList(res.payload.data?.personnel) } if (res.payload.data?.webApp?.length > 3) { setWebList([...res.payload.data?.webApp, ...res.payload.data?.webApp]) - startmarquee('web') + let web + let webtop = 0 + let webId = document.getElementById('web'); + if (web) clearInterval(web) + if (memberId) { + function webstart () { + member = setInterval(() => { + webtop += 5 + webId.scrollTop = webtop + if (webId.scrollTop >= webId.scrollHeight / 2) webtop = 0, webId.scrollTop = webtop + }, 500); + webId.onmouseover = () => clearInterval(web) + } + webId.onmouseout = () => webstart() + setTimeout(webstart(), 1000); + } } else { setWebList(res.payload.data?.webApp) } @@ -170,7 +215,7 @@ const Control = (props) => { //查询最新动态 async function concentration3 () { if (exhibition?.current?.dynamic?.length > 0) { - console.log(query?.page); + // console.log(query?.page); await dispatch(control.getLatestDynamic({ ...query, projectCorrelationId: pepProjectId })).then(res => { // console.log(res.payload.data); if (res.payload.data?.appear?.length || 0 + res.payload.data?.confirm?.length + res.payload.data?.notice?.length < 10) setASk(false) @@ -217,7 +262,7 @@ const Control = (props) => { return -1 } }) - console.log(data) + // console.log(data) querydata.current = data setQueryData1(data) } @@ -232,14 +277,14 @@ 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) + // 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) + // console.log(res.payload.data) news.scrollTop = news.scrollTop - 640 let data = querydata.current if (res.success) { @@ -284,7 +329,7 @@ const Control = (props) => { return -1 } }) - console.log(data) + // console.log(data) querydata.current = data setQueryData1(data) } @@ -406,8 +451,8 @@ const Control = (props) => { let p = false let top = 0 let o = document.getElementById(name); + if (t) clearInterval(t) if (o) { - function start () { t = setInterval(() => { top += 5 @@ -1135,7 +1180,7 @@ const Control = (props) => { border: '1px solid #F2F3F5' }} onClick={() => { - if (toolData && toolData < 10) { + if (toolData == 0 && toolData < 10) { setTool(true) }