Browse Source

剩余log

master
maochaoying 2 years ago
parent
commit
e3c9b82a7d
  1. 4
      src/components/Progress.vue
  2. 5
      src/store/modules/device.js
  3. 3
      src/store/modules/websocket.js

4
src/components/Progress.vue

@ -87,7 +87,7 @@
</svg> </svg>
<div class="left_log_wrap"> <div class="left_log_wrap">
<p class="text">当前剩余</p> <p class="text">当前剩余</p>
<p class="val">12log</p>
<p class="val">{{ deviceStore.nowlog || 0 }}log</p>
</div> </div>
<div <div
class="btn" class="btn"
@ -209,6 +209,7 @@ import {
useWebSocketStore, useWebSocketStore,
useEchartsStore, useEchartsStore,
useSettingStore, useSettingStore,
useDeviceStore,
} from '@/store' } from '@/store'
import { time_To_hhmmss } from '@/utils' import { time_To_hhmmss } from '@/utils'
import { import {
@ -224,6 +225,7 @@ import { storeToRefs } from 'pinia'
const echartsStore = useEchartsStore() const echartsStore = useEchartsStore()
const settingStore = useSettingStore() const settingStore = useSettingStore()
const deviceStore = useDeviceStore()
const binLocal = computed(() => { const binLocal = computed(() => {
return echartsStore?.binCharts || localStorage.getItem('bin') return echartsStore?.binCharts || localStorage.getItem('bin')

5
src/store/modules/device.js

@ -27,10 +27,15 @@ export const useDeviceStore = defineStore({
envirHP2: 0, envirHP2: 0,
// 仓内过氧化氢相对饱和度 // 仓内过氧化氢相对饱和度
binSaturation: 0, binSaturation: 0,
// 剩余log
nowlog: 0,
} }
}, },
// actions // actions
actions: { actions: {
updateNowLog(nowlog) {
this.nowlog = nowlog
},
updateBinSaturation(binSaturation) { updateBinSaturation(binSaturation) {
if (binSaturation < 0) { if (binSaturation < 0) {
this.binSaturation = 0 this.binSaturation = 0

3
src/store/modules/websocket.js

@ -42,6 +42,7 @@ export const useWebSocketStore = defineStore({
const { state } = JSON.parse(ev.data) const { state } = JSON.parse(ev.data)
const { const {
disinfectionWorkState, disinfectionWorkState,
disinfectionState,
preHeat, preHeat,
preHeatRaminTimeS, preHeatRaminTimeS,
estimatedRemainingTimeS, estimatedRemainingTimeS,
@ -79,6 +80,8 @@ export const useWebSocketStore = defineStore({
sprinklerPumpRPM, sprinklerPumpRPM,
sprinklerPumpGPM, sprinklerPumpGPM,
} = sensor_data } = sensor_data
const { nowlog } = disinfectionState || {}
deviceStore.updateNowLog(nowlog)
if ([1, 2, 3, 4].includes(disinfectionWorkState)) { if ([1, 2, 3, 4].includes(disinfectionWorkState)) {
operatorStore.updateShowStartReady(false) operatorStore.updateShowStartReady(false)
} else { } else {

Loading…
Cancel
Save