From 20185dc2a26f590a91092f4e4d101665afe640cc Mon Sep 17 00:00:00 2001 From: zqc <835569504@qq.com> Date: Mon, 12 Jan 2026 15:27:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=B8=A6=E5=87=BA=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E6=89=93=E5=8D=B0=EF=BC=8C=E4=BD=86=E6=98=AF=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E6=98=BE=E7=A4=BA=EF=BC=8C=E6=8E=92=E6=9F=A5=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web_page/index.html | 77 ++++++++++++++++++++++++++++++++------------- 1 file changed, 56 insertions(+), 21 deletions(-) diff --git a/web_page/index.html b/web_page/index.html index 4ef087a..dccfa90 100644 --- a/web_page/index.html +++ b/web_page/index.html @@ -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); + } @@ -220,30 +225,47 @@ const title = document.createElement('div'); 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'); - 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; - } - + 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 => { + 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'); 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) {