|
|
@ -155,7 +155,7 @@ const operationState = computed(() => { |
|
|
|
const startInjection = async () => { |
|
|
|
const stopParams = { |
|
|
|
className: 'DisinfectionCtrlServiceExt', |
|
|
|
fnName: 'setHandleStopPumpInjectionFlag', |
|
|
|
fnName: 'handleStartPumpInjection', |
|
|
|
params: {}, |
|
|
|
} |
|
|
|
await sendCmd(stopParams) |
|
|
@ -165,12 +165,23 @@ const startInjection = async () => { |
|
|
|
const stopInjection = async () => { |
|
|
|
const stopParams = { |
|
|
|
className: 'DisinfectionCtrlServiceExt', |
|
|
|
fnName: 'clearHandleStopPumpInjectionFlag', |
|
|
|
fnName: 'handleStopPumpInjection', |
|
|
|
params: {}, |
|
|
|
} |
|
|
|
await sendCmd(stopParams) |
|
|
|
FtMessage.success('操作成功') |
|
|
|
} |
|
|
|
|
|
|
|
const formatSeconds = (seconds: number) => { |
|
|
|
const hours = Math.floor(seconds / 3600) |
|
|
|
const minutes = Math.floor((seconds % 3600) / 60) |
|
|
|
// const remainingSeconds = seconds % 60 |
|
|
|
|
|
|
|
// 补零函数 |
|
|
|
const padZero = (num: number) => num.toString().padStart(2, '0') |
|
|
|
|
|
|
|
return `${padZero(hours)}:${padZero(minutes)}` |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<template> |
|
|
@ -212,10 +223,10 @@ const stopInjection = async () => { |
|
|
|
v-if="!operationState" |
|
|
|
style="width: 100%; display: flex; align-items: center; justify-content: center; margin-top: 10px" |
|
|
|
> |
|
|
|
<div style="margin-right: 10px"> |
|
|
|
<span v-if="homeStore.disinfectionState.handlePumpStopFlag">已开启</span> |
|
|
|
<span v-else>已关闭</span> |
|
|
|
</div> |
|
|
|
<!-- <div style="margin-right: 10px"> --> |
|
|
|
<!-- <span v-if="homeStore.disinfectionState.handlePumpStopFlag">已开启</span> --> |
|
|
|
<!-- <span v-else>已关闭</span> --> |
|
|
|
<!-- </div> --> |
|
|
|
<el-button type="primary" @click="startInjection"> |
|
|
|
开启喷液 |
|
|
|
</el-button> |
|
|
@ -231,7 +242,7 @@ const stopInjection = async () => { |
|
|
|
<span v-else> 消毒状态: </span> |
|
|
|
</div> |
|
|
|
<div v-if="disinfectionState.state === 'disinfection'" class="home-remaini-value"> |
|
|
|
{{ curStateRemainTimeS }} |
|
|
|
{{ formatSeconds(homeStore.disinfectionState.curStateRemainTimeS) }} |
|
|
|
</div> |
|
|
|
<div v-else> |
|
|
|
{{ deviceStateMap[disinfectionState.state] }} |
|
|
|