update
This commit is contained in:
부모
e4a2af8458
커밋
c3511e1bfe
@ -6,6 +6,7 @@ import { useEffect, useState } from "react";
|
||||
import { useSelector } from "react-redux";
|
||||
|
||||
function WindFrequence(props) {
|
||||
const [currLine, setCurrLine] = useState('1线')
|
||||
const [showChart, setShowChart] = useState(false);
|
||||
const [currentLine, setCurrentLine] = useState([]);
|
||||
const runState = useSelector((state) => state.annealFanFrequence.runtime);
|
||||
@ -155,6 +156,7 @@ function WindFrequence(props) {
|
||||
|
||||
function handleLineChange(line) {
|
||||
const lineNum = line[0];
|
||||
setCurrLine(line);
|
||||
setCurrentLine((old) =>
|
||||
dataList.filter((item) => item?.name.startsWith(`${lineNum}#`))
|
||||
);
|
||||
@ -169,6 +171,7 @@ function WindFrequence(props) {
|
||||
switchPosition={[null, 200]} // [top, left]
|
||||
onSwitch={handleSwitchChange}
|
||||
dateOptions={["1线", "2线", "3线", "4线", "5线"]}
|
||||
defaultSelect={currLine}
|
||||
onDateChange={handleLineChange}
|
||||
>
|
||||
<div className={cls.chart} style={{ marginTop: "24px" }}>
|
||||
|
@ -32,7 +32,7 @@ function TemperatureBottom(props) {
|
||||
}}
|
||||
>
|
||||
{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>
|
||||
);
|
||||
|
@ -36,7 +36,7 @@ function TemperatureTop(props) {
|
||||
}}
|
||||
>
|
||||
{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>
|
||||
);
|
||||
|
@ -1,8 +1,8 @@
|
||||
import cls from "./index.module.css";
|
||||
import GraphBase from "../GraphBase";
|
||||
import ReactECharts from "echarts-for-react";
|
||||
import { useSelector, useDispatch } from "react-redux";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useSelector } from "react-redux";
|
||||
import { useState } from "react";
|
||||
|
||||
function preHandleStatisticData(data, legend) {
|
||||
const obj = {};
|
||||
@ -36,92 +36,8 @@ function preHandleStatisticData(data, legend) {
|
||||
return series;
|
||||
}
|
||||
|
||||
function FaultTotal(props) {
|
||||
const [currentSelect, setCurrentSelect] = useState("日");
|
||||
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 = {
|
||||
function getOptions(series, isra, currentStatistic) {
|
||||
return {
|
||||
color: ["#2760FF", "#8167F6", "#5B9BFF", "#99D66C", "#FFD160", "#FF8A40"],
|
||||
grid: { top: 42, right: 12, bottom: 20, left: 48 },
|
||||
legend: {
|
||||
@ -182,6 +98,25 @@ function FaultTotal(props) {
|
||||
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) {
|
||||
setCurrentSelect(v);
|
||||
|
불러오는 중...
Reference in New Issue
Block a user