fix(web): 修复设备ID获取不全与空值处理不完善的问题

补充从ev.detail中提取设备ID的逻辑,同时新增对空字符串和'---'格式设备ID的统一处理
This commit is contained in:
2026-07-10 13:37:56 +08:00
parent 8435717a58
commit f65e043130
6 changed files with 14 additions and 14 deletions
+2 -2
View File
@@ -320,14 +320,14 @@
}
const stationEn = event.station_en || event['站点英文'] || '';
let deviceId = String(event.device || event.device_id || event['设备编号'] || event['机器ID'] || '').trim();
let deviceId = String(event.device || event.device_id || event.detail?.device || event.detail?.device_id || event['设备编号'] || event['机器ID'] || '').trim();
const dStr = deviceId.toLowerCase();
if (dStr === 'gate') {
deviceId = '闸机';
} else if (dStr === 'refill_machine') {
deviceId = '充值机';
} else if (dStr === 'ticket_machine' || dStr === 'ticket_vending_machine' || /^#?\d+$/.test(dStr) || dStr.includes('computer') || dStr === 'unknown') {
} else if (dStr === 'ticket_machine' || dStr === 'ticket_vending_machine' || /^#?\d+$/.test(dStr) || dStr.includes('computer') || dStr === 'unknown' || dStr === '---' || dStr === '') {
if (type === 'entry' || action === 'entry' || type === 'exit' || action === 'exit' || type === 'check') {
deviceId = '闸机';
} else if (type === 'topup' || type === 'refill' || action === 'topup' || type === '充值') {