From 6b82e8c63399005e65322f6d5d463f6e33fedbdc Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 09 Jan 2026 15:49:27 +0800
Subject: [PATCH] feat:数据驾驶舱接口对接

---
 applications/drone-command/src/views/dataCockpit/components/CenterContainer.vue |   41 +++++++++++++++++++++++++++++++----------
 1 files changed, 31 insertions(+), 10 deletions(-)

diff --git a/applications/drone-command/src/views/dataCockpit/components/CenterContainer.vue b/applications/drone-command/src/views/dataCockpit/components/CenterContainer.vue
index 4eac750..abbda6a 100644
--- a/applications/drone-command/src/views/dataCockpit/components/CenterContainer.vue
+++ b/applications/drone-command/src/views/dataCockpit/components/CenterContainer.vue
@@ -39,45 +39,46 @@
 </template>
 
 <script setup>
-import { ref } from 'vue'
+import { onMounted, ref } from 'vue'
 import warningLogo from '@/assets/images/dataCockpit/warning.png'
 import equipmentLogo from '@/assets/images/dataCockpit/equipment.png'
+import { alarmStatisticsApi } from '@/api/dataCockpit'
 
-let warningList = ref([
+const warningList = ref([
 	{
 		title: '实时告警',
-		value: 56,
+		value: 0,
 		type: 1
 	},
 	{
 		title: '设备告警',
-		value: 127,
+		value: 0,
 		type: 2
 	},
 	{
 		title: '历史告警',
-		value: 619,
+		value: 0,
 		type: 3
 	},
 ])
 
-let equipmentList = ref([
+const equipmentList = ref([
 	{
 		title: '设备统计',
-		value: 18,
+		value: 0,
 		isHighlight: true,
 	},
 	{
 		title: '无线电',
-		value: 9,
+		value: 0,
 	},
 	{
 		title: '光电',
-		value: 6,
+		value: 0,
 	},
 	{
 		title: '雷达',
-		value: 3,
+		value: 0,
 	}
 ])
 
@@ -92,6 +93,26 @@
 		emit('select-equipment')
 	}
 }
+
+const updateStats = async () => {
+	const res = await alarmStatisticsApi()
+	const data = res?.data?.data || {}
+	warningList.value = [
+		{ title: '实时告警', value: data.realTimeAlarmCount ?? 0, type: 1 },
+		{ title: '设备告警', value: data.deviceAlarmCount ?? 0, type: 2 },
+		{ title: '历史告警', value: data.historyAlarmCount ?? 0, type: 3 }
+	]
+	equipmentList.value = [
+		{ title: '设备统计', value: data.deviceCount ?? 0, isHighlight: true },
+		{ title: '无线电', value: data.radioCount ?? 0 },
+		{ title: '光电', value: data.opticalCount ?? 0 },
+		{ title: '雷达', value: data.radarCount ?? 0 }
+	]
+}
+
+onMounted(() => {
+	updateStats()
+})
 </script>
 
 <style lang="scss" scoped>

--
Gitblit v1.9.3