From 1ebda5cf6fb6cfa1987808e35fce21c35fd1f948 Mon Sep 17 00:00:00 2001 From: lb Date: Wed, 24 Jan 2024 15:58:16 +0800 Subject: [PATCH] 1 --- .../Common/BottomItemBackground/index.jsx | 2 +- src/components/Common/GasFlow/index.jsx | 13 ++-- src/components/Common/NatGasFlow/index.jsx | 59 +++++++++++++++---- .../Common/NatGasFlow/index.module.css | 2 +- .../SmokeHandle/SmokeTrendChart/index.jsx | 38 +++++++++++- .../SmokeTrendChart/index.module.css | 4 ++ .../Common/TodayFaultTotal/index.jsx | 2 +- .../components/GoodRateChart/index.jsx | 14 ++--- src/components/container.module.scss | 3 +- 9 files changed, 109 insertions(+), 28 deletions(-) diff --git a/src/components/Common/BottomItemBackground/index.jsx b/src/components/Common/BottomItemBackground/index.jsx index db9ce43..c3f0690 100644 --- a/src/components/Common/BottomItemBackground/index.jsx +++ b/src/components/Common/BottomItemBackground/index.jsx @@ -6,7 +6,7 @@ function BottomBarItem(props) { diff --git a/src/components/Common/GasFlow/index.jsx b/src/components/Common/GasFlow/index.jsx index b6813cb..39cd367 100644 --- a/src/components/Common/GasFlow/index.jsx +++ b/src/components/Common/GasFlow/index.jsx @@ -6,6 +6,7 @@ import * as echarts from "echarts"; import { Switch } from "antd"; import { useState, useEffect } from "react"; import { useSelector, useDispatch } from "react-redux"; +import dayjs from "dayjs"; /** 助燃风流量 */ function GasI(props) { @@ -22,10 +23,17 @@ function GasI(props) { setShowChart(false); } } + + const desc = + dayjs().subtract(7, "day").format("YYYY.MM.DD") + + " - " + + dayjs().subtract(1, "day").format("YYYY.MM.DD"); + return ( @@ -39,10 +47,7 @@ function GasI(props) {
{showChart && ( - + )} {!showChart && (
diff --git a/src/components/Common/NatGasFlow/index.jsx b/src/components/Common/NatGasFlow/index.jsx index 08888ea..1246adb 100644 --- a/src/components/Common/NatGasFlow/index.jsx +++ b/src/components/Common/NatGasFlow/index.jsx @@ -1,11 +1,12 @@ // 天然气流量 import cls from "./index.module.css"; import BottomBarItem from "../BottomItemBackground"; - -import { Switch, Radio } from "antd"; +import triangle from "../../../assets/Icon/triangle.svg"; +import { Switch, Select, Radio } from "antd"; import { useState } from "react"; import GridList from "./gridList"; import GasChart from "./gasChart"; +import dayjs from "dayjs"; function GasII(props) { const [dataSource, setDataSource] = useState("gas-i"); // gas-i , gas-ii @@ -19,20 +20,33 @@ function GasII(props) { } } - function handleSourceChange(e) { - if (e.target.value == "ii") { - // 天然气II - setDataSource("gas-ii"); - } else if (e.target.value == "i") { - // 天然气 I + // function handleSourceChange(e) { + // if (e.target.value == "ii") { + // // 天然气II + // setDataSource("gas-ii"); + // } else if (e.target.value == "i") { + // // 天然气 I + // setDataSource("gas-i"); + // } + // } + + function handleDateChange(value) { + if (value == "天然气I") { setDataSource("gas-i"); + } else { + setDataSource("gas-ii"); } } + const desc = + dayjs().subtract(7, "day").format("YYYY.MM.DD") + + " - " + + dayjs().subtract(1, "day").format("YYYY.MM.DD"); return ( @@ -44,7 +58,32 @@ function GasII(props) { {!showChart && 实时流量}
- ({ + label: item, + value: item, + }))} + suffixIcon={#} + notFoundContent={ + + - 无 - + + } + onChange={(value, option) => handleDateChange(value)} + /> + + {/* 天然气 II - + */}
diff --git a/src/components/Common/NatGasFlow/index.module.css b/src/components/Common/NatGasFlow/index.module.css index 1fa1f50..68ef262 100644 --- a/src/components/Common/NatGasFlow/index.module.css +++ b/src/components/Common/NatGasFlow/index.module.css @@ -70,7 +70,7 @@ .radioGroup * { border: none !important; - border-radius: 0 !important; + border-radius: 6px !important; } .radioGroup *:focus-within { diff --git a/src/components/Common/SmokeHandle/SmokeTrendChart/index.jsx b/src/components/Common/SmokeHandle/SmokeTrendChart/index.jsx index 784eba3..465cdf9 100644 --- a/src/components/Common/SmokeHandle/SmokeTrendChart/index.jsx +++ b/src/components/Common/SmokeHandle/SmokeTrendChart/index.jsx @@ -1,10 +1,11 @@ import cls from "./index.module.css"; import { randomInt } from "../../../../utils"; import * as echarts from "echarts"; -import { Radio } from "antd"; +import { Radio , Select } from "antd"; import ReactECharts from "echarts-for-react"; import { useState } from "react"; import { useSelector } from "react-redux"; +import triangle from "../../../../assets/Icon/triangle.svg"; const SmokeTrendChart = (props) => { const dayTrend = useSelector((state) => state.smoke?.dayTrend); @@ -26,6 +27,12 @@ const SmokeTrendChart = (props) => { const options = getOptions(source, period, currentTrend); + function handleDateChange(value) { + setPeriod({ + 日: 'day', 周: 'week', 月: 'month', 年: 'year' + }[value]) + } + return (
@@ -62,7 +69,7 @@ const SmokeTrendChart = (props) => { - setPeriod(e.target.value)} buttonStyle="solid" @@ -80,7 +87,32 @@ const SmokeTrendChart = (props) => { - + */} + +