|
|
/**
|
|
|
* @name umi 的路由配置
|
|
|
* @description 只支持 path,components,routes,redirect,wrappers,name,icon 的配置
|
|
|
* @param path path 只支持两种占位符配置,第一种是动态参数 :id 的形式,第二种是 * 通配符,通配符只能出现路由字符串的最后。
|
|
|
* @param components 配置 location 和 path 匹配后用于渲染的 React 组件路径。可以是绝对路径,也可以是相对路径,如果是相对路径,会从 src/pages 开始找起。
|
|
|
* @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 default [
|
|
|
{
|
|
|
path: '/user',
|
|
|
layout: false,
|
|
|
routes: [
|
|
|
{
|
|
|
name: 'login',
|
|
|
path: '/user/login',
|
|
|
component: './User/Login/index1',
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
{
|
|
|
path: '/welcome',
|
|
|
name: 'welcome',
|
|
|
component: 'Welcome/Welcome',
|
|
|
},
|
|
|
{
|
|
|
path: '/admin',
|
|
|
name: 'admin',
|
|
|
|
|
|
access: 'canAdmin',
|
|
|
routes: [
|
|
|
{
|
|
|
path: '/admin',
|
|
|
redirect: '/admin/sub-page',
|
|
|
},
|
|
|
{
|
|
|
path: '/admin/sub-page',
|
|
|
name: 'sub-page',
|
|
|
component: './Admin',
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
|
|
|
|
|
|
{
|
|
|
path: '/system',
|
|
|
|
|
|
name: 'system',
|
|
|
|
|
|
routes: [
|
|
|
{
|
|
|
name: 'api-list',
|
|
|
path: '/system/api-list',
|
|
|
component: 'System/ApiList',
|
|
|
access: 'canReadMenu',
|
|
|
},
|
|
|
{
|
|
|
name: 'menu-list',
|
|
|
path: '/system/menu-list',
|
|
|
component: 'System/MenuList',
|
|
|
access: 'canReadMenu',
|
|
|
},
|
|
|
{
|
|
|
name: 'role-list',
|
|
|
path: '/system/role-list',
|
|
|
component: 'System/RoleList',
|
|
|
access: 'canReadMenu',
|
|
|
},
|
|
|
{
|
|
|
name: 'user-list',
|
|
|
path: '/system/user-list',
|
|
|
component: 'System/UserList',
|
|
|
access: 'canReadMenu',
|
|
|
},
|
|
|
{
|
|
|
name: 'post-list',
|
|
|
path: '/system/post-list',
|
|
|
component: 'System/PostList',
|
|
|
access: 'canReadMenu',
|
|
|
},
|
|
|
{
|
|
|
name: 'department-list',
|
|
|
path: '/system/department-list',
|
|
|
component: 'System/DepartmentList',
|
|
|
access: 'canReadMenu',
|
|
|
},
|
|
|
{
|
|
|
name: 'operation_record-list',
|
|
|
path: '/system/operation_record-list',
|
|
|
component: 'System/OperationRecordList',
|
|
|
access: 'canReadMenu',
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
{
|
|
|
name: 'device',
|
|
|
path: '/device',
|
|
|
routes: [{
|
|
|
'name': 'device-list',
|
|
|
'path': '/device/device-list',
|
|
|
'component': 'Device/DeviceList',
|
|
|
'access': 'canReadMenu'
|
|
|
}, {
|
|
|
'name': 'device-category-list',
|
|
|
'path': '/device/device-category-list',
|
|
|
'component': 'Device/DeviceCategoryList',
|
|
|
'access': 'canReadMenu'
|
|
|
}, {
|
|
|
'name': 'device-group-list',
|
|
|
'path': '/device/device-group-list',
|
|
|
'component': 'Device/DeviceGroupList',
|
|
|
'access': 'canReadMenu'
|
|
|
}, {
|
|
|
'name': 'device-relation-list',
|
|
|
'path': '/device/device-relation-list',
|
|
|
'component': 'Device/DeviceRelationList',
|
|
|
'access': 'canReadMenu'
|
|
|
}],
|
|
|
|
|
|
},
|
|
|
{
|
|
|
name: 'DCSDevice',
|
|
|
path: '/DCSDevice',
|
|
|
routes: [{
|
|
|
'name': 'DCSDevice-device-group-list',
|
|
|
'path': '/DCSDevice/device-group-list',
|
|
|
'component': 'DCSDevice/DeviceGroupList',
|
|
|
'access': 'canReadMenu'
|
|
|
},{
|
|
|
'name': 'DCSDevice-device-category-list',
|
|
|
'path': '/DCSDevice/device-category-list',
|
|
|
'component': 'DCSDevice/DeviceCategoryList',
|
|
|
'access': 'canReadMenu'
|
|
|
},{
|
|
|
'name': 'DCSDevice-device-list',
|
|
|
'path': '/DCSDevice/device-list',
|
|
|
'component': 'DCSDevice/DeviceList',
|
|
|
'access': 'canReadMenu'
|
|
|
}, {
|
|
|
'name': 'DCSDevice-device-status',
|
|
|
'path': '/DCSDevice/device-status',
|
|
|
'component': 'DCSDevice/DeviceStatus',
|
|
|
'access': 'canReadMenu'
|
|
|
}],
|
|
|
|
|
|
},
|
|
|
{
|
|
|
name: 'resource',
|
|
|
path: '/resource',
|
|
|
routes: [{
|
|
|
'name': 'algorithm-model-list',
|
|
|
|
|
|
'path': '/resource/algorithm-model-list',
|
|
|
'component': 'Resource/AlgorithmModelList',
|
|
|
'access': 'canReadMenu',
|
|
|
}, {
|
|
|
'name': 'algorithm-model-detail',
|
|
|
'path': '/resource/algorithm-model-detail/:id',
|
|
|
'component': 'Resource/AlgorithmModelList/detail',
|
|
|
'access': 'canReadMenu',
|
|
|
"isHideTab": true,
|
|
|
}, {
|
|
|
'name': 'business-image-list',
|
|
|
|
|
|
'path': '/resource/business-image-list',
|
|
|
'component': 'Resource/BusinessImageList',
|
|
|
'access': 'canReadMenu'
|
|
|
}, {
|
|
|
'name': 'model-category-list',
|
|
|
|
|
|
'path': '/resource/model-category-list',
|
|
|
'component': 'Resource/ModelCategoryList',
|
|
|
'access': 'canReadMenu'
|
|
|
}, {
|
|
|
'name': 'model-image-list',
|
|
|
'path': '/resource/model-image-list',
|
|
|
'component': 'Resource/ModelImageList',
|
|
|
'access': 'canReadMenu'
|
|
|
}, {
|
|
|
'name': 'model-version-list',
|
|
|
'path': '/resource/model-version-list',
|
|
|
'component': 'Resource/ModelVersionList',
|
|
|
'access': 'canReadMenu'
|
|
|
}]
|
|
|
},
|
|
|
{
|
|
|
name: 'analysis',
|
|
|
path: '/analysis',
|
|
|
routes: [
|
|
|
{
|
|
|
'name': 'action-detection-list',
|
|
|
'path': '/analysis/action-detection-list',
|
|
|
'component': 'Analysis/ActionDetectionList',
|
|
|
'access': 'canReadMenu'
|
|
|
}
|
|
|
]
|
|
|
|
|
|
},
|
|
|
{
|
|
|
name: 'project',
|
|
|
path: '/project',
|
|
|
routes: [{
|
|
|
'name': 'project-list',
|
|
|
|
|
|
'path': '/project/project-list',
|
|
|
'component': 'Project/ProjectList',
|
|
|
'access': 'canReadMenu'
|
|
|
}]
|
|
|
},
|
|
|
{
|
|
|
name: 'Contact',
|
|
|
path: '/Contact',
|
|
|
routes: [{
|
|
|
'name': 'Contact-contact-list',
|
|
|
'path': '/Contact/contact-list',
|
|
|
'component': 'Contact/ContactList',
|
|
|
'access': 'canReadMenu'
|
|
|
}],
|
|
|
|
|
|
},
|
|
|
{
|
|
|
name: 'task',
|
|
|
path: '/task',
|
|
|
component: 'Hidden',
|
|
|
},
|
|
|
{
|
|
|
name: 'compute_power',
|
|
|
path: '/compute_power',
|
|
|
component: 'ComputePowerAllocation/ComputePowerAllocation',
|
|
|
},
|
|
|
{
|
|
|
name: 'data_screen',
|
|
|
path: '/data_screen',
|
|
|
},
|
|
|
{
|
|
|
name: 'algorithm_setting',
|
|
|
path: '/algorithm_setting',
|
|
|
component: 'Setting/AlgorithmSetting',
|
|
|
},
|
|
|
{
|
|
|
name: 'alarm',
|
|
|
path: '/alarm',
|
|
|
component: 'Hidden',
|
|
|
},
|
|
|
{
|
|
|
name: 'logging',
|
|
|
path: 'http://192.168.10.96:5601/app/r/s/uDpRg',
|
|
|
},
|
|
|
{
|
|
|
path: '/',
|
|
|
redirect: '/welcome',
|
|
|
},
|
|
|
{
|
|
|
path: '*',
|
|
|
layout: false,
|
|
|
component: './404',
|
|
|
},
|
|
|
];
|