From 9f51f2b3cb7af838e8c0576724df3da282e14250 Mon Sep 17 00:00:00 2001 From: lb Date: Thu, 7 Dec 2023 09:56:21 +0800 Subject: [PATCH] update --- src/App.js | 2 - src/components/Common/CurrentTemp/index.jsx | 254 +++++++++--------- src/components/Common/FanInfo/index.jsx | 24 +- .../Common/FanRunFrequence/index.jsx | 50 +--- src/components/Common/Feeder/index.jsx | 16 +- src/components/Common/GasFlow/index.jsx | 14 - src/components/Common/KilnInfo/Kiln.jsx | 39 +-- .../Modules/EnergyCostAnalysis/O/index.jsx | 21 -- .../Modules/KilnInner/Center/index.jsx | 64 ----- .../Center/videoComponents/EnterToFloor1.jsx | 13 - .../Center/videoComponents/Floor1To2.jsx | 14 - .../Center/videoComponents/Floor2To1.jsx | 14 - .../Modules/QualityCheck/RightSide/index.jsx | 4 - src/pages/Home/index.jsx | 4 - 14 files changed, 150 insertions(+), 383 deletions(-) diff --git a/src/App.js b/src/App.js index bbb8173..3a6e5e1 100644 --- a/src/App.js +++ b/src/App.js @@ -1,8 +1,6 @@ -// import "./App.css"; import "./global.css"; import "./index.css"; import Head from "./components/Common/Company"; -// import { SocketContextProvider } from "../store/socket-data-provider"; import useSlider, { Slider } from "./hooks/useSlider"; import NavMenu from "./components/Common/NavMenu"; import { useState } from "react"; diff --git a/src/components/Common/CurrentTemp/index.jsx b/src/components/Common/CurrentTemp/index.jsx index 4f91dbe..015b046 100644 --- a/src/components/Common/CurrentTemp/index.jsx +++ b/src/components/Common/CurrentTemp/index.jsx @@ -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 ( -
- {props.split !== false && ( - - )} - {props.children} -
- ); + return ( +
+ {props.split !== false && ( + + )} + {props.children} +
+ ); }; 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 ( - -
- -

A1区板上

-
- 123.8℃ - 123.8℃ - 123.8℃ -
-
- -

A1区板上

-
- 123.8℃ - 123.8℃ - 123.8℃ -
-
- -

A1区板上

-
- 123.8℃ - 123.8℃ - 123.8℃ -
-
- -

A1区板上

-
- 123.8℃ - 123.8℃ - 123.8℃ -
-
- -

A1区板上

-
- 123.8℃ - 123.8℃ - 123.8℃ -
-
- -
- 123.8℃ - 123.8℃ - 123.8℃ -
-
- -

A1区板上

-
- 123.8℃ - 123.8℃ - 123.8℃ -
-
- -
- 123.8℃ - 123.8℃ - 123.8℃ -
-
- -

A1区板上

-
- 123.8℃ -
-
- -

A1区板上

-
- 123.8℃ -
-
-
-
- ); + return ( + +
+ +

A1区板上

+
+ 123.8℃ + 123.8℃ + 123.8℃ +
+
+ +

A1区板上

+
+ 123.8℃ + 123.8℃ + 123.8℃ +
+
+ +

A1区板上

+
+ 123.8℃ + 123.8℃ + 123.8℃ +
+
+ +

A1区板上

+
+ 123.8℃ + 123.8℃ + 123.8℃ +
+
+ +

A1区板上

+
+ 123.8℃ + 123.8℃ + 123.8℃ +
+
+ +
+ 123.8℃ + 123.8℃ + 123.8℃ +
+
+ +

A1区板上

+
+ 123.8℃ + 123.8℃ + 123.8℃ +
+
+ +
+ 123.8℃ + 123.8℃ + 123.8℃ +
+
+ +

A1区板上

+
+ 123.8℃ +
+
+ +

A1区板上

+
+ 123.8℃ +
+
+
+
+ ); } export default WindFrequence; diff --git a/src/components/Common/FanInfo/index.jsx b/src/components/Common/FanInfo/index.jsx index 924cd2e..af06bda 100644 --- a/src/components/Common/FanInfo/index.jsx +++ b/src/components/Common/FanInfo/index.jsx @@ -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" - }">${ - item == 1 ? "运行" : item == 0 ? "故障" : "未运行" - }`; + }">${item == 1 ? "运行" : item == 0 ? "故障" : "未运行"}`; } return `${item}`; }); @@ -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 = { diff --git a/src/components/Common/FanRunFrequence/index.jsx b/src/components/Common/FanRunFrequence/index.jsx index 7486193..c668b5f 100644 --- a/src/components/Common/FanRunFrequence/index.jsx +++ b/src/components/Common/FanRunFrequence/index.jsx @@ -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 = [ diff --git a/src/components/Common/Feeder/index.jsx b/src/components/Common/Feeder/index.jsx index def4066..564bf28 100644 --- a/src/components/Common/Feeder/index.jsx +++ b/src/components/Common/Feeder/index.jsx @@ -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} diff --git a/src/components/Common/GasFlow/index.jsx b/src/components/Common/GasFlow/index.jsx index 8f47b1e..fe955ac 100644 --- a/src/components/Common/GasFlow/index.jsx +++ b/src/components/Common/GasFlow/index.jsx @@ -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 = [ diff --git a/src/components/Common/KilnInfo/Kiln.jsx b/src/components/Common/KilnInfo/Kiln.jsx index 9910be9..22d8557 100644 --- a/src/components/Common/KilnInfo/Kiln.jsx +++ b/src/components/Common/KilnInfo/Kiln.jsx @@ -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 (
diff --git a/src/components/Modules/EnergyCostAnalysis/O/index.jsx b/src/components/Modules/EnergyCostAnalysis/O/index.jsx index a73c25f..497da56 100644 --- a/src/components/Modules/EnergyCostAnalysis/O/index.jsx +++ b/src/components/Modules/EnergyCostAnalysis/O/index.jsx @@ -2,27 +2,6 @@ import GraphBase from '../../../Common/GraphBase'; import ReactECharts from 'echarts-for-react'; import getOptions from '../../../../hooks/getChartOption'; -// function rand(max) { -// return Math.ceil(Math.random() * max); -// } -// function getArr(len) { -// return Array(len).fill(1).map(() => rand(100)) -// } -// function getArrs(len) { -// return Array(len).fill(1).map(() => getArr(7)) -// } -// function fan4(...arrs) { -// const total = arrs[0].map((_, i) => -// arrs.reduce((sum, arr) => sum + arr[i], 0), -// ); -// arrs.unshift(total); -// return arrs; -// } -// function main() { -// // console.log(JSON.stringify(fan(getArrs(3)))) -// console.log(fan(getArrs(3))) -// } - function Oxygen(props) { function handleSwitch(v) { console.log('switched ', v); diff --git a/src/components/Modules/KilnInner/Center/index.jsx b/src/components/Modules/KilnInner/Center/index.jsx index 9907ddc..03671ed 100644 --- a/src/components/Modules/KilnInner/Center/index.jsx +++ b/src/components/Modules/KilnInner/Center/index.jsx @@ -2,7 +2,6 @@ import { useState } from "react"; import cls from "./index.module.css"; import Chart2 from "../../../Common/TimeFireDir"; import VideoContainer from "./VideoContainer"; -import TemperatureTop from "../../../Common/TemperatureTop"; function KilnCenter() { const [floor, setFloor] = useState(0); @@ -57,71 +56,8 @@ function KilnCenter() {
- {/* 覆盖层温度信息 */} - {/* */} - {/* video */} - - {/*
*/} - - {/* left side */} - {/*
- {data.map((item) => ( -
- - {item.name} - - - {item.value} ℃ - -
- ))} -
- -
-
-
-
*/} ); } diff --git a/src/components/Modules/KilnInner/Center/videoComponents/EnterToFloor1.jsx b/src/components/Modules/KilnInner/Center/videoComponents/EnterToFloor1.jsx index 5a7d9a6..80f54e8 100644 --- a/src/components/Modules/KilnInner/Center/videoComponents/EnterToFloor1.jsx +++ b/src/components/Modules/KilnInner/Center/videoComponents/EnterToFloor1.jsx @@ -69,19 +69,6 @@ function EnterToFloorOne(props) { > )} - {/* */} )} - {/* */} )} - {/* */} -