This commit is contained in:
lb
2023-12-07 09:56:21 +08:00
parent d4a4e82aa6
commit 9f51f2b3cb
14 changed files with 150 additions and 383 deletions

View File

@@ -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 = [