@@ -18,7 +18,7 @@ function GasChart(props) { | |||||
: Array(dataSource == 'gas-i' ? 8 : 5).fill(Array(7).fill(0)); | : Array(dataSource == 'gas-i' ? 8 : 5).fill(Array(7).fill(0)); | ||||
// debug | // debug | ||||
// console.log('gasII series data', dataName, hisState?.[dataName], seriesData) | |||||
console.log('天然气 series data', dataName, hisState?.[dataName], seriesData); | |||||
return ( | return ( | ||||
<div className={cls.gasChart}> | <div className={cls.gasChart}> | ||||
@@ -1,5 +1,6 @@ | |||||
import cls from './index.module.css'; | import cls from './index.module.css'; | ||||
import { useEffect, useState } from 'react'; | |||||
import { useContext, useEffect, useState } from 'react'; | |||||
import SocketContext from '../../../../store/socket-data-provider'; | |||||
function getData(type) { | function getData(type) { | ||||
let data = []; | let data = []; | ||||
@@ -30,7 +31,13 @@ function getData(type) { | |||||
} | } | ||||
function GridList(props) { | function GridList(props) { | ||||
const dataList = getData(props.dataSource); | |||||
const { runState } = useContext(SocketContext); | |||||
const key = props.dataSource == 'gas-i' ? 'gasFlowArr' : 'furnaceGasFlowArr'; | |||||
let dataList = getData(props.dataSource); | |||||
dataList = runState?.[key] | |||||
? dataList.map((v, i) => ({ ...v, value: runState[key][i] ?? '/' })) | |||||
: dataList; | |||||
return ( | return ( | ||||
<div className={cls.gridList}> | <div className={cls.gridList}> | ||||
@@ -17,7 +17,7 @@ function EnergyCost(props) { | |||||
<div className={cls.info__item_groups}> | <div className={cls.info__item_groups}> | ||||
<div className={cls.info__item}>水 耗 量 : 32Km³</div> | <div className={cls.info__item}>水 耗 量 : 32Km³</div> | ||||
<div className={cls.info__item}>天 然 气 I : 83m³</div> | <div className={cls.info__item}>天 然 气 I : 83m³</div> | ||||
<div className={cls.info__item}>电 耗 量 : 52Km³</div> | |||||
<div className={cls.info__item}>电 耗 量 : 52kWh</div> | |||||
<div className={cls.info__item}>天 然 气 II: 32m³</div> | <div className={cls.info__item}>天 然 气 II: 32m³</div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||