Browse Source

自动项目渲染

master
maochaoying 2 years ago
parent
commit
1f29347b34
  1. 24
      src/components/SealTest.vue
  2. 4
      src/store/modules/seal.js
  3. 2
      src/store/modules/websocket.js

24
src/components/SealTest.vue

@ -73,11 +73,15 @@
</div>
</div>
</div>
<van-overlay :show="testOverlayVisible" z-index="3">
<van-overlay
:show="testOverlayVisible"
class-name="diy_overlay"
z-index="3"
>
<div class="wrapper" @click.stop>
<div class="block">
<van-loading />
<p class="shutdown_text">正在充气...</p>
<p class="shutdown_text">密性测试中...</p>
</div>
</div>
</van-overlay>
@ -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);
}
</style>

4
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
},

2
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':

Loading…
Cancel
Save