预警图片检测触发修复

This commit is contained in:
2026-06-16 16:58:24 +08:00
parent 0158b41712
commit 7396889f32
4 changed files with 15 additions and 315 deletions
+8 -5
View File
@@ -583,8 +583,13 @@ const handleUploadSuccess = (response) => {
if (response.data.alerts && response.data.alerts.length > 0) {
alerts.value = response.data.alerts
response.data.alerts.forEach(alert => {
// 同步到全局预警中心,供 AlertList 展示
alertStore.addAlert(alert)
// 兼容两种字段名: 旧格式 {type, message} / 新格式 {event_type, metadata.description}
const alertType = alert.type || alert.event_type
const alertMessage = alert.message || (alert.metadata && alert.metadata.description) || ''
ElMessage({
message: `行为告警: ${alert.type} - ${alert.message}`,
message: `警: ${alertType} - ${alertMessage}`,
type: 'warning',
duration: 3000
})
@@ -1117,8 +1122,6 @@ onUnmounted(() => {
.image-container {
width: 100%;
aspect-ratio: 16 / 9;
min-height: 400px;
max-height: 600px;
display: flex;
align-items: center;
@@ -1130,8 +1133,8 @@ onUnmounted(() => {
}
.display-image {
width: 100%;
height: 100%;
max-width: 100%;
max-height: 600px;
object-fit: contain;
background: #000;
}