fix(mileage): reconcile track and daily semantics

This commit is contained in:
lingniu
2026-07-20 08:52:27 +08:00
parent 6245a9b979
commit 6574b49ff9
4 changed files with 49 additions and 2 deletions

View File

@@ -197,7 +197,8 @@ test('renders a map-first replay workspace and connects stop, event, and panel i
expect(view.container.querySelector('.v2-track-current-card.semi-card')).toBeInTheDocument();
expect(view.container.querySelector('.v2-track-current-coverage')).toBeInTheDocument();
expect(view.container.querySelectorAll('.v2-track-current-metrics > span')).toHaveLength(4);
expect(view.container.querySelector('.v2-track-current-metrics')).toHaveTextContent('累计总里程100 km');
expect(view.container.querySelector('.v2-track-current-metrics')).toHaveTextContent('设备累计值非区间100 km');
expect(view.container.querySelector('.v2-track-current-metrics > span:last-child small > b')).toHaveTextContent('非区间');
expect(view.container.querySelector('.v2-track-current-metrics > span:last-child')).toHaveAttribute('title', '当前轨迹点设备上报的累计总里程,不是所选时间窗里程或今日里程');
expect(view.container.querySelector('.v2-track-current-evidence')).toHaveTextContent('JT/T 808时间窗完整3 → 3 点报警 —');
expect(view.container.querySelector('.v2-track-current-evidence .v2-track-protocol-tag')).toHaveClass('semi-tag-cyan-light');

View File

@@ -522,7 +522,10 @@ export default function TrackPage() {
<span><small></small><strong>{number(current?.speedKmh ?? 0)}<em> km/h</em></strong></span>
<span><small></small><strong>{direction(current?.directionDeg)}</strong></span>
<span><small>SOC</small><strong>{current?.socAvailable ? `${number(current.socPercent)}%` : '—'}</strong></span>
<span title="当前轨迹点设备上报的累计总里程,不是所选时间窗里程或今日里程"><small></small><strong>{trackPointMileageAvailable(current) ? number(current?.totalMileageKm ?? 0) : '—'}{trackPointMileageAvailable(current) ? <em> km</em> : null}</strong></span>
<span title="当前轨迹点设备上报的累计总里程,不是所选时间窗里程或今日里程">
<small><b></b></small>
<strong>{trackPointMileageAvailable(current) ? number(current?.totalMileageKm ?? 0) : '—'}{trackPointMileageAvailable(current) ? <em> km</em> : null}</strong>
</span>
</div>
<div className={`v2-track-current-evidence v2-track-current-coverage${track.coverage.complete ? '' : ' is-warning'}`}>
<ProtocolTag className="v2-track-protocol-tag" protocol={current?.protocol} compact />

View File

@@ -1948,10 +1948,25 @@
}
.v2-track-current-card > .semi-card-body > .v2-track-current-metrics small {
display: flex;
min-width: 0;
align-items: center;
gap: 5px;
color: #8491a2;
font-size: 10px;
}
.v2-track-current-card > .semi-card-body > .v2-track-current-metrics small > b {
flex: 0 0 auto;
border-radius: 999px;
background: #edf3fa;
padding: 1px 5px;
color: #536a84;
font-size: 8px;
font-weight: 700;
line-height: 13px;
}
.v2-track-current-card > .semi-card-body > .v2-track-current-metrics strong {
margin-top: 4px;
color: #25384f;
@@ -4419,6 +4434,10 @@
font-size: 8px;
}
.v2-track-current-card > .semi-card-body > .v2-track-current-metrics small > b {
display: none;
}
.v2-track-current-card > .semi-card-body > .v2-track-current-metrics strong {
margin-top: 2px;
font-size: 12px;