update 天然气流量
This commit is contained in:
@@ -5,8 +5,8 @@ import { useSelector, useDispatch } from "react-redux";
|
||||
|
||||
function GasChart(props) {
|
||||
const { dataSource } = props;
|
||||
const hisState = useSelector((state) => state.combustionAir.runtime);
|
||||
const dataName = dataSource == "gas-i" ? "hisGas1" : "hisGas2";
|
||||
const hisState = useSelector((state) => state.natGas.history);
|
||||
const dataName = dataSource == "gas-i" ? "gasIHistory" : "gasIIHistory";
|
||||
|
||||
const seriesData = hisState?.[dataName]
|
||||
? Object.keys(hisState?.[dataName])
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import cls from "./index.module.css";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useSelector } from "react-redux";
|
||||
|
||||
function getData(type) {
|
||||
let data = [];
|
||||
@@ -30,14 +30,16 @@ function getData(type) {
|
||||
}
|
||||
|
||||
function GridList(props) {
|
||||
// const { runState } = useContext(SocketContext);
|
||||
const runState = null;
|
||||
const runState = useSelector((state) => state.natGas.runtime);
|
||||
|
||||
const key = props.dataSource == "gas-i" ? "gasFlowArr" : "furnaceGasFlowArr";
|
||||
const key = props.dataSource == "gas-i" ? "gasIRuntime" : "gasIIRuntime";
|
||||
|
||||
let dataList = getData(props.dataSource);
|
||||
dataList = runState?.[key]
|
||||
? dataList.map((v, i) => ({ ...v, value: runState[key][i] ?? "/" }))
|
||||
? dataList.map((v, i) => ({
|
||||
...v,
|
||||
value: (runState[key][i] || 0) + "m³/h",
|
||||
}))
|
||||
: dataList;
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user