|
|
@ -31,9 +31,18 @@ const Electrical = ({ dispatch, actions, siteList }) => { |
|
|
|
const [electricityTrend, setElectricityTrend] = useState([]) //电流趋势
|
|
|
|
const [useTrend, setUseTrend] = useState([]) //用电趋势
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
setStrucId(siteList[0]?.value) |
|
|
|
const autoStructId = sessionStorage.getItem('structId'); |
|
|
|
let nextStructId = siteList[0]?.value; |
|
|
|
if (autoStructId) { |
|
|
|
for (let i = 0; i < siteList.length; i++) { |
|
|
|
if (autoStructId == siteList[i].value) { |
|
|
|
nextStructId = siteList[i].value; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
setStrucId(nextStructId); |
|
|
|
}, [siteList]) |
|
|
|
|
|
|
|
useEffect(async () => { |
|
|
@ -187,7 +196,7 @@ const Electrical = ({ dispatch, actions, siteList }) => { |
|
|
|
|
|
|
|
return <div style={{ width: '100%', height: 'calc(100% - 200px', color: '#FFF', position: 'absolute', top: 160, left: 0 }}> |
|
|
|
<div style={{ width: '100%', height: "100%", position: 'relative', }}> |
|
|
|
<RealTimeStatus setPumpOne={setPumpOne} pumpId={pumpId} pumpList={pumpList} setPumpId={setPumpId} pumpOne={pumpOne} strucId={strucId} siteList={siteList} /> |
|
|
|
<RealTimeStatus setPumpOne={setPumpOne} pumpId={pumpId} pumpList={pumpList} setPumpId={setPumpId} pumpOne={pumpOne} strucId={strucId} siteList={siteList} /> |
|
|
|
<LineBoxStatus cabinetId={cabinetId} cabinetList={cabinetList} setCabinetId={setCabinetId} cabinetOne={cabinetOne} /> |
|
|
|
<VoltageTrend pumpList={pumpList} voltagePumpId={voltagePumpId} setVoltagePumpId={setVoltagePumpId} data={voltagepump} /> |
|
|
|
<LevelTrend depthWater={depthWater} /> |
|
|
@ -202,7 +211,7 @@ const Electrical = ({ dispatch, actions, siteList }) => { |
|
|
|
}}> |
|
|
|
<div style={{ fontSize: 20, color: '#E2F8FF', fontWeight: 600 }}> |
|
|
|
环境湿度:</div> |
|
|
|
<span style={{color: '#00FFF8',fontFamily:"D-DIN-Italic"}}>{depthWater[depthWater.length-1]?.sHumidity || "--"} %</span> |
|
|
|
<span style={{ color: '#00FFF8', fontFamily: "D-DIN-Italic" }}>{depthWater[depthWater.length - 1]?.sHumidity || "--"} %</span> |
|
|
|
</div> |
|
|
|
<div style={{ |
|
|
|
backgroundImage: 'url(/assets/images/monitor/pedestal.png)', |
|
|
@ -211,8 +220,8 @@ const Electrical = ({ dispatch, actions, siteList }) => { |
|
|
|
}}> |
|
|
|
<div style={{ fontSize: 20, color: '#E2F8FF', fontWeight: 600 }}> |
|
|
|
环境温度: |
|
|
|
</div> |
|
|
|
<span style={{color: '#00FFF8',fontFamily:"D-DIN-Italic"}}>{depthWater[depthWater.length-1]?.sTEMP || "--"} ℃</span> |
|
|
|
</div> |
|
|
|
<span style={{ color: '#00FFF8', fontFamily: "D-DIN-Italic" }}>{depthWater[depthWater.length - 1]?.sTEMP || "--"} ℃</span> |
|
|
|
</div> |
|
|
|
<div style={{ |
|
|
|
backgroundImage: 'url(/assets/images/monitor/pedestal.png)', |
|
|
@ -221,7 +230,7 @@ const Electrical = ({ dispatch, actions, siteList }) => { |
|
|
|
}}> |
|
|
|
<div style={{ fontSize: 20, color: '#E2F8FF', fontWeight: 600 }}> |
|
|
|
信号:</div> |
|
|
|
<span style={{color: '#00FFF8',fontFamily:"D-DIN-Italic"}}>{depthWater[depthWater.length-1]?.CSQ4G || "--"}</span> |
|
|
|
<span style={{ color: '#00FFF8', fontFamily: "D-DIN-Italic" }}>{depthWater[depthWater.length - 1]?.CSQ4G || "--"}</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<img style={{ width: "44%", height: "46%", position: "absolute", left: "28%", top: "34%" }} src={`/assets/images/electrical/centre.png`} /> |
|
|
@ -254,7 +263,7 @@ const Electrical = ({ dispatch, actions, siteList }) => { |
|
|
|
</div > |
|
|
|
} |
|
|
|
|
|
|
|
function mapStateToProps (state) { |
|
|
|
function mapStateToProps(state) { |
|
|
|
const { auth, global } = state; |
|
|
|
return { |
|
|
|
user: auth.user, |
|
|
|