polish single vehicle entry workspace

This commit is contained in:
lingniu
2026-07-18 11:09:27 +08:00
parent 5805635ccf
commit 622c4398ec
7 changed files with 45 additions and 28 deletions

View File

@@ -124,12 +124,17 @@ export function AppShell() {
const roleLabel = { viewer: '只读', operator: '处置员', admin: '管理员', customer: '客户' }[session.role];
useEffect(() => scheduleIdleRoutePreloads({ activePathname: activeRoutePath }), [activeRoutePath]);
useLayoutEffect(() => {
const content = document.querySelector<HTMLElement>('.v2-content');
if (!content) return;
const reset = () => {
content.scrollTop = 0;
content.scrollLeft = 0;
content.scrollTo?.({ top: 0, left: 0, behavior: 'auto' });
for (const content of document.querySelectorAll<HTMLElement>('.v2-content')) {
content.scrollTop = 0;
content.scrollLeft = 0;
content.scrollTo?.({ top: 0, left: 0, behavior: 'auto' });
const routeRoot = content.firstElementChild;
if (routeRoot instanceof HTMLElement) {
routeRoot.scrollTop = 0;
routeRoot.scrollLeft = 0;
}
}
};
reset();
let trailingFrame = 0;