供应商路由调整
This commit is contained in:
@@ -197,7 +197,11 @@ export const dynamicRoutes = [
|
||||
path: 'index',
|
||||
component: () => import('@/views/customersuppliermanagement/supplierinfo/supplieredit/index.vue'),
|
||||
name: 'SupplierEdit',
|
||||
meta: { title: '供应商编辑', activeMenu: '/customersuppliermanagement/supplierinfo' }
|
||||
// 高亮地址跟菜单走。供应商目录 path 曾被写成 "1",列表实际是 /1/supplierinfo,写死客户管理目录会对不上。
|
||||
beforeEnter(to) {
|
||||
to.meta.activeMenu = supplierListPath()
|
||||
},
|
||||
meta: { title: '供应商编辑', activeMenu: '/supplier/supplierinfo' }
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -264,4 +268,13 @@ const router = createRouter({
|
||||
},
|
||||
})
|
||||
|
||||
/**
|
||||
* 供应商列表的真实地址由菜单注册,不写死目录。
|
||||
* 当前库里「供应商管理」目录 path 若仍是 1,这里会得到 /1/supplierinfo。
|
||||
*/
|
||||
export function supplierListPath() {
|
||||
const hit = router.getRoutes().find(r => /\/supplierinfo$/.test(r.path))
|
||||
return hit ? hit.path : '/supplier/supplierinfo'
|
||||
}
|
||||
|
||||
export default router
|
||||
|
||||
Reference in New Issue
Block a user