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;