feat: clarify mobile mileage legend

This commit is contained in:
lingniu
2026-07-19 01:33:28 +08:00
parent e7b49df8ed
commit 3770afabec
3 changed files with 48 additions and 16 deletions

View File

@@ -73,6 +73,10 @@ test('renders only the desktop matrix with dates as columns and a period total',
expect(screen.getByRole('note', { name: '里程矩阵读表说明' })).toHaveTextContent('0 km已上报、无里程增量');
expect(screen.getByRole('note', { name: '里程矩阵读表说明' })).toHaveTextContent('—无可用里程');
expect(screen.getByRole('note', { name: '里程矩阵读表说明' })).toHaveTextContent('颜色越深、里程越高');
expect(screen.getByLabelText('移动端里程矩阵读表说明')).toHaveTextContent('左右滑动日期 · 车牌与总里程固定');
expect(screen.getByLabelText('0 公里表示已上报、无里程增量')).toHaveTextContent('0 km无增量');
expect(screen.getByLabelText('横线表示无可用里程')).toHaveTextContent('—无数据');
expect(screen.getByLabelText('颜色越深、里程越高')).toHaveTextContent('色阶深色更高');
const matrixRegion = screen.getByRole('region', { name: '车辆每日里程矩阵,可横向滚动查看日期' });
expect(matrixRegion).toHaveAttribute('tabindex', '0');
const matrixScroller = matrixRegion.querySelector<HTMLElement>('.semi-table-body');

View File

@@ -287,11 +287,17 @@ function dateLabel(date: string) {
function MileageMatrixGuide() {
return <aside id="v2-mileage-matrix-guide" className="v2-mileage-matrix-guide" role="note" aria-label="里程矩阵读表说明">
<span className="v2-mileage-matrix-guide-title"><IconInfoCircle /><strong></strong></span>
<span><Tag color="blue" type="light" size="small">0 km</Tag></span>
<span><Tag color="grey" type="light" size="small"></Tag></span>
<span><Tag color="blue" type="light" size="small"></Tag></span>
<span className="is-mobile-hint"> · </span>
<span className="v2-mileage-matrix-guide-title is-desktop-guide"><IconInfoCircle /><strong></strong></span>
<span className="is-desktop-guide"><Tag color="blue" type="light" size="small">0 km</Tag></span>
<span className="is-desktop-guide"><Tag color="grey" type="light" size="small"></Tag></span>
<span className="is-desktop-guide"><Tag color="blue" type="light" size="small"></Tag></span>
<span className="is-desktop-guide is-mobile-hint"> · </span>
<span className="v2-mileage-matrix-guide-mobile" aria-label="移动端里程矩阵读表说明">
<span className="is-mobile-hint"><IconInfoCircle /><strong></strong> · </span>
<span aria-label="0 公里表示已上报、无里程增量"><Tag color="blue" type="light" size="small">0 km</Tag></span>
<span aria-label="横线表示无可用里程"><Tag color="grey" type="light" size="small"></Tag></span>
<span aria-label="颜色越深、里程越高"><Tag color="blue" type="light" size="small"></Tag></span>
</span>
</aside>;
}