This commit is contained in:
lb 2023-12-14 11:24:03 +08:00
parent 68065b612a
commit e4a2af8458
24 changed files with 130 additions and 119 deletions

View File

@ -48,7 +48,6 @@ function WindFrequence(props) {
const currentTempList = useSelector((state) => state.annealTemperature?.data); const currentTempList = useSelector((state) => state.annealTemperature?.data);
function handleSourceChange(line) { function handleSourceChange(line) {
console.log("line changed", line);
setDataSource(line); setDataSource(line);
} }

View File

@ -84,8 +84,6 @@ const EnergyCostChart = (props) => {
}; };
function handleSwitchChange(val) { function handleSwitchChange(val) {
// val: boolean
console.log('switch change', val);
} }
return ( return (

View File

@ -6,7 +6,6 @@ import { useSelector } from "react-redux";
function EnergyCost(props) { function EnergyCost(props) {
const energyInfo = useSelector((state) => state.energy?.info); const energyInfo = useSelector((state) => state.energy?.info);
console.log("energyInfo", energyInfo);
if (energyInfo) { if (energyInfo) {
} }
return ( return (

View File

@ -56,7 +56,6 @@ function GraphBase(props) {
}); });
} }
if (dateOptions) { if (dateOptions) {
console.log('[Graph Base] ', dateOptions, defaultSelect)
dto = dateOptions.map((item) => ( dto = dateOptions.map((item) => (
<Radio.Button value={item} key={item} className="radio-group__item"> <Radio.Button value={item} key={item} className="radio-group__item">
{item} {item}
@ -108,8 +107,9 @@ function GraphBase(props) {
</div> </div>
)} )}
{dateOptions && ( {dateOptions && (
// defaultValue={defaultSelect || dateOptions[0]}
<Radio.Group <Radio.Group
defaultValue={defaultSelect || dateOptions[0]} value={defaultSelect || dateOptions[0]}
buttonStyle="solid" buttonStyle="solid"
className={cls.graphBaseDate + ' ' + cls.radioGroup} className={cls.graphBaseDate + ' ' + cls.radioGroup}
onChange={({ target }) => onDateChange(target.value)} onChange={({ target }) => onDateChange(target.value)}

View File

@ -13,10 +13,7 @@ function GasChart(props) {
.sort() .sort()
.map((key, index) => hisState?.[dataName][key]) .map((key, index) => hisState?.[dataName][key])
: Array(dataSource == "gas-i" ? 8 : 4).fill(Array(7).fill(0)); : Array(dataSource == "gas-i" ? 8 : 4).fill(Array(7).fill(0));
// // debug
// console.log(' series data', dataName, hisState?.[dataName], seriesData);
return ( return (
<div className={cls.gasChart}> <div className={cls.gasChart}>
<ReactECharts <ReactECharts

View File

@ -20,7 +20,6 @@ function GasII(props) {
} }
function handleSourceChange(e) { function handleSourceChange(e) {
console.log("val", e.target.value);
if (e.target.value == "ii") { if (e.target.value == "ii") {
// II // II
setDataSource("gas-ii"); setDataSource("gas-ii");

View File

@ -118,7 +118,6 @@ const SmokeTrendChart = (props) => {
function handleSwitchChange(val) { function handleSwitchChange(val) {
// val: boolean // val: boolean
console.log('switch change', val);
} }
return ( return (

View File

@ -39,74 +39,74 @@ function preHandleStatisticData(data, legend) {
function FaultTotal(props) { function FaultTotal(props) {
const [currentSelect, setCurrentSelect] = useState("日"); const [currentSelect, setCurrentSelect] = useState("日");
const isra = useSelector((state) => state.isra); const isra = useSelector((state) => state.isra);
const dispatch = useDispatch(); // const dispatch = useDispatch();
useEffect(() => { // useEffect(() => {
// // //
dispatch({ // dispatch({
type: "isra/setCheckTypeList", // type: "isra/setCheckTypeList",
payload: [ // payload: [
"Lehrer", // "Lehrer",
"Anwalt", // "Anwalt",
"Professorin", // "Professorin",
"Professor", // "Professor",
"Lehrerin", // "Lehrerin",
"Anwältin", // "Anwältin",
], // ],
}); // });
dispatch({ // dispatch({
type: "isra/setDayStatistic", // type: "isra/setDayStatistic",
payload: [ // payload: [
// 线1 // // 线1
{ // {
name: "10.1.1.1", // name: "10.1.1.1",
sum: 500, // sum: 500,
data: [ // data: [
{ checkType: "Lehrer", checkNum: 100 }, // { checkType: "Lehrer", checkNum: 100 },
{ checkType: "Anwalt", checkNum: 200 }, // { checkType: "Anwalt", checkNum: 200 },
{ checkType: "Professor", checkNum: 200 }, // { checkType: "Professor", checkNum: 200 },
], // ],
}, // },
// 线2 // // 线2
{ // {
name: "10.1.1.2", // name: "10.1.1.2",
sum: 730, // sum: 730,
data: [ // data: [
{ checkType: "Lehrer", checkNum: 200 }, // { checkType: "Lehrer", checkNum: 200 },
{ checkType: "Anwalt", checkNum: 130 }, // { checkType: "Anwalt", checkNum: 130 },
{ checkType: "Lehrerin", checkNum: 400 }, // { checkType: "Lehrerin", checkNum: 400 },
], // ],
}, // },
], // ],
}); // });
dispatch({ // dispatch({
type: "isra/setWeekStatistic", // type: "isra/setWeekStatistic",
payload: [ // payload: [
// 线1 // // 线1
{ // {
name: "10.1.1.1", // name: "10.1.1.1",
sum: 500, // sum: 500,
data: [ // data: [
{ checkType: "Lehrerin", checkNum: 100 }, // { checkType: "Lehrerin", checkNum: 100 },
{ checkType: "Anwalt", checkNum: 200 }, // { checkType: "Anwalt", checkNum: 200 },
{ checkType: "Professor", checkNum: 200 }, // { checkType: "Professor", checkNum: 200 },
], // ],
}, // },
// 线2 // // 线2
{ // {
name: "10.1.1.2", // name: "10.1.1.2",
sum: 730, // sum: 730,
data: [ // data: [
{ checkType: "Professor", checkNum: 200 }, // { checkType: "Professor", checkNum: 200 },
{ checkType: "Anwalt", checkNum: 130 }, // { checkType: "Anwalt", checkNum: 130 },
{ checkType: "Lehrerin", checkNum: 400 }, // { checkType: "Lehrerin", checkNum: 400 },
], // ],
}, // },
], // ],
}); // });
}, []); // }, []);
const currentStatistic = const currentStatistic =
currentSelect == "日" currentSelect == "日"
@ -196,12 +196,27 @@ function FaultTotal(props) {
icon="battery" icon="battery"
title="产线缺陷统计" title="产线缺陷统计"
dateOptions={["日", "周", "月", "年"]} dateOptions={["日", "周", "月", "年"]}
defaultSelect={currentSelect}
onDateChange={handleDateChange} onDateChange={handleDateChange}
size={bgSize} size={bgSize}
style={{ width: "600px" }} style={{ width: "600px" }}
> >
<div className={cls.chart}> <div className={cls.chart}>
<ReactECharts option={options} style={{ height: "100%" }} /> {currentStatistic.length != 0 && (
<ReactECharts option={options} style={{ height: "100%" }} />
)}
{currentStatistic.length == 0 && (
<p
style={{
paddingTop: "72px",
color: "#fff6",
textAlign: "center",
fontSize: "24px",
}}
>
暂无数据
</p>
)}
</div> </div>
</GraphBase> </GraphBase>
); );

View File

@ -42,7 +42,7 @@ function getOptions(series) {
} }
function getSeries(currentStatistic, currentLine) { function getSeries(currentStatistic, currentLine) {
console.log("get series", currentStatistic, currentLine); const currentItem = currentStatistic.find((item) => item.name == currentLine);
return [ return [
{ {
type: "pie", type: "pie",
@ -58,15 +58,10 @@ function getSeries(currentStatistic, currentLine) {
labelLine: { labelLine: {
length: 0, length: 0,
}, },
data: [ data: currentItem.data.map((item) => ({
{ value: 1048, name: "缺陷1" }, value: item.checkNum,
{ value: 735, name: "缺陷2" }, name: item.checkType,
{ value: 580, name: "缺陷3" }, })),
{ value: 484, name: "缺陷4" },
{ value: 300, name: "缺陷5" },
{ value: 300, name: "缺陷6" },
{ value: 300, name: "缺陷8" },
],
}, },
]; ];
} }
@ -76,9 +71,7 @@ function FaultType(props) {
const [currentLine, setCurrentLine] = useState(""); const [currentLine, setCurrentLine] = useState("");
const isra = useSelector((state) => state.isra); const isra = useSelector((state) => state.isra);
const currentStatistic = isra.dayStatistic || []; const currentStatistic = isra.dayStatistic || [];
const lines = currentStatistic.map((item) => item.name);
console.log("currentStatistic ", currentStatistic);
const lines = currentStatistic.map((item, index) => item.name);
useEffect(() => { useEffect(() => {
if (init == false) return; if (init == false) return;
if (lines.length) { if (lines.length) {
@ -110,7 +103,21 @@ function FaultType(props) {
style={{ width: "600px" }} style={{ width: "600px" }}
> >
<div className={cls.chart}> <div className={cls.chart}>
<ReactECharts option={options} style={{ height: "100%" }} /> {currentStatistic.length == 0 && (
<p
style={{
paddingTop: "72px",
color: "#fff6",
textAlign: "center",
fontSize: "24px",
}}
>
暂无数据
</p>
)}
{currentStatistic.length != 0 && (
<ReactECharts option={options} style={{ height: "100%" }} />
)}
</div> </div>
</GraphBase> </GraphBase>
); );

View File

@ -112,7 +112,6 @@ const GoodRateChart = (props) => {
function handleSwitchChange(val) { function handleSwitchChange(val) {
// val: boolean // val: boolean
console.log('switch change', val);
} }
return ( return (

View File

@ -4,11 +4,11 @@ import getOptions from '../../../../hooks/getChartOption';
function Gas(props) { function Gas(props) {
function handleSwitch(v) { function handleSwitch(v) {
console.log('switched ', v); // console.log('switched ', v);
} }
function handleDateChange(v) { function handleDateChange(v) {
console.log('date ', v); // console.log('date ', v);
} }
return ( return (

View File

@ -4,11 +4,11 @@ import getOptions from '../../../../hooks/getChartOption';
function ElecCost(props) { function ElecCost(props) {
function handleSwitch(v) { function handleSwitch(v) {
console.log('switched ', v); // console.log('switched ', v);
} }
function handleDateChange(v) { function handleDateChange(v) {
console.log('date ', v); // console.log('date ', v);
} }
return ( return (

View File

@ -4,11 +4,11 @@ import getOptions from '../../../../hooks/getChartOption';
function NO(props) { function NO(props) {
function handleSwitch(v) { function handleSwitch(v) {
console.log('switched ', v); // console.log('switched ', v);
} }
function handleDateChange(v) { function handleDateChange(v) {
console.log('date ', v); // console.log('date ', v);
} }
return ( return (

View File

@ -4,11 +4,11 @@ import getOptions from '../../../../hooks/getChartOption';
function NO2(props) { function NO2(props) {
function handleSwitch(v) { function handleSwitch(v) {
console.log('switched ', v); // console.log('switched ', v);
} }
function handleDateChange(v) { function handleDateChange(v) {
console.log('date ', v); // console.log('date ', v);
} }
return ( return (

View File

@ -4,11 +4,11 @@ import getOptions from '../../../../hooks/getChartOption';
function NatGas(props) { function NatGas(props) {
function handleSwitch(v) { function handleSwitch(v) {
console.log('switched ', v); // console.log('switched ', v);
} }
function handleDateChange(v) { function handleDateChange(v) {
console.log('date ', v); // console.log('date ', v);
} }
return ( return (

View File

@ -4,11 +4,11 @@ import getOptions from '../../../../hooks/getChartOption';
function Oxygen(props) { function Oxygen(props) {
function handleSwitch(v) { function handleSwitch(v) {
console.log('switched ', v); // console.log('switched ', v);
} }
function handleDateChange(v) { function handleDateChange(v) {
console.log('date ', v); // console.log('date ', v);
} }
return ( return (

View File

@ -4,11 +4,11 @@ import getOptions from '../../../../hooks/getChartOption';
function RestHeat(props) { function RestHeat(props) {
function handleSwitch(v) { function handleSwitch(v) {
console.log('switched ', v); // console.log('switched ', v);
} }
function handleDateChange(v) { function handleDateChange(v) {
console.log('date ', v); // console.log('date ', v);
} }
return ( return (

View File

@ -4,11 +4,11 @@ import getOptions from '../../../../hooks/getChartOption';
function SO2(props) { function SO2(props) {
function handleSwitch(v) { function handleSwitch(v) {
console.log('switched ', v); // console.log('switched ', v);
} }
function handleDateChange(v) { function handleDateChange(v) {
console.log('date ', v); // console.log('date ', v);
} }
return ( return (

View File

@ -4,11 +4,11 @@ import getOptions from '../../../../hooks/getChartOption';
function WaterCost(props) { function WaterCost(props) {
function handleSwitch(v) { function handleSwitch(v) {
console.log('switched ', v); // console.log('switched ', v);
} }
function handleDateChange(v) { function handleDateChange(v) {
console.log('date ', v); // console.log('date ', v);
} }
return ( return (

View File

@ -82,7 +82,7 @@ function VideoContainer(props) {
}; };
function handleEnterVideoEnd() { function handleEnterVideoEnd() {
console.log('video end'); // console.log('video end');
enterToFloorOne(); enterToFloorOne();
} }

View File

@ -16,12 +16,12 @@ function EnterToFloorOne(props) {
if (show) { if (show) {
vd.current.play(); vd.current.play();
setTimeout(() => { setTimeout(() => {
console.log("开启enter的火播放"); // console.log("enter");
setFireCanPlay(true); setFireCanPlay(true);
}, 5000); }, 5000);
} }
return () => { return () => {
console.log("关闭enter的火播放"); // console.log("enter");
setFireCanPlay(false); setFireCanPlay(false);
}; };
}, [show]); }, [show]);

View File

@ -17,13 +17,13 @@ function FloorOneToTwo(props) {
if (show) { if (show) {
vd.current.play(); vd.current.play();
setTimeout(() => { setTimeout(() => {
console.log("开启1-2的火播放"); // console.log("1-2");
setFireCanPlay(true); setFireCanPlay(true);
}, 3000); }, 3000);
} }
if (!show) setFireCanPlay(false); if (!show) setFireCanPlay(false);
return () => { return () => {
console.log("关闭1-2的火播放"); // console.log("1-2");
setFireCanPlay(false); setFireCanPlay(false);
}; };
}, [show]); }, [show]);

View File

@ -16,13 +16,13 @@ function FloorTwoToOne(props) {
if (show) { if (show) {
vd.current.play(); vd.current.play();
setTimeout(() => { setTimeout(() => {
console.log("开启2-1的火播放"); // console.log("2-1");
setFireCanPlay(true); setFireCanPlay(true);
}, 3000); }, 3000);
} }
if (!show) setFireCanPlay(false); if (!show) setFireCanPlay(false);
return () => { return () => {
console.log("关闭2-1的火播放"); // console.log("2-1");
setFireCanPlay(false); setFireCanPlay(false);
}; };
}, [show]); }, [show]);

View File

@ -12,7 +12,6 @@ import RestHeat from '../../components/Modules/EnergyCostAnalysis/RestHeat';
import Gas from '../../components/Modules/EnergyCostAnalysis/BadGas'; import Gas from '../../components/Modules/EnergyCostAnalysis/BadGas';
function EnergyAnalysis(props) { function EnergyAnalysis(props) {
console.log('[rendering...] 加载 能耗分析页面');
return ( return (
<div className={cls.grid}> <div className={cls.grid}>
<div className={cls.bgDitu}></div> <div className={cls.bgDitu}></div>