From beb95fb5fc166804056abafd70fc01ac27de7621 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Mon, 26 Jan 2026 09:11:00 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
applications/drone-command/src/views/dataCockpit/components/RealWarning.vue | 58 +++++++++++++++++++++++++++-------------------------------
1 files changed, 27 insertions(+), 31 deletions(-)
diff --git a/applications/drone-command/src/views/dataCockpit/components/RealWarning.vue b/applications/drone-command/src/views/dataCockpit/components/RealWarning.vue
index 7210005..e40f246 100644
--- a/applications/drone-command/src/views/dataCockpit/components/RealWarning.vue
+++ b/applications/drone-command/src/views/dataCockpit/components/RealWarning.vue
@@ -2,7 +2,7 @@
* @Author : yuan
* @Date : 2026-01-08 09:29:07
* @LastEditors : yuan
- * @LastEditTime : 2026-01-08 14:49:09
+ * @LastEditTime : 2026-01-19 11:31:09
* @FilePath : \applications\drone-command\src\views\dataCockpit\components\RealWarning.vue
* @Description :
* Copyright 2026 OBKoro1, All Rights Reserved.
@@ -15,16 +15,18 @@
element-loading-background="rgba(5, 5, 15, 0.6)"
element-loading-text="加载中..."
>
- <EmptyState v-if="!realWarningData.length" />
- <RealTemplate
- v-else
- v-for="(item, ind) in realWarningData"
- :key="ind"
- :data="item"
- @signal="() => handleAction('signal', item)"
- @counter="() => handleAction('counter', item)"
- @favorite="() => console.log('收藏', item.id)"
- />
+ <div class="list-content">
+ <EmptyState v-if="!realWarningData.length" />
+ <RealTemplate
+ v-else
+ v-for="(item, ind) in realWarningData"
+ :key="ind"
+ :data="item"
+ @signal="() => handleAction('signal', item)"
+ @counter="() => handleAction('counter', item)"
+ @favorite="() => console.log('收藏', item.id)"
+ />
+ </div>
</div>
</template>
@@ -36,7 +38,7 @@
import { ElMessage } from 'element-plus'
const realWarningData = ref([])
-const loading = ref(false)
+const loading = ref(true)
const minLoadingMs = 400
const actionTextMap = {
@@ -44,32 +46,18 @@
counter: '诱导驱离'
}
-const buildPayload = (item) => ({
- alarmRecordId: item.id,
- areaCode: item.areaCode,
- counterEffect: '',
- coverRadiusM: item.coverRadiusM,
- deployLatitude: item.latitude,
- deployLongitude: item.longitude,
- deviceCode: item.deviceCode,
- deviceId: item.deviceId,
- deviceModel: item.deviceModel,
- deviceName: item.deviceName,
- deviceType: item.deviceType,
- droneDeviceCode: item.droneSerialNo,
- droneName: item.droneName,
- droneType: item.droneType,
- findTime: item.alarmTime,
- id: item.id,
- workMode: ''
+const buildPayload = (type, item) => ({
+ counterWay: type === 'signal' ? 1 : type === 'counter' ? 2 : '',
+ alarmRecordId: item?.alarmRecordId ?? item?.id
})
const handleAction = async (type, item) => {
const actionText = actionTextMap[type] || '操作'
try {
- const res = await interferenceAndExpulsionApi(buildPayload(item))
+ const res = await interferenceAndExpulsionApi(buildPayload(type, item))
if (res?.data?.success) {
ElMessage({ type: 'success', message: `${actionText}成功` })
+ await fetchRealWarning()
} else {
ElMessage({ type: 'error', message: res?.data?.msg || `${actionText}失败` })
}
@@ -102,8 +90,16 @@
<style lang="scss" scoped>
.real-warning {
+ display: flex;
+ flex-direction: column;
width: 100%;
height: 100%;
+ overflow: hidden;
}
+.list-content {
+ height: 0;
+ flex: 1;
+ overflow-y: auto;
+}
</style>
--
Gitblit v1.9.3