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

Loading…
Cancel
Save