feat: 注册客户管理列表与表单路由

main
halo 2026-07-09 21:40:42 +08:00
parent 801cadbcc4
commit 247c74e387
2 changed files with 22 additions and 2 deletions

View File

@ -6,5 +6,18 @@ export const routePathComponentMap = {
'/system/org': 'system/org/OrgList',
'/system/permission': 'system/permission/PermissionList',
'/base-config/channel': 'base-config/channel/ChannelList',
'/base-config/manager': 'base-config/manager/ManagerList'
'/base-config/manager': 'base-config/manager/ManagerList',
'/customer/personal': 'customer/personal/PersonalList',
'/customer/enterprise': 'customer/enterprise/EnterpriseList'
}
// 新增/编辑/查看等表单页不是后端菜单节点(不出现在侧边栏),但仍需要注册为
// MainLayout 下的可访问路由,由列表页通过 router.push 跳转进入。
export const extraChildRoutes = [
{ path: 'customer/personal/create', name: 'customer-personal-create', component: 'customer/personal/PersonalForm' },
{ path: 'customer/personal/edit', name: 'customer-personal-edit', component: 'customer/personal/PersonalForm' },
{ path: 'customer/personal/detail', name: 'customer-personal-detail', component: 'customer/personal/PersonalForm' },
{ path: 'customer/enterprise/create', name: 'customer-enterprise-create', component: 'customer/enterprise/EnterpriseForm' },
{ path: 'customer/enterprise/edit', name: 'customer-enterprise-edit', component: 'customer/enterprise/EnterpriseForm' },
{ path: 'customer/enterprise/detail', name: 'customer-enterprise-detail', component: 'customer/enterprise/EnterpriseForm' }
]

View File

@ -1,5 +1,5 @@
import MainLayout from '@/layouts/MainLayout.vue'
import { routePathComponentMap } from './componentRegistry'
import { routePathComponentMap, extraChildRoutes } from './componentRegistry'
const componentModules = import.meta.glob('@/views/**/*.vue')
@ -48,6 +48,13 @@ export function buildRouteRecords(menuTree) {
export function installDynamicRoutes(router, menuTree) {
const children = buildRouteRecords(menuTree)
extraChildRoutes.forEach((route) => {
children.push({
path: route.path,
name: route.name,
component: resolveComponent(route.component)
})
})
router.addRoute({
path: '/',
component: MainLayout,