yudao-dev/src/store/modules/websocket.js
2024-01-03 14:08:49 +08:00

113 lines
3.1 KiB
JavaScript

const state = {
fanFrequencyInfo:{},// 分机运行频率
kilnInfo:{},// 窑炉信息
gasInfo:{},// 天然气流量图
sumGasInfo: {},// 天然气总量
israKiln:[],// ISRA缺陷检测
material:[],// 原料
energyInfo: {
elecQty1: '',
elecQty2: '',
waterQty: ''
}, // 能耗
energyWeekTrend:[],
energyMonthTrend:[],
energyYearTrend:[],// 能耗图
exhaustGasInfo:{}, // 烟气
gasChartDayTrend:{}, // 烟气
gasChartWeekTrend:{}, // 烟气
gasChartMonthTrend:{}, // 烟气
gasChartYearTrend:{} // 烟气
};
const mutations = {
SET_FANFREQUENCYINFO: (state, fanFrequencyInfo) => {
state.fanFrequencyInfo = fanFrequencyInfo
},
SET_KILNINFO: (state, kilnInfo) => {
state.kilnInfo = kilnInfo
},
SET_GASINFO: (state, gasInfo) => {
state.gasInfo = gasInfo
},
SET_SUMGASINFO: (state, sumGasInfo) => {
state.sumGasInfo = sumGasInfo
},
SET_ISRAKILN: (state, israKiln) => {
state.israKiln = israKiln
},
SET_MATERIAL: (state, material) => {
state.material = material
},
SET_ENERGYINFO: (state, energyInfo) => {
if (Object.keys(energyInfo).length > 1) {
state.energyInfo.elecQty1 = energyInfo.elecQty1
state.energyInfo.elecQty2 = energyInfo.elecQty2
} else {
state.energyInfo.waterQty = energyInfo.waterQty
}
},
SET_ENERGYTREND: (state, energyTrend) => {
if (energyTrend.week.length > 0) {
state.energyWeekTrend = energyTrend.week
}
if (energyTrend.month.length > 0) {
state.energyMonthTrend = energyTrend.month
}
if (energyTrend.year.length > 0) {
state.energyYearTrend = energyTrend.year
}
},
SET_EXHAUSTGASINFO: (state, exhaustGasInfo) => {
state.exhaustGasInfo = exhaustGasInfo
},
SET_EXHAUSTGASCHART: (state, exhaustGasChart) => {
state.gasChartDayTrend = exhaustGasChart.gasChartDayTrend
state.gasChartWeekTrend = exhaustGasChart.gasChartWeekTrend
state.gasChartMonthTrend = exhaustGasChart.gasChartMonthTrend
state.gasChartYearTrend = exhaustGasChart.gasChartYearTrend
}
};
const actions = {
setFanFrequencyInfo({ commit }, fanFrequencyInfo) {
commit('SET_FANFREQUENCYINFO', fanFrequencyInfo.payload)
},
setKilnInfo({ commit }, kilnInfo) {
commit('SET_KILNINFO', kilnInfo.payload)
},
setGasInfo({ commit }, gasInfo) {
commit('SET_GASINFO', gasInfo.payload)
},
setSumGasInfo({ commit }, sumGasInfo) {
commit('SET_SUMGASINFO', sumGasInfo.payload)
},
setIsraKiln({ commit }, israKiln) {
commit('SET_ISRAKILN', israKiln.payload)
},
setMaterial({ commit }, material) {
commit('SET_MATERIAL', material.payload)
},
setEnergyInfo({ commit }, energyInfo) {
commit('SET_ENERGYINFO', energyInfo.payload)
},
setEnergyTrend({ commit }, energyTrend) {
commit('SET_ENERGYTREND', energyTrend.payload)
},
setExhaustGasInfo({ commit }, exhaustGasInfo) {
commit('SET_EXHAUSTGASINFO', exhaustGasInfo.payload)
},
setExhaustGasChart({ commit }, exhaustGasChart) {
commit('SET_EXHAUSTGASCHART', exhaustGasChart.payload)
},
};
export default {
namespaced: true,
state,
mutations,
actions,
}