feat: add total device count

This commit is contained in:
yangsy
2025-08-21 21:12:31 +08:00
parent fa213940d6
commit a6f2a0a54e
2 changed files with 45 additions and 23 deletions

View File

@@ -32,6 +32,13 @@ const offlineDeviceCount = computed(() => {
});
return count;
});
const deviceCount = computed(() => {
let count = 0;
Object.values(DeviceType).forEach((deviceType) => {
count += stationDevices.value[deviceType].length;
});
return count;
});
const devicAlarmCount = computed(() => {
let count = 0;
Object.values(DeviceType).forEach((deviceType) => {
@@ -116,7 +123,7 @@ const theme = useThemeVars();
<span class="font-xx-small" :class="[online ? 'clickable' : '']" @click="openOfflineDeviceTreeModal">离线设备</span>
</template>
<template #default>
<span class="font-medium">{{ offlineDeviceCount }}</span>
<span class="font-medium">{{ offlineDeviceCount }}/{{ deviceCount }}</span>
</template>
<template #suffix>
<span class="font-xx-small"></span>