import { RoutesAlias } from '../routesAlias' import { AppRouteRecord } from '@/types/router' /** * 菜单列表、异步路由 * * 支持两种模式: * 1. 前端静态配置 - 直接使用本文件中定义的路由配置 * 2. 后端动态配置 - 后端返回菜单数据,前端解析生成路由 * * 菜单标题(title): * 可以是 i18n 的 key,也可以是字符串,比如:'用户列表' */ export const asyncRoutes: AppRouteRecord[] = [ { name: 'Dashboard', path: '/dashboard', component: RoutesAlias.Home, meta: { title: 'menus.dashboard.title', icon: '' }, children: [ { path: 'console', name: 'Console', component: RoutesAlias.Dashboard, meta: { title: 'menus.dashboard.console', keepAlive: false, fixedTab: true } }, { path: 'analysis', name: 'Analysis', component: RoutesAlias.Analysis, meta: { title: 'menus.dashboard.analysis', keepAlive: false } }, { path: 'ecommerce', name: 'Ecommerce', component: RoutesAlias.Ecommerce, meta: { title: 'menus.dashboard.ecommerce', keepAlive: false } } ] }, // { // path: '/widgets', // name: 'Widgets', // component: RoutesAlias.Home, // meta: { // title: 'menus.widgets.title', // icon: '' // }, // children: [ // { // path: 'icon-list', // name: 'IconList', // component: RoutesAlias.IconList, // meta: { // title: 'menus.widgets.iconList', // keepAlive: true // } // }, // { // path: 'icon-selector', // name: 'IconSelector', // component: RoutesAlias.IconSelector, // meta: { // title: 'menus.widgets.iconSelector', // keepAlive: true // } // }, // { // path: 'image-crop', // name: 'ImageCrop', // component: RoutesAlias.ImageCrop, // meta: { // title: 'menus.widgets.imageCrop', // keepAlive: true // } // }, // { // path: 'excel', // name: 'Excel', // component: RoutesAlias.Excel, // meta: { // title: 'menus.widgets.excel', // keepAlive: true // } // }, // { // path: 'video', // name: 'Video', // component: RoutesAlias.Video, // meta: { // title: 'menus.widgets.video', // keepAlive: true // } // }, // { // path: 'count-to', // name: 'CountTo', // component: RoutesAlias.CountTo, // meta: { // title: 'menus.widgets.countTo', // keepAlive: false // } // }, // { // path: 'wang-editor', // name: 'WangEditor', // component: RoutesAlias.WangEditor, // meta: { // title: 'menus.widgets.wangEditor', // keepAlive: true // } // }, // { // path: 'watermark', // name: 'Watermark', // component: RoutesAlias.Watermark, // meta: { // title: 'menus.widgets.watermark', // keepAlive: true // } // }, // { // path: 'context-menu', // name: 'ContextMenu', // component: RoutesAlias.ContextMenu, // meta: { // title: 'menus.widgets.contextMenu', // keepAlive: true // } // }, // { // path: 'qrcode', // name: 'Qrcode', // component: RoutesAlias.Qrcode, // meta: { // title: 'menus.widgets.qrcode', // keepAlive: true // } // }, // { // path: 'drag', // name: 'Drag', // component: RoutesAlias.Drag, // meta: { // title: 'menus.widgets.drag', // keepAlive: true // } // }, // { // path: 'text-scroll', // name: 'TextScroll', // component: RoutesAlias.TextScroll, // meta: { // title: 'menus.widgets.textScroll', // keepAlive: true // } // }, // { // path: 'fireworks', // name: 'Fireworks', // component: RoutesAlias.Fireworks, // meta: { // title: 'menus.widgets.fireworks', // keepAlive: true, // showTextBadge: 'Hot' // } // }, // { // path: '/outside/iframe/elementui', // name: 'ElementUI', // component: '', // meta: { // title: 'menus.widgets.elementUI', // keepAlive: false, // link: 'https://element-plus.org/zh-CN/component/overview.html', // isIframe: true, // showBadge: true // } // } // ] // }, // { // path: '/template', // name: 'Template', // component: RoutesAlias.Home, // meta: { // title: 'menus.template.title', // icon: '' // }, // children: [ // { // path: 'cards', // name: 'Cards', // component: RoutesAlias.Cards, // meta: { // title: 'menus.template.cards', // keepAlive: false // } // }, // { // path: 'banners', // name: 'Banners', // component: RoutesAlias.Banners, // meta: { // title: 'menus.template.banners', // keepAlive: false // } // }, // { // path: 'charts', // name: 'Charts', // component: RoutesAlias.Charts, // meta: { // title: 'menus.template.charts', // keepAlive: false // } // }, // { // path: 'map', // name: 'Map', // component: RoutesAlias.Map, // meta: { // title: 'menus.template.map', // keepAlive: true // } // }, // { // path: 'chat', // name: 'Chat', // component: RoutesAlias.Chat, // meta: { // title: 'menus.template.chat', // keepAlive: true // } // }, // { // path: 'calendar', // name: 'Calendar', // component: RoutesAlias.Calendar, // meta: { // title: 'menus.template.calendar', // keepAlive: true // } // }, // { // path: 'pricing', // name: 'Pricing', // component: RoutesAlias.Pricing, // meta: { // title: 'menus.template.pricing', // keepAlive: true // } // } // ] // }, { path: '/system', name: 'System', component: RoutesAlias.Home, meta: { title: 'menus.system.title', icon: '', roles: ['R_SUPER', 'R_ADMIN'] }, children: [ { path: 'role', name: 'Role', component: RoutesAlias.Role, meta: { title: 'menus.system.role', keepAlive: true, roles: ['R_SUPER'] } }, { path: 'permission', name: 'PermissionManagement', component: RoutesAlias.Permission, meta: { title: 'menus.system.permission', keepAlive: true, roles: ['R_SUPER'] } }, { path: 'carrier-management', name: 'CarrierManagement', component: RoutesAlias.CarrierManagement, meta: { title: 'menus.account.carrierManagement', keepAlive: true } }, { path: 'user-center', name: 'UserCenter', component: RoutesAlias.UserCenter, meta: { title: 'menus.system.userCenter', isHide: true, keepAlive: true, isHideTab: true } } // { // path: 'menu', // name: 'Menus', // component: RoutesAlias.Menu, // meta: { // title: 'menus.system.menu', // keepAlive: true, // roles: ['R_SUPER'], // authList: [ // { // title: '新增', // auth_mark: 'add' // }, // { // title: '编辑', // auth_mark: 'edit' // }, // { // title: '删除', // auth_mark: 'delete' // } // ] // } // } // { // path: 'nested', // name: 'Nested', // component: '', // meta: { // title: 'menus.system.nested', // keepAlive: true // }, // children: [ // { // path: 'menu1', // name: 'NestedMenu1', // component: RoutesAlias.NestedMenu1, // meta: { // title: 'menus.system.menu1', // icon: '', // keepAlive: true // } // }, // { // path: 'menu2', // name: 'NestedMenu2', // component: '', // meta: { // title: 'menus.system.menu2', // icon: '', // keepAlive: true // }, // children: [ // { // path: 'menu2-1', // name: 'NestedMenu2-1', // component: RoutesAlias.NestedMenu21, // meta: { // title: 'menus.system.menu21', // icon: '', // keepAlive: true // } // } // ] // }, // { // path: 'menu3', // name: 'NestedMenu3', // component: '', // meta: { // title: 'menus.system.menu3', // icon: '', // keepAlive: true // }, // children: [ // { // path: 'menu3-1', // name: 'NestedMenu3-1', // component: RoutesAlias.NestedMenu31, // meta: { // title: 'menus.system.menu31', // icon: '', // keepAlive: true // } // }, // { // path: 'menu3-2', // name: 'NestedMenu3-2', // component: '', // meta: { // title: 'menus.system.menu32', // icon: '', // keepAlive: true // }, // children: [ // { // path: 'menu3-2-1', // name: 'NestedMenu3-2-1', // component: RoutesAlias.NestedMenu321, // meta: { // title: 'menus.system.menu321', // icon: '', // keepAlive: true // } // } // ] // } // ] // } // ] // } ] }, // { // path: '/article', // name: 'Article', // component: RoutesAlias.Home, // meta: { // title: 'menus.article.title', // icon: '', // roles: ['R_SUPER', 'R_ADMIN'] // }, // children: [ // { // path: 'article-list', // name: 'ArticleList', // component: RoutesAlias.ArticleList, // meta: { // title: 'menus.article.articleList', // keepAlive: true, // authList: [ // { // title: '新增', // auth_mark: 'add' // }, // { // title: '编辑', // auth_mark: 'edit' // } // ] // } // }, // { // path: 'detail', // name: 'ArticleDetail', // component: RoutesAlias.ArticleDetail, // meta: { // title: 'menus.article.articleDetail', // isHide: true, // keepAlive: true // } // }, // { // path: 'comment', // name: 'ArticleComment', // component: RoutesAlias.Comment, // meta: { // title: 'menus.article.comment', // keepAlive: true // } // }, // { // path: 'publish', // name: 'ArticlePublish', // component: RoutesAlias.ArticlePublish, // meta: { // title: 'menus.article.articlePublish', // keepAlive: true, // authList: [ // { // title: '发布', // auth_mark: 'article/article-publish/add' // } // ] // } // } // ] // }, // { // path: '/result', // name: 'Result', // component: RoutesAlias.Home, // meta: { // title: 'menus.result.title', // icon: '' // }, // children: [ // { // path: 'success', // name: 'ResultSuccess', // component: RoutesAlias.Success, // meta: { // title: 'menus.result.success', // keepAlive: true // } // }, // { // path: 'fail', // name: 'ResultFail', // component: RoutesAlias.Fail, // meta: { // title: 'menus.result.fail', // keepAlive: true // } // } // ] // }, // { // path: '/exception', // name: 'Exception', // component: RoutesAlias.Home, // meta: { // title: 'menus.exception.title', // icon: '' // }, // children: [ // { // path: '403', // name: '403', // component: RoutesAlias.Exception403, // meta: { // title: 'menus.exception.forbidden', // keepAlive: true // } // }, // { // path: '404', // name: '404', // component: RoutesAlias.Exception404, // meta: { // title: 'menus.exception.notFound', // keepAlive: true // } // }, // { // path: '500', // name: '500', // component: RoutesAlias.Exception500, // meta: { // title: 'menus.exception.serverError', // keepAlive: true // } // } // ] // }, // { // path: '/safeguard', // name: 'Safeguard', // component: RoutesAlias.Home, // meta: { // title: 'menus.safeguard.title', // icon: '', // keepAlive: false // }, // children: [ // { // path: 'server', // name: 'SafeguardServer', // component: RoutesAlias.Server, // meta: { // title: 'menus.safeguard.server', // keepAlive: true // } // } // ] // }, // { // name: 'Help', // path: '/help', // component: RoutesAlias.Home, // meta: { // title: 'menus.help.title', // icon: '', // keepAlive: false, // roles: ['R_SUPER', 'R_ADMIN'] // }, // children: [ // { // path: '', // name: 'Document', // meta: { // title: 'menus.help.document', // link: WEB_LINKS.DOCS, // isIframe: false, // keepAlive: false // } // } // ] // }, // 一级菜单 // { // name: 'ChangeLog', // path: '/change/log', // component: RoutesAlias.ChangeLog, // meta: { // title: 'menus.plan.log', // showTextBadge: `v${__APP_VERSION__}`, // icon: '', // keepAlive: false // } // }, // 物联网卡管理系统模块 // { // path: '/card-management', // name: 'CardManagement', // component: RoutesAlias.Home, // meta: { // title: 'menus.cardManagement.title', // icon: '' // }, // children: [ // { // path: 'card-detail', // name: 'CardDetail', // component: RoutesAlias.CardDetail, // meta: { // title: 'menus.cardManagement.cardDetail', // keepAlive: true // } // }, // { // path: 'single-card', // name: 'SingleCard', // component: RoutesAlias.SingleCard, // meta: { // title: 'menus.cardManagement.singleCard', // keepAlive: true // } // }, // { // path: 'card-assign', // name: 'CardAssign', // component: RoutesAlias.CardAssign, // meta: { // title: 'menus.cardManagement.cardAssign', // keepAlive: true // } // }, // { // path: 'card-shutdown', // name: 'CardShutdown', // component: RoutesAlias.CardShutdown, // meta: { // title: 'menus.cardManagement.cardShutdown', // keepAlive: true // } // }, // { // path: 'my-cards', // name: 'MyCards', // component: RoutesAlias.MyCards, // meta: { // title: 'menus.cardManagement.myCards', // keepAlive: true // } // }, // { // path: 'card-transfer', // name: 'CardTransfer', // component: RoutesAlias.CardTransfer, // meta: { // title: 'menus.cardManagement.cardTransfer', // keepAlive: true // } // }, // { // path: 'card-replacement', // name: 'CardReplacement', // component: RoutesAlias.CardReplacement, // meta: { // title: 'menus.cardManagement.cardReplacement', // keepAlive: true // } // }, // { // path: 'package-gift', // name: 'PackageGift', // component: RoutesAlias.PackageGift, // meta: { // title: 'menus.cardManagement.packageGift', // keepAlive: true // } // }, // { // path: 'card-change-card', // name: 'CardChangeCard', // component: RoutesAlias.CardChangeCard, // meta: { // title: 'menus.cardManagement.cardChange', // keepAlive: true // } // } // ] // }, { path: '/package-management', name: 'PackageManagement', component: RoutesAlias.Home, meta: { title: 'menus.packageManagement.title', icon: '' }, children: [ { path: 'package-series', name: 'PackageSeries', component: RoutesAlias.PackageSeries, meta: { title: 'menus.packageManagement.packageSeries', keepAlive: true } }, { path: 'package-series/detail/:id', name: 'PackageSeriesDetail', component: RoutesAlias.PackageSeriesDetail, meta: { title: 'menus.packageManagement.packageSeriesDetail', isHide: true, keepAlive: false } }, { path: 'package-list', name: 'PackageList', component: RoutesAlias.PackageList, meta: { title: 'menus.packageManagement.packageList', keepAlive: true } }, { path: 'package-list/detail/:id', name: 'PackageDetail', component: RoutesAlias.PackageDetail, meta: { title: 'menus.packageManagement.packageDetail', isHide: true, keepAlive: false } }, { path: 'series-grants', name: 'SeriesGrants', component: RoutesAlias.SeriesGrants, meta: { title: 'menus.packageManagement.seriesGrants', keepAlive: true } }, { path: 'series-grants/detail/:id', name: 'SeriesGrantsDetail', component: RoutesAlias.SeriesGrantsDetail, meta: { title: 'menus.packageManagement.seriesGrantsDetail', isHide: true, keepAlive: false } } ] }, { path: '/shop-management', name: 'ShopManagement', component: RoutesAlias.Home, meta: { title: 'menus.product.shop', icon: '' }, children: [ { path: 'list', name: 'Shop', component: RoutesAlias.Shop, meta: { title: 'menus.product.shop', keepAlive: true } } ] }, { path: '/account-management', name: 'AccountManagement', component: RoutesAlias.Home, meta: { title: 'menus.accountManagement.title', icon: '' }, children: [ { path: 'account', name: 'Account', component: RoutesAlias.Account, meta: { title: 'menus.accountManagement.account', keepAlive: true } }, // { // path: 'platform-account', // name: 'PlatformAccount', // component: RoutesAlias.PlatformAccount, // meta: { // title: 'menus.accountManagement.platformAccount', // keepAlive: true // } // }, // { // path: 'shop-account', // name: 'ShopAccount', // component: RoutesAlias.ShopAccount, // meta: { // title: 'menus.accountManagement.shopAccount', // keepAlive: true // } // }, // { // path: 'customer-role', // name: 'CustomerRole', // component: RoutesAlias.CustomerRole, // meta: { // title: 'menus.accountManagement.customerRole', // keepAlive: true // } // }, // { // path: 'agent', // name: 'AgentManagement', // component: RoutesAlias.AgentManagement, // meta: { // title: 'menus.accountManagement.agent', // keepAlive: true // } // }, { path: 'enterprise-customer', name: 'EnterpriseCustomer', component: RoutesAlias.EnterpriseCustomer, meta: { title: 'menus.accountManagement.enterpriseCustomer', keepAlive: true } }, { path: 'enterprise-customer/customer-accounts/:id', name: 'EnterpriseCustomerAccounts', component: RoutesAlias.EnterpriseCustomerAccounts, meta: { title: 'menus.accountManagement.enterpriseCustomerAccounts', isHide: true, keepAlive: false } }, { path: 'enterprise-cards', name: 'EnterpriseCards', component: RoutesAlias.EnterpriseCards, meta: { title: 'menus.accountManagement.enterpriseCards', isHide: true, keepAlive: false } } ] }, // { // path: '/product', // name: 'Product', // component: RoutesAlias.Home, // meta: { // title: 'menus.product.title', // icon: '' // }, // children: [ // // { // // path: 'sim-card', // // name: 'SimCardManagement', // // component: RoutesAlias.SimCardManagement, // // meta: { // // title: 'menus.product.simCard', // // keepAlive: true // // } // // }, // // { // // path: 'sim-card-assign', // // name: 'SimCardAssign', // // component: RoutesAlias.SimCardAssign, // // meta: { // // title: 'menus.product.simCardAssign', // // keepAlive: true // // } // // }, // // { // // path: 'package-series', // // name: 'PackageSeries', // // component: RoutesAlias.PackageSeries, // // meta: { // // title: 'menus.product.packageSeries', // // keepAlive: true // // } // // }, // // { // // path: 'package-list', // // name: 'PackageList', // // component: RoutesAlias.PackageList, // // meta: { // // title: 'menus.product.packageList', // // keepAlive: true // // } // // }, // // { // // path: 'package-assign', // // name: 'PackageAssign', // // component: RoutesAlias.PackageAssign, // // meta: { // // title: 'menus.product.packageAssign', // // keepAlive: true // // } // // }, // { // path: 'shop', // name: 'Shop', // component: RoutesAlias.Shop, // meta: { // title: 'menus.product.shop', // keepAlive: true // } // } // ] // }, { path: '/asset-management', name: 'AssetManagement', component: RoutesAlias.Home, meta: { title: 'menus.assetManagement.title', icon: '' }, children: [ { path: 'single-card', name: 'SingleCard', component: RoutesAlias.SingleCard, meta: { title: 'menus.cardManagement.singleCard', keepAlive: true } }, { path: 'iot-card-management', name: 'StandaloneCardList', component: RoutesAlias.StandaloneCardList, meta: { title: 'menus.assetManagement.standaloneCardList', keepAlive: true } }, { path: 'devices', name: 'DeviceList', component: RoutesAlias.DeviceList, meta: { title: 'menus.assetManagement.devices', keepAlive: true } }, { path: 'enterprise-devices', name: 'EnterpriseDevices', component: RoutesAlias.EnterpriseDevices, meta: { title: 'menus.assetManagement.enterpriseDevices', isHide: true, keepAlive: false } }, // 换货管理 { path: 'exchange-management', name: 'ExchangeManagement', component: RoutesAlias.ExchangeManagement, meta: { title: 'menus.assetManagement.exchangeManagement', keepAlive: true } }, { path: 'exchange-management/detail/:id', name: 'ExchangeDetail', component: RoutesAlias.ExchangeDetail, meta: { title: 'menus.assetManagement.exchangeDetail', isHide: true, keepAlive: false } }, // 记录管理 { path: 'records', name: 'RecordsManagement', component: '', meta: { title: 'menus.assetManagement.recordsManagement', keepAlive: true }, children: [ { path: 'asset-assign', name: 'AssetAssign', component: RoutesAlias.AssetAssign, meta: { title: 'menus.assetManagement.assetAssign', keepAlive: true } }, { path: 'asset-assign/detail/:id', name: 'AssetAssignDetail', component: RoutesAlias.AssetAssignDetail, meta: { title: 'menus.assetManagement.assetAssignDetail', isHide: true, keepAlive: false } }, { path: 'authorization-records', name: 'AuthorizationRecords', component: RoutesAlias.AuthorizationRecords, meta: { title: 'menus.assetManagement.authorizationRecords', keepAlive: true } }, { path: 'authorization-records/detail/:id', name: 'AuthorizationRecordDetail', component: RoutesAlias.AuthorizationRecordDetail, meta: { title: 'menus.assetManagement.authorizationRecordDetail', isHide: true, keepAlive: false } } ] }, // 任务管理 { path: 'tasks', name: 'TaskManagement', component: '', meta: { title: 'menus.assetManagement.taskManagement', keepAlive: true }, children: [ { path: 'iot-card-task', name: 'IotCardTask', component: RoutesAlias.IotCardTask, meta: { title: 'menus.assetManagement.iotCardTask', keepAlive: true } }, { path: 'device-task', name: 'DeviceTask', component: RoutesAlias.DeviceTask, meta: { title: 'menus.assetManagement.deviceTask', keepAlive: true } }, { path: 'task-detail', name: 'TaskDetail', component: RoutesAlias.TaskDetail, meta: { title: 'menus.assetManagement.taskDetail', isHide: true, keepAlive: false } } ] } ] }, { path: '/account', name: 'Finance', component: RoutesAlias.Home, meta: { title: 'menus.account.title', icon: '' }, children: [ // { // path: 'customer-account', // name: 'CustomerAccountList', // component: RoutesAlias.CustomerAccountList, // meta: { // title: 'menus.account.customerAccount', // keepAlive: true // } // }, { path: 'orders', name: 'OrderManagement', component: '/order-management/order-list', meta: { title: 'menus.account.orders', keepAlive: true } }, { path: 'orders/detail/:id', name: 'OrderDetail', component: '/order-management/order-list/detail', meta: { title: 'menus.account.orderDetail', isHide: true, keepAlive: false } } // { // path: 'my-account', // name: 'MyAccount', // component: RoutesAlias.MyAccount, // meta: { // title: 'menus.account.myAccount', // keepAlive: true // } // } ] }, { path: '/finance', name: 'FinanceManagement', component: RoutesAlias.Home, meta: { title: '财务管理', icon: '' }, children: [ { path: 'agent-recharge', name: 'AgentRecharge', component: RoutesAlias.AgentRecharge, meta: { title: '代理充值', keepAlive: true } }, { path: 'agent-recharge/detail/:id', name: 'AgentRechargeDetailRoute', component: RoutesAlias.AgentRechargeDetail, meta: { title: '充值详情', isHide: true, keepAlive: false } } ] }, { path: '/commission', name: 'CommissionManagement', component: RoutesAlias.Home, meta: { title: 'menus.commission.menu.management', icon: '' }, children: [ { path: 'withdrawal-approval', name: 'WithdrawalApproval', component: RoutesAlias.WithdrawalApproval, meta: { title: 'menus.commission.menu.withdrawal', keepAlive: true, roles: ['R_SUPER', 'R_ADMIN'] } }, { path: 'withdrawal-settings', name: 'CommissionWithdrawalSettings', component: RoutesAlias.CommissionWithdrawalSettings, meta: { title: 'menus.commission.menu.withdrawalSettings', keepAlive: true, roles: ['R_SUPER', 'R_ADMIN'] } }, { path: 'my-commission', name: 'MyCommission', component: RoutesAlias.MyCommission, meta: { title: 'menus.commission.menu.myCommission', keepAlive: true, roles: ['R_AGENT'] } }, { path: 'agent-commission', name: 'AgentCommission', component: RoutesAlias.AgentCommission, meta: { title: 'menus.commission.menu.agentCommission', keepAlive: true, roles: ['R_SUPER', 'R_ADMIN'] } } ] }, { path: '/settings', name: 'Settings', component: RoutesAlias.Home, meta: { title: '设置管理', icon: '' }, children: [ { path: 'wechat-config', name: 'WechatConfig', component: RoutesAlias.WechatConfig, meta: { title: '微信支付配置', keepAlive: true } }, { path: 'wechat-config/detail/:id', name: 'WechatConfigDetailRoute', component: RoutesAlias.WechatConfigDetail, meta: { title: '支付配置详情', isHide: true, keepAlive: false } } // { // path: 'payment-merchant', // name: 'PaymentMerchant', // component: RoutesAlias.PaymentMerchant, // meta: { // title: 'menus.settings.paymentMerchant', // keepAlive: true // } // }, // { // path: 'developer-api', // name: 'DeveloperApi', // component: RoutesAlias.DeveloperApi, // meta: { // title: 'menus.settings.developerApi', // keepAlive: true // } // }, // { // path: 'commission-template', // name: 'CommissionTemplate', // component: RoutesAlias.CommissionTemplate, // meta: { // title: 'menus.settings.commissionTemplate', // keepAlive: true // } // } ] } ]