From 23545fcd763ae8bc87072df7001ccd2682b82cce Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Mon, 09 Feb 2026 15:18:45 +0800
Subject: [PATCH] feat:侦测反制设备&场景部署调整
---
applications/drone-command/src/views/dataCockpit/index.vue | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/applications/drone-command/src/views/dataCockpit/index.vue b/applications/drone-command/src/views/dataCockpit/index.vue
index 1224bd5..2bb7d2a 100644
--- a/applications/drone-command/src/views/dataCockpit/index.vue
+++ b/applications/drone-command/src/views/dataCockpit/index.vue
@@ -57,8 +57,8 @@
const rightCollapsed = ref(false);
const allDevices = ref([]);
const realWarningData = ref([]);
- const realWarningLoading = ref(true);
- const minLoadingMs = 400;
+ const realWarningLoading = ref(false);
+ const loadingTimer = ref(null);
const onSelectWarning = (type) => {
leftActiveId.value = type;
@@ -131,8 +131,11 @@
};
const fetchRealWarning = async () => {
- const startAt = Date.now();
- realWarningLoading.value = true;
+ // 只有超过200ms才显示loading,避免闪烁
+ loadingTimer.value = setTimeout(() => {
+ realWarningLoading.value = true;
+ }, 200);
+
try {
const params = { current: 1, size: 9999, alarmType: '1' };
const res = await alarmLogApi(params);
@@ -144,10 +147,7 @@
(record?.favorited === 1 || record?.favorited === '1')
}));
} finally {
- const elapsed = Date.now() - startAt;
- if (elapsed < minLoadingMs) {
- await new Promise((resolve) => setTimeout(resolve, minLoadingMs - elapsed));
- }
+ if (loadingTimer.value) clearTimeout(loadingTimer.value);
realWarningLoading.value = false;
}
};
--
Gitblit v1.9.3