Browse Source

fix: 喷涂倒计时:暂停停止计时,恢复继续计时

master
guoapeng 2 weeks ago
parent
commit
0c6f43da64
  1. 5
      src/components/spray/Countdown/index.vue
  2. 10
      src/views/spray/index.vue

5
src/components/spray/Countdown/index.vue

@ -85,6 +85,11 @@ watch(
},
{ immediate: true },
)
defineExpose({
startTimer,
stopTimer,
})
</script>
<template>

10
src/views/spray/index.vue

@ -94,12 +94,17 @@ const startWork = async () => {
// currentSpeed = Number(form.value.movingSpeed)
}
const countdownRefs = ref([])
const pauseWork = async () => {
const params = {
cmdCode: 'matrix_spray_pause',
cmdId: '',
}
await sendControl(params)
countdownRefs.value.forEach((item) => {
item?.stopTimer()
})
}
const continueWork = async () => {
@ -109,6 +114,9 @@ const continueWork = async () => {
params: {},
}
await sendControl(params)
countdownRefs.value.forEach((item) => {
item?.startTimer()
})
// currentSpeed = Number(form.value.movingSpeed)
}
@ -297,7 +305,7 @@ const viewParams = (index: number) => {
运行参数
</ft-button>
<div class="spray-params-footer">
<Countdown v-if="finishTImeList.find(item => item.index === index)?.finishTime" :end-time="finishTImeList.find(item => item.index === index)?.finishTime" />
<Countdown v-if="finishTImeList.find(item => item.index === index)?.finishTime" ref="countdownRefs" :end-time="finishTImeList.find(item => item.index === index)?.finishTime" />
</div>
</div>
</div>

Loading…
Cancel
Save