Browse Source

常用工具添加

dev
wenlele 2 years ago
parent
commit
1a12cbf1cb
  1. 69
      web/client/src/sections/control/containers/control.jsx

69
web/client/src/sections/control/containers/control.jsx

@ -138,7 +138,22 @@ const Control = (props) => {
if (res.success) { if (res.success) {
if (res.payload.data?.length > 4) { if (res.payload.data?.length > 4) {
setProblemsList([...res.payload.data, ...res.payload.data]) 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 { } else {
setProblemsList(res.payload.data) setProblemsList(res.payload.data)
} }
@ -149,13 +164,43 @@ const Control = (props) => {
if (res.success) { if (res.success) {
if (res.payload.data?.personnel?.length > 5) { if (res.payload.data?.personnel?.length > 5) {
setMemberList([...res.payload.data?.personnel, ...res.payload.data?.personnel]) 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 { } else {
setMemberList(res.payload.data?.personnel) setMemberList(res.payload.data?.personnel)
} }
if (res.payload.data?.webApp?.length > 3) { if (res.payload.data?.webApp?.length > 3) {
setWebList([...res.payload.data?.webApp, ...res.payload.data?.webApp]) 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 { } else {
setWebList(res.payload.data?.webApp) setWebList(res.payload.data?.webApp)
} }
@ -170,7 +215,7 @@ const Control = (props) => {
// //
async function concentration3 () { async function concentration3 () {
if (exhibition?.current?.dynamic?.length > 0) { if (exhibition?.current?.dynamic?.length > 0) {
console.log(query?.page); // console.log(query?.page);
await dispatch(control.getLatestDynamic({ ...query, projectCorrelationId: pepProjectId })).then(res => { await dispatch(control.getLatestDynamic({ ...query, projectCorrelationId: pepProjectId })).then(res => {
// console.log(res.payload.data); // 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) 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 return -1
} }
}) })
console.log(data) // console.log(data)
querydata.current = data querydata.current = data
setQueryData1(data) setQueryData1(data)
} }
@ -232,14 +277,14 @@ const Control = (props) => {
const news = document.getElementById("news") const news = document.getElementById("news")
if (line && news) { if (line && news) {
news.onscroll = () => { news.onscroll = () => {
console.log(line.clientHeight) // console.log(line.clientHeight)
console.log(news.clientHeight) // console.log(news.clientHeight)
console.log(news.scrollTop) // console.log(news.scrollTop)
if ((line.clientHeight - 578) < news.scrollTop + 10) { if ((line.clientHeight - 578) < news.scrollTop + 10) {
setQuery({ ...query, page: query.page + 1 }) setQuery({ ...query, page: query.page + 1 })
if (exhibition?.current?.dynamic?.length > 0) { if (exhibition?.current?.dynamic?.length > 0) {
dispatch(control.getLatestDynamic({ ...query, projectCorrelationId: pepProjectId, page: query.page + 1 })).then(res => { 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 news.scrollTop = news.scrollTop - 640
let data = querydata.current let data = querydata.current
if (res.success) { if (res.success) {
@ -284,7 +329,7 @@ const Control = (props) => {
return -1 return -1
} }
}) })
console.log(data) // console.log(data)
querydata.current = data querydata.current = data
setQueryData1(data) setQueryData1(data)
} }
@ -406,8 +451,8 @@ const Control = (props) => {
let p = false let p = false
let top = 0 let top = 0
let o = document.getElementById(name); let o = document.getElementById(name);
if (t) clearInterval(t)
if (o) { if (o) {
function start () { function start () {
t = setInterval(() => { t = setInterval(() => {
top += 5 top += 5
@ -1135,7 +1180,7 @@ const Control = (props) => {
border: '1px solid #F2F3F5' border: '1px solid #F2F3F5'
}} }}
onClick={() => { onClick={() => {
if (toolData && toolData < 10) { if (toolData == 0 && toolData < 10) {
setTool(true) setTool(true)
} }

Loading…
Cancel
Save