Move menu component list out of router entry
This commit is contained in:
@@ -34,34 +34,4 @@ const coreRouteNames = traverseTreeValues(coreRoutes, (route) => route.name);
|
||||
/** 有权限校验的路由列表,包含动态路由和静态路由 */
|
||||
const accessRoutes = [...dynamicRoutes, ...staticRoutes];
|
||||
|
||||
const componentKeys: string[] = Object.keys(
|
||||
import.meta.glob([
|
||||
'../../views/_core/account-settings/**/*.vue',
|
||||
'../../views/_core/agent-chat/**/*.vue',
|
||||
'../../views/_core/announcement/index.vue',
|
||||
'../../views/_core/announcement/list.vue',
|
||||
'../../views/_core/authentication/login.vue',
|
||||
'../../views/_core/authentication/oauth-callback.vue',
|
||||
'../../views/_core/control-center/index.vue',
|
||||
'../../views/_core/fallback/**/*.vue',
|
||||
'../../views/_core/menu/index.vue',
|
||||
'../../views/_core/permission/index.vue',
|
||||
'../../views/_core/role/index.vue',
|
||||
'../../views/_core/system-config/index.vue',
|
||||
'../../views/_core/user/index.vue',
|
||||
'../../views/ai-platform/agent/editor/index.vue',
|
||||
'../../views/ai-platform/agent/index.vue',
|
||||
'../../views/ai-platform/knowledge/detail/index.vue',
|
||||
'../../views/ai-platform/knowledge/index.vue',
|
||||
'../../views/ai-platform/workflow/editor/index.vue',
|
||||
'../../views/ai-platform/workflow/index.vue',
|
||||
'../../views/ai-platform/workflow-runs/index.vue',
|
||||
]),
|
||||
)
|
||||
.filter((item) => !item.includes('/modules/'))
|
||||
.map((v) => {
|
||||
const path = v.replace('../../views/', '/');
|
||||
return path.endsWith('.vue') ? path.slice(0, -4) : path;
|
||||
});
|
||||
|
||||
export { accessRoutes, componentKeys, coreRouteNames, routes };
|
||||
export { accessRoutes, coreRouteNames, routes };
|
||||
|
||||
@@ -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[] {
|
||||
|
||||
Reference in New Issue
Block a user