refine Semi UI track replay summary
This commit is contained in:
@@ -227,7 +227,9 @@ test('renders a map-first replay workspace and connects stop, event, and panel i
|
|||||||
expect(screen.queryByRole('textbox', { name: '搜索轨迹车辆' })).not.toBeInTheDocument();
|
expect(screen.queryByRole('textbox', { name: '搜索轨迹车辆' })).not.toBeInTheDocument();
|
||||||
|
|
||||||
fireEvent.click(screen.getByRole('button', { name: '隐藏查询与明细' }));
|
fireEvent.click(screen.getByRole('button', { name: '隐藏查询与明细' }));
|
||||||
expect(screen.getByRole('button', { name: '打开轨迹详情' })).toBeInTheDocument();
|
const expandRail = screen.getByRole('button', { name: '打开轨迹详情' });
|
||||||
|
expect(expandRail).toBeInTheDocument();
|
||||||
|
expect(expandRail).toHaveTextContent('轨迹详情8 km · 1 个停留');
|
||||||
fireEvent.click(screen.getByRole('button', { name: '打开轨迹详情' }));
|
fireEvent.click(screen.getByRole('button', { name: '打开轨迹详情' }));
|
||||||
expect(screen.getByRole('button', { name: '隐藏查询与明细' })).toBeInTheDocument();
|
expect(screen.getByRole('button', { name: '隐藏查询与明细' })).toBeInTheDocument();
|
||||||
|
|
||||||
|
|||||||
@@ -393,7 +393,12 @@ export default function TrackPage() {
|
|||||||
<section className="v2-track-stage">
|
<section className="v2-track-stage">
|
||||||
<TrackMap points={points} stops={track?.stops ?? []} activeIndex={boundedIndex} showStops={showStops} follow={follow} followDurationMs={playing ? Math.max(40, trackPlaybackInterval(playbackSpeed) - 10) : 180} onSelectIndex={selectIndex} onFollowChange={setFollow} />
|
<TrackMap points={points} stops={track?.stops ?? []} activeIndex={boundedIndex} showStops={showStops} follow={follow} followDurationMs={playing ? Math.max(40, trackPlaybackInterval(playbackSpeed) - 10) : 180} onSelectIndex={selectIndex} onFollowChange={setFollow} />
|
||||||
|
|
||||||
{railCollapsed && track?.points.length ? <Button className="v2-track-rail-expand" theme="light" aria-label="打开轨迹详情" icon={<IconList />} onClick={() => setRailCollapsed(false)}>轨迹详情</Button> : null}
|
{railCollapsed && track?.points.length ? <Button className="v2-track-rail-expand" theme="light" aria-label="打开轨迹详情" icon={<IconList />} onClick={() => setRailCollapsed(false)}>
|
||||||
|
<span className="v2-track-rail-expand-copy">
|
||||||
|
<strong>轨迹详情</strong>
|
||||||
|
<small>{number(track.summary.distanceKm)} km · {track.stops.length} 个停留</small>
|
||||||
|
</span>
|
||||||
|
</Button> : null}
|
||||||
<div className="v2-track-stage-tools" role="toolbar" aria-label="地图轨迹工具">
|
<div className="v2-track-stage-tools" role="toolbar" aria-label="地图轨迹工具">
|
||||||
<Button theme="borderless" aria-label={follow ? '关闭车辆跟随' : '开启车辆跟随'} className={follow ? 'is-active' : ''} icon={<IconMapPin />} disabled={!points.length} onClick={() => setFollow((value) => !value)}>{follow ? '跟随车辆' : '自由浏览'}</Button>
|
<Button theme="borderless" aria-label={follow ? '关闭车辆跟随' : '开启车辆跟随'} className={follow ? 'is-active' : ''} icon={<IconMapPin />} disabled={!points.length} onClick={() => setFollow((value) => !value)}>{follow ? '跟随车辆' : '自由浏览'}</Button>
|
||||||
<Button theme="borderless" aria-label={showStops ? '隐藏停留点' : '显示停留点'} className={showStops ? 'is-active' : ''} icon={showStops ? <IconEyeOpened /> : <IconEyeClosed />} disabled={!track?.stops.length} onClick={() => setShowStops((value) => !value)}>停留点</Button>
|
<Button theme="borderless" aria-label={showStops ? '隐藏停留点' : '显示停留点'} className={showStops ? 'is-active' : ''} icon={showStops ? <IconEyeOpened /> : <IconEyeClosed />} disabled={!track?.stops.length} onClick={() => setShowStops((value) => !value)}>停留点</Button>
|
||||||
|
|||||||
@@ -9273,9 +9273,9 @@ button, a { -webkit-tap-highlight-color: transparent; }
|
|||||||
.v2-mileage-query-panel.semi-card { flex: 0 0 auto; border-radius: 10px; }
|
.v2-mileage-query-panel.semi-card { flex: 0 0 auto; border-radius: 10px; }
|
||||||
.v2-mileage-filter {
|
.v2-mileage-filter {
|
||||||
min-height: 70px;
|
min-height: 70px;
|
||||||
grid-template-columns: minmax(220px,1.45fr) minmax(112px,.65fr) minmax(112px,.65fr) auto auto minmax(255px,1.2fr);
|
grid-template-columns: minmax(190px,1.25fr) repeat(2,minmax(138px,.72fr)) auto minmax(170px,.9fr) minmax(232px,1.1fr);
|
||||||
align-items: end;
|
align-items: end;
|
||||||
gap: 9px;
|
gap: 7px;
|
||||||
padding: 10px 12px;
|
padding: 10px 12px;
|
||||||
}
|
}
|
||||||
.v2-mileage-filter > label { gap: 5px; font-size: 10px; }
|
.v2-mileage-filter > label { gap: 5px; font-size: 10px; }
|
||||||
@@ -9340,7 +9340,7 @@ button, a { -webkit-tap-highlight-color: transparent; }
|
|||||||
.v2-mileage-evidence { min-height: 17px; flex: 0 0 auto; overflow: hidden; white-space: nowrap; }
|
.v2-mileage-evidence { min-height: 17px; flex: 0 0 auto; overflow: hidden; white-space: nowrap; }
|
||||||
|
|
||||||
@media (max-width: 1100px) and (min-width: 681px) {
|
@media (max-width: 1100px) and (min-width: 681px) {
|
||||||
.v2-mileage-filter { grid-template-columns: minmax(220px,1fr) repeat(2,minmax(112px,.55fr)) auto auto; }
|
.v2-mileage-filter { grid-template-columns: minmax(190px,1fr) repeat(2,minmax(138px,.72fr)) auto minmax(168px,.9fr); }
|
||||||
.v2-mileage-ranges { grid-column: 1 / -1; }
|
.v2-mileage-ranges { grid-column: 1 / -1; }
|
||||||
.v2-mileage-summary > .semi-card-body { grid-template-columns: minmax(285px,1fr) minmax(0,2fr); }
|
.v2-mileage-summary > .semi-card-body { grid-template-columns: minmax(285px,1fr) minmax(0,2fr); }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -629,6 +629,63 @@
|
|||||||
background: #e7edf4;
|
background: #e7edf4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.v2-track-rail-expand.semi-button {
|
||||||
|
top: 50%;
|
||||||
|
left: 14px;
|
||||||
|
min-width: 154px;
|
||||||
|
min-height: 50px;
|
||||||
|
justify-content: flex-start;
|
||||||
|
flex-direction: row;
|
||||||
|
gap: 9px;
|
||||||
|
border: 1px solid rgba(202, 216, 232, .98);
|
||||||
|
border-radius: 11px;
|
||||||
|
background: rgba(255, 255, 255, .97);
|
||||||
|
padding: 8px 11px;
|
||||||
|
color: var(--v2-blue);
|
||||||
|
box-shadow: 0 12px 28px rgba(28, 48, 74, .16);
|
||||||
|
transform: translateY(-50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.v2-track-rail-expand.semi-button:hover {
|
||||||
|
border-color: #a9c3e7;
|
||||||
|
background: #fff;
|
||||||
|
box-shadow: 0 15px 32px rgba(28, 48, 74, .2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.v2-track-rail-expand.semi-button .semi-icon {
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
flex: 0 0 auto;
|
||||||
|
border-radius: 9px;
|
||||||
|
background: #eaf2ff;
|
||||||
|
color: var(--v2-blue);
|
||||||
|
}
|
||||||
|
|
||||||
|
.v2-track-rail-expand.semi-button span {
|
||||||
|
max-width: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.v2-track-rail-expand-copy {
|
||||||
|
display: grid;
|
||||||
|
min-width: 0;
|
||||||
|
gap: 2px;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.v2-track-rail-expand-copy strong {
|
||||||
|
color: #29415d;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.35;
|
||||||
|
}
|
||||||
|
|
||||||
|
.v2-track-rail-expand-copy small {
|
||||||
|
color: #75869a;
|
||||||
|
font-size: 9px;
|
||||||
|
font-weight: 550;
|
||||||
|
line-height: 1.35;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
.v2-track-stage-tools {
|
.v2-track-stage-tools {
|
||||||
top: 14px;
|
top: 14px;
|
||||||
right: 14px;
|
right: 14px;
|
||||||
@@ -961,9 +1018,28 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.v2-track-rail-expand {
|
.v2-track-rail-expand {
|
||||||
|
top: auto;
|
||||||
|
left: 8px;
|
||||||
|
min-width: 138px;
|
||||||
|
min-height: 42px;
|
||||||
|
padding: 6px 9px;
|
||||||
|
transform: none;
|
||||||
bottom: calc(116px + env(safe-area-inset-bottom));
|
bottom: calc(116px + env(safe-area-inset-bottom));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.v2-track-rail-expand.semi-button .semi-icon {
|
||||||
|
width: 28px;
|
||||||
|
height: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.v2-track-rail-expand-copy strong {
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.v2-track-rail-expand-copy small {
|
||||||
|
font-size: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
.v2-track-stage:has(.v2-track-current-card) .v2-track-rail-expand {
|
.v2-track-stage:has(.v2-track-current-card) .v2-track-rail-expand {
|
||||||
bottom: calc(264px + env(safe-area-inset-bottom));
|
bottom: calc(264px + env(safe-area-inset-bottom));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user