fix: restore dashboard renderer quality

This commit is contained in:
2026-06-22 13:20:30 +08:00
parent 01b801bebc
commit 1dc4abf063
5 changed files with 16 additions and 366 deletions
+5 -2
View File
@@ -9,6 +9,7 @@ import { preferences } from '@vben/preferences';
import { getAllMenusApi } from '#/api/core/menu';
import { BasicLayout, IFrameView } from '#/layouts';
import { ensureAdminRuntime } from '#/runtime/admin';
import { useAppContextStore } from '#/store/app-context';
import { createAdminRuntimePage } from './admin-runtime-page';
@@ -93,6 +94,7 @@ function withAdminRuntimePages(pageMap: ComponentRecordType) {
const PREFETCH_LIGHT_PAGE_KEYS = [
'../views/_core/menu/index.vue',
'../views/_core/permission/index.vue',
'../views/_core/role/index.vue',
'../views/_core/user/index.vue',
];
@@ -114,6 +116,7 @@ function prefetchLightPages(pageMap: ComponentRecordType) {
lightPagesPrefetched = true;
window.setTimeout(() => {
scheduleIdleTask(() => {
void ensureAdminRuntime().catch(() => undefined);
for (const key of PREFETCH_LIGHT_PAGE_KEYS) {
const loader = pageMap[key];
if (typeof loader === 'function') {
@@ -121,7 +124,7 @@ function prefetchLightPages(pageMap: ComponentRecordType) {
}
}
});
}, 12_000);
}, 3_000);
}
const LIGHT_AI_PLATFORM_MENU_ROUTES = [
@@ -289,7 +292,7 @@ async function generateAccess(options: GenerateMenuAndRoutesOptions) {
layoutMap,
pageMap,
});
prefetchLightPages(pageMap);
prefetchLightPages(rawPageMap);
return accessible;
}