This commit is contained in:
lb 2023-07-14 09:47:21 +08:00
джерело e531907301
коміт 0e32824730
3 змінених файлів з 11 додано та 4 видалено

@ -18,7 +18,7 @@ function GasChart(props) {
: Array(dataSource == 'gas-i' ? 8 : 5).fill(Array(7).fill(0));
// debug
// console.log('gasII series data', dataName, hisState?.[dataName], seriesData)
console.log('天然气 series data', dataName, hisState?.[dataName], seriesData);
return (
<div className={cls.gasChart}>

@ -1,5 +1,6 @@
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) {
let data = [];
@ -30,7 +31,13 @@ function getData(type) {
}
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 (
<div className={cls.gridList}>

@ -17,7 +17,7 @@ function EnergyCost(props) {
<div className={cls.info__item_groups}>
<div className={cls.info__item}> : 32Km³</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>
</div>