From 1f29347b3476395986489330f680d5c8e4f9fd77 Mon Sep 17 00:00:00 2001 From: maochaoying <925670706@qq.com> Date: Wed, 27 Dec 2023 13:39:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E9=A1=B9=E7=9B=AE=E6=B8=B2?= =?UTF-8?q?=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SealTest.vue | 24 ++++++++++++++++++------ src/store/modules/seal.js | 4 ++++ src/store/modules/websocket.js | 2 ++ 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/components/SealTest.vue b/src/components/SealTest.vue index cf2d68a..bd87026 100644 --- a/src/components/SealTest.vue +++ b/src/components/SealTest.vue @@ -73,11 +73,15 @@ - +
-

正在充气...

+

气密性测试中...

@@ -264,16 +268,15 @@ const waitAirFinish = async () => { }) } -const sleepVal1 = ref(3) -const sleepVal2 = ref(60) +const sleepVal1 = ref(1) +const sleepVal2 = ref(20) const newStartTest = async flag => { if (flag == 1) { // 开始测试 // 启动计时器 + sealStore.updateShowPressure(false) testOverlayVisible.value = true - timerFunc() - sealStore.updateIsStartTest(true) // 空压机选通阀切换到通道2(空气) websocketStore.sendCommandMsg(airCompressorChannelSelectJSON([2])) // 空压机电子阀1打开 空压机电子阀2打开 @@ -298,6 +301,9 @@ const newStartTest = async flag => { websocketStore.sendCommandMsg(airCompressorChannelSelectJSON([1])) // 等待5s await wait(sleepVal2.value * 1000) + sealStore.updateShowPressure(true) + timerFunc() + sealStore.updateIsStartTest(true) testOverlayVisible.value = false // 记录当前压力数值作为初始压力值 websocketStore.sendCommandMsg(airCompressorGetPressureDirectJSON) @@ -311,6 +317,7 @@ const newStartTest = async flag => { * 风机入口比例阀恢复 * 风机出口比例阀恢复 */ + sealStore.updateAirProportionalValveIsBusy(1) websocketStore.sendCommandMsg(airCompressorSetValve1JSON([1])) websocketStore.sendCommandMsg(airCompressorSetValve2JSON([1])) @@ -328,6 +335,7 @@ const newStartTest = async flag => { ) // 停止计时器 stopTimer() + sealStore.updateShowPressure(false) } } @@ -644,4 +652,8 @@ onMounted(() => { white-space: nowrap; } } +.diy_overlay { + background: rgba(0, 0, 0, 0.58); + backdrop-filter: blur(20px); +} diff --git a/src/store/modules/seal.js b/src/store/modules/seal.js index 0df685b..24c2a82 100644 --- a/src/store/modules/seal.js +++ b/src/store/modules/seal.js @@ -4,6 +4,7 @@ export const useSealStore = defineStore({ // state state: () => { return { + showPressure: false, // 0~800kPa currentAirPressure: 0, isStartTest: false, @@ -22,6 +23,9 @@ export const useSealStore = defineStore({ }, // actions actions: { + updateShowPressure(showPressure) { + this.showPressure = showPressure + }, updateAirProportionalValveIsBusy(AirProportionalValveIsBusy) { this.AirProportionalValveIsBusy = AirProportionalValveIsBusy }, diff --git a/src/store/modules/websocket.js b/src/store/modules/websocket.js index 0c2905b..d324ff8 100644 --- a/src/store/modules/websocket.js +++ b/src/store/modules/websocket.js @@ -197,9 +197,11 @@ export const useWebSocketStore = defineStore({ JSON.parse(ev.data) if (getPressureInterCode == 0) { // 值初始化 + // if (sealStore.showPressure) { sealStore.updateCurrentAirPressure( pressureIntervalAck[0].toFixed(1) || 0, ) + // } } break case 'AirProportionalValve_isBusy':