增加功能报价

This commit is contained in:
2026-09-16 00:22:17 +08:00
parent 71a14c46f9
commit 60b2658d4b
32 changed files with 3578 additions and 77 deletions
+31
View File
@@ -38,6 +38,9 @@ function resolvePageComponent(menu) {
return () => import('@/views/404/404.vue');
}
/** 套餐未开通模块的锁定占位页组件 */
const lockedPageComponent = () => import('@/views/locked/index.vue');
/**
* 菜单子节点 -> 嵌套路由(path 相对 layoutAbsPath)
*/
@@ -59,6 +62,20 @@ function nestedMenuToRoute(menu, layoutAbsPath) {
componentPath: menu.component_path,
};
// 套餐未开通模块:渲染锁定占位页(子路由同样注册,保证深链接不 404)
if (menu.locked) {
const route = {
path: relPath,
name: `menu_${menu.id}`,
meta,
component: lockedPageComponent,
};
if (hasChildren) {
route.children = convertNestedMenuChildren(menu.children, childAbs);
}
return route;
}
// 既有自己的页面又有子菜单:套一层 EmptyLayout,避免父页面组件里没有 <router-view> 导致子路由无法渲染
if (hasChildren && ownPage) {
return {
@@ -128,6 +145,20 @@ export function convertMenusToRoutes(menus, parentPath = '') {
componentPath: menu.component_path,
};
// 套餐未开通模块:渲染锁定占位页(子路由同样注册,保证深链接不 404)
if (menu.locked) {
const route = {
path: fullPath || menu.path || '',
name: `menu_${menu.id}`,
meta,
component: lockedPageComponent,
};
if (hasChildren) {
route.children = convertMenusToRoutes(menu.children, fullPath);
}
return route;
}
// 顶层:有页面 + 有子菜单 -> EmptyLayout + 默认子路由 + 相对 path 子路由
if (hasChildren && ownPage) {
return {
+7
View File
@@ -157,6 +157,13 @@ const staticRoutes = [
path: "/apps/erp/dashborad",
redirect: "/apps/erp/dashboard"
},
// 产品购买页:home 未开通卡片「购买」按钮跳转,独立于 Main 框架展示
{
path: "/product/:code",
name: "ProductPurchase",
component: () => import("@/views/product/index.vue"),
meta: { requiresAuth: true, title: "产品购买", isStandalone: true }
},
{
path: "/:pathMatch(.*)*",
name: "NotFound",