Browse Source

fix:修复调试页面无法使用的问题

master
白凤吉 2 weeks ago
parent
commit
f34360fb22
  1. 250
      src/views/debug/index.vue

250
src/views/debug/index.vue

@ -1,11 +1,15 @@
<script lang="ts" setup>
import { sendCmd } from 'apis/system'
import { roundNumber } from 'libs/utils'
import { useDebugStore } from 'stores/debugStore'
import { useHomeStore } from 'stores/homeStore'
import { ref, watchEffect } from 'vue'
const homeStore = useHomeStore()
const debugStore = useDebugStore()
const h2O2SensorData = ref<Home.DisplayrelyMgrParams[]>(homeStore.h2O2SensorData)
const sprayPumpGpmValue = ref<number>(5)
const airLeakDetectTestMode = ref<string>('disinfection')
watchEffect(() => {
const hdData = homeStore.h2O2SensorData
@ -15,71 +19,144 @@ watchEffect(() => {
})
//
const onAddLiquid = async () => {
const params = {
className: 'AddLiquidService',
fnName: 'start',
params: {
stopatg: 100,
},
const liquidFillingPumpDoLiquidFilling = async () => {
const data = {
className: 'TestPageCtrlService',
fnName: 'liquidFillingPumpDoLiquidFilling',
params: {},
}
await sendCmd(params)
await sendCmd(data)
}
//
const onDisLiquid = async () => {
const params = {
className: 'DrainLiquidService',
fnName: 'start',
const liquidFillingPumpDoLiquidDischarge = async () => {
const data = {
className: 'TestPageCtrlService',
fnName: 'liquidFillingPumpDoLiquidDischarge',
params: {},
}
sendCmd(params)
sendCmd(data)
}
//
const onOffLiquidMotor = () => {
const stopAddparams = {
className: 'AddLiquidService',
fnName: 'stop',
const liquidFillingPumpDoStop = () => {
const data = {
className: 'TestPageCtrlService',
fnName: 'liquidFillingPumpDoStop',
params: {},
}
sendCmd(stopAddparams)
const params = {
className: 'DrainLiquidService',
fnName: 'stop',
params: {},
}
sendCmd(params)
sendCmd(data)
}
//
const onOpenAirPump = () => {
const airCompressorDoOpen = () => {
const data = {
className: 'TestPageCtrlService',
fnName: 'airCompressorDoOpen',
params: {},
}
sendCmd(data)
}
//
const onCloseAirPump = () => {
const airCompressorDoClose = () => {
const data = {
className: 'TestPageCtrlService',
fnName: 'airCompressorDoClose',
params: {},
}
sendCmd(data)
}
//
const onOpenHeat = () => {
const heatingDoOpen = () => {
const data = {
className: 'TestPageCtrlService',
fnName: 'heatingDoOpen',
params: {},
}
sendCmd(data)
}
//
const onCloseHeat = () => {}
const heatingDoClose = () => {
const data = {
className: 'TestPageCtrlService',
fnName: 'heatingDoClose',
params: {},
}
sendCmd(data)
}
// (gpm)
const sprayPumpDoForward = () => {
const data = {
className: 'TestPageCtrlService',
fnName: 'sprayPumpDoForward',
params: {
gpm: sprayPumpGpmValue.value,
},
}
sendCmd(data)
}
// (gpm)
const sprayPumpDoBackward = () => {
const data = {
className: 'TestPageCtrlService',
fnName: 'sprayPumpDoBackward',
params: {
gpm: sprayPumpGpmValue.value,
},
}
sendCmd(data)
}
//
const onClosePump = () => {
const data = {
className: 'TestPageCtrlService',
fnName: 'sprayPumpDoStop',
params: {},
}
sendCmd(data)
}
//
const queryEvaporationState = () => {}
//
const onSprayMetor = () => {}
//
const onRefluxMetor = () => {}
//
const onClosePump = () => {}
//
const blowerDoOpen = () => {
const data = {
className: 'TestPageCtrlService',
fnName: 'blowerDoOpen',
params: {},
}
sendCmd(data)
}
//
const blowerDoClose = () => {
const data = {
className: 'TestPageCtrlService',
fnName: 'blowerDoClose',
params: {},
}
sendCmd(data)
}
//
const airLeakDetectTestModeDoSetMode = () => {
const data = {
className: 'TestPageCtrlService',
fnName: 'airLeakDetectTestModeDoSetMode',
params: {
mode: airLeakDetectTestMode.value,
},
}
sendCmd(data)
}
//
const onOpenFan = () => {}
//
const onCloseFan = () => {}
//
const onBottomState = () => {}
//
const printerDoTest = () => {
const data = {
className: 'TestPageCtrlService',
fnName: 'printerDoTest',
params: {},
}
sendCmd(data)
}
</script>
<template>
@ -107,88 +184,94 @@ const onBottomState = () => {}
</div>
</div>
</section>
<hr class="divider">
<div class="debug-lower">
<section>
<div>
<div class="debug-left-lh">
<div class="debug-label">
加液蠕动
加液泵控制
</div>
<div class="debug-bw">
<div>
<bt-button
type="primary"
button-text="加液"
@click="onAddLiquid"
@click="liquidFillingPumpDoLiquidFilling"
/>
</div>
<div>
<bt-button
type="primary"
button-text="排"
@click="onDisLiquid"
button-text="排"
@click="liquidFillingPumpDoLiquidDischarge"
/>
</div>
<div>
<bt-button
button-text="关闭"
@click="onOffLiquidMotor"
button-text="停止"
@click="liquidFillingPumpDoStop"
/>
</div>
</div>
<div class="debug-left-lh">
<div class="debug-label">
空压机
空压机控制
</div>
<div class="debug-bw">
<span class="debug-text">0.00A</span>
<span class="debug-text">{{ debugStore.debugPageState?.airCompressorCurrent }} A</span>
</div>
<div>
<bt-button
type="primary"
button-text="打开"
@click="onOpenAirPump"
@click="airCompressorDoOpen"
/>
</div>
<div>
<bt-button
button-text="关闭"
@click="onCloseAirPump"
@click="airCompressorDoClose"
/>
</div>
</div>
<div class="debug-left-lh">
<div class="debug-label">
加热片
加热片控制
</div>
<div class="debug-bw">
<span class="debug-text">0.00A</span>
<span class="debug-text">{{ debugStore.debugPageState?.heaterCurrent }} A</span>
<span class="debug-text">{{ debugStore.debugPageState?.heaterTemperature }} </span>
</div>
<div>
<bt-button
type="primary"
button-text="打开"
@click="onOpenHeat"
@click="heatingDoOpen"
/>
</div>
<div>
<bt-button
button-text="关闭"
@click="onCloseHeat"
@click="heatingDoClose"
/>
</div>
</div>
<div class="debug-left-lh">
<div class="debug-label">
蒸发仓水浸
气密性阀门模式
</div>
<div class="debug-bw">
<span class="debug-text">没水</span>
<el-select v-model="airLeakDetectTestMode" placeholder="请选择模式" style="width: 100%;" >
<el-option label="消毒模式" value="disinfection" />
<el-option label="加压模式" value="inflation" />
<el-option label="泄露测试模式" value="leakTest" />
</el-select>
</div>
<div>
<bt-button
type="primary"
button-text="读取状态"
@click="queryEvaporationState"
button-text="切换"
@click="airLeakDetectTestModeDoSetMode"
/>
</div>
</div>
@ -198,62 +281,64 @@ const onBottomState = () => {}
<div>
<div class="debug-left-lh">
<div class="debug-label">
注射蠕动泵
喷液泵控制
</div>
<div class="debug-bw">
<el-select v-model="sprayPumpGpmValue" placeholder="请选择加液量" style="width: 100%;">
<el-option v-for="opt in [2, 5, 8, 10, 15]" :key="opt" :label="`${opt} gpm`" :value="opt" />
</el-select>
</div>
<div>
<bt-button
type="primary"
button-text="喷射"
@click="onSprayMetor"
button-text="喷"
@click="sprayPumpDoForward"
/>
</div>
<div>
<bt-button
type="primary"
button-text="回流"
@click="onRefluxMetor"
@click="sprayPumpDoBackward"
/>
</div>
<div>
<bt-button
button-text="关闭"
button-text="停止"
@click="onClosePump"
/>
</div>
</div>
<div class="debug-left-lh">
<div class="debug-label">
风机
风机控制
</div>
<div class="debug-bw">
<span class="debug-text">0.00A</span>
<span class="debug-text">{{ debugStore.debugPageState?.blowerCurrent }} A</span>
</div>
<div>
<bt-button
type="primary"
button-text="打开"
@click="onOpenFan"
@click="blowerDoOpen"
/>
</div>
<div>
<bt-button
button-text="关闭"
@click="onCloseFan"
@click="blowerDoClose"
/>
</div>
</div>
<div class="debug-left-lh">
<div class="debug-label">
设备底部水浸
</div>
<div class="debug-bw">
<span class="debug-text">没水</span>
打印机测试
</div>
<div>
<bt-button
type="primary"
button-text="读取状态"
@click="onBottomState"
button-text="测试"
@click="printerDoTest"
/>
</div>
</div>
@ -270,8 +355,7 @@ const onBottomState = () => {}
height: $main-container-height;
overflow: hidden;
background: $gradient-color;
padding-top: 4vh;
padding-left: 30px;
padding: 4vh;
font-size: 20px;
.debug-upper{
display: grid;
@ -289,6 +373,10 @@ const onBottomState = () => {}
}
}
}
.divider{
margin-top: 4vh;
margin-bottom: 4vh;
}
.debug-env {
display: grid;
grid-template-columns: repeat(2, 1fr);
@ -308,10 +396,10 @@ const onBottomState = () => {}
height: 10vh;
}
.debug-bw{
width: 13vw;
width: 10vw;
}
.debug-label{
width: 13vw;
width: 18vw;
text-align: end;
}
.debug-text{

Loading…
Cancel
Save