done 当前温度

This commit is contained in:
lb
2023-12-11 15:28:59 +08:00
parent c549f38231
commit aa2a730acc
12 changed files with 490 additions and 552 deletions

Binary file not shown.

View File

@@ -0,0 +1,7 @@
@font-face {
font-family: "HelloFont WenYiHei";
/* font-style: normal;
font-weight: 400; */
src: url("./ziyou.ttf");
/* font-display: swap; */
}

View File

@@ -1,6 +1,10 @@
import GraphBase from "../GraphBase";
import "./font.css";
import cls from "./index.module.css";
import { useState } from "react";
import { useEffect, useState } from "react";
import { Tooltip, Button } from "antd";
import { InfoCircleOutlined } from "@ant-design/icons";
import { useSelector } from "react-redux";
const SmallBox = (props) => {
return (
@@ -27,7 +31,7 @@ const SmallBox = (props) => {
width: "2px",
height: "80%",
top: "10%",
left: "50%",
left: "45%",
background:
"linear-gradient(to bottom, transparent, #fff3, #fffa, #fff3, transparent)",
}}
@@ -39,17 +43,26 @@ const SmallBox = (props) => {
};
function WindFrequence(props) {
const [dataSource, setDataSource] = useState("风机");
const [dataSource, setDataSource] = useState("1线");
const [currentLineTemp, setCurrentLineTemp] = useState([]);
const currentTempList = useSelector((state) => state.annealTemperature?.data);
function handleSourceChange(v) {
console.log("val", v);
function handleSourceChange(line) {
console.log("line changed", line);
setDataSource(line);
}
useEffect(() => {
setCurrentLineTemp(
(currentTempList && currentTempList[dataSource.replace("线", "#")]) || []
);
}, [dataSource]);
return (
<GraphBase
icon="pause"
title="当前温度"
dateOptions={["风机", "风阀", "电加热"]}
dateOptions={["1线", "2线", "3线", "4线", "5线"]}
onDateChange={handleSourceChange}
size={["middle", "long"]}
>
@@ -57,75 +70,130 @@ function WindFrequence(props) {
<SmallBox>
<h1 className={cls.areaName}>A1区板上</h1>
<div className={cls.areaContent}>
<span className={cls.areaValue}>123.8</span>
<span className={cls.areaValue}>123.8</span>
<span className={cls.areaValue}>123.8</span>
<span className={cls.areaValue}>{currentLineTemp[0] || 0} </span>
<span className={cls.areaValue}>{currentLineTemp[1] || 0} </span>
<span className={cls.areaValue}>{currentLineTemp[2] || 0} </span>
</div>
</SmallBox>
<SmallBox>
<h1 className={cls.areaName}>A1区板上</h1>
<h1 className={cls.areaName}>A2区板上</h1>
<div className={cls.areaContent}>
<span className={cls.areaValue}>123.8</span>
<span className={cls.areaValue}>123.8</span>
<span className={cls.areaValue}>123.8</span>
<span className={cls.areaValue}>{currentLineTemp[6] || 0} </span>
<span className={cls.areaValue}>{currentLineTemp[7] || 0} </span>
<span className={cls.areaValue}>{currentLineTemp[8] || 0} </span>
</div>
</SmallBox>
<SmallBox>
<h1 className={cls.areaName}>A1区板上</h1>
<h1 className={cls.areaName}>B区板上</h1>
<div className={cls.areaContent}>
<span className={cls.areaValue}>123.8</span>
<span className={cls.areaValue}>123.8</span>
<span className={cls.areaValue}>123.8</span>
<span className={cls.areaValue}>{currentLineTemp[12] || 0} </span>
<span className={cls.areaValue}>{currentLineTemp[13] || 0} </span>
<span className={cls.areaValue}>{currentLineTemp[14] || 0} </span>
</div>
</SmallBox>
<SmallBox>
<h1 className={cls.areaName}>A1区板上</h1>
<h1 className={cls.areaName}>C区板上</h1>
<div className={cls.areaContent}>
<span className={cls.areaValue}>123.8</span>
<span className={cls.areaValue}>123.8</span>
<span className={cls.areaValue}>123.8</span>
<span className={cls.areaValue}>{currentLineTemp[18] || 0} </span>
<span className={cls.areaValue}>{currentLineTemp[19] || 0} </span>
<span className={cls.areaValue}>{currentLineTemp[20] || 0} </span>
</div>
</SmallBox>
<SmallBox>
<h1 className={cls.areaName}>A1区板</h1>
<h1 className={cls.areaName}>A1区板</h1>
<div className={cls.areaContent}>
<span className={cls.areaValue}>123.8</span>
<span className={cls.areaValue}>123.8</span>
<span className={cls.areaValue}>123.8</span>
<span className={cls.areaValue}>{currentLineTemp[3] || 0} </span>
<span className={cls.areaValue}>{currentLineTemp[4] || 0} </span>
<span className={cls.areaValue}>{currentLineTemp[5] || 0} </span>
</div>
</SmallBox>
<SmallBox split={false}>
<SmallBox>
<h1 className={cls.areaName}>A2区板下</h1>
<div className={cls.areaContent}>
<span className={cls.areaValue}>{currentLineTemp[9] || 0} </span>
<span className={cls.areaValue}>{currentLineTemp[10] || 0} </span>
<span className={cls.areaValue}>{currentLineTemp[11] || 0} </span>
</div>
</SmallBox>
<SmallBox>
<h1 className={cls.areaName}>B区板下</h1>
<div className={cls.areaContent}>
<span className={cls.areaValue}>{currentLineTemp[15] || 0} </span>
<span className={cls.areaValue}>{currentLineTemp[16] || 0} </span>
<span className={cls.areaValue}>{currentLineTemp[17] || 0} </span>
</div>
</SmallBox>
<SmallBox>
<h1 className={cls.areaName}>C区板下</h1>
<div className={cls.areaContent}>
<span className={cls.areaValue}>{currentLineTemp[21] || 0} </span>
<span className={cls.areaValue}>{currentLineTemp[22] || 0} </span>
<span className={cls.areaValue}>{currentLineTemp[23] || 0} </span>
</div>
</SmallBox>
<SmallBox split={false} style={{ position: "relative" }}>
<div className={cls.areaPureContent}>
<span className={cls.areaPureValue}>123.8</span>
<span className={cls.areaPureValue}>123.8</span>
<span className={cls.areaPureValue}>123.8</span>
<div
className="hint"
style={{ position: "absolute", top: "0", right: "0" }}
>
<Tooltip title="红外温度">
<Button
shape="circle"
type="text"
style={{ color: "#cccc" }}
icon={<InfoCircleOutlined />}
></Button>
</Tooltip>
</div>
<span className={cls.areaPureValue}>
{currentLineTemp[26] || 0}
</span>
<span className={cls.areaPureValue}>
{currentLineTemp[27] || 0}
</span>
<span className={cls.areaPureValue}>
{currentLineTemp[28] || 0}
</span>
</div>
</SmallBox>
<SmallBox>
<h1 className={cls.areaName}>A1区板上</h1>
<div className={cls.areaContent}>
<span className={cls.areaValue}>123.8</span>
<span className={cls.areaValue}>123.8</span>
<span className={cls.areaValue}>123.8</span>
</div>
</SmallBox>
<SmallBox split={false}>
<SmallBox split={false} style={{ position: "relative" }}>
<div className={cls.areaPureContent}>
<span className={cls.areaPureValue}>123.8</span>
<span className={cls.areaPureValue}>123.8</span>
<span className={cls.areaPureValue}>123.8</span>
<div
className="hint"
style={{ position: "absolute", top: "0", right: "0" }}
>
<Tooltip title="压延机冷却水温度 | 过度辊台冷却水温度 | 唇砖冷却水温度">
<Button
shape="circle"
type="text"
style={{ color: "#cccc" }}
icon={<InfoCircleOutlined />}
></Button>
</Tooltip>
</div>
<span className={cls.areaPureValue}>
{currentLineTemp[29] || 0}
</span>
<span className={cls.areaPureValue}>
{currentLineTemp[30] || 0}
</span>
<span className={cls.areaPureValue}>
{currentLineTemp[31] || 0}
</span>
</div>
</SmallBox>
<SmallBox>
<h1 className={cls.areaName}>A1区板上</h1>
<h1 className={cls.areaName}>RET1区</h1>
<div className={cls.areaContent}>
<span className={cls.areaValue}>123.8</span>
<span className={cls.areaValue}>{currentLineTemp[24] || 0} </span>
</div>
</SmallBox>
<SmallBox>
<h1 className={cls.areaName}>A1区板上</h1>
<h1 className={cls.areaName}>RET2区</h1>
<div className={cls.areaContent}>
<span className={cls.areaValue}>123.8</span>
<span className={cls.areaValue}>{currentLineTemp[25] || 0} </span>
</div>
</SmallBox>
</div>

View File

@@ -1,139 +1,141 @@
.chart {
height: 100%;
height: 100%;
}
.gas {
position: relative;
position: relative;
}
.currentFlow {
position: absolute;
top: 20px;
left: 50%;
transform: translateX(-50%);
padding: 8px 22px;
border-radius: 2px;
letter-spacing: 2px;
box-shadow: inset 0 0 22px 0px hsla(0, 0%, 100%, 0.15);
line-height: 18px;
font-size: 18px;
text-align: center;
color: #12fff5;
position: absolute;
top: 20px;
left: 50%;
transform: translateX(-50%);
padding: 8px 22px;
border-radius: 2px;
letter-spacing: 2px;
box-shadow: inset 0 0 22px 0px hsla(0, 0%, 100%, 0.15);
line-height: 18px;
font-size: 18px;
text-align: center;
color: #12fff5;
}
.floatHead {
position: absolute;
top: 22px;
right: 24px;
height: 32px;
width: 410px;
display: flex;
align-items: center;
justify-content: flex-end;
position: absolute;
top: 22px;
right: 24px;
height: 32px;
width: 410px;
display: flex;
align-items: center;
justify-content: flex-end;
}
.mainContent {
padding-top: 16px;
padding-top: 16px;
}
.alignRight {
text-align: right;
justify-self: flex-end;
text-align: right;
justify-self: flex-end;
}
.grid {
display: grid;
gap: 6px;
grid-template-columns: repeat(2, minmax(100px, 1fr));
grid-auto-rows: minmax(64px, min-content);
display: grid;
gap: 6px;
grid-template-columns: repeat(2, minmax(100px, 1fr));
grid-auto-rows: minmax(64px, min-content);
}
.areaName {
color: #fff;
font-size: 20px;
line-height: 1;
letter-spacing: 1.5px;
margin: 0;
padding-left: 20px;
width: 50%;
color: #fff;
font-size: 18px;
line-height: 1;
letter-spacing: 1.5px;
margin: 0;
padding-left: 20px;
width: 50%;
}
.areaPureContent {
display: flex;
display: flex;
}
.areaPureValue {
padding: 0 8px;
padding: 0 8px;
}
.areaPureValue:not(:first-child) {
border-left: 2px solid #fff6;
span.areaPureValue:not(:first-of-type) {
border-left: 2px solid #fff6;
}
.areaContent {
width: 50%;
padding-left: 12px;
display: flex;
flex-direction: column;
width: 50%;
padding-left: 12px;
display: flex;
flex-direction: column;
}
.areaPureValue,
.areaValue {
display: inline-block;
font-size: 17px;
line-height: 22px;
letter-spacing: 1.2px;
display: inline-block;
font-size: 14px;
line-height: 16px;
letter-spacing: 1.2px;
font-family: "HelloFont WenYiHei", sans-serif;
color: #53c2d4;
}
.switchLabel {
color: white;
margin-left: 6px;
color: white;
margin-left: 6px;
}
.legend:last-child {
margin-left: 8px;
margin-left: 8px;
}
.legend > span {
display: inline-block;
color: #dff1fe;
font-size: 14px;
letter-spacing: 2px;
display: inline-block;
color: #dff1fe;
font-size: 14px;
letter-spacing: 2px;
}
.legend > span:first-child {
width: 12px;
height: 12px;
margin-right: 4px;
border-radius: 2px;
width: 12px;
height: 12px;
margin-right: 4px;
border-radius: 2px;
}
.gasIcon {
background: #12fff5;
background: #12fff5;
}
.gas2Icon {
background: #2760ff;
background: #2760ff;
}
.radioGroup {
user-select: none;
user-select: none;
}
.radioGroup * {
border: none !important;
border-radius: 0 !important;
border: none !important;
border-radius: 0 !important;
}
.radioGroup *:focus-within {
box-shadow: none !important;
box-shadow: none !important;
}
.radioGroup *::before {
width: 0 !important;
width: 0 !important;
}
.radioGroup_button_wrapper {
color: #fff !important;
background: #03233c !important;
color: #fff !important;
background: #03233c !important;
}

Binary file not shown.

View File

@@ -1,187 +0,0 @@
// FanRunFrequence
import cls from "./index.module.css";
import * as echarts from "echarts";
import GraphBase from "../GraphBase";
import { useState } from "react";
import { useSelector } from "react-redux";
function WindFrequence(props) {
const [showChart, setShowChart] = useState(false);
const runState = useSelector((state) => state.fanFrequence.runtime);
const hisState = useSelector((state) => state.fanFrequence.history);
let dataList = [];
let seriesData = [];
const colors = [
"#12FFF5",
"#2760FF",
"#FFD160",
"#E80091",
"#8064ff",
"#ff8a3b",
"#8cd26d",
"#2aa1ff",
];
let options = null;
if (showChart) {
// keys() 结果不是按照顺序,需要 sort()
seriesData =
hisState != null
? Object.keys(hisState)
.sort()
.map((key) => hisState[key])
: Array(8)
.fill(1)
.map((_) => Array(7).fill(0));
options = {
color: colors,
grid: { top: 32, right: 12, bottom: 20, left: 48 },
xAxis: {
type: "category",
data: Array(7)
.fill(1)
.map((_, index) => {
const today = new Date();
const dtimestamp = today - index * 24 * 60 * 60 * 1000;
return `${new Date(dtimestamp).getMonth() + 1}.${new Date(
dtimestamp
).getDate()}`;
})
.reverse(),
axisLabel: {
color: "#fff",
fontSize: 12,
},
axisTick: { show: false },
axisLine: {
lineStyle: {
width: 1,
color: "#213259",
},
},
},
yAxis: {
name: "单位/m³",
nameTextStyle: {
color: "#fff",
fontSize: 10,
align: "right",
},
type: "value",
axisLabel: {
color: "#fff",
fontSize: 12,
},
axisLine: {
show: true,
lineStyle: {
color: "#213259",
},
},
splitLine: {
lineStyle: {
color: "#213259a0",
},
},
// interval: 10,
// min: 0,
// max: 100,
},
series: seriesData.map((v, i) => ({
name: i + 1 + "#风机",
data: v,
type: "line",
symbol: "circle",
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
// i % 8 避免超过8个数据时无颜色的问题
{ offset: 0, color: colors[i % 8] + "40" },
{ offset: 0.5, color: colors[i % 8] + "20" },
{ offset: 1, color: colors[i % 8] + "00" },
]),
},
})),
tooltip: {
trigger: "axis",
},
};
} else {
dataList =
runState != null
? Object.keys(runState).map((fan) => ({
id: Math.random(),
name: fan,
value: runState[fan],
}))
: [
{ id: 1, name: "1#风机", value: "0m³/h" },
{ id: 2, name: "2#风机", value: "0m³/h" },
{ id: 3, name: "3#风机", value: "0m³/h" },
{ id: 4, name: "4#风机", value: "0m³/h" },
{ id: 5, name: "5#风机", value: "0m³/h" },
{ id: 6, name: "6#风机", value: "0m³/h" },
{ id: 7, name: "7#风机", value: "0m³/h" },
{ id: 8, name: "8#风机", value: "0m³/h" },
{ id: 9, name: "9#风机", value: "0m³/h" },
{ id: 10, name: "10#风机", value: "0m³/h" },
{ id: 11, name: "11#风机", value: "0m³/h" },
{ id: 12, name: "12#风机", value: "0m³/h" },
{ id: 13, name: "13#风机", value: "0m³/h" },
{ id: 14, name: "14#风机", value: "0m³/h" },
{ id: 15, name: "15#风机", value: "0m³/h" },
{ id: 16, name: "16#风机", value: "0m³/h" },
];
}
function handleSwitchChange(val) {
if (val) {
setShowChart(true);
} else {
setShowChart(false);
}
}
return (
<GraphBase
icon="kiln"
title="风机运行频率"
size={["middle", "long"]}
switchOptions={false}
switchPosition={[null, 200]} // [top, left]
onSwitch={handleSwitchChange}
>
<div className={cls.chart}>
{/* {showChart && (
<ReactECharts option={options} style={{ height: "100%" }} />
)} */}
{!showChart && (
<div className={cls.gridList}>
{dataList.map((item) => (
<div
key={item.id}
className={cls.listItem}
style={{ padding: props.stretch ? "16px 0" : "" }}
>
<span className={cls.fanName}>{item.name}</span>
<span
className={cls.fanValue}
style={{
fontWeight: 700,
letterSpacing: 1,
fontSize: 16,
// color: "#e03537",
color: "#24aebb",
}}
>
{item.value}
</span>
</div>
))}
</div>
)}
</div>
</GraphBase>
);
}
export default WindFrequence;

View File

@@ -0,0 +1,189 @@
import { createSlice } from "@reduxjs/toolkit";
export const initialState = {
data: {
"3#": [
"53",
"36",
"67",
"73",
"66",
"77",
"61",
"45",
"58",
"82",
"70",
"73",
"83",
"63",
"41",
"41",
"20",
"94",
"94",
"50",
"51",
"73",
"46",
"37",
"98",
"36",
"48",
"59",
"49",
"56",
"68",
"68",
],
"2#": [
"56",
"13",
"47",
"5",
"62",
"24",
"70",
"50",
"71",
"83",
"58",
"87",
"76",
"28",
"8",
"73",
"34",
"78",
"73",
"44",
"23",
"54",
"76",
"16",
"71",
"48",
"54",
"81",
"5",
"28",
"54",
"53",
],
"1#": [
"60",
"58",
"37",
"93",
"15",
"41",
"78",
"8",
"4",
"0",
"7",
"27",
"26",
"17",
"83",
"72",
"34",
"7",
"19",
"65",
"90",
"80",
"82",
"87",
"76",
"97",
"12",
"32",
"93",
"91",
"37",
"34",
],
"5#": [
"90",
"27",
"65",
"89",
"72",
"58",
"26",
"10",
"14",
"46",
"35",
"66",
"69",
"28",
"10",
"74",
"76",
"47",
"5",
"95",
"72",
"67",
"69",
"63",
"77",
"96",
"56",
"91",
"19",
"57",
"38",
"65",
],
"4#": [
"82",
"42",
"75",
"24",
"71",
"31",
"40",
"76",
"14",
"91",
"32",
"82",
"56",
"82",
"18",
"68",
"82",
"79",
"89",
"42",
"56",
"24",
"22",
"67",
"31",
"70",
"53",
"40",
"16",
"21",
"82",
"22",
],
},
};
const annealTemperatureSlice = createSlice({
name: "annealTemperature",
initialState,
reducers: {
setTemp: (state, action) => {
state.data = action.payload;
},
},
});
export default annealTemperatureSlice.reducer;
export const { setTemp } = annealTemperatureSlice.actions;

57
src/store/features/t.json Normal file
View File

@@ -0,0 +1,57 @@
{
"data": {
"AnnealFanFrequencyInfo": {
"1#退火A2区1#风机": "49",
"1#退火A2区2#风机": "49",
"1#退火B区1#风机": "19",
"1#退火B区2#风机": "17",
"1#退火C区1#风机": "15",
"1#退火C区2#风机": "2",
"1#退火F1区风机": "80",
"1#退火F2区风机": "45",
"1#退火RET1区1#风机": "50",
"1#退火RET1区2#风机": "24",
"2#退火A2区1#风机": "0",
"2#退火A2区2#风机": "18",
"2#退火B区1#风机": "56",
"2#退火B区2#风机": "14",
"2#退火C区1#风机": "72",
"2#退火C区2#风机": "83",
"2#退火F1区风机": "45",
"2#退火F2区风机": "54",
"2#退火RET1区1#风机": "64",
"2#退火RET1区2#风机": "98",
"3#退火A2区1#风机": "45",
"3#退火A2区2#风机": "42",
"3#退火B区1#风机": "17",
"3#退火B区2#风机": "71",
"3#退火C区1#风机": "69",
"3#退火C区2#风机": "51",
"3#退火F1区风机": "64",
"3#退火F2区风机": "18",
"3#退火RET1区1#风机": "26",
"3#退火RET1区2#风机": "74",
"4#退火A2区1#风机": "22",
"4#退火A2区2#风机": "77",
"4#退火B区1#风机": "96",
"4#退火B区2#风机": "76",
"4#退火C区1#风机": "16",
"4#退火C区2#风机": "12",
"4#退火F1区风机": "65",
"4#退火F2区风机": "12",
"4#退火RET1区1#风机": "68",
"4#退火RET1区2#风机": "34",
"5#退火A2区1#风机": "76",
"5#退火A2区2#风机": "65",
"5#退火B区1#风机": "79",
"5#退火B区2#风机": "65",
"5#退火C区1#风机": "16",
"5#退火C区2#风机": "92",
"5#退火F1区风机": "6",
"5#退火F2区风机": "86",
"5#退火RET1区1#风机": "99",
"5#退火RET1区2#风机": "62"
}
},
"type": "AnnealFanFrequencyInfo"
}

View File

@@ -6,6 +6,7 @@ import fanFrequenceReducer from "./features/fanFrequenceSlice";
import combustionAirReducer from "./features/combustionAirSlice";
import gasReducer from "./features/gasSlice";
import temperatureReducer from "./features/temperatureSlice";
import annealTemperatureReducer from "./features/annealTemperatureSlice";
import fanInfoReducer from "./features/fanInfo";
import energySlice from "./features/EnergySlice";
import annealFanFrequenceReducer from "./features/annealFanFrequenceSlice";
@@ -30,6 +31,8 @@ export const store = configureStore({
combustionAir: combustionAirReducer,
// 温度
temperature: temperatureReducer,
// 温度
annealTemperature: annealTemperatureReducer,
// 能耗
energy: energySlice
},

View File

@@ -31,7 +31,8 @@ class XClient {
}
new XClient(
"ws://192.168.1.12:8081/xc-screen/websocket/xc001",
"ws://m306416y13.yicp.fun:35441/xc-screen/websocket/xc001",
// "ws://192.168.1.12:8081/xc-screen/websocket/xc001",
"DCS_DATA",
(msg) => {
let serializedData = null;
@@ -117,6 +118,14 @@ new XClient(
});
break;
}
case "AnnealTempInfo": {
// 退火监测温度列表
store.dispatch({
type: "annealTemperature/setTemp",
payload: serializedData.data,
});
break;
}
case "FeederInfo": {
// 投料机信息
store.dispatch({