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