新增带出消息打印,但是没有显示,排查中
This commit is contained in:
@@ -169,6 +169,11 @@
|
|||||||
color: #60a5fa;
|
color: #60a5fa;
|
||||||
border: 1px solid rgba(59, 130, 246, 0.3);
|
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>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -220,30 +225,47 @@
|
|||||||
|
|
||||||
const title = document.createElement('div');
|
const title = document.createElement('div');
|
||||||
title.className = 'message-title';
|
title.className = 'message-title';
|
||||||
title.textContent = `检测到异常: `;
|
|
||||||
|
|
||||||
msg.result_type.forEach(action => {
|
if (msg.msg_type === 'take_out') {
|
||||||
|
// 处理take_out类型的消息
|
||||||
|
title.textContent = `人员带出: `;
|
||||||
|
|
||||||
const tag = document.createElement('span');
|
const tag = document.createElement('span');
|
||||||
tag.className = 'action-tag';
|
tag.className = 'action-tag action-takeout';
|
||||||
|
tag.textContent = msg.person_name;
|
||||||
if (action === 'face') {
|
|
||||||
tag.classList.add('action-face');
|
|
||||||
tag.textContent = '检测到黑名单';
|
|
||||||
} else {
|
|
||||||
tag.classList.add('action-action');
|
|
||||||
const actionMap = {
|
|
||||||
'Slap': '扇巴掌',
|
|
||||||
'LeavingPost': '离岗',
|
|
||||||
'Collision': '撞击',
|
|
||||||
'Push': '推搡',
|
|
||||||
'Lyingdown': '倒下',
|
|
||||||
'Hanging': '自缢'
|
|
||||||
};
|
|
||||||
tag.textContent = actionMap[action] || action;
|
|
||||||
}
|
|
||||||
|
|
||||||
title.appendChild(tag);
|
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 => {
|
||||||
|
const tag = document.createElement('span');
|
||||||
|
tag.className = 'action-tag';
|
||||||
|
|
||||||
|
if (action === 'face') {
|
||||||
|
tag.classList.add('action-face');
|
||||||
|
tag.textContent = '检测到黑名单';
|
||||||
|
} else {
|
||||||
|
tag.classList.add('action-action');
|
||||||
|
const actionMap = {
|
||||||
|
'Slap': '扇巴掌',
|
||||||
|
'LeavingPost': '离岗',
|
||||||
|
'Collision': '撞击',
|
||||||
|
'Push': '推搡',
|
||||||
|
'Lyingdown': '倒下',
|
||||||
|
'Hanging': '自缢'
|
||||||
|
};
|
||||||
|
tag.textContent = actionMap[action] || action;
|
||||||
|
}
|
||||||
|
|
||||||
|
title.appendChild(tag);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const meta = document.createElement('div');
|
const meta = document.createElement('div');
|
||||||
meta.className = 'message-meta';
|
meta.className = 'message-meta';
|
||||||
@@ -342,6 +364,19 @@
|
|||||||
const alertTypes = alertMsg.result_type.join(', ');
|
const alertTypes = alertMsg.result_type.join(', ');
|
||||||
addLog(`检测到异常: ${alertTypes}`, 'warning');
|
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) {
|
} catch (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user