|
|
@ -11,15 +11,14 @@ import Right_2 from './basis/right_2'; |
|
|
|
import { POWER_STATIONS } from './shuizhan_detail'; |
|
|
|
import './basis.less' |
|
|
|
|
|
|
|
const Basis = ({ actions, dispatch, setshowData }) => { |
|
|
|
const Basis = ({ actions, dispatch, setshowData, siteList, siteData }) => { |
|
|
|
|
|
|
|
const { bigScreen } = actions |
|
|
|
const [siteList, setSiteList] = useState([]) //站点列表
|
|
|
|
// const [siteList, setSiteList] = useState([]) //站点列表
|
|
|
|
const [strucId, setStrucId] = useState() //站点ID
|
|
|
|
const [pageRefresh1, setPageRefresh1] = useState(false) |
|
|
|
const [pageRefresh2, setPageRefresh2] = useState(0) |
|
|
|
const [pageRefresh3, setPageRefresh3] = useState(0) |
|
|
|
const [left2List, setleft2List] = useState([]) |
|
|
|
const [depthWater, setDepthWater] = useState([]) |
|
|
|
const [information, setInformation] = useState({}) |
|
|
|
|
|
|
@ -28,18 +27,16 @@ const Basis = ({ actions, dispatch, setshowData }) => { |
|
|
|
const pumpNumber = useRef(0) |
|
|
|
|
|
|
|
useEffect(async () => { |
|
|
|
await dispatch(bigScreen.axyData({ type: 'get', url: `organizations/{orgId}/structures` })).then(async res => { |
|
|
|
if (res.success) { |
|
|
|
setSiteList(res.payload.data?.map(v => ({ value: v.id, label: v.name })) || []) |
|
|
|
setshowData(res.payload.data?.map(v => ({ name: v.name, lat: v.latitude, lng: v.longitude })) || []) |
|
|
|
setStrucId(res.payload.data[0]?.id) |
|
|
|
|
|
|
|
if (siteData) { |
|
|
|
setStrucId(siteData[0]?.id) |
|
|
|
for (let key in POWER_STATIONS) { |
|
|
|
if (POWER_STATIONS[key]?.name == res.payload.data[0]?.name) { |
|
|
|
if (POWER_STATIONS[key]?.name == siteData[0]?.name) { |
|
|
|
setInformation(POWER_STATIONS[key]) |
|
|
|
} |
|
|
|
} |
|
|
|
//获取所有泵站的集水池液位
|
|
|
|
res.payload.data?.map(async v => { |
|
|
|
siteData?.map(async v => { |
|
|
|
await dispatch(bigScreen.axyData({ type: 'get', url: `structures/${v.id}/factors` })).then(async r => { |
|
|
|
//泵站信息
|
|
|
|
let informationId = r.payload.data?.find(v => v.name == '泵站信息')?.id |
|
|
@ -111,9 +108,12 @@ const Basis = ({ actions, dispatch, setshowData }) => { |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
}, []) |
|
|
|
}, [siteData]) |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
setStrucId(siteList[0]?.value) |
|
|
|
}, [siteList]) |
|
|
|
|
|
|
|
useEffect(async () => { |
|
|
|
if (strucId) { |
|
|
@ -161,10 +161,10 @@ const Basis = ({ actions, dispatch, setshowData }) => { |
|
|
|
<div style={{ |
|
|
|
width: '100%', height: 40, |
|
|
|
backgroundImage: 'url(/assets/images/monitor/end.png)', backgroundSize: '100% 100%', backgroundPosition: 'center', backgroundRepeat: 'no-repeat', |
|
|
|
display: 'flex', alignItems: 'flex-end', |
|
|
|
display: 'flex', alignItems: 'flex-end', lineHeight: "40px" |
|
|
|
}}> |
|
|
|
<div style={{ width: 80 }}>地点</div> |
|
|
|
<div>编号</div> |
|
|
|
<div style={{ width: 80, fontFamily: "SourceHanSansCN-Normal", fontStyle: 'italic', textAlign: "center" }}>地点</div> |
|
|
|
<div style={{ fontFamily: "SourceHanSansCN-Normal", fontStyle: 'italic', width: "calc(100% - 80px)", textAlign: "center" }}>编号</div> |
|
|
|
</div> |
|
|
|
<SimpleBar |
|
|
|
style={{ |
|
|
@ -178,20 +178,15 @@ const Basis = ({ actions, dispatch, setshowData }) => { |
|
|
|
display: 'flex', alignItems: 'center', marginTop: 6, width: '100%', height: 36, |
|
|
|
backgroundImage: 'linear-gradient(180deg, #000e28e6 1%, #021f48cc 100%)' |
|
|
|
}}> |
|
|
|
<div style={{ width: 76, overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis', }}>{v.name}</div> |
|
|
|
<div title={v.name} style={{ width: 76, margin: '0 12px', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis', fontFamily: "SourceHanSansCN-Normal", fontStyle: 'italic' }}>{v.name}</div> |
|
|
|
<div > |
|
|
|
{v.data?.map((s, i) => <img style={{ width: 20, height: 20, marginLeft: 3 }} src={`/assets/images/number/${[2, 4, 6].includes(s.data[0]?.sMotor_State) ? 'problem' : 'good'}${i + 1}.png`} />) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
</div>)} |
|
|
|
</SimpleBar> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
@ -207,7 +202,7 @@ const Basis = ({ actions, dispatch, setshowData }) => { |
|
|
|
backgroundImage: 'url(/assets/images/monitor/lower-left.png)', |
|
|
|
backgroundSize: '100% 100%', backgroundPosition: 'center', backgroundRepeat: 'no-repeat', |
|
|
|
}}> |
|
|
|
<img style={{ width: 40, height: 40, position: 'absolute', left: 12, top: -18, }} src='/assets/images/monitor/pumpPO.png' /> |
|
|
|
<img style={{ width: 40, height: 40, position: 'absolute', left: 12, top: -18, }} src='/assets/images/monitor/pumpPo.png' /> |
|
|
|
泵站数量:{siteList?.length || 0} |
|
|
|
</div> |
|
|
|
<div style={{ |
|
|
|