From 4b043214ca409f9543ff9d04c5d8a753a877b9c3 Mon Sep 17 00:00:00 2001 From: lb Date: Tue, 2 Jan 2024 10:53:43 +0800 Subject: [PATCH] update elec --- src/components/Common/CurrentLineSpec/index.jsx | 4 ++-- .../Modules/Home/CenterTop/RightTable/index.jsx | 4 ++-- src/store/features/EnergySlice.js | 10 +++++++++- src/utils/energe.ts | 2 +- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/components/Common/CurrentLineSpec/index.jsx b/src/components/Common/CurrentLineSpec/index.jsx index 46f6cb3..b904a5f 100644 --- a/src/components/Common/CurrentLineSpec/index.jsx +++ b/src/components/Common/CurrentLineSpec/index.jsx @@ -11,8 +11,8 @@ function Chart1(props) { headerBGC: "#044A8460", header: [ '产线名', - '原板宽度', - '净板宽', + '玻璃长度', + '玻璃宽度', '玻璃厚度', ], // oddRowBGC: "#042444", diff --git a/src/components/Modules/Home/CenterTop/RightTable/index.jsx b/src/components/Modules/Home/CenterTop/RightTable/index.jsx index f9b60c4..ef81040 100644 --- a/src/components/Modules/Home/CenterTop/RightTable/index.jsx +++ b/src/components/Modules/Home/CenterTop/RightTable/index.jsx @@ -9,8 +9,8 @@ function CurrentSpec(props) { headerBGC: "#044A8460", header: [ '产线名', - '原板宽度', - '净板宽', + '玻璃长度', + '玻璃宽度', '玻璃厚度', ], // oddRowBGC: "#042444", diff --git a/src/store/features/EnergySlice.js b/src/store/features/EnergySlice.js index 445d0ca..e693684 100644 --- a/src/store/features/EnergySlice.js +++ b/src/store/features/EnergySlice.js @@ -93,7 +93,15 @@ const energySlice = createSlice({ state.info = { ...state.info, ...action.payload }; }, setElecTrend: (state, action) => { - state.trend.elec = action.payload; + if (action.payload.week?.length) { + state.trend.elec.week = action.payload.week; + } + if (action.payload.month?.length) { + state.trend.elec.month = action.payload.month; + } + if (action.payload.year?.length) { + state.trend.elec.year = action.payload.year; + } }, setSumGasData: (state, action) => { if ("sumGas1Now" in action.payload) { diff --git a/src/utils/energe.ts b/src/utils/energe.ts index 534e367..e7fa54a 100644 --- a/src/utils/energe.ts +++ b/src/utils/energe.ts @@ -18,7 +18,7 @@ export default function handler(msg: MessageEvent) { } case "EnergyTrend": { store.dispatch({ - type: "energy/setTrend", + type: "energy/setElecTrend", payload: serializedData.data, }); break;