From 0bd1f8dcacd934404524d0f099ac7325459ce816 Mon Sep 17 00:00:00 2001 From: lb Date: Thu, 25 Jan 2024 15:42:25 +0800 Subject: [PATCH] update energy cost page --- .../EnergyCostAnalysis/Energy/index.jsx | 177 ++++++++++++++---- .../Energy/index.module.css | 4 +- 2 files changed, 140 insertions(+), 41 deletions(-) diff --git a/src/components/Modules/EnergyCostAnalysis/Energy/index.jsx b/src/components/Modules/EnergyCostAnalysis/Energy/index.jsx index afacd88..524203c 100644 --- a/src/components/Modules/EnergyCostAnalysis/Energy/index.jsx +++ b/src/components/Modules/EnergyCostAnalysis/Energy/index.jsx @@ -1,9 +1,18 @@ import cls from "./index.module.css"; import GradientText from "../../../Common/GradientText"; import { useSelector } from "react-redux"; +import { useEffect, useState } from "react"; function Energy(props) { + const [isPage1, setIsPage1] = useState(true); const energyInfo = useSelector((state) => state.energy?.info); + + useEffect(() => { + setInterval(() => { + setIsPage1((pre) => !pre); + }, 3000); + }, []); + return (
- - 余热发电/kWh - - {(+energyInfo?.elecQty1)?.toFixed(2) || 0} - - - - - 水耗量/Km³ - - {(+energyInfo?.waterQty)?.toFixed(2) || 0} - - - - 天然气I/Nm³ - - {energyInfo?.ngQty1?.replace("Nm³", "") || "0Nm³"} - - - - 电耗量/kWh - - {(+energyInfo?.elecQty2)?.toFixed(2) || 0} - - - - 天然气II/Nm³ - - {energyInfo?.ngQty2?.replace("Nm³", "") || "0Nm³"} - - + {!isPage1 && ( +
+
+ 智慧能源光伏发电(昨日)/kWh + + {(+energyInfo?.elecQty6)?.toFixed(2) || 0} + +
+
+ 许昌安彩光伏发电(昨日)/kWh + + {(+energyInfo?.elecQty7)?.toFixed(2) || 0} + +
+
+ 智慧能源光伏发电(总量)/kWh + + {(+energyInfo?.elecQty4)?.toFixed(2) || 0} + +
+
+ 许昌安彩光伏发电(总量)/kWh + + {(+energyInfo?.elecQty5)?.toFixed(2) || 0} + +
+
+ )} + {isPage1 && ( + <> +
+
+ 余热发电(实时)/kWh + + {(+energyInfo?.elecQty1)?.toFixed(2) || 0} + +
+
+ 余热发电(总量)/kWh + + {(+energyInfo?.elecQty3)?.toFixed(2) || 0} + +
+
+ + 水耗量/Km³ + + {(+energyInfo?.waterQty)?.toFixed(2) || 0} + + + + 天然气I/Nm³ + + {energyInfo?.ngQty1?.replace("Nm³", "") || "0Nm³"} + + + + 电耗量/kWh + + {(+energyInfo?.elecQty2)?.toFixed(2) || 0} + + + + 天然气II/Nm³ + + {energyInfo?.ngQty2?.replace("Nm³", "") || "0Nm³"} + + + + )}
); } diff --git a/src/components/Modules/EnergyCostAnalysis/Energy/index.module.css b/src/components/Modules/EnergyCostAnalysis/Energy/index.module.css index c0615d3..c5613f8 100644 --- a/src/components/Modules/EnergyCostAnalysis/Energy/index.module.css +++ b/src/components/Modules/EnergyCostAnalysis/Energy/index.module.css @@ -2,7 +2,7 @@ display: grid; gap: 6px; /* grid-template-columns: 133px 158px 292px 292px; */ - grid-template-columns: 133px 210px 266px 266px; + grid-template-columns: 125px 250px 250px 250px; /* grid-template-rows: 60px 60px; */ grid-template-rows: 129px 129px; } @@ -15,7 +15,7 @@ .infoText { text-align: center; - font-size: 24px; + font-size: 22px; line-height: 2.5; /* line-height: 20px; */ letter-spacing: 1px;