connect 助燃风流量

This commit is contained in:
lb
2023-11-30 16:40:02 +08:00
parent af531456f4
commit d65fc0e3ed
4 changed files with 128 additions and 64 deletions

View File

@@ -0,0 +1,44 @@
import { createSlice } from "@reduxjs/toolkit";
/** 助燃风流量 */
export const initialState = {
history: {
// 历史数据
"1#天然气流量": [
// ...Array.from({ length: 7 }, () => Math.floor(Math.random() * 100)),
...Array.from({ length: 7 }, () => 0),
],
"2#天然气流量": [...Array.from({ length: 7 }, () => 0)],
"3#天然气流量": [...Array.from({ length: 7 }, () => 0)],
"4#天然气流量": [...Array.from({ length: 7 }, () => 0)],
"5#天然气流量": [...Array.from({ length: 7 }, () => 0)],
"6#天然气流量": [...Array.from({ length: 7 }, () => 0)],
"7#天然气流量": [...Array.from({ length: 7 }, () => 0)],
"8#天然气流量": [...Array.from({ length: 7 }, () => 0)],
},
runtime: [
// 实时数据
...Array.from(
{ length: 16 },
() => "0m³/h"
// () => Math.floor(Math.random() * 100) + "m³/h"
),
],
};
const combustionAir = createSlice({
name: "combustionAir",
initialState,
reducers: {
setHistory: (state, action) => {
state.history = action.payload;
},
setRuntime: (state, action) => {
state.runtime = action.payload;
},
},
});
export default combustionAir.reducer;
export const { setHistory, setRuntime } = combustionAir.actions;

View File

@@ -2,13 +2,20 @@ import { configureStore } from "@reduxjs/toolkit";
import kilnReducer from "./features/kilnSlice";
import fireReducer from "./features/fireSlice";
import fanFrequenceReducer from "./features/fanFrequenceSlice";
import combustionAirReducer from "./features/combustionAirSlice";
import gasReducer from "./features/gasSlice";
export const store = configureStore({
reducer: {
// 窑炉信息
kiln: kilnReducer,
// 火向信息
fireInfo: fireReducer,
// 风机运行频率
fanFrequence: fanFrequenceReducer,
// 天然气流量
wind: gasReducer,
// 助燃风流量
combustionAir: combustionAirReducer,
},
});