feat: preserve BI sub tab history
This commit is contained in:
@@ -32,18 +32,30 @@ export default function MileageModule() {
|
||||
compactInfo
|
||||
>
|
||||
<div className="sticky top-0 z-30 -mx-3 bg-[var(--app-bg)] px-3 pb-2 pt-1 shadow-[0_8px_12px_-12px_rgba(15,23,42,0.08)] md:-mx-6 md:top-12 md:px-6">
|
||||
<SegmentedNav tabs={MILEAGE_TABS} active={activeSubTab} onChange={setActiveSubTab} />
|
||||
<SegmentedNav
|
||||
tabs={MILEAGE_TABS}
|
||||
active={activeSubTab}
|
||||
onChange={setActiveSubTab}
|
||||
idPrefix="mileage-view"
|
||||
ariaLabel="里程分析视图"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<AnimatePresence mode="wait">
|
||||
<FadeIn key={activeSubTab}>
|
||||
{activeSubTab === 'monitoring' ? (
|
||||
<MonitoringView />
|
||||
) : activeSubTab === 'statistics' ? (
|
||||
<StatisticsView />
|
||||
) : (
|
||||
<DailyReportView />
|
||||
)}
|
||||
<div
|
||||
id={`mileage-view-panel-${activeSubTab}`}
|
||||
role="tabpanel"
|
||||
aria-labelledby={`mileage-view-tab-${activeSubTab}`}
|
||||
>
|
||||
{activeSubTab === 'monitoring' ? (
|
||||
<MonitoringView />
|
||||
) : activeSubTab === 'statistics' ? (
|
||||
<StatisticsView />
|
||||
) : (
|
||||
<DailyReportView />
|
||||
)}
|
||||
</div>
|
||||
</FadeIn>
|
||||
</AnimatePresence>
|
||||
<RotatingFooterHint />
|
||||
|
||||
Reference in New Issue
Block a user