update elec

This commit is contained in:
lb
2024-01-02 10:53:43 +08:00
parent 871efd2eb2
commit 4b043214ca
4 changed files with 14 additions and 6 deletions

View File

@@ -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) {