新增带出消息打印,但是没有显示,排查中
This commit is contained in:
@@ -169,6 +169,11 @@
|
||||
color: #60a5fa;
|
||||
border: 1px solid rgba(59, 130, 246, 0.3);
|
||||
}
|
||||
.action-takeout {
|
||||
background: rgba(139, 92, 246, 0.2);
|
||||
color: #a78bfa;
|
||||
border: 1px solid rgba(139, 92, 246, 0.3);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -220,6 +225,22 @@
|
||||
|
||||
const title = document.createElement('div');
|
||||
title.className = 'message-title';
|
||||
|
||||
if (msg.msg_type === 'take_out') {
|
||||
// 处理take_out类型的消息
|
||||
title.textContent = `人员带出: `;
|
||||
|
||||
const tag = document.createElement('span');
|
||||
tag.className = 'action-tag action-takeout';
|
||||
tag.textContent = msg.person_name;
|
||||
title.appendChild(tag);
|
||||
|
||||
const countTag = document.createElement('span');
|
||||
countTag.className = 'action-tag action-face';
|
||||
countTag.textContent = `第${msg.historical_alert_count}次`;
|
||||
title.appendChild(countTag);
|
||||
} else {
|
||||
// 处理原有的异常检测消息
|
||||
title.textContent = `检测到异常: `;
|
||||
|
||||
msg.result_type.forEach(action => {
|
||||
@@ -244,6 +265,7 @@
|
||||
|
||||
title.appendChild(tag);
|
||||
});
|
||||
}
|
||||
|
||||
const meta = document.createElement('div');
|
||||
meta.className = 'message-meta';
|
||||
@@ -342,6 +364,19 @@
|
||||
const alertTypes = alertMsg.result_type.join(', ');
|
||||
addLog(`检测到异常: ${alertTypes}`, 'warning');
|
||||
}
|
||||
} else if (msg.msg_type === 'take_out') {
|
||||
// 处理take_out类型的消息
|
||||
const takeOutMsg = {
|
||||
msg_type: 'take_out',
|
||||
person_name: msg.person_name,
|
||||
historical_alert_count: msg.historical_alert_count || 0,
|
||||
timestamp: Math.floor(Date.now() / 1000)
|
||||
};
|
||||
|
||||
alerts.push(takeOutMsg);
|
||||
renderMessages();
|
||||
|
||||
addLog(`人员带出: ${takeOutMsg.person_name} (历史告警: ${takeOutMsg.historical_alert_count})`, 'warning');
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user