update
This commit is contained in:
parent
e4a2af8458
commit
c3511e1bfe
@ -6,6 +6,7 @@ import { useEffect, useState } from "react";
|
|||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
|
|
||||||
function WindFrequence(props) {
|
function WindFrequence(props) {
|
||||||
|
const [currLine, setCurrLine] = useState('1线')
|
||||||
const [showChart, setShowChart] = useState(false);
|
const [showChart, setShowChart] = useState(false);
|
||||||
const [currentLine, setCurrentLine] = useState([]);
|
const [currentLine, setCurrentLine] = useState([]);
|
||||||
const runState = useSelector((state) => state.annealFanFrequence.runtime);
|
const runState = useSelector((state) => state.annealFanFrequence.runtime);
|
||||||
@ -155,6 +156,7 @@ function WindFrequence(props) {
|
|||||||
|
|
||||||
function handleLineChange(line) {
|
function handleLineChange(line) {
|
||||||
const lineNum = line[0];
|
const lineNum = line[0];
|
||||||
|
setCurrLine(line);
|
||||||
setCurrentLine((old) =>
|
setCurrentLine((old) =>
|
||||||
dataList.filter((item) => item?.name.startsWith(`${lineNum}#`))
|
dataList.filter((item) => item?.name.startsWith(`${lineNum}#`))
|
||||||
);
|
);
|
||||||
@ -169,6 +171,7 @@ function WindFrequence(props) {
|
|||||||
switchPosition={[null, 200]} // [top, left]
|
switchPosition={[null, 200]} // [top, left]
|
||||||
onSwitch={handleSwitchChange}
|
onSwitch={handleSwitchChange}
|
||||||
dateOptions={["1线", "2线", "3线", "4线", "5线"]}
|
dateOptions={["1线", "2线", "3线", "4线", "5线"]}
|
||||||
|
defaultSelect={currLine}
|
||||||
onDateChange={handleLineChange}
|
onDateChange={handleLineChange}
|
||||||
>
|
>
|
||||||
<div className={cls.chart} style={{ marginTop: "24px" }}>
|
<div className={cls.chart} style={{ marginTop: "24px" }}>
|
||||||
|
@ -32,7 +32,7 @@ function TemperatureBottom(props) {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{Object.keys(tempBottom).map((d) => (
|
{Object.keys(tempBottom).map((d) => (
|
||||||
<BlueRect title={d} value={tempBottom[d]} blue={blueTe.includes(d)} />
|
<BlueRect title={d} key={d + Math.random()} value={tempBottom[d]} blue={blueTe.includes(d)} />
|
||||||
))}
|
))}
|
||||||
</motion.div>
|
</motion.div>
|
||||||
);
|
);
|
||||||
|
@ -36,7 +36,7 @@ function TemperatureTop(props) {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{Object.keys(tempTop).map((d) => (
|
{Object.keys(tempTop).map((d) => (
|
||||||
<BlueRect title={d} value={tempTop[d]} blue={blueTe.includes(d)} />
|
<BlueRect title={d} key={d + Math.random()} value={tempTop[d]} blue={blueTe.includes(d)} />
|
||||||
))}
|
))}
|
||||||
</motion.div>
|
</motion.div>
|
||||||
);
|
);
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import cls from "./index.module.css";
|
import cls from "./index.module.css";
|
||||||
import GraphBase from "../GraphBase";
|
import GraphBase from "../GraphBase";
|
||||||
import ReactECharts from "echarts-for-react";
|
import ReactECharts from "echarts-for-react";
|
||||||
import { useSelector, useDispatch } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import { useEffect, useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
function preHandleStatisticData(data, legend) {
|
function preHandleStatisticData(data, legend) {
|
||||||
const obj = {};
|
const obj = {};
|
||||||
@ -36,92 +36,8 @@ function preHandleStatisticData(data, legend) {
|
|||||||
return series;
|
return series;
|
||||||
}
|
}
|
||||||
|
|
||||||
function FaultTotal(props) {
|
function getOptions(series, isra, currentStatistic) {
|
||||||
const [currentSelect, setCurrentSelect] = useState("日");
|
return {
|
||||||
const isra = useSelector((state) => state.isra);
|
|
||||||
// const dispatch = useDispatch();
|
|
||||||
|
|
||||||
// useEffect(() => {
|
|
||||||
// // 设置缺陷
|
|
||||||
// dispatch({
|
|
||||||
// type: "isra/setCheckTypeList",
|
|
||||||
// payload: [
|
|
||||||
// "Lehrer",
|
|
||||||
// "Anwalt",
|
|
||||||
// "Professorin",
|
|
||||||
// "Professor",
|
|
||||||
// "Lehrerin",
|
|
||||||
// "Anwältin",
|
|
||||||
// ],
|
|
||||||
// });
|
|
||||||
|
|
||||||
// dispatch({
|
|
||||||
// type: "isra/setDayStatistic",
|
|
||||||
// payload: [
|
|
||||||
// // 产线1
|
|
||||||
// {
|
|
||||||
// name: "10.1.1.1",
|
|
||||||
// sum: 500,
|
|
||||||
// data: [
|
|
||||||
// { checkType: "Lehrer", checkNum: 100 },
|
|
||||||
// { checkType: "Anwalt", checkNum: 200 },
|
|
||||||
// { checkType: "Professor", checkNum: 200 },
|
|
||||||
// ],
|
|
||||||
// },
|
|
||||||
// // 产线2
|
|
||||||
// {
|
|
||||||
// name: "10.1.1.2",
|
|
||||||
// sum: 730,
|
|
||||||
// data: [
|
|
||||||
// { checkType: "Lehrer", checkNum: 200 },
|
|
||||||
// { checkType: "Anwalt", checkNum: 130 },
|
|
||||||
// { checkType: "Lehrerin", checkNum: 400 },
|
|
||||||
// ],
|
|
||||||
// },
|
|
||||||
// ],
|
|
||||||
// });
|
|
||||||
|
|
||||||
// dispatch({
|
|
||||||
// type: "isra/setWeekStatistic",
|
|
||||||
// payload: [
|
|
||||||
// // 产线1
|
|
||||||
// {
|
|
||||||
// name: "10.1.1.1",
|
|
||||||
// sum: 500,
|
|
||||||
// data: [
|
|
||||||
// { checkType: "Lehrerin", checkNum: 100 },
|
|
||||||
// { checkType: "Anwalt", checkNum: 200 },
|
|
||||||
// { checkType: "Professor", checkNum: 200 },
|
|
||||||
// ],
|
|
||||||
// },
|
|
||||||
// // 产线2
|
|
||||||
// {
|
|
||||||
// name: "10.1.1.2",
|
|
||||||
// sum: 730,
|
|
||||||
// data: [
|
|
||||||
// { checkType: "Professor", checkNum: 200 },
|
|
||||||
// { checkType: "Anwalt", checkNum: 130 },
|
|
||||||
// { checkType: "Lehrerin", checkNum: 400 },
|
|
||||||
// ],
|
|
||||||
// },
|
|
||||||
// ],
|
|
||||||
// });
|
|
||||||
// }, []);
|
|
||||||
|
|
||||||
const currentStatistic =
|
|
||||||
currentSelect == "日"
|
|
||||||
? isra.dayStatistic
|
|
||||||
: currentSelect == "周"
|
|
||||||
? isra.weekStatistic
|
|
||||||
: currentSelect == "月"
|
|
||||||
? isra.monthStatistic
|
|
||||||
: currentSelect == "月"
|
|
||||||
? isra.yearStatistic
|
|
||||||
: [];
|
|
||||||
|
|
||||||
const series = preHandleStatisticData(currentStatistic, isra.checkTypeList);
|
|
||||||
|
|
||||||
const options = {
|
|
||||||
color: ["#2760FF", "#8167F6", "#5B9BFF", "#99D66C", "#FFD160", "#FF8A40"],
|
color: ["#2760FF", "#8167F6", "#5B9BFF", "#99D66C", "#FFD160", "#FF8A40"],
|
||||||
grid: { top: 42, right: 12, bottom: 20, left: 48 },
|
grid: { top: 42, right: 12, bottom: 20, left: 48 },
|
||||||
legend: {
|
legend: {
|
||||||
@ -182,6 +98,25 @@ function FaultTotal(props) {
|
|||||||
trigger: "axis",
|
trigger: "axis",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function FaultTotal(props) {
|
||||||
|
const [currentSelect, setCurrentSelect] = useState("日");
|
||||||
|
const isra = useSelector((state) => state.isra);
|
||||||
|
|
||||||
|
const currentStatistic =
|
||||||
|
currentSelect == "日"
|
||||||
|
? isra.dayStatistic
|
||||||
|
: currentSelect == "周"
|
||||||
|
? isra.weekStatistic
|
||||||
|
: currentSelect == "月"
|
||||||
|
? isra.monthStatistic
|
||||||
|
: currentSelect == "月"
|
||||||
|
? isra.yearStatistic
|
||||||
|
: [];
|
||||||
|
|
||||||
|
const series = preHandleStatisticData(currentStatistic, isra.checkTypeList);
|
||||||
|
const options = getOptions(series, isra, currentStatistic);
|
||||||
|
|
||||||
function handleDateChange(v) {
|
function handleDateChange(v) {
|
||||||
setCurrentSelect(v);
|
setCurrentSelect(v);
|
||||||
|
Loading…
Reference in New Issue
Block a user