feat: 注册客户管理列表与表单路由
parent
801cadbcc4
commit
247c74e387
|
|
@ -6,5 +6,18 @@ export const routePathComponentMap = {
|
||||||
'/system/org': 'system/org/OrgList',
|
'/system/org': 'system/org/OrgList',
|
||||||
'/system/permission': 'system/permission/PermissionList',
|
'/system/permission': 'system/permission/PermissionList',
|
||||||
'/base-config/channel': 'base-config/channel/ChannelList',
|
'/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' }
|
||||||
|
]
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import MainLayout from '@/layouts/MainLayout.vue'
|
import MainLayout from '@/layouts/MainLayout.vue'
|
||||||
import { routePathComponentMap } from './componentRegistry'
|
import { routePathComponentMap, extraChildRoutes } from './componentRegistry'
|
||||||
|
|
||||||
const componentModules = import.meta.glob('@/views/**/*.vue')
|
const componentModules = import.meta.glob('@/views/**/*.vue')
|
||||||
|
|
||||||
|
|
@ -48,6 +48,13 @@ export function buildRouteRecords(menuTree) {
|
||||||
|
|
||||||
export function installDynamicRoutes(router, menuTree) {
|
export function installDynamicRoutes(router, menuTree) {
|
||||||
const children = buildRouteRecords(menuTree)
|
const children = buildRouteRecords(menuTree)
|
||||||
|
extraChildRoutes.forEach((route) => {
|
||||||
|
children.push({
|
||||||
|
path: route.path,
|
||||||
|
name: route.name,
|
||||||
|
component: resolveComponent(route.component)
|
||||||
|
})
|
||||||
|
})
|
||||||
router.addRoute({
|
router.addRoute({
|
||||||
path: '/',
|
path: '/',
|
||||||
component: MainLayout,
|
component: MainLayout,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue