perf(admin): 实现切页即时导航与列表 loading 壳

非阻塞 session 刷新、侧边栏 chunk 预取、KeepAlive 对齐,以及按 tab 延迟加载重型列表页。
This commit is contained in:
2026-06-18 16:45:01 +08:00
parent f2f6927a75
commit c5a5e66bbd
21 changed files with 321 additions and 117 deletions

View File

@@ -10,6 +10,7 @@ import AdminLocaleSwitcher from '../components/AdminLocaleSwitcher.vue';
import AdminNavIcon from '../components/AdminNavIcon.vue';
import { resolveAdminBreadcrumb } from '../utils/admin-breadcrumb';
import { useDepositPendingCount } from '../composables/useDepositPendingCount';
import { prefetchRouteChunks } from '../utils/route-prefetch';
const route = useRoute();
const router = useRouter();
@@ -29,7 +30,7 @@ const keepAliveIncludes = [
'AdminCashback',
'AdminMatches',
'AdminMatchesOutrights',
'AdminDepositOrders',
'AdminDepositManage',
'AdminStaffManage',
'AdminFinanceLogs',
'AdminAgentManager',
@@ -174,6 +175,10 @@ function onNavClick() {
}
}
function prefetchNavRoute(path: string) {
prefetchRouteChunks(router, path);
}
function logout() {
auth.logout();
router.push('/login');
@@ -233,6 +238,8 @@ watch(() => route.path, () => {
: isMatchesSectionPath(route.path))),
}"
@click="onNavClick"
@mouseenter="prefetchNavRoute(m.path)"
@focus="prefetchNavRoute(m.path)"
>
<AdminNavIcon :name="m.icon" />
<span class="nav-label">