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

5
src/store/modules/device.js

@ -27,10 +27,15 @@ export const useDeviceStore = defineStore({
envirHP2: 0,
// 仓内过氧化氢相对饱和度
binSaturation: 0,
// 剩余log
nowlog: 0,
}
},
// actions
actions: {
updateNowLog(nowlog) {
this.nowlog = nowlog
},
updateBinSaturation(binSaturation) {
if (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 {
disinfectionWorkState,
disinfectionState,
preHeat,
preHeatRaminTimeS,
estimatedRemainingTimeS,
@ -79,6 +80,8 @@ export const useWebSocketStore = defineStore({
sprinklerPumpRPM,
sprinklerPumpGPM,
} = sensor_data
const { nowlog } = disinfectionState || {}
deviceStore.updateNowLog(nowlog)
if ([1, 2, 3, 4].includes(disinfectionWorkState)) {
operatorStore.updateShowStartReady(false)
} else {

Loading…
Cancel
Save