diff --git a/src/components/Progress.vue b/src/components/Progress.vue index 444c7c7..b61f308 100644 --- a/src/components/Progress.vue +++ b/src/components/Progress.vue @@ -588,7 +588,7 @@ onMounted(() => { }, 1000 * 20) time1.value = setInterval(() => { - binCharts.value?.setOption({ + binCharts.value?.setOption({ tooltip: { trigger: 'axis', }, @@ -662,25 +662,25 @@ onMounted(() => { name: '温度', type: 'line', stack: '1', - data: [], + data: echartsStore.envir1Temp, }, { name: '湿度', type: 'line', stack: '2', - data: [], + data: echartsStore.envir1Humidity, }, { name: 'H2O2浓度', type: 'line', stack: '3', - data: [], + data: echartsStore.envir1HP, }, { name: 'H2O2饱和度', type: 'line', stack: '4', - data: [], + data: echartsStore.envir1Saturation, }, ], }) @@ -710,25 +710,25 @@ onMounted(() => { name: '温度', type: 'line', stack: '1', - data: [], + data: echartsStore.envir2Temp, }, { name: '湿度', type: 'line', stack: '2', - data: [], + data: echartsStore.envir2Humidity, }, { name: 'H2O2浓度', type: 'line', stack: '3', - data: [], + data: echartsStore.envir2HP, }, { name: 'H2O2饱和度', type: 'line', stack: '4', - data: [], + data: echartsStore.envir2Saturation, }, ], }) diff --git a/src/store/modules/echarts.js b/src/store/modules/echarts.js index 24bf48f..c352ffe 100644 --- a/src/store/modules/echarts.js +++ b/src/store/modules/echarts.js @@ -78,6 +78,13 @@ export const useEchartsStore = defineStore({ }) return arr }, + envir1Saturation(state) { + let arr = [] + Object.values(state.envir1Charts).map(item => { + arr.push(item[3]) + }) + return arr + }, envir2Temp(state) { let arr = [] Object.values(state.envir2Charts).map(item => { @@ -99,5 +106,12 @@ export const useEchartsStore = defineStore({ }) return arr }, + envir2Saturation(state) { + let arr = [] + Object.values(state.envir2Charts).map(item => { + arr.push(item[3]) + }) + return arr + }, }, }) diff --git a/src/store/modules/websocket.js b/src/store/modules/websocket.js index 4504f05..2a5f42d 100644 --- a/src/store/modules/websocket.js +++ b/src/store/modules/websocket.js @@ -149,8 +149,8 @@ export const useWebSocketStore = defineStore({ saveEchartsDataToLocal( moment().utcOffset(8).format('HH:mm'), [temp_1, humid_1, h2o2_1, saturation_1], - [temp_2, humid_2, h2o2_2, saturation_1], - [temp_3, humid_3, h2o2_3, saturation_1], + [temp_2, humid_2, h2o2_2, saturation_2], + [temp_3, humid_3, h2o2_3, saturation_3], ) echartsStore.updateBinCharts( JSON.parse(localStorage.getItem('bin')), @@ -340,8 +340,8 @@ export const useWebSocketStore = defineStore({ saveEchartsDataToLocal( moment().utcOffset(8).format('HH:mm'), [temp_1, humid_1, h2o2_1, saturation_1], - [temp_2, humid_2, h2o2_2, saturation_1], - [temp_3, humid_3, h2o2_3, saturation_1], + [temp_2, humid_2, h2o2_2, saturation_2], + [temp_3, humid_3, h2o2_3, saturation_3], ) echartsStore.updateBinCharts( JSON.parse(localStorage.getItem('bin')),