diff --git a/src/components/home/HomeFormula.vue b/src/components/home/HomeFormula.vue index ded6c37..1b9ede4 100644 --- a/src/components/home/HomeFormula.vue +++ b/src/components/home/HomeFormula.vue @@ -34,7 +34,7 @@ watchEffect(async () => {
速率 - {{ rate }}g/分钟 + {{ homeStore.disinfectionState.injectedVelocity }}g/分钟
diff --git a/src/views/home/chart.vue b/src/views/home/chart.vue index 1970751..4100864 100644 --- a/src/views/home/chart.vue +++ b/src/views/home/chart.vue @@ -137,12 +137,12 @@ onUnmounted(() => { const formatSeconds = (seconds: number) => { const hours = Math.floor(seconds / 3600) const minutes = Math.floor((seconds % 3600) / 60) - // const remainingSeconds = seconds % 60 + const remainingSeconds = seconds % 60 // 补零函数 const padZero = (num: number) => num.toString().padStart(2, '0') - return `${padZero(hours)}:${padZero(minutes)}` + return `${padZero(hours)}:${padZero(minutes)}:${padZero(remainingSeconds)}` } @@ -167,7 +167,10 @@ const formatSeconds = (seconds: number) => { 预计剩余时间: 消毒状态: -
+
{{ formatSeconds(homeStore.disinfectionState.curStateRemainTimeS) }}
diff --git a/src/views/seal/index.vue b/src/views/seal/index.vue index 398870e..ee82d16 100644 --- a/src/views/seal/index.vue +++ b/src/views/seal/index.vue @@ -6,7 +6,7 @@ import SealInstrumentSvg from 'assets/images/seal/seal-instrument.svg' import SoftKeyboard from 'components/common/SoftKeyboard/index.vue' import DashboardChart from 'components/seal/DashboardChart.vue' import { roundNumber } from 'libs/utils' -import { computed, onMounted, ref, watch } from 'vue' +import { computed, onMounted, onUnmounted, ref, watch } from 'vue' import { getDeviceStatus } from '@/libs/deviceComm' import { FtMessage } from '@/libs/message' @@ -50,11 +50,21 @@ onMounted(async () => { params: { inflationTimeMs: 0.3 }, }) inflationTime.value = res.inflationTimeMs + poll = setInterval(() => { + if (sealInfo.value.workState === 'leakTesting') { + sealStore.startLeakTimer() + clearInterval(poll) + } + }, 100) +}) +onUnmounted(() => { + clearInterval(poll) }) const stopText = computed(() => (sealInfo.value.workState === 'stopping' ? '停止中...' : '停止测试')) const stopDisabled = computed(() => sealInfo.value.workState === 'stopping' || sealInfo.value.workState === 'idle') +let poll: any = 0 function onStartTest() { const statusName = getDeviceStatus() if (statusName) { @@ -65,7 +75,12 @@ function onStartTest() { syncSendCmd({ className: 'AirLeakDetectTest', fnName: 'start', params: { inflationTimeMs: 0 } }) .then((res) => { if (res.ackcode === 0) { - sealStore.startLeakTimer() + poll = setInterval(() => { + if (sealInfo.value.workState === 'leakTesting') { + sealStore.startLeakTimer() + clearInterval(poll) + } + }, 100) FtMessage.success('开始执行密封测试') } else { @@ -110,7 +125,7 @@ function handleConfirm(value: string) {
测试时间:
-
+
未开始
@@ -127,6 +142,10 @@ function handleConfirm(value: string) {
稳压中
+
+ 停止中 +
+
{{ initialPressure }}Kpa
@@ -227,7 +246,7 @@ function handleConfirm(value: string) { //width: 16rem; height: 5rem; border-radius: 15px; - padding: 0 2px 0; + padding: 0 20px; } .seal-time-text { font-size: 1.5rem;