This commit is contained in:
lb
2023-12-07 09:56:21 +08:00
parent d4a4e82aa6
commit 9f51f2b3cb
14 changed files with 150 additions and 383 deletions

View File

@@ -1,138 +1,136 @@
import BottomBarItem from '../BottomItemBackground';
import GraphBase from '../GraphBase';
import { Radio } from 'antd';
import cls from './index.module.css';
import { useState } from 'react';
import GraphBase from "../GraphBase";
import cls from "./index.module.css";
import { useState } from "react";
const SmallBox = (props) => {
return (
<div
className="small-box"
style={{
boxShadow: 'inset 0 0 18px 10px #fff1',
borderRadius: '3px',
padding: '6px',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
color: '#fff',
position: 'relative',
userSelect: 'none',
}}
>
{props.split !== false && (
<span
className="vertical-line"
style={{
position: 'absolute',
display: 'inline-block',
width: '2px',
height: '80%',
top: '10%',
left: '50%',
background:
'linear-gradient(to bottom, transparent, #fff3, #fffa, #fff3, transparent)',
}}
></span>
)}
{props.children}
</div>
);
return (
<div
className="small-box"
style={{
boxShadow: "inset 0 0 18px 10px #fff1",
borderRadius: "3px",
padding: "6px",
display: "flex",
alignItems: "center",
justifyContent: "center",
color: "#fff",
position: "relative",
userSelect: "none",
}}
>
{props.split !== false && (
<span
className="vertical-line"
style={{
position: "absolute",
display: "inline-block",
width: "2px",
height: "80%",
top: "10%",
left: "50%",
background:
"linear-gradient(to bottom, transparent, #fff3, #fffa, #fff3, transparent)",
}}
></span>
)}
{props.children}
</div>
);
};
function WindFrequence(props) {
const [dataSource, setDataSource] = useState('风机');
const [dataSource, setDataSource] = useState("风机");
function handleSourceChange(v) {
console.log('val', v);
}
function handleSourceChange(v) {
console.log("val", v);
}
return (
<GraphBase
icon="pause"
title="当前温度"
dateOptions={['风机', '风阀', '电加热']}
onDateChange={handleSourceChange}
size={['middle', 'long']}
>
<div className={cls.mainContent + ' ' + cls.grid}>
<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>
<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>
<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>
<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>
<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}>
<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>
</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}>
<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>
</SmallBox>
<SmallBox>
<h1 className={cls.areaName}>A1区板上</h1>
<div className={cls.areaContent}>
<span className={cls.areaValue}>123.8</span>
</div>
</SmallBox>
<SmallBox>
<h1 className={cls.areaName}>A1区板上</h1>
<div className={cls.areaContent}>
<span className={cls.areaValue}>123.8</span>
</div>
</SmallBox>
</div>
</GraphBase>
);
return (
<GraphBase
icon="pause"
title="当前温度"
dateOptions={["风机", "风阀", "电加热"]}
onDateChange={handleSourceChange}
size={["middle", "long"]}
>
<div className={cls.mainContent + " " + cls.grid}>
<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>
<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>
<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>
<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>
<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}>
<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>
</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}>
<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>
</SmallBox>
<SmallBox>
<h1 className={cls.areaName}>A1区板上</h1>
<div className={cls.areaContent}>
<span className={cls.areaValue}>123.8</span>
</div>
</SmallBox>
<SmallBox>
<h1 className={cls.areaName}>A1区板上</h1>
<div className={cls.areaContent}>
<span className={cls.areaValue}>123.8</span>
</div>
</SmallBox>
</div>
</GraphBase>
);
}
export default WindFrequence;

View File

@@ -3,17 +3,6 @@ import "./index.module.scss";
import { useSelector } from "react-redux";
import { ScrollBoard } from "@jiaminghi/data-view-react";
function getRandomRow() {
const idx = Math.ceil(Math.random() * 100);
return [idx, `${idx}#风机`, Math.ceil(Math.random() * 2) - 1];
}
function getRandomRows(rows) {
return Array(rows)
.fill(0)
.map(() => getRandomRow());
}
function attachStyle(data) {
return data.map((arr) => {
return arr.map((item, index) => {
@@ -23,9 +12,9 @@ function attachStyle(data) {
item == 1 ? "#2760ff55" : item == 0 ? "#a81b2655" : "#E6A23C55"
}; margin-right: 8px; width: 8px; height: 8px; border-radius: 8px; background: ${
item == 1 ? "#2760ff" : item == 0 ? "#a81b26" : "#E6A23C"
}"></span><span style="color: ${item == 1 ? "#2760ff" : item == 0 ? "#a81b26" : "#E6A23C"}">${
item == 1 ? "运行" : item == 0 ? "故障" : "未运行"
}</span></div>`;
}"></span><span style="color: ${
item == 1 ? "#2760ff" : item == 0 ? "#a81b26" : "#E6A23C"
}">${item == 1 ? "运行" : item == 0 ? "故障" : "未运行"}</span></div>`;
}
return `<span style='color: #fffa'>${item}</span>`;
});
@@ -34,11 +23,14 @@ function attachStyle(data) {
function FanInfo(props) {
const rowNum = props.rows || 8;
// let data = getRandomRows(100);
const fanInfo = useSelector((state) => state.fanInfo.fanInfo);
const data = Object.keys(fanInfo).map((key, index) => {
return [index+1, key, fanInfo[key] == "运行" ? 1 : fanInfo[key] == "故障" ? 0 : 2];
return [
index + 1,
key,
fanInfo[key] == "运行" ? 1 : fanInfo[key] == "故障" ? 0 : 2,
];
});
let config = {

View File

@@ -1,61 +1,15 @@
// FanRunFrequence
import cls from "./index.module.css";
import ReactECharts from "echarts-for-react";
import * as echarts from "echarts";
import GraphBase from "../../Common/GraphBase";
import { useEffect, useState } from "react";
import { useSelector, useDispatch } from "react-redux";
// function mockData(type = "runtime") {
// const RUNTIME_DATA_LENGTH = 16;
// const MAX_HISTORY_DATA_LENGTH = 10;
// const WEEK = 7;
// switch (type) {
// case "runtime":
// return [
// ...Array.from(
// { length: RUNTIME_DATA_LENGTH },
// () => Math.floor(Math.random() * 100) + "m³/h"
// ),
// ];
// case "history":
// return {
// ...Array.from(
// { length: Math.floor(Math.random() * MAX_HISTORY_DATA_LENGTH) },
// (_, index) => ({
// ["FAIIA" + index]: [
// ...Array.from({ length: WEEK }, () =>
// Math.floor(Math.random() * 100)
// ),
// ],
// })
// ).reduce((arr, curr) => ({ ...arr, ...curr }), {}),
// };
// default:
// break;
// }
// }
import { useState } from "react";
import { useSelector } from "react-redux";
function WindFrequence(props) {
const [showChart, setShowChart] = useState(false);
// const dispath = useDispatch();
const runState = useSelector((state) => state.fanFrequence.runtime);
const hisState = useSelector((state) => state.fanFrequence.history);
// useEffect(() => {
// setInterval(() => {
// dispath({
// type: "fanFrequence/setRuntime",
// payload: mockData("runtime"),
// });
// dispath({
// type: "fanFrequence/setHistory",
// payload: mockData("history"),
// });
// }, 50000);
// }, [dispath]);
let dataList = [];
let seriesData = [];
const colors = [

View File

@@ -1,5 +1,5 @@
import { useSelector } from "react-redux";
import { motion, AnimatePresence } from "framer-motion";
import { motion } from "framer-motion";
function FeederStatus(props) {
const feeder = useSelector((state) => state.feeder);
@@ -29,7 +29,12 @@ function FeederStatus(props) {
color: "#fff",
border: "1px solid #fff",
padding: "12px",
background: leftFeeder == "运行" ? "#0f03" : leftFeeder == "故障" ? "#f003" : "#da33",
background:
leftFeeder == "运行"
? "#0f03"
: leftFeeder == "故障"
? "#f003"
: "#da33",
}}
>
投料机1 : {leftFeeder}
@@ -39,7 +44,12 @@ function FeederStatus(props) {
color: "#fff",
border: "1px solid #fff",
padding: "12px",
background: rightFeeder == "运行" ? "#0f03" : rightFeeder == "故障" ? "#f003" : "#da33",
background:
rightFeeder == "运行"
? "#0f03"
: rightFeeder == "故障"
? "#f003"
: "#da33",
}}
>
投料机2 : {rightFeeder}

View File

@@ -41,23 +41,9 @@ import { useSelector, useDispatch } from "react-redux";
/** 助燃风流量 */
function GasI(props) {
const [showChart, setShowChart] = useState(true);
// const dispath = useDispatch();
const runState = useSelector((state) => state.combustionAir.runtime);
const hisState = useSelector((state) => state.combustionAir.history);
// useEffect(() => {
// setInterval(() => {
// dispath({
// type: "combustionAir/setRuntime",
// payload: mockData("runtime"),
// });
// dispath({
// type: "combustionAir/setHistory",
// payload: mockData("history"),
// });
// }, 60000);
// }, [dispath]);
let dataList = [];
let seriesData = [];
const colors = [

View File

@@ -1,53 +1,16 @@
import cls from "./kiln.module.scss";
import Container from "../../Container";
import { useEffect } from "react";
import { useSelector, useDispatch } from "react-redux";
import { useSelector } from "react-redux";
import { stateNameMap } from "../../../store/features/kilnSlice";
export default function Kiln() {
const kilnInfo = useSelector((state) => state.kiln);
// const dispatch = useDispatch();
const infos = Object.keys(kilnInfo).map((key) => ({
label: stateNameMap[key],
value: kilnInfo[key],
}));
// useEffect(() => {
// setInterval(() => {
// dispatch({
// type: "kiln/setKilnInfo",
// payload: {
// kilnPressure: Math.ceil(Math.random() * 100) + "Pa",
// waterTemp: Math.ceil(Math.random() * 100) + "℃",
// waterFlow: Math.ceil(Math.random() * 100) + "m³/h",
// waterPressure: Math.ceil(Math.random() * 100) + "Pa",
// combustionAirPressure: Math.ceil(Math.random() * 100) + "Pa",
// topTemp: Math.ceil(Math.random() * 100) + "℃",
// compressedAirPressure: Math.ceil(Math.random() * 100) + "Pa",
// meltTemp: Math.ceil(Math.random() * 100) + "℃",
// },
// });
// }, 30000);
// }, [dispatch]);
// const infos = [
// { label: "窑炉压力", value: ctx?.runState?.kilnPressure || "0Pa" },
// { label: "循环水温度", value: ctx?.runState?.waterTemp || "0℃" },
// { label: "循环水流量", value: ctx?.runState?.waterFlow || "0㎡/h" },
// { label: "循环水压力", value: ctx?.runState?.waterPressure || "0Pa" },
// {
// label: "助燃风压力",
// value: ctx?.runState?.combustionAirPressure || "0℃",
// },
// { label: "碹顶加权温度", value: ctx?.runState?.topTemp || "0℃" },
// {
// label: "压缩气压力",
// value: ctx?.runState?.compressedAirPressure || "0Pa",
// },
// { label: "融化加权温度", value: ctx?.runState?.meltTemp || "0℃" },
// ];
return (
<Container title="窑炉信息" icon="kiln" className={cls.leftBar__top}>
<div className={cls.leftBar__top__content}>