This commit is contained in:
2024-07-09 14:50:29 +08:00
parent 8b4322996e
commit 9968280724
73 changed files with 1560 additions and 6 deletions

View File

@@ -0,0 +1,159 @@
import { createSlice } from "@reduxjs/toolkit";
export const initialState = {
// info: {
// // 余热发电
// elecQty1: "0", // kWh
// // 电消耗量
// elecQty2: "0", // kWh
// elecQty3: "0", // kWh
// elecQty4: "0", // kWh
// elecQty5: "0", // kWh
// elecQty6: "0", // kWh
// elecQty7: "0", // kWh
// // 水消耗量
// waterQty: "0", // Km³
// // 天然气1
// ngQty1: "0", // m³
// // 天然气2
// ngQty2: "0", // m³
// },
// trend: {
// natGas1: {
// // 暂时只存了周数据:
// week: [],
// month: [],
// year: [],
// },
// natGas2: {
// week: [],
// month: [],
// year: [],
// },
// elec: {
// week: [
// // { qty: 10, time: "01" },
// // { qty: 20, time: "02" },
// // { qty: 30, time: "03" },
// // { qty: 40, time: "04" },
// // { qty: 50, time: "05" },
// // { qty: 60, time: "06" },
// // { qty: 70, time: "07" },
// ],
// month: [
// // { qty: 20, time: "02" },
// // { qty: 30, time: "03" },
// // { qty: 40, time: "04" },
// // { qty: 50, time: "05" },
// // { qty: 60, time: "06" },
// // { qty: 70, time: "07" },
// // { qty: 80, time: "08" },
// // { qty: 90, time: "09" },
// // { qty: 100, time: "10" },
// // { qty: 110, time: "11" },
// // { qty: 120, time: "12" },
// // { qty: 130, time: "13" },
// // { qty: 140, time: "14" },
// // { qty: 150, time: "15" },
// // { qty: 160, time: "16" },
// // { qty: 170, time: "17" },
// // { qty: 180, time: "18" },
// // { qty: 190, time: "19" },
// // { qty: 200, time: "20" },
// // { qty: 210, time: "21" },
// // { qty: 220, time: "22" },
// // { qty: 230, time: "23" },
// // { qty: 240, time: "24" },
// // { qty: 250, time: "25" },
// // { qty: 260, time: "26" },
// // { qty: 270, time: "27" },
// // { qty: 280, time: "28" },
// // { qty: 290, time: "29" },
// // { qty: 300, time: "30" },
// // { qty: 310, time: "31" },
// ],
// year: [
// // { qty: 10, time: "01" },
// // { qty: 20, time: "02" },
// // { qty: 30, time: "03" },
// // { qty: 40, time: "04" },
// // { qty: 50, time: "05" },
// // { qty: 60, time: "06" },
// // { qty: 70, time: "07" },
// // { qty: 80, time: "08" },
// // { qty: 90, time: "09" },
// // { qty: 100, time: "10" },
// // { qty: 110, time: "11" },
// // { qty: 120, time: "12" },
// ],
// },
// },
pressureAvg:{},
liquidAvg:{},
bottomTempAvg:{},
topTempAvg:{}
};
const kilnOptimizeSlice = createSlice({
name: "kilnOptimize",
initialState,
reducers: {
// setInfo: (state, action) => {
// state.info = { ...state.info, ...action.payload };
// },
// setElecTrend: (state, action) => {
// 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) {
// state.info.ngQty1 = action.payload.sumGas1Now;
// }
// if ("sumGas2Now" in action.payload) {
// state.info.ngQty2 = action.payload.sumGas2Now;
// }
// if ("hisSumGas1For7Day" in action.payload) {
// state.trend.natGas1.week = action.payload.hisSumGas1For7Day;
// }
// if ("hisSumGas2For7Day" in action.payload) {
// state.trend.natGas2.week = action.payload.hisSumGas2For7Day;
// }
// if ("sumGas1ForMonth" in action.payload) {
// state.trend.natGas1.month = action.payload.sumGas1ForMonth;
// }
// if ("sumGas2ForMonth" in action.payload) {
// state.trend.natGas2.month = action.payload.sumGas2ForMonth;
// }
// if ("sumGas1ForYear" in action.payload) {
// state.trend.natGas1.year = action.payload.sumGas1ForYear;
// }
// if ("sumGas2ForYear" in action.payload) {
// state.trend.natGas2.year = action.payload.sumGas2ForYear;
// }
// },
// ====================
setPressureAvg: (state, action) => {
console.log(action.payload)
state.pressureAvg = action.payload;
},
setLiquidAvg: (state, action) => {
state.liquidAvg = action.payload;
},
setBottomTempAvg: (state, action) => {
state.bottomTempAvg = action.payload;
},
setTopTempAvg: (state, action) => {
state.topTempAvg = action.payload;
}
},
});
export default kilnOptimizeSlice.reducer;
export const { setPressureAvg, setLiquidAvg,setBottomTempAvg,setTopTempAvg} = kilnOptimizeSlice.actions;

View File

@@ -15,6 +15,7 @@ import annealFanInfoReducer from "./features/annealFanInfoSlice";
import cuttingReducer from "./features/cuttingSlice";
import smokeReducer from "./features/smokeSlice";
import alarmSlice from "./features/alarmSlice";
import kilnOptimizeSlice from "./features/kilnOptimizeSlice";
export const store = configureStore({
reducer: {
@@ -49,6 +50,8 @@ export const store = configureStore({
// 切割
cutting: cuttingReducer,
// 烟气
smoke: smokeReducer
smoke: smokeReducer,
// 窑炉优化
kilnOptimize: kilnOptimizeSlice
},
});