Browse Source

最新动态勾选修改

dev
wenlele 2 years ago
parent
commit
4e59070260
  1. 19
      web/client/src/sections/control/containers/control.jsx

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

@ -48,7 +48,7 @@ const Control = (props) => {
const [videoBI, setVideoBI] = useState([]); //BI- const [videoBI, setVideoBI] = useState([]); //BI-
const [appBI, setAppBI] = useState([]); //BI- const [appBI, setAppBI] = useState([]); //BI-
const [efficiencyBI, setEfficiencyBI] = 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 [querydata1, setQueryData1] = useState([]); //
const [long, setLong] = useState(''); // const [long, setLong] = useState(''); //
const [pomsList, setPomsList] = useState([]); // const [pomsList, setPomsList] = useState([]); //
@ -61,7 +61,6 @@ const Control = (props) => {
const exhibition = useRef({ workbench: [], statistical: [] }) // const exhibition = useRef({ workbench: [], statistical: [] }) //
const FormApi = useRef() const FormApi = useRef()
const querydata = useRef([])// const querydata = useRef([])//
// const query={ limit: 10, page: 0, projectCorrelationId: '', types: '1,2,3,4' } //
// websocket 使 // websocket 使
useEffect(() => { useEffect(() => {
@ -130,7 +129,6 @@ const Control = (props) => {
}) })
} }
concentration1() concentration1()
}, [pepProjectId]) }, [pepProjectId])
@ -211,14 +209,16 @@ const Control = (props) => {
concentration4() concentration4()
}, [projectId]) }, [projectId])
// console.log(exhibition?.current?.dynamic);
useEffect(() => { useEffect(() => {
// //
async function concentration3 () { async function concentration3 () {
if (exhibition?.current?.dynamic?.length > 0) { if (exhibition?.current?.dynamic?.length > 0) {
// console.log(query?.page); let type = []
await dispatch(control.getLatestDynamic({ ...query, projectCorrelationId: pepProjectId })).then(res => { if (exhibition?.current?.dynamic?.find(v => v.key == 'discovery')) type.push(1)
// console.log(res.payload.data); 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) if (res.payload.data?.appear?.length || 0 + res.payload.data?.confirm?.length + res.payload.data?.notice?.length < 10) setASk(false)
let data = [] let data = []
if (res.success) { if (res.success) {
@ -278,14 +278,10 @@ 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(news.clientHeight)
// 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)
news.scrollTop = news.scrollTop - 640 news.scrollTop = news.scrollTop - 640
let data = querydata.current let data = querydata.current
if (res.success) { if (res.success) {
@ -330,7 +326,6 @@ const Control = (props) => {
return -1 return -1
} }
}) })
// console.log(data)
querydata.current = data querydata.current = data
setQueryData1(data) setQueryData1(data)
} }

Loading…
Cancel
Save