add energe slice

这个提交包含在:
lb
2023-12-06 16:24:34 +08:00
父节点 49ac95fbbd
当前提交 5f92580c7e
共有 3 个文件被更改,包括 40 次插入0 次删除

查看文件

@@ -0,0 +1,29 @@
import { createSlice } from "@reduxjs/toolkit";
export const initialState = {
info: {
// 余热发电
elecQty1: "0", // kWh
// 电消耗量
elecQty2: "0", // kWh
// 水消耗量
waterQty: "0", // Km³
// 天然气1
ngQty1: "0", // m³
// 天然气2
ngQty2: "0", // m³
},
};
const energySlice = createSlice({
name: "energy",
initialState,
reducers: {
setInfo: (state, action) => {
state.info = { ...state.info, ...action.payload };
},
},
});
export default energySlice.reducer;
export const { setInfo } = energySlice.actions;

查看文件

@@ -7,6 +7,7 @@ import combustionAirReducer from "./features/combustionAirSlice";
import gasReducer from "./features/gasSlice";
import temperatureReducer from "./features/temperatureSlice";
import fanInfoReducer from "./features/fanInfo";
import energySlice from "./features/EnergySlice";
export const store = configureStore({
reducer: {
@@ -26,5 +27,7 @@ export const store = configureStore({
combustionAir: combustionAirReducer,
// 温度
temperature: temperatureReducer,
// 能耗
energy: energySlice
},
});