Browse Source

(*) 防汛 返回平台增加loading

master
peng.peng 1 year ago
parent
commit
1e80ff3740
  1. 13
      super-screen/client/src/sections/water-prevention/containers/homePage.js

13
super-screen/client/src/sections/water-prevention/containers/homePage.js

@ -1,6 +1,7 @@
import React, { useEffect, useState } from 'react' import React, { useEffect, useState } from 'react'
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { push } from 'react-router-redux'; import { push } from 'react-router-redux';
import { Spin } from 'antd';
import LeftTop from '../components/left-top' import LeftTop from '../components/left-top'
import LeftBottom from '../components/left-bottom' import LeftBottom from '../components/left-bottom'
import RightTop from '../components/right-top' import RightTop from '../components/right-top'
@ -34,6 +35,7 @@ function homePage(props) {
const [structures, setStructures] = useState([]); const [structures, setStructures] = useState([]);
const [waterLevelAlarms, setWaterLevelAlarms] = useState([]); const [waterLevelAlarms, setWaterLevelAlarms] = useState([]);
const [emerResource, setEmerResource] = useState([]); const [emerResource, setEmerResource] = useState([]);
const [spinning, setSpinning] = useState(true)
const { data: emergencyList = {} } = useFsRequest({ url: 'water/emergency' }); const { data: emergencyList = {} } = useFsRequest({ url: 'water/emergency' });
const SCREEN_COMPONENTS = { const SCREEN_COMPONENTS = {
overview: { leftTop: LeftTop, leftBottom: LeftBottom, rightTop: RightTop, rightBottom: RightBottom }, overview: { leftTop: LeftTop, leftBottom: LeftBottom, rightTop: RightTop, rightBottom: RightBottom },
@ -47,6 +49,9 @@ function homePage(props) {
useEffect(() => { useEffect(() => {
getWaterData(); getWaterData();
setTimeout(() => {
setSpinning(false)
}, 8 * 1000);
}, []) }, [])
// 获取水务数据 // 获取水务数据
@ -148,6 +153,7 @@ function homePage(props) {
}; };
}) })
setWaterLevelAlarms(levelAlarms); setWaterLevelAlarms(levelAlarms);
setSpinning(false)
} }
}) })
} }
@ -159,6 +165,7 @@ function homePage(props) {
} }
return <> return <>
<FullScreenContainer> <FullScreenContainer>
<div className='homepage'> <div className='homepage'>
<div className='_title'> <div className='_title'>
@ -166,7 +173,9 @@ function homePage(props) {
防汛提前知 防汛提前知
</div> </div>
<Weather /> <Weather />
<div onClick={() => { dispatch(push('/homepage')) }} className='_exit' >返回平台</div>
<div onClick={() => { dispatch(push('/homepage')) }} className='_exit' > <Spin spinning={spinning}>返回平台 </Spin></div>
</div> </div>
<div className='homepage-left homepage-left-left'> <div className='homepage-left homepage-left-left'>
<div div className="list"> <div div className="list">
@ -206,6 +215,8 @@ function homePage(props) {
</div > </div >
</FullScreenContainer> </FullScreenContainer>
</> </>
} }

Loading…
Cancel
Save