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>;
}

View File

@@ -13780,6 +13780,10 @@
display: none;
}
.v2-mileage-matrix-guide > .v2-mileage-matrix-guide-mobile {
display: none;
}
.v2-mileage-table-wrap {
scrollbar-color: #9eb0c4 #f2f5f9;
scrollbar-gutter: stable;
@@ -14013,22 +14017,34 @@
}
.v2-mileage-matrix-guide {
min-height: 34px;
gap: 11px;
padding: 4px 9px;
min-height: 58px;
overflow: hidden;
gap: 0;
padding: 4px 8px 5px;
font-size: 9px;
white-space: normal;
}
.v2-mileage-matrix-guide-title .semi-icon {
font-size: 12px;
.v2-mileage-matrix-guide > .is-desktop-guide {
display: none;
}
.v2-mileage-matrix-guide-title {
order: 0;
.v2-mileage-matrix-guide > .v2-mileage-matrix-guide-mobile {
display: grid;
width: 100%;
grid-template-columns: repeat(3, minmax(0, 1fr));
align-items: center;
gap: 3px 6px;
}
.v2-mileage-matrix-guide > span:not(.v2-mileage-matrix-guide-title):not(.is-mobile-hint) {
order: 2;
.v2-mileage-matrix-guide-mobile > span {
display: inline-flex;
min-width: 0;
align-items: center;
justify-content: center;
gap: 4px;
color: #66798f;
white-space: nowrap;
}
.v2-mileage-matrix-guide .semi-tag {
@@ -14038,13 +14054,19 @@
font-size: 8px;
}
.v2-mileage-matrix-guide .is-mobile-hint {
.v2-mileage-matrix-guide-mobile > .is-mobile-hint {
display: inline-flex;
order: 1;
min-height: 22px;
grid-column: 1 / -1;
color: #3e6798;
font-weight: 650;
}
.v2-mileage-matrix-guide-mobile > .is-mobile-hint .semi-icon {
color: #1268df;
font-size: 12px;
}
.v2-mileage-source-sidesheet .semi-sidesheet-inner {
overflow: hidden;
border: 1px solid #d9e3ef;