fix(web): 修复设备ID获取不全与空值处理不完善的问题
补充从ev.detail中提取设备ID的逻辑,同时新增对空字符串和'---'格式设备ID的统一处理
This commit is contained in:
@@ -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 === '充值') {
|
||||
|
||||
Reference in New Issue
Block a user