修改了一些东西
This commit is contained in:
@@ -191,7 +191,11 @@
|
||||
const formatIcCardEventUnified = (ev) => {
|
||||
const type = String(ev?.type || '').toLowerCase();
|
||||
const action = String(ev?.action || '').toLowerCase();
|
||||
const deviceId = ev?.device || ev?.device_id || ev?.["设备编号"] || ev?.["机器ID"] || '---';
|
||||
let deviceId = ev?.device || ev?.device_id || ev?.["设备编号"] || ev?.["机器ID"] || '---';
|
||||
if (/^\d+$/.test(deviceId)) deviceId = 'ticket_machine';
|
||||
if (deviceId === 'ticket_machine') deviceId = '售票机';
|
||||
if (deviceId === 'gate') deviceId = '闸机';
|
||||
if (deviceId === 'refill_machine') deviceId = '充值机';
|
||||
const timeStr = formatTime(ev?.ts);
|
||||
const balance = ev?.balance ?? ev?.["余额"] ?? 0;
|
||||
|
||||
|
||||
@@ -90,7 +90,11 @@
|
||||
const formatIcCardEventUnified = (ev) => {
|
||||
const type = String(ev?.type || '').toLowerCase();
|
||||
const action = String(ev?.action || '').toLowerCase();
|
||||
const deviceId = ev?.device || ev?.device_id || ev?.["设备编号"] || ev?.["机器ID"] || '---';
|
||||
let deviceId = ev?.device || ev?.device_id || ev?.["设备编号"] || ev?.["机器ID"] || '---';
|
||||
if (/^\d+$/.test(deviceId)) deviceId = 'ticket_machine';
|
||||
if (deviceId === 'ticket_machine') deviceId = '售票机';
|
||||
if (deviceId === 'gate') deviceId = '闸机';
|
||||
if (deviceId === 'refill_machine') deviceId = '充值机';
|
||||
const timeStr = formatTime(ev?.ts);
|
||||
const balance = ev?.balance ?? ev?.["余额"] ?? 0;
|
||||
|
||||
|
||||
+10
-2
@@ -348,7 +348,11 @@ createApp({
|
||||
const formatTicketEventUnified = (ev) => {
|
||||
const type = getTicketEventType(ev);
|
||||
const action = getTicketEventAction(ev);
|
||||
const deviceId = ev?.device || ev?.device_id || ev?.["设备编号"] || ev?.["机器ID"] || '---';
|
||||
let deviceId = ev?.device || ev?.device_id || ev?.["设备编号"] || ev?.["机器ID"] || '---';
|
||||
if (/^\d+$/.test(deviceId)) deviceId = 'ticket_machine';
|
||||
if (deviceId === 'ticket_machine') deviceId = '售票机';
|
||||
if (deviceId === 'gate') deviceId = '闸机';
|
||||
if (deviceId === 'refill_machine') deviceId = '充值机';
|
||||
const timeStr = formatTime(ev?.ts || ev?.["时间戳"]);
|
||||
|
||||
if (type === 'sale' || type === '售票') {
|
||||
@@ -451,7 +455,11 @@ createApp({
|
||||
const formatIcEventDetail = (ev) => {
|
||||
const type = String(ev?.type || '').toLowerCase();
|
||||
const action = String(ev?.action || '').toLowerCase();
|
||||
const deviceId = ev?.device || ev?.device_id || ev?.["设备编号"] || ev?.["机器ID"] || '---';
|
||||
let deviceId = ev?.device || ev?.device_id || ev?.["设备编号"] || ev?.["机器ID"] || '---';
|
||||
if (/^\d+$/.test(deviceId)) deviceId = 'ticket_machine';
|
||||
if (deviceId === 'ticket_machine') deviceId = '售票机';
|
||||
if (deviceId === 'gate') deviceId = '闸机';
|
||||
if (deviceId === 'refill_machine') deviceId = '充值机';
|
||||
const timeStr = formatTime(ev?.ts);
|
||||
const balance = ev?.balance ?? ev?.["余额"] ?? 0;
|
||||
|
||||
|
||||
+27
-3
@@ -96,7 +96,15 @@
|
||||
{{ statusInfo.text }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="jr-route-board">
|
||||
<div v-if="String(ticket.overview.train_type || ticket.overview['车型'] || '').toLowerCase() === 'single'" class="jr-route-board" style="justify-content: center; text-align: center;">
|
||||
<div class="jr-station-block">
|
||||
<div class="jr-station-line" style="justify-content: center;">
|
||||
<span class="jr-station-title">{{ ticket.overview.start_name }}</span>
|
||||
</div>
|
||||
<div class="jr-station-en" style="text-align: center; margin-top: 4px;">单程单区间</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="jr-route-board">
|
||||
<div class="jr-station-block">
|
||||
<div class="jr-station-line">
|
||||
<span class="jr-station-title">{{ ticket.overview.start_name }}</span>
|
||||
@@ -113,7 +121,18 @@
|
||||
<div class="jr-station-en">{{ ticket.overview.terminal_en }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="jr-meta-grid">
|
||||
|
||||
<div v-if="String(ticket.overview.train_type || ticket.overview['车型'] || '').toLowerCase() === 'single'" class="jr-meta-grid" style="grid-template-columns: repeat(2, 1fr);">
|
||||
<div class="jr-meta-item">
|
||||
<span>票价</span>
|
||||
<strong>¥ {{ ticket.overview.amount || 0 }}</strong>
|
||||
</div>
|
||||
<div class="jr-meta-item">
|
||||
<span>更新时间</span>
|
||||
<strong>{{ formatTime(ticket.overview.last_update_ts) }}</strong>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="jr-meta-grid">
|
||||
<div class="jr-meta-item">
|
||||
<span>车型</span>
|
||||
<strong>{{ formatTrainType(ticket.overview.train_type) }}</strong>
|
||||
@@ -298,7 +317,12 @@
|
||||
}
|
||||
|
||||
const stationEn = event.station_en || event['站点英文'] || '';
|
||||
const deviceId = event.device_id || event['设备编号'] || '';
|
||||
let deviceId = event.device || event.device_id || event['设备编号'] || event['机器ID'] || '';
|
||||
if (/^\d+$/.test(deviceId)) deviceId = 'ticket_machine';
|
||||
if (deviceId === 'ticket_machine') deviceId = '售票机';
|
||||
if (deviceId === 'gate') deviceId = '闸机';
|
||||
if (deviceId === 'refill_machine') deviceId = '充值机';
|
||||
|
||||
if (stationEn && deviceId) return `${stationEn} (${deviceId})`;
|
||||
if (deviceId) return `设备:${deviceId}`;
|
||||
return stationEn;
|
||||
|
||||
+5
-1
@@ -228,7 +228,11 @@ createApp({
|
||||
const formatTicketEventUnified = (ev) => {
|
||||
const type = getTicketEventType(ev);
|
||||
const action = getTicketEventAction(ev);
|
||||
const deviceId = ev?.device || ev?.device_id || ev?.["设备编号"] || ev?.["机器ID"] || '---';
|
||||
let deviceId = ev?.device || ev?.device_id || ev?.["设备编号"] || ev?.["机器ID"] || '---';
|
||||
if (/^\d+$/.test(deviceId)) deviceId = 'ticket_machine';
|
||||
if (deviceId === 'ticket_machine') deviceId = '售票机';
|
||||
if (deviceId === 'gate') deviceId = '闸机';
|
||||
if (deviceId === 'refill_machine') deviceId = '充值机';
|
||||
const timeStr = formatTime(ev?.ts || ev?.["时间戳"]);
|
||||
|
||||
if (type === 'sale' || type === '售票') {
|
||||
|
||||
+72
-25
@@ -110,7 +110,11 @@
|
||||
const formatTicketEventUnified = (ev) => {
|
||||
const type = getEventType(ev);
|
||||
const action = String(ev.action || ev["动作"] || '').toLowerCase();
|
||||
const deviceId = ev.device || ev.device_id || ev["设备编号"] || ev["机器ID"] || '---';
|
||||
let deviceId = ev.device || ev.device_id || ev["设备编号"] || ev["机器ID"] || '---';
|
||||
if (/^\d+$/.test(deviceId)) deviceId = 'ticket_machine';
|
||||
if (deviceId === 'ticket_machine') deviceId = '售票机';
|
||||
if (deviceId === 'gate') deviceId = '闸机';
|
||||
if (deviceId === 'refill_machine') deviceId = '充值机';
|
||||
const timeStr = formatTime(ev.ts || ev["时间戳"]);
|
||||
|
||||
if (type === 'sale' || type === '售票') {
|
||||
@@ -151,6 +155,9 @@
|
||||
const overview = it.overview || it["概览"] || null;
|
||||
const startName = overview ? (overview.start_name || overview["起点"]) : (it.start_name || it["起点"] || '---');
|
||||
const terminalName = overview ? (overview.terminal_name || overview["终点"]) : (it.terminal_name || it["终点"] || '---');
|
||||
const trainType = overview ? (overview.train_type || overview["车型"]) : (it.train_type || it["车型"]);
|
||||
const isSingle = String(trainType || '').toLowerCase() === 'single';
|
||||
|
||||
const updateTime = formatTime(
|
||||
(overview && (overview.last_update_ts || overview["上次更新时间"])) ||
|
||||
it.last_update_ts ||
|
||||
@@ -158,13 +165,20 @@
|
||||
''
|
||||
);
|
||||
|
||||
let routeHtml = '';
|
||||
if (isSingle) {
|
||||
routeHtml = `${escapeHtml(startName)} <span style="font-size: 0.8em; margin-left: 8px; color: #666; font-weight: normal;">单程单区间</span>`;
|
||||
} else {
|
||||
routeHtml = `${escapeHtml(startName)} → ${escapeHtml(terminalName)}`;
|
||||
}
|
||||
|
||||
row.innerHTML = `
|
||||
<div class="jr-ticket-row-head">
|
||||
<span class="jr-ticket-id mono">${escapeHtml(id)}</span>
|
||||
<span class="jr-status-pill ${isValidStatus(statusText) ? 'jr-status-valid' : (statusText === '已使用' ? 'jr-status-used' : 'jr-status-expired')}">${escapeHtml(statusText)}</span>
|
||||
</div>
|
||||
<div class="jr-ticket-route">
|
||||
${escapeHtml(startName)} → ${escapeHtml(terminalName)}
|
||||
${routeHtml}
|
||||
</div>
|
||||
<div class="jr-list-meta">最近更新 ${escapeHtml(updateTime)}</div>
|
||||
`;
|
||||
@@ -192,6 +206,60 @@
|
||||
const stRaw = ov.status || ov["状态"] || d.status || d["状态"] || '';
|
||||
const statusText = formatStatusText(stRaw);
|
||||
const statusClass = isValidStatus(stRaw) ? 'jr-status-valid' : (statusText === '已使用' ? 'jr-status-used' : 'jr-status-expired');
|
||||
const isSingle = String(ov.train_type || ov["车型"] || '').toLowerCase() === 'single';
|
||||
|
||||
let routeBoardHtml = '';
|
||||
if (isSingle) {
|
||||
routeBoardHtml = `
|
||||
<div class="jr-route-board" style="justify-content: center; text-align: center;">
|
||||
<div class="jr-station-block">
|
||||
<div class="jr-station-line" style="justify-content: center;">
|
||||
<span class="jr-station-title">${escapeHtml(ov.start_name || ov["起点"] || '---')}</span>
|
||||
</div>
|
||||
<div class="jr-station-en" style="text-align: center; margin-top: 4px;">单程单区间</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
} else {
|
||||
routeBoardHtml = `
|
||||
<div class="jr-route-board">
|
||||
<div class="jr-station-block">
|
||||
<div class="jr-station-line">
|
||||
<span class="jr-station-title">${escapeHtml(ov.start_name || ov["起点"] || '---')}</span>
|
||||
<span class="jr-station-code">${escapeHtml(ov.start_code || ov["起点编号"] || '')}</span>
|
||||
</div>
|
||||
<div class="jr-station-en">${escapeHtml(ov.start_en || ov["起点英文"] || '')}</div>
|
||||
</div>
|
||||
<div class="jr-route-track"><i class="fas fa-train"></i></div>
|
||||
<div class="jr-station-block is-end">
|
||||
<div class="jr-station-line">
|
||||
<span class="jr-station-title">${escapeHtml(ov.terminal_name || ov["终点"] || '---')}</span>
|
||||
<span class="jr-station-code">${escapeHtml(ov.terminal_code || ov["终点编号"] || '')}</span>
|
||||
</div>
|
||||
<div class="jr-station-en">${escapeHtml(ov.terminal_en || ov["终点英文"] || '')}</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
let metaGridHtml = '';
|
||||
if (isSingle) {
|
||||
metaGridHtml = `
|
||||
<div class="jr-meta-grid" style="grid-template-columns: repeat(2, 1fr);">
|
||||
<div class="jr-meta-item"><span>票价</span><strong>${escapeHtml(ov.amount ?? ov["金额"] ?? 0)}</strong></div>
|
||||
<div class="jr-meta-item"><span>更新</span><strong>${escapeHtml(formatTime(ov.last_update_ts ?? ov["上次更新时间"]))}</strong></div>
|
||||
</div>
|
||||
`;
|
||||
} else {
|
||||
metaGridHtml = `
|
||||
<div class="jr-meta-grid">
|
||||
<div class="jr-meta-item"><span>车型</span><strong>${escapeHtml(formatTrainType(ov.train_type || ov["车型"]))}</strong></div>
|
||||
<div class="jr-meta-item"><span>乘次</span><strong>${escapeHtml(ov.trips_total ?? ov["总乘次"] ?? 0)}</strong></div>
|
||||
<div class="jr-meta-item"><span>票价</span><strong>${escapeHtml(ov.amount ?? ov["金额"] ?? 0)}</strong></div>
|
||||
<div class="jr-meta-item"><span>更新</span><strong>${escapeHtml(formatTime(ov.last_update_ts ?? ov["上次更新时间"]))}</strong></div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
detailEl.innerHTML = `
|
||||
<div class="jr-ticket-preview" onclick="openTicketDetail('${id}')" style="cursor:pointer;" title="点击查看电子票看板">
|
||||
@@ -199,29 +267,8 @@
|
||||
<span class="jr-ticket-id mono">${id} <i class="fas fa-external-link-alt" style="font-size:0.8em; margin-left:4px"></i></span>
|
||||
<span class="jr-status-pill ${statusClass}">${statusText}</span>
|
||||
</div>
|
||||
<div class="jr-route-board">
|
||||
<div class="jr-station-block">
|
||||
<div class="jr-station-line">
|
||||
<span class="jr-station-title">${ov.start_name || ov["起点"] || '---'}</span>
|
||||
<span class="jr-station-code">${ov.start_code || ov["起点编号"] || ''}</span>
|
||||
</div>
|
||||
<div class="jr-station-en">${ov.start_en || ov["起点英文"] || ''}</div>
|
||||
</div>
|
||||
<div class="jr-route-track"><i class="fas fa-train"></i></div>
|
||||
<div class="jr-station-block is-end">
|
||||
<div class="jr-station-line">
|
||||
<span class="jr-station-title">${ov.terminal_name || ov["终点"] || '---'}</span>
|
||||
<span class="jr-station-code">${ov.terminal_code || ov["终点编号"] || ''}</span>
|
||||
</div>
|
||||
<div class="jr-station-en">${ov.terminal_en || ov["终点英文"] || ''}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="jr-meta-grid">
|
||||
<div class="jr-meta-item"><span>车型</span><strong>${formatTrainType(ov.train_type || ov["车型"])}</strong></div>
|
||||
<div class="jr-meta-item"><span>乘次</span><strong>${ov.trips_total ?? ov["总乘次"] ?? 0}</strong></div>
|
||||
<div class="jr-meta-item"><span>票价</span><strong>${ov.amount ?? ov["金额"] ?? 0}</strong></div>
|
||||
<div class="jr-meta-item"><span>更新</span><strong>${formatTime(ov.last_update_ts ?? ov["上次更新时间"])}</strong></div>
|
||||
</div>
|
||||
${routeBoardHtml}
|
||||
${metaGridHtml}
|
||||
</div>
|
||||
|
||||
<div class="jr-panel-headline" style="margin:20px 0 14px;">
|
||||
|
||||
Reference in New Issue
Block a user