From 052d0e8bd9c1d8e0d243a166bedf761fc5a7a891 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Wed, 14 Jan 2026 16:38:00 +0800
Subject: [PATCH] feat:通用弹窗样式调整
---
applications/drone-command/src/views/dataCockpit/components/CenterContainer.vue | 55 +++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 39 insertions(+), 16 deletions(-)
diff --git a/applications/drone-command/src/views/dataCockpit/components/CenterContainer.vue b/applications/drone-command/src/views/dataCockpit/components/CenterContainer.vue
index 3545362..abbda6a 100644
--- a/applications/drone-command/src/views/dataCockpit/components/CenterContainer.vue
+++ b/applications/drone-command/src/views/dataCockpit/components/CenterContainer.vue
@@ -1,4 +1,4 @@
-<template>
+<template>
<div class="center-container">
<div class="left-box">
<div class="logo">
@@ -6,7 +6,7 @@
</div>
<div class="list">
- <div class="item" v-for="item, ind in warningList" :key="ind">
+ <div class="item" v-for="(item, ind) in warningList" :key="ind">
<div class="val" @click="warningTypeClick(item.type)">
{{ item.value }}
</div>
@@ -24,7 +24,7 @@
</div>
<div class="list">
- <div class="item" v-for="item, ind in equipmentList" :key="ind">
+ <div class="item" v-for="(item, ind) in equipmentList" :key="ind">
<div class="val" :class="{highlight: item.isHighlight}" @click="equipmentClick(item.isHighlight)">
{{ item.value }}
</div>
@@ -39,57 +39,80 @@
</template>
<script setup>
+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,
}
])
+const emit = defineEmits(['select-warning', 'select-equipment'])
+
const warningTypeClick = (type) => {
- console.log('点击了告警类型:', type);
+ emit('select-warning', type)
}
const equipmentClick = (isHighlight) => {
if (isHighlight) {
- console.log('点击了设备统计');
+ 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>
@@ -196,4 +219,4 @@
}
}
}
-</style>
\ No newline at end of file
+</style>
--
Gitblit v1.9.3