diff --git a/src/components/Common/Energy/EnergyCostChart/index.jsx b/src/components/Common/Energy/EnergyCostChart/index.jsx
index 3489aed..f9f7945 100644
--- a/src/components/Common/Energy/EnergyCostChart/index.jsx
+++ b/src/components/Common/Energy/EnergyCostChart/index.jsx
@@ -1,9 +1,11 @@
import cls from "./index.module.css";
-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 { getOptions } from "../../../../utils/energeChartOption";
+import triangle from "../../../../assets/Icon/triangle.svg";
+import dayjs from "dayjs";
const EnergyCostChart = (props) => {
const elecTrend = useSelector((state) => state.energy.trend.elec);
@@ -21,6 +23,17 @@ const EnergyCostChart = (props) => {
currentTrend ?? { week: [], month: [], year: [] }
);
+ function handleDateChange(value) {
+ setPeriod(
+ {
+ 日: "day",
+ 周: "week",
+ 月: "month",
+ 年: "year",
+ }[value]
+ );
+ }
+
return (
@@ -45,7 +58,7 @@ const EnergyCostChart = (props) => {
-
setPeriod(v.target.value)}
@@ -60,7 +73,31 @@ const EnergyCostChart = (props) => {
年
-
+ */}
+
diff --git a/src/components/Common/Energy/EnergyCostChart/index.module.css b/src/components/Common/Energy/EnergyCostChart/index.module.css
index bfb21cc..7b615e4 100644
--- a/src/components/Common/Energy/EnergyCostChart/index.module.css
+++ b/src/components/Common/Energy/EnergyCostChart/index.module.css
@@ -16,7 +16,13 @@
letter-spacing: 1.2px;
color: #52fff8;
}
-
+.graphBaseDesc {
+ margin: 0 12px;
+ line-height: 1;
+ color: #76fff9;
+ flex: 1;
+ }
+
.energyCostChart .titleBar .legend {
display: flex;
align-items: center;
@@ -67,6 +73,10 @@
border: none !important;
border-radius: 0 !important;
}
+.radioGroupShort * {
+ border: none !important;
+ border-radius: 6px !important;
+}
.radioGroup *:focus-within {
box-shadow: none !important;
}
diff --git a/src/components/Common/SmokeHandle/SmokeTrendChart/index.jsx b/src/components/Common/SmokeHandle/SmokeTrendChart/index.jsx
index 465cdf9..7ef118b 100644
--- a/src/components/Common/SmokeHandle/SmokeTrendChart/index.jsx
+++ b/src/components/Common/SmokeHandle/SmokeTrendChart/index.jsx
@@ -1,11 +1,12 @@
import cls from "./index.module.css";
import { randomInt } from "../../../../utils";
import * as echarts from "echarts";
-import { Radio , Select } from "antd";
+import { Radio, Select } from "antd";
import ReactECharts from "echarts-for-react";
-import { useState } from "react";
+import { useEffect, useState } from "react";
import { useSelector } from "react-redux";
import triangle from "../../../../assets/Icon/triangle.svg";
+import dayjs from "dayjs";
const SmokeTrendChart = (props) => {
const dayTrend = useSelector((state) => state.smoke?.dayTrend);
@@ -27,10 +28,63 @@ const SmokeTrendChart = (props) => {
const options = getOptions(source, period, currentTrend);
+ const [desc, setDesc] = useState("");
+
+ useEffect(() => {
+ switch (period) {
+ case "day":
+ setDesc(
+ dayjs().subtract(1, "day").format("YYYY.MM.DD") +
+ " 7点 - " +
+ dayjs().format("YYYY.MM.DD") +
+ " 7点"
+ );
+ break;
+ case "month":
+ setDesc(
+ dayjs().subtract(1, "month").format("YYYY.MM.") +
+ "29 - " +
+ dayjs().format("YYYY.MM.") +
+ "28"
+ );
+ break;
+ case "week":
+ setDesc(
+ dayjs().subtract(7, "day").format("YYYY.MM.DD") +
+ " - " +
+ dayjs().subtract(1, "day").format("YYYY.MM.DD")
+ );
+ break;
+ case "year":
+ setDesc(
+ dayjs().subtract(1, "year").endOf("year").format("YYYY.MM.") +
+ "29 - " +
+ dayjs().endOf("year").format("YYYY.MM.") +
+ "28"
+ );
+ break;
+ }
+ }, [period]);
+
function handleDateChange(value) {
- setPeriod({
- 日: 'day', 周: 'week', 月: 'month', 年: 'year'
- }[value])
+ setPeriod(
+ {
+ 日: "day",
+ 周: "week",
+ 月: "month",
+ 年: "year",
+ }[value]
+ );
+ }
+ function handleSourceChange(value) {
+ setPeriod(
+ {
+ 氧气: "O2_float",
+ 氮氧化物: "NOX_float",
+ 二氧化硫: "SO2_float",
+ 颗粒物: "dust_float",
+ }[value]
+ );
}
return (
@@ -49,7 +103,7 @@ const SmokeTrendChart = (props) => {
-
setSource(e.target.value)}
buttonStyle="solid"
@@ -67,7 +121,33 @@ const SmokeTrendChart = (props) => {
颗粒物
-
+ */}
+