This commit is contained in:
ygx
2026-03-15 23:16:00 +08:00
parent 18072d75a4
commit 2835695d78
36 changed files with 6902 additions and 17 deletions

View File

@@ -44,12 +44,10 @@ export function loadViewComponent(componentPath: string) {
}
// 构建完整的文件路径
const filePath = `/src/views/${normalizedPath}.vue`
console.log('filePath', filePath)
// 从预加载的模块中查找
const modulePath = Object.keys(viewModules).find((path) => path.endsWith(filePath) || path === filePath)
console.log('modulePath', modulePath)
if (modulePath && viewModules[modulePath]) {
return viewModules[modulePath]
}
@@ -98,7 +96,6 @@ export function transformMenuToRoutes(menuItems: ServerMenuItem[]): AppRouteReco
// 传递父级的 component 和 path 给子路由处理函数
route.children = transformChildRoutes(item.children, item.component, item.menu_path)
} else if (item.component) {
console.log('menu item component:', item.component)
// 一级菜单没有 children 但有 component创建一个空路径的子路由
const routeName = route.name
route.children = [
@@ -171,7 +168,6 @@ function transformChildRoutes(
return children.map((child) => {
// 优先使用子菜单自己的 component否则继承父级的 component
const componentPath = child.component || parentComponent
console.log('child component:', componentPath)
// 计算子路由的相对路径
const childFullPath = child.menu_path || child.path || ''
const relativePath = extractRelativePath(childFullPath, parentPath || '')

View File

@@ -64,6 +64,15 @@ const OPS: AppRouteRecordRaw = {
roles: ['*'],
},
},
{
path: 'feedback/all',
name: 'FeedbackAll',
component: () => import('@/views/ops/pages/feedback/all/index.vue'),
meta: {
requiresAuth: true,
roles: ['*'],
},
},
],
}