From a43a8b24e3e625e36bf1fe6befc41e9da869ebc4 Mon Sep 17 00:00:00 2001 From: yangsy Date: Tue, 19 May 2026 14:58:15 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E6=AD=A3=E5=AE=89=E9=98=B2?= =?UTF-8?q?=E7=AE=B1=E9=97=A8=E7=A6=81=E5=92=8C=E9=98=B2=E9=9B=B7=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../current-diag/security-box-env-card.vue | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/device/device-card/components/current-diag/security-box-env-card.vue b/src/components/device/device-card/components/current-diag/security-box-env-card.vue index b21a8ed..188b171 100644 --- a/src/components/device/device-card/components/current-diag/security-box-env-card.vue +++ b/src/components/device/device-card/components/current-diag/security-box-env-card.vue @@ -16,23 +16,23 @@ const showCard = computed(() => { return Object.values(props).some((value) => !!value); }); -// 门禁状态 -const accessControlStatus = computed(() => { - if (!switches?.value || switches.value.length < 1) return null; - const status = switches.value.at(0)!; - return status === 0 ? '开门' : status === 1 ? '关门' : '-'; -}); - // 防雷状态 const lightningProtectionStatus = computed(() => { if (!switches?.value || switches.value.length < 2) return null; + const status = switches.value.at(0)!; + return status === 0 ? '失效' : status === 1 ? '生效' : '-'; +}); + +// 门禁状态 +const accessControlStatus = computed(() => { + if (!switches?.value || switches.value.length < 1) return null; const status = switches.value.at(1)!; - return status === 0 ? '正常' : status === 1 ? '失效' : '-'; + return status === 0 ? '开门' : status === 1 ? '关门' : '-'; }); const getStatusTagType = (status: string | null) => { - if (['正常'].includes(status ?? '')) return 'success'; - if (['失效'].includes(status ?? '')) return 'error'; + if (['生效', '关门'].includes(status ?? '')) return 'success'; + if (['失效', '开门'].includes(status ?? '')) return 'error'; return 'default'; };