|
|
@ -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) => { |
|
|
|
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 <> |
|
|
|
<FullScreenContainer> |
|
|
|
<div className='homepage'> |
|
|
@ -198,8 +165,6 @@ function homePage(props) { |
|
|
|
}} |
|
|
|
changeEmengencyTab={(e) => { |
|
|
|
setEmengencyTab(e) |
|
|
|
const { token } = JSON.parse(sessionStorage.getItem('worksafetyUser')); |
|
|
|
getEmerResource(e, token) |
|
|
|
}} |
|
|
|
trendData={trendData} |
|
|
|
waterLevelAlarms={waterLevelAlarms} |
|
|
|