const state = { fanFrequencyInfo:{},// 分机运行频率 kilnInfo:{},// 窑炉信息 gasInfo:{},// 天然气流量图 sumGasInfo: {},// 天然气总量 israKiln:[],// ISRA窑炉缺陷检测 material:[],// 原料 energyInfo: { elecQty1: '', elecQty2: '', waterQty: '' }, // 能耗 energyWeekTrend:[], energyMonthTrend:[], energyYearTrend:[],// 能耗图 energyMonitoring: [], // 能源监控 exhaustGasInfo:{}, // 烟气 gasChartDayTrend:{}, // 烟气 gasChartWeekTrend:{}, // 烟气 gasChartMonthTrend:{}, // 烟气 gasChartYearTrend:{}, // 烟气 israCheckType: [], israDayStatistic: [],//缺陷统计 israWeekStatistic: [],//缺陷统计 israMonthStatistic: [],//缺陷统计 israYearStatistic: [],//缺陷统计 productline: [], // SJG产线产量及良品率 sjgEquipment:[],// SJG设备报警 workOrder: [], // 工单监控 defectSum: [], // 缺陷汇总 order: [],// 订单完成情况 yieldRateTable: [],// 本日生产良率table cutChartDay:[], cutChartWeek:[], cutChartMonth:[], cutChartYear:[] }; 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_ENERGY_MONITORING: (state, energyMonitoring) => { state.energyMonitoring = energyMonitoring }, SET_EXHAUSTGASINFO: (state, exhaustGasInfo) => { state.exhaustGasInfo = exhaustGasInfo }, SET_EXHAUSTGASCHART: (state, exhaustGasChart) => { state.gasChartDayTrend = exhaustGasChart.dayTrend state.gasChartWeekTrend = exhaustGasChart.weekTrend state.gasChartMonthTrend = exhaustGasChart.monthTrend state.gasChartYearTrend = exhaustGasChart.yearTrend }, SET_DEFECTCHART: (state, israStatistic) => { state.israCheckType = israStatistic.checkType state.israDayStatistic = israStatistic.dayStatistic state.israWeekStatistic = israStatistic.weekStatistic state.israMonthStatistic = israStatistic.monthStatistic state.israYearStatistic = israStatistic.yearStatistic }, SET_PRODUCTLINE: (state, productline) => { state.productline = productline }, SET_SJGEQ: (state, equipment) => { state.sjgEquipment = equipment }, SET_WORKORDER: (state, workOrder) => { state.workOrder = workOrder }, SET_DEFECTSUM: (state, defectSum) => { state.defectSum = defectSum }, SET_ORDER: (state, order) => { state.order = order }, SET_YIELDRATETABLE: (state, yieldRateTable) => { state.yieldRateTable = yieldRateTable }, SET_CUTCHARDAY: (state, cutChartDay) => { state.cutChartDay = cutChartDay }, SET_CUTCHARWEEK: (state, cutChartWeek) => { state.cutChartWeek = cutChartWeek }, SET_CUTCHARMONTH: (state, cutChartMonth) => { state.cutChartMonth = cutChartMonth }, SET_CUTCHARYEAR: (state, cutChartYear) => { state.cutChartYear = cutChartYear } }; 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) }, setEnergyMonitoring({ commit }, energyMonitoring) { commit('SET_ENERGY_MONITORING', energyMonitoring.payload) }, setExhaustGasInfo({ commit }, exhaustGasInfo) { commit('SET_EXHAUSTGASINFO', exhaustGasInfo.payload) }, setExhaustGasChart({ commit }, exhaustGasChart) { commit('SET_EXHAUSTGASCHART', exhaustGasChart.payload) }, setDefectChart({ commit }, israStatistic) { commit('SET_DEFECTCHART', israStatistic.payload) }, setProductline({ commit }, productline) { commit('SET_PRODUCTLINE', productline.payload) }, setSJGEq({ commit }, equipment) { commit('SET_SJGEQ', equipment.payload) }, setWorkOrder({ commit }, workOrder) { commit('SET_WORKORDER', workOrder.payload) }, setDefectSum({ commit }, defectSum) { commit('SET_DEFECTSUM', defectSum.payload) }, setOrder({ commit }, order) { commit('SET_ORDER', order.payload) }, setYieldRateTable({ commit }, yieldRateTable) { commit('SET_YIELDRATETABLE', yieldRateTable.payload) }, setCutChartDay({ commit }, cutChartDay) { commit('SET_CUTCHARDAY', cutChartDay.payload) }, setCutChartWeek({ commit }, cutChartWeek) { commit('SET_CUTCHARWEEK', cutChartWeek.payload) }, setCutChartMonth({ commit }, cutChartMonth) { commit('SET_CUTCHARMONTH', cutChartMonth.payload) }, setCutChartYear({ commit }, cutChartYear) { commit('SET_CUTCHARYEAR', cutChartYear.payload) } }; export default { namespaced: true, state, mutations, actions, }