From b27a20f3cfd62689813192b597ce0c85c2b6d718 Mon Sep 17 00:00:00 2001 From: lb Date: Thu, 25 Jan 2024 10:24:08 +0800 Subject: [PATCH] update rightbar --- .../Energy/EnergeCostRealtime/index.jsx | 46 ++++++++++++------- .../EnergeCostRealtime/index.module.scss | 22 +++++---- .../Common/Energy/index.module.scss | 6 +-- .../SmokeHandle/SmokeHandleTable/index.jsx | 24 ++++++++++ .../SmokeHandle/SmokeTrendChart/index.jsx | 9 +--- .../SmokeTrendChart/index.module.css | 1 + src/components/Common/SmokeHandle/index.jsx | 19 +------- .../Common/SmokeHandle/index.module.scss | 10 ++-- 8 files changed, 77 insertions(+), 60 deletions(-) create mode 100644 src/components/Common/SmokeHandle/SmokeHandleTable/index.jsx diff --git a/src/components/Common/Energy/EnergeCostRealtime/index.jsx b/src/components/Common/Energy/EnergeCostRealtime/index.jsx index 04c4748..3f2b131 100644 --- a/src/components/Common/Energy/EnergeCostRealtime/index.jsx +++ b/src/components/Common/Energy/EnergeCostRealtime/index.jsx @@ -6,22 +6,36 @@ const EnergyCostRealtime = () => { return (
-
- - 余热发电 - - - {(+energyInfo?.elecQty1)?.toFixed(2) || 0}kWh - +
+
+ + 余热发电(实时) + + + {(+energyInfo?.elecQty2)?.toFixed(2) || 0}kWh + +
+ +
+ + 余热发电(总量) + + + {(+energyInfo?.elecQty1)?.toFixed(2) || 0}kWh + +
diff --git a/src/components/Common/Energy/EnergeCostRealtime/index.module.scss b/src/components/Common/Energy/EnergeCostRealtime/index.module.scss index f838cae..5147cf5 100644 --- a/src/components/Common/Energy/EnergeCostRealtime/index.module.scss +++ b/src/components/Common/Energy/EnergeCostRealtime/index.module.scss @@ -1,24 +1,20 @@ .cost__info { margin-top: 4px; margin-bottom: 12px; - - div { - flex-grow: 1; - } } .info__item { border-radius: 2px; color: hsl(0, 0%, 100%, 0.9); box-shadow: inset 0 0 17px 0px hsla(0, 0%, 100%, 0.15); - // min-width: 190px; - // height: 43px; font-size: 14px; - // letter-spacing: 1.43px; - line-height: 40px; + line-height: 28px; padding-left: 12px; - // text-align: center; + padding: 8px 0; user-select: none; + display: flex; + flex-direction: column; + align-items: center; } .hAuto { @@ -26,8 +22,16 @@ } .info__item_groups { + flex: 2; margin-left: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } + +.info__item_groups_col1 { + flex: 1; + display: grid; + grid-template-rows: 1fr 1fr; + gap: 8px; +} diff --git a/src/components/Common/Energy/index.module.scss b/src/components/Common/Energy/index.module.scss index 70b3580..6afebf4 100644 --- a/src/components/Common/Energy/index.module.scss +++ b/src/components/Common/Energy/index.module.scss @@ -2,7 +2,7 @@ background: url(../../../assets/energy.png) no-repeat; background-size: 100% 100%; width: 626px; - height: 400px; + height: 460px; } .cost__info { @@ -18,13 +18,9 @@ border-radius: 2px; color: hsl(0, 0%, 100%, 0.9); box-shadow: inset 0 0 17px 0px hsla(0, 0%, 100%, 0.15); - // min-width: 190px; - // height: 43px; font-size: 14px; - // letter-spacing: 1.43px; line-height: 40px; padding-left: 12px; - // text-align: center; user-select: none; } diff --git a/src/components/Common/SmokeHandle/SmokeHandleTable/index.jsx b/src/components/Common/SmokeHandle/SmokeHandleTable/index.jsx new file mode 100644 index 0000000..2343e01 --- /dev/null +++ b/src/components/Common/SmokeHandle/SmokeHandleTable/index.jsx @@ -0,0 +1,24 @@ +import { useSelector } from "react-redux"; +import cls from "../index.module.scss"; + +const SmokeHandleTable = () => { + const smokeInfo = useSelector((state) => state.smoke?.info); + return ( +
+
+ 氧 气 含 量 : {(+smokeInfo?.O2_float)?.toFixed(2) || 0}% +
+
+ 氮氧化物浓度: {(+smokeInfo?.NOX_float)?.toFixed(2) || 0}mg/m³ +
+
+ 二氧化硫浓度: {(+smokeInfo?.SO2_float)?.toFixed(2) || 0}mg/m³ +
+
+ 颗粒物浓度: {(+smokeInfo?.dust_float)?.toFixed(2) || 0}mg/m³ +
+
+ ); +}; + +export default SmokeHandleTable; diff --git a/src/components/Common/SmokeHandle/SmokeTrendChart/index.jsx b/src/components/Common/SmokeHandle/SmokeTrendChart/index.jsx index 7ef118b..28812a1 100644 --- a/src/components/Common/SmokeHandle/SmokeTrendChart/index.jsx +++ b/src/components/Common/SmokeHandle/SmokeTrendChart/index.jsx @@ -1,7 +1,6 @@ import cls from "./index.module.css"; -import { randomInt } from "../../../../utils"; import * as echarts from "echarts"; -import { Radio, Select } from "antd"; +import { Select } from "antd"; import ReactECharts from "echarts-for-react"; import { useEffect, useState } from "react"; import { useSelector } from "react-redux"; @@ -194,7 +193,7 @@ const SmokeTrendChart = (props) => { onChange={(value, option) => handleDateChange(value)} />
- {options && } + {options && } {!options && (

state.smoke?.info); - return (

-
-
- 氧 气 含 量 : {(+smokeInfo?.O2_float)?.toFixed(2) || 0}% -
-
- 氮氧化物浓度: {(+smokeInfo?.NOX_float)?.toFixed(2) || 0}mg/m³ -
-
- 二氧化硫浓度: {(+smokeInfo?.SO2_float)?.toFixed(2) || 0}mg/m³ -
-
- 颗粒物浓度: {(+smokeInfo?.dust_float)?.toFixed(2) || 0}mg/m³ -
-
+
diff --git a/src/components/Common/SmokeHandle/index.module.scss b/src/components/Common/SmokeHandle/index.module.scss index bb8632c..dacb98b 100644 --- a/src/components/Common/SmokeHandle/index.module.scss +++ b/src/components/Common/SmokeHandle/index.module.scss @@ -3,7 +3,7 @@ background: url(../../../assets/smoke.png) no-repeat; background-size: 100% 100%; width: 626px; - height: 540px; + height: 490px; .smokeHandle__content { margin-top: 8px; } @@ -13,19 +13,17 @@ border-radius: 2px; color: hsl(0, 0%, 100%, 0.9); box-shadow: inset 0 0 17px 0px hsla(0, 0%, 100%, 0.15); - // width: 288px; - height: 56px; + height: 32px; font-size: 16px; letter-spacing: 1.43px; - line-height: 56px; + line-height: 32px; text-align: center; user-select: none; } .info__item_groups { margin-bottom: 12px; - margin-left: 8px; display: grid; grid-template-columns: 1fr 1fr; - gap: 8px; + gap: 4px; }