From 4be49cc35bc3a52113309e5835dfc30b07d61d00 Mon Sep 17 00:00:00 2001 From: maochaoying <925670706@qq.com> Date: Tue, 5 Sep 2023 13:17:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=AF=92=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Operator.vue | 9 ++--- src/components/Progress.vue | 51 ++++++++++++++++++++-------- src/components/Setting/components/Device.vue | 4 +-- src/components/dialogs/DisinfectModal.vue | 2 +- src/pages/Home.vue | 18 ++++++---- src/store/modules/operator.js | 8 ++++- src/store/modules/user.js | 2 +- src/store/modules/websocket.js | 6 ++-- 8 files changed, 64 insertions(+), 36 deletions(-) diff --git a/src/components/Operator.vue b/src/components/Operator.vue index 72ff8e5..791c89b 100644 --- a/src/components/Operator.vue +++ b/src/components/Operator.vue @@ -18,10 +18,7 @@

警报信息

@@ -542,7 +539,7 @@ const startDisinfect = () => { const realStart = () => { localStorage.setItem('logVal', logVal.value) - if (![1, 2].includes(operatorStore.disinfectStatus)) { + if (operatorStore.disinfectStatus == 0) { localStorage.removeItem('bin') localStorage.removeItem('envir1') localStorage.removeItem('envir2') diff --git a/src/components/Progress.vue b/src/components/Progress.vue index 9bf9369..7626b4e 100644 --- a/src/components/Progress.vue +++ b/src/components/Progress.vue @@ -11,10 +11,7 @@

- + + + + + + + + +
结束消毒
返回 @@ -696,15 +717,15 @@ onUnmounted(() => { }) const pauseDisinfect = () => { - if (operatorStore.disinfectStatus == 1) { - webSocketStore.sendCommandMsg(pauseDisinfectionJSON) - } + // if (operatorStore.disinfectStatus == 1) { + // webSocketStore.sendCommandMsg(pauseDisinfectionJSON) + // } } const disinfectWarnVisible = ref(false) const stopDisinfect = () => { disinfectWarnVisible.value = true - if ([1, 2].includes(operatorStore.disinfectStatus)) { + if ([1, 2, 3, 4].includes(operatorStore.disinfectStatus)) { webSocketStore.sendCommandMsg(stopDisinfectionJSON) } } @@ -714,9 +735,9 @@ const hideDisinfectModal = () => { } const continueDisinfect = () => { - if (operatorStore.disinfectStatus == 2) { - webSocketStore.sendCommandMsg(continueDisinfectionJSON) - } + // if (operatorStore.disinfectStatus == 2) { + // webSocketStore.sendCommandMsg(continueDisinfectionJSON) + // } } diff --git a/src/components/Setting/components/Device.vue b/src/components/Setting/components/Device.vue index 48f235e..1134c99 100644 --- a/src/components/Setting/components/Device.vue +++ b/src/components/Setting/components/Device.vue @@ -91,7 +91,7 @@ />

-
+

允许消毒最大湿度(%RH)

-
+

预热时间(s)

{ } const handleStart = () => { - if ([1, 2].includes(operatorStore.disinfectStatus)) { + if ([1, 2, 3, 4].includes(operatorStore.disinfectStatus)) { operatorStore.updateStopReady(true) webSocketStore.sendCommandMsg(stopDisinfectionJSON) props.hideDisinfectModal() diff --git a/src/pages/Home.vue b/src/pages/Home.vue index cce51a8..63923c1 100644 --- a/src/pages/Home.vue +++ b/src/pages/Home.vue @@ -31,7 +31,7 @@ activeTab == 2 ? 'tab_btn style-btn active_btn' : 'style-btn tab_btn' " @click="changeTab(2)" - v-if="operatorStore.disinfectStatus != 1" + v-if="[0, 5].includes(operatorStore.disinfectStatus)" > - + diff --git a/src/store/modules/operator.js b/src/store/modules/operator.js index 9bdec5c..be1f38c 100644 --- a/src/store/modules/operator.js +++ b/src/store/modules/operator.js @@ -5,12 +5,18 @@ export const useOperatorStore = defineStore({ state: () => { return { // 是否开始消毒 + // 0 未开始 + // 1 预加热 + // 2 3 消毒中 + // 4 降解中 + // 5 已完成 disinfectStatus: 0, + // 预热时间和消毒剩余时间都用这个字段 estimatedRemainingTimeS: 0, disinfection_id: '', drainingWorkState: 0, replenishingFluidsWorkState: 0, - // 是否预热 + // 是否预热 废弃!!! preHeat: false, preHeatRaminTimeS: 0, // 准备消毒loading diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 0e2f444..d8c3244 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -7,7 +7,7 @@ export const useUserStore = defineStore({ allUserList: [], operUser: '', loginUser: '', - loginUserPermission: 2, + loginUserPermission: 3, } }, // actions diff --git a/src/store/modules/websocket.js b/src/store/modules/websocket.js index 3a3d9ef..96de680 100644 --- a/src/store/modules/websocket.js +++ b/src/store/modules/websocket.js @@ -76,7 +76,7 @@ export const useWebSocketStore = defineStore({ waterImmersionSensor1, waterImmersionSensor2, } = sensor_data - if (disinfectionWorkState != 0) { + if ([1, 2, 3, 4].includes(disinfectionWorkState)) { operatorStore.updateShowStartReady(false) } else { operatorStore.updateStopReady(false) @@ -119,7 +119,7 @@ export const useWebSocketStore = defineStore({ operatorStore.updateDisinfectionId(disinfection_id) // 将sensor_data中的数据更新到store中 - if (operatorStore.disinfectStatus == 1) { + if ([1, 2, 3, 4].includes(operatorStore.disinfectStatus)) { saveEchartsDataToLocal( moment(timeStamp).format('HH:mm'), [temp_1, humid_1, h2o2_1, saturation_1], @@ -244,7 +244,7 @@ export const useWebSocketStore = defineStore({ deviceStore.updateEnvirHP2(h2o2_3) // 对数据进行处理 并存入到localstorage中 - if (operatorStore.disinfectStatus) { + if ([1, 2, 3, 4].includes(operatorStore.disinfectStatus)) { saveEchartsDataToLocal( moment(timeStamp).format('HH:mm'), [temp_1, humid_1, h2o2_1, saturation_1],