This commit is contained in:
lb 2023-07-14 09:47:21 +08:00
parent e531907301
commit 0e32824730
3 changed files with 11 additions and 4 deletions

View File

@ -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}>

View File

@ -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}>

View File

@ -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 : 83</div> <div className={cls.info__item}> I : 83</div>
<div className={cls.info__item}> : 52Km³</div> <div className={cls.info__item}> : 52kWh</div>
<div className={cls.info__item}> II: 32</div> <div className={cls.info__item}> II: 32</div>
</div> </div>
</div> </div>