Move menu component list out of router entry

This commit is contained in:
2026-06-09 15:27:35 +08:00
parent 5620170e9d
commit ff1c126777
2 changed files with 33 additions and 32 deletions
@@ -26,7 +26,6 @@ import {
getAllMenuTreeApi,
updateMenuApi,
} from '#/api/core/menu';
import { componentKeys } from '#/router/routes';
import { useAppContextStore } from '#/store/app-context';
import { getMenuTypeOptions } from '../data';
@@ -93,6 +92,38 @@ const BadgeVariants = [
'outline',
];
const componentKeys: string[] = Object.keys(
import.meta.glob([
'../../../_core/account-settings/**/*.vue',
'../../../_core/agent-chat/**/*.vue',
'../../../_core/announcement/index.vue',
'../../../_core/announcement/list.vue',
'../../../_core/authentication/login.vue',
'../../../_core/authentication/oauth-callback.vue',
'../../../_core/control-center/index.vue',
'../../../_core/fallback/**/*.vue',
'../../../_core/menu/index.vue',
'../../../_core/permission/index.vue',
'../../../_core/role/index.vue',
'../../../_core/system-config/index.vue',
'../../../_core/user/index.vue',
'../../../../ai-platform/agent/editor/index.vue',
'../../../../ai-platform/agent/index.vue',
'../../../../ai-platform/knowledge/detail/index.vue',
'../../../../ai-platform/knowledge/index.vue',
'../../../../ai-platform/workflow/editor/index.vue',
'../../../../ai-platform/workflow/index.vue',
'../../../../ai-platform/workflow-runs/index.vue',
]),
)
.filter((item) => !item.includes('/modules/'))
.map((v) => {
const path = v
.replace('../../../_core/', '/_core/')
.replace('../../../../ai-platform/', '/ai-platform/');
return path.endsWith('.vue') ? path.slice(0, -4) : path;
});
function getFormSchema(
getCurrentMenuId: () => string | undefined,
): VbenFormSchema[] {