Browse Source

(*) 路况展示优化

master
peng.peng 1 year ago
parent
commit
6fb8c890d9
  1. 4
      super-screen/client/src/sections/fire-control/components/Right-top2.js
  2. 37
      super-screen/client/src/sections/water-prevention/containers/homePage.js

4
super-screen/client/src/sections/fire-control/components/Right-top2.js

@ -261,7 +261,7 @@ const DataTop5 = ({ dispatch, actions, longitudeLatitude }) => {
<div style={{ width: "62%", display: 'flex', flexDirection: "column", justifyContent: "space-evenly", }}> <div style={{ width: "62%", display: 'flex', flexDirection: "column", justifyContent: "space-evenly", }}>
<div style={{ height: 22, background: "rgb(0 88 204 / 50%)", textIndent: 20 }}>近30日最高拥堵指数</div> <div style={{ height: 22, background: "rgb(0 88 204 / 50%)", textIndent: 20 }}>近30日最高拥堵指数</div>
<div style={{ display: "flex", alignItems: 'center' }}> <div style={{ display: "flex", alignItems: 'center' }}>
<div style={{ fontSize: 28, fontFamily: "D-DINExp-Italic", fontWeight: 'Italic', color: '#ECF7FF', marginRight: 38 }}>{traffic?.month_max_yongdu_index || '--'}</div> <div style={{ fontSize: 28, fontFamily: "D-DINExp-Italic", fontWeight: 'Italic', color: '#ECF7FF', marginRight: 38 }}>{traffic?.month_max_yongdu_index?.toFixed(3) || '--'}</div>
<div style={{ color: '#C3E6FF' }}>{traffic?.month_max_congest_time} {weeks[traffic?.month_max_week_day]}</div> <div style={{ color: '#C3E6FF' }}>{traffic?.month_max_congest_time} {weeks[traffic?.month_max_week_day]}</div>
</div> </div>
</div> </div>
@ -275,7 +275,7 @@ const DataTop5 = ({ dispatch, actions, longitudeLatitude }) => {
</div> </div>
</div > </div >
} }
function mapStateToProps (state) { function mapStateToProps(state) {
const { auth, global } = state const { auth, global } = state
return { return {
user: auth.user, user: auth.user,

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

@ -131,46 +131,13 @@ function homePage(props) {
}) })
} }
}) })
// 安监
dispatch(worksafetyLogin({ p: 'anjianshidian', username: 'SuperAdmin', password: '123456' })).then(res => {
if (res.success) {
sessionStorage.setItem('worksafetyUser', JSON.stringify(res.payload.data));
getEmerResource(emengencyTab, res.payload.data.token)
}
})
} }
const getPumpStatusData = async (structId) => { const getPumpStatusData = async (structId) => {
return await dispatch(getPumpStatus(structId)); return await dispatch(getPumpStatus(structId));
} }
const getEmerResource = (type, token) => {
if (type && token) {
const handleRequestComplete = (res) => {
if (res.success) setEmerResource(res.payload.data);
}
switch (type) {
case 'yjjg':
dispatch(getEmerOrgList({ token })).then(handleRequestComplete);
break;
case 'yjdw':
dispatch(getEmerTeamList({ token })).then(handleRequestComplete);
break;
case 'yjzj':
dispatch(getEmerExpertList({ token })).then(handleRequestComplete);
break;
case 'yljg':
dispatch(getEmerMedicalList({ token })).then(handleRequestComplete);
break;
case 'bncs':
dispatch(getEmerRefugeList({ token })).then(handleRequestComplete);
break;
default:
break;
}
}
}
return <> return <>
<FullScreenContainer> <FullScreenContainer>
<div className='homepage'> <div className='homepage'>
@ -198,8 +165,6 @@ function homePage(props) {
}} }}
changeEmengencyTab={(e) => { changeEmengencyTab={(e) => {
setEmengencyTab(e) setEmengencyTab(e)
const { token } = JSON.parse(sessionStorage.getItem('worksafetyUser'));
getEmerResource(e, token)
}} }}
trendData={trendData} trendData={trendData}
waterLevelAlarms={waterLevelAlarms} waterLevelAlarms={waterLevelAlarms}

Loading…
Cancel
Save