diff --git a/.env b/.env index c4ae906..fe3f0dd 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ -# VITE_BASE_WS1_URL=ws://192.168.8.10:19001/ -# VITE_BASE_WS2_URL=ws://192.168.8.10:19002/ +VITE_BASE_WS1_URL=ws://192.168.8.10:19001/ +VITE_BASE_WS2_URL=ws://192.168.8.10:19002/ -VITE_BASE_WS1_URL=ws://127.0.0.1:19001/ -VITE_BASE_WS2_URL=ws://127.0.0.1:19002/ \ No newline at end of file +# VITE_BASE_WS1_URL=ws://127.0.0.1:19001/ +# VITE_BASE_WS2_URL=ws://127.0.0.1:19002/ \ No newline at end of file diff --git a/src/components/SealTest.vue b/src/components/SealTest.vue index 93228a2..4fc8f6b 100644 --- a/src/components/SealTest.vue +++ b/src/components/SealTest.vue @@ -73,6 +73,14 @@ + +
+
+ +

正在测试压力中...

+
+
+
@@ -105,6 +113,8 @@ const sealStore = useSealStore() const testStore = useTestStore() const websocketStore = useWebSocketStore() +const testOverlayVisible = ref(false) + const { airInletProportionalInitVal, airOutletProportionalInitVal } = storeToRefs(sealStore) @@ -114,7 +124,7 @@ const sealOptions = ref({ { type: 'gauge', min: 0, - max: 30, + max: 10, progress: { show: true, width: 18, @@ -254,13 +264,15 @@ const waitAirFinish = async () => { }) } -const sleepVal1 = ref(3) +const sleepVal1 = ref(1) const sleepVal2 = ref(60) const newStartTest = async flag => { if (flag == 1) { // 开始测试 // 启动计时器 + // 开启遮罩loading 并在1min后消失 展示数据 + testOverlayVisible.value = true timerFunc() sealStore.updateIsStartTest(true) // 空压机选通阀切换到通道2(空气) @@ -276,7 +288,6 @@ const newStartTest = async flag => { await waitAirFinish() // 空压机打开 websocketStore.sendCommandMsg(airCompressor_setStateJSON([1])) - // 等待1s await wait(sleepVal1.value * 1000) // 空压机关闭 websocketStore.sendCommandMsg(airCompressor_setStateJSON([0])) @@ -288,6 +299,8 @@ const newStartTest = async flag => { // 等待5s await wait(sleepVal2.value * 1000) // 记录当前压力数值作为初始压力值 + // 等待1min 然后展示数据 + testOverlayVisible.value = false websocketStore.sendCommandMsg(airCompressorGetPressureDirectJSON) } if (flag == 2) { @@ -336,7 +349,7 @@ onMounted(() => { { type: 'gauge', min: 0, - max: 30, + max: 10, progress: { show: true, width: 18, @@ -606,4 +619,30 @@ onMounted(() => { // width: 50px; // height: 100px; // } + +.wrapper { + display: flex; + align-items: center; + justify-content: center; + height: 100%; +} +.block { + width: 120px; + height: 120px; + display: flex; + flex-direction: column; + padding: 16px; + align-items: center; + justify-content: center; + .shutdown_text { + margin-top: 24px; + font-family: Source Han Sans CN; + font-size: 18px; + font-weight: normal; + line-height: normal; + letter-spacing: 0.06em; + color: #fff; + white-space: nowrap; + } +} diff --git a/src/pages/Home.vue b/src/pages/Home.vue index a00ff76..57a2828 100644 --- a/src/pages/Home.vue +++ b/src/pages/Home.vue @@ -28,58 +28,6 @@
- - - - - -

加液

-
-
- - - - - -

排液

-
-
item.name == 'proportional_valve_default_value', )[0] - this.proportionalValveDefaultValue = proportionalValveDefaultValueObj.val - this.pre_heat_time_s = pre_heat_time_sOBj.val - this.max_humidity = max_humidityObj.val - this.continued_satur = continued_saturObj.val - this.stoped_satur = stoped_saturObj.val - this.continued_gs = continued_gsObj.val - this.stoped_gs = stoped_gsObj.val + this.proportionalValveDefaultValue = proportionalValveDefaultValueObj?.val + this.pre_heat_time_s = pre_heat_time_sOBj?.val + this.max_humidity = max_humidityObj?.val + this.continued_satur = continued_saturObj?.val + this.stoped_satur = stoped_saturObj?.val + this.continued_gs = continued_gsObj?.val + this.stoped_gs = stoped_gsObj?.val // 对当前数组进行处理 赋予给泵参数 const addLiquid = allSettingList.filter( item => item.name == 'drainage_pump_speed', diff --git a/src/store/modules/websocket.js b/src/store/modules/websocket.js index 0c2905b..4eec53b 100644 --- a/src/store/modules/websocket.js +++ b/src/store/modules/websocket.js @@ -198,7 +198,8 @@ export const useWebSocketStore = defineStore({ if (getPressureInterCode == 0) { // 值初始化 sealStore.updateCurrentAirPressure( - pressureIntervalAck[0].toFixed(1) || 0, + (pressureIntervalAck && pressureIntervalAck[0]?.toFixed(1)) || + 0, ) } break @@ -208,13 +209,9 @@ export const useWebSocketStore = defineStore({ ack: airProportionalValveAck, } = JSON.parse(ev.data) if (airProportionalValveCode == 0) { - console.log( - 'airProportionalValveAck[0]', - airProportionalValveAck[0], - ) // 比例阀当前是否到位 sealStore.updateAirProportionalValveIsBusy( - airProportionalValveAck[0], + airProportionalValveAck && airProportionalValveAck[0], ) } break