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'; };