From fa46f73d3478ea01d850b3c07498de48a9b17a51 Mon Sep 17 00:00:00 2001 From: guoapeng Date: Mon, 7 Jul 2025 17:54:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B5=8B=E8=AF=95=E9=A1=B5ui=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/home/HomeOperation.vue | 32 ++++++- src/components/home/PressureControl.vue | 4 +- src/stores/homeStore.ts | 6 +- src/views/debug/index.vue | 151 ++++++++++++++++---------------- src/views/home/index.vue | 3 +- 5 files changed, 113 insertions(+), 83 deletions(-) diff --git a/src/components/home/HomeOperation.vue b/src/components/home/HomeOperation.vue index abd201f..9b7cbc2 100644 --- a/src/components/home/HomeOperation.vue +++ b/src/components/home/HomeOperation.vue @@ -3,7 +3,6 @@ import { sendCmd } from 'apis/system' import homeFinish from 'assets/images/home/home-finish.svg' import homeStart from 'assets/images/home/home-start.svg' import { startTimer, stopTimer } from 'libs/countdownTimer' -import { deviceStateMap } from 'libs/utils' import { computed, ref, watchEffect } from 'vue' import { getDeviceStatus } from '@/libs/deviceComm' @@ -144,6 +143,26 @@ const doStopDisinfect = async () => { const operationState = computed(() => { return disinfectionState.value.state === 'idle' || disinfectionState.value.state === 'finished' }) + +const startInjection = async () => { + const stopParams = { + className: 'DisinfectionCtrlServiceExt', + fnName: 'stop', + params: {}, + } + await sendCmd(stopParams) + FtMessage.success('操作成功') +} + +const stopInjection = async () => { + const stopParams = { + className: 'DisinfectionCtrlServiceExt', + fnName: 'stop', + params: {}, + } + await sendCmd(stopParams) + FtMessage.success('操作成功') +} +
+ + 开始注射 + + + 结束注射 + +
+
@@ -200,7 +228,7 @@ const operationState = computed(() => { .home-disinfect { display: flex; justify-content: center; - margin-top: 40px; + margin-top: 20px; } .home-start { background: #31cb7a; diff --git a/src/components/home/PressureControl.vue b/src/components/home/PressureControl.vue index 603b4e9..6af1d54 100644 --- a/src/components/home/PressureControl.vue +++ b/src/components/home/PressureControl.vue @@ -44,12 +44,12 @@ const deviceType = computed(() => { const sealStore = useSealStore() const sealInfo = computed(() => sealStore.sealInfo) // 用户选择后立即更新压力配置(支持仅选择类型的情况) -const confirm = (val: string[]) => { +const confirm = async (val: string[]) => { // 判断设备当前的状态 if (sealInfo.value.workState === 'stopping' || sealInfo.value.workState === 'idle') { if (!val || !val.length) return - homeStore.updatePressure(val) + await homeStore.updatePressure(val) } else { FtMessageBox.error('密封性测试中,禁止修改正负压') diff --git a/src/stores/homeStore.ts b/src/stores/homeStore.ts index 78f8f66..053026c 100644 --- a/src/stores/homeStore.ts +++ b/src/stores/homeStore.ts @@ -159,7 +159,7 @@ export const useHomeStore = defineStore('home', () => { * @param {Array} pressureData - 压力配置数据 [压力类型, 压力值] * @desc 更新压力类型及对应压力值配置 */ - const updatePressure = async (pressureData: string | number[]) => { + const updatePressure = async (pressureData: string[]) => { if (pressureData && pressureData.length) { const type = pressureData[0] const pressureTypeParams = { @@ -167,7 +167,7 @@ export const useHomeStore = defineStore('home', () => { fnName: 'setType', params: { type }, } - syncSendCmd(pressureTypeParams) + await syncSendCmd(pressureTypeParams) // 正压或负压时保存设置的压力值 if (type === 'positivePressure' || type === 'negativePressure') { const intensity = pressureData[1] @@ -176,7 +176,7 @@ export const useHomeStore = defineStore('home', () => { fnName: 'setIntensity', params: { intensity: Number(intensity) }, } - syncSendCmd(intensityParams) + await syncSendCmd(intensityParams) } } } diff --git a/src/views/debug/index.vue b/src/views/debug/index.vue index 99c784b..d26d4a3 100644 --- a/src/views/debug/index.vue +++ b/src/views/debug/index.vue @@ -13,10 +13,7 @@ const h2O2SensorData = ref(homeStore.h2O2SensorData const sprayPumpGpmValue = ref(5) const airLeakDetectTestMode = ref('disinfection') -const formatValue = (v?: number) => - v === 0 || v == null - ? '--' - : roundNumber(v, 2) +const formatValue = (v?: number) => (v === 0 || v == null ? '--' : roundNumber(v, 2)) watchEffect(() => { const hdData = homeStore.h2O2SensorData @@ -176,8 +173,8 @@ const deviceType = computed(() => __DEVICE_TYPE__)
-
- {{ index === 0 ? '仓内环境' : item.title || `探头${index}` }} +
+ {{ index === 0 ? '仓内环境' : item.title || `探头${index}` }}:
温度 @@ -223,57 +220,55 @@ const deviceType = computed(() => __DEVICE_TYPE__)
-
-
-
- 加液泵控制: -
-
- -
-
- -
-
- -
+
+
+ 加液泵控制:
-
-
- 空压机控制: -
-
- -
-
- -
+
+
-
-
- 加热片控制: -
-
- -
-
- -
+
+
-
-
- 气密性阀门模式: -
-
- - - - - -
-
- -
+
+ +
+
+
+
+ 空压机控制: +
+
+ +
+
+ +
+
+
+
+ 加热片控制: +
+
+ +
+
+ +
+
+
+
+ 气密性阀门模式: +
+
+ + + + + +
+
+
@@ -332,17 +327,18 @@ const deviceType = computed(() => __DEVICE_TYPE__)