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);
function handleSourceChange(line) {
console.log("line changed", line);
setDataSource(line);
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -39,74 +39,74 @@ function preHandleStatisticData(data, legend) {
function FaultTotal(props) {
const [currentSelect, setCurrentSelect] = useState("日");
const isra = useSelector((state) => state.isra);
const dispatch = useDispatch();
// const dispatch = useDispatch();
useEffect(() => {
//
dispatch({
type: "isra/setCheckTypeList",
payload: [
"Lehrer",
"Anwalt",
"Professorin",
"Professor",
"Lehrerin",
"Anwältin",
],
});
// 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/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 },
],
},
],
});
}, []);
// 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 == "日"
@ -196,12 +196,27 @@ function FaultTotal(props) {
icon="battery"
title="产线缺陷统计"
dateOptions={["日", "周", "月", "年"]}
defaultSelect={currentSelect}
onDateChange={handleDateChange}
size={bgSize}
style={{ width: "600px" }}
>
<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>
</GraphBase>
);

View File

@ -42,7 +42,7 @@ function getOptions(series) {
}
function getSeries(currentStatistic, currentLine) {
console.log("get series", currentStatistic, currentLine);
const currentItem = currentStatistic.find((item) => item.name == currentLine);
return [
{
type: "pie",
@ -58,15 +58,10 @@ function getSeries(currentStatistic, currentLine) {
labelLine: {
length: 0,
},
data: [
{ value: 1048, name: "缺陷1" },
{ value: 735, name: "缺陷2" },
{ value: 580, name: "缺陷3" },
{ value: 484, name: "缺陷4" },
{ value: 300, name: "缺陷5" },
{ value: 300, name: "缺陷6" },
{ value: 300, name: "缺陷8" },
],
data: currentItem.data.map((item) => ({
value: item.checkNum,
name: item.checkType,
})),
},
];
}
@ -76,9 +71,7 @@ function FaultType(props) {
const [currentLine, setCurrentLine] = useState("");
const isra = useSelector((state) => state.isra);
const currentStatistic = isra.dayStatistic || [];
console.log("currentStatistic ", currentStatistic);
const lines = currentStatistic.map((item, index) => item.name);
const lines = currentStatistic.map((item) => item.name);
useEffect(() => {
if (init == false) return;
if (lines.length) {
@ -110,7 +103,21 @@ function FaultType(props) {
style={{ width: "600px" }}
>
<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>
</GraphBase>
);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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