diff --git a/src/store/modules/websocket.js b/src/store/modules/websocket.js index 3191b86e..7dde1bb3 100644 --- a/src/store/modules/websocket.js +++ b/src/store/modules/websocket.js @@ -1,6 +1,10 @@ const state = { - fanFrequencyInfo:{}, - kilnInfo:{} + fanFrequencyInfo:{},// 分机运行频率 + kilnInfo:{},// 窑炉信息 + gasInfo:{},// 天然气 + + israKiln:[],// ISRA缺陷检测 + material:[]// 原料 }; const mutations = { SET_FANFREQUENCYINFO: (state, fanFrequencyInfo) => { @@ -8,6 +12,17 @@ const mutations = { }, SET_KILNINFO: (state, kilnInfo) => { state.kilnInfo = kilnInfo + }, + SET_GASINFO: (state, gasInfo) => { + state.gasInfo = gasInfo + }, + + + SET_ISRAKILN: (state, israKiln) => { + state.israKiln = israKiln + }, + SET_MATERIAL: (state, material) => { + state.material = material } }; const actions = { @@ -16,7 +31,18 @@ const actions = { }, setKilnInfo({ commit }, kilnInfo) { commit('SET_KILNINFO', kilnInfo.payload) - } + }, + setGasInfo({ commit }, gasInfo) { + commit('SET_GASINFO', gasInfo.payload) + }, + + + setIsraKiln({ commit }, israKiln) { + commit('SET_ISRAKILN', israKiln.payload) + }, + setMaterial({ commit }, material) { + commit('SET_MATERIAL', material.payload) + }, }; export default { namespaced: true, diff --git a/src/views/databoard/components/GasChart.vue b/src/views/databoard/components/GasChart.vue index 366c7b10..5b70f50e 100644 --- a/src/views/databoard/components/GasChart.vue +++ b/src/views/databoard/components/GasChart.vue @@ -116,6 +116,9 @@ export default { sidebarStatus() { return this.$store.state.app.sidebar.opened; }, + gasChartMsg() { + return this.$store.state.websocket.gasInfo + } }, watch: { sidebarStatus(val) { @@ -127,6 +130,14 @@ export default { this.chart.setOption(this.option); }, 500); }, + gasChartMsg: { + handler(newVal, oldVal) { + console.log(newVal) + // this.chartData = newVal + console.log('newVal============') + // this.updateChart() + } + } }, mounted() { this.$el.addEventListener('resize', () => { diff --git a/src/views/databoard/components/Header.vue b/src/views/databoard/components/Header.vue index 8ac700cc..3312fc46 100644 --- a/src/views/databoard/components/Header.vue +++ b/src/views/databoard/components/Header.vue @@ -7,9 +7,7 @@