From 940f42f66af37a26efc13899e58a7b38074b1d5c Mon Sep 17 00:00:00 2001 From: yangsy Date: Mon, 10 Nov 2025 20:30:05 +0800 Subject: [PATCH] fix(nvr-history-diag-card): distinguish nvr cluster --- .../history-diag-card/nvr-history-diag-card.vue | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/components/device-page/device-card/history-diag-card/nvr-history-diag-card.vue b/src/components/device-page/device-card/history-diag-card/nvr-history-diag-card.vue index ae8e625..7430527 100644 --- a/src/components/device-page/device-card/history-diag-card/nvr-history-diag-card.vue +++ b/src/components/device-page/device-card/history-diag-card/nvr-history-diag-card.vue @@ -65,12 +65,17 @@ onMounted(() => { refreshData(); }); -const diagCards = ref([ - { label: '设备状态', value: 'status' }, - { label: '设备告警', value: 'alarm' }, - { label: '硬件使用率', value: 'usage' }, - { label: '硬盘健康', value: 'health' }, -]); +const diagCards = computed(() => { + const isCluster = (maybeNvrCluster: NdmNvrResultVO) => !!maybeNvrCluster.clusterList?.trim() && maybeNvrCluster.clusterList !== maybeNvrCluster.ipAddress; + const baseOptions: SelectOption[] = [ + { label: '设备状态', value: 'status' }, + { label: '设备告警', value: 'alarm' }, + ]; + if (!isCluster(ndmNvr.value)) { + baseOptions.push({ label: '硬件使用率', value: 'usage' }, { label: '硬盘健康', value: 'health' }); + } + return baseOptions; +}); const selectedCards = ref([...diagCards.value.map((option) => `${option.value ?? ''}`)]);