You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

226 lines
5.8 KiB
TypeScript

/*
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-03-27 14:56:27
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-06-17 14:42:27
* @FilePath: \general-ai-manage\config\routes.ts
* @Description:
*/
/**
2 years ago
* @name umi
* @description path,component,routes,redirect,wrappers,name,icon
2 years ago
* @param path path :id *
* @param component location path React src/pages
2 years ago
* @param routes layout 使
* @param redirect
* @param wrappers
* @param name menu.ts menu.xxxx name login menu.ts menu.login
* @param icon https://ant.design/components/icon-cn 注意去除风格后缀和大小写,如想要配置图标为 <StepBackwardOutlined /> 则取值应为 stepBackward 或 StepBackward如想要配置图标为 <UserOutlined /> 则取值应为 user 或者 User
* @doc https://umijs.org/docs/guides/routes
*/
/** 主页路由模块 */
// 首页
export const homeRoute = [
2 years ago
{
name: 'home-business-project',
path: '/home/business-project',
component: './Project/BusinessProject',
access: 'canReadMenu',
key: 'BusinessProject001',
level: 1, // 一级菜单
2 years ago
},
];
2 years ago
// 算力中心
export const computePowerCenterRoute = [
{
name: 'computePower-center',
path: '/home/computePower-center',
component: './ComputePowerCenter',
access: 'canReadMenu',
key: 'ComputePowerCenter001',
level: 1, // 一级菜单
},
];
// 系统日志
// 算力中心
export const logRoute = [
{
name: 'log-index',
path: '/home/log-index',
component: './Log',
access: 'canReadMenu',
key: 'LogIndex001',
level: 1, // 一级菜单
},
];
/**
* @
* @param modelRouteIndex
* @param subModelRoute
* @param level
* @param isHideMenu
* @param icon
* @param rootMenuKey key
*/
const modelRouteIndex = {
name: 'model-manage',
path: '/home/model-index',
component: './Model/ModelIndex',
access: 'canReadMenu',
// menuIcon: 'icon-moxingliebiao-unselected',
key: 'model000',
};
const subModelRoute = [
{
name: 'model-index',
path: '/home/model-index',
component: './Model/ModelIndex',
access: 'canReadMenu',
// menuIcon: 'icon-moxingliebiao-unselected',
defaultIcon: 'modelListActiveIcon',
// activeIcon: modelListActiveIicon,
key: 'model001',
rootMenuKey: 'model000',
},
{
name: 'model-runtime-lib',
path: '/home/runtime-lib',
component: './Model/ModelRuntimeLib',
access: 'canReadMenu',
key: 'model002',
menuIcon: 'icon-moxingyunhangku-unselected',
level: 2,
rootMenuKey: 'model000',
},
{
name: 'model-detail',
path: '/home/model-detail/:id',
component: './Model/ModelDetail',
access: 'canReadMenu',
key: 'model003',
isHideMenu: true,
level: 2,
rootMenuKey: 'model000',
2 years ago
},
];
export const modelRoute = [
2 years ago
{
...modelRouteIndex,
level: 1,
subMenu: [...subModelRoute],
},
...subModelRoute,
];
/**
* @
*/
export const outerMenuRoute = {
name: 'home',
path: '/home',
layout: false,
access: 'canReadMenu',
component: '@/layouts/HomeLayout',
routes: [...homeRoute, ...modelRoute, ...computePowerCenterRoute, ...logRoute],
};
/**
* @
*/
export const innerMenuRoutes = [
{
name: 'business-info-index',
path: '/business/index',
component: './Project/BusinessInfo',
access: 'canReadMenu',
key: '1001',
menuIcon: 'icon-qiyexinxi',
},
{
name: 'business-device-group',
path: '/business/deviceGroup',
component: './Business/DeviceGroup',
access: 'canReadMenu',
key: '1002',
menuIcon: 'icon-jiedianshezhi',
},
{
name: 'business-model-index',
path: '/business/businessModel',
component: './Business/BusinessModel',
access: 'canReadMenu',
key: '1003',
menuIcon: 'icon-yewumoxing',
},
{
name: 'business-server-state',
path: '/business/serverState',
component: './Business/BusinessState',
access: 'canReadMenu',
key: '1004',
menuIcon: 'icon-fuwuqizhuangtai',
},
{
name: 'business-device-state',
path: '/business/deviceState',
component: './Business/BusinessState/deviceSate',
access: 'canReadMenu',
key: '1005',
menuIcon: 'icon-shebeizhuangtai',
},
];
// 全路由模块
export default [
outerMenuRoute,
{
path: '/user',
layout: false,
routes: [
{
name: 'login',
path: '/user/login',
component: './User/Login',
},
],
2 years ago
},
...innerMenuRoutes,
{
path: '/',
redirect: '/home/business-project',
},
{
path: '*',
layout: false,
component: './404',
},
// test demo
// {
// path: '/admin',
// name: 'admin',
// icon: 'crown',
// routes: [
// {
// path: '/admin',
// redirect: '/admin/index',
// },
// {
// path: '/admin/index',
// name: 'admin-index',
// component: './Admin',
// },
// {
// path: '/admin/previewFile',
// name: 'admin-preview-file',
// component: './Admin/previewFile',
// },
// ],
// },
2 years ago
];