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 [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)
}

Loading…
Cancel
Save