123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- /**
- * @name umi 的路由配置
- * @description 只支持 path,component,routes,redirect,wrappers,title 的配置
- * @param path path 只支持两种占位符配置,第一种是动态参数 :id 的形式,第二种是 * 通配符,通配符只能出现路由字符串的最后。
- * @param component 配置 location 和 path 匹配后用于渲染的 React 组件路径。可以是绝对路径,也可以是相对路径,如果是相对路径,会从 src/pages 开始找起。
- * @param routes 配置子路由,通常在需要为多个路径增加 layout 组件时使用。
- * @param redirect 配置路由跳转
- * @param wrappers 配置路由组件的包装组件,通过包装组件可以为当前的路由组件组合进更多的功能。 比如,可以用于路由级别的权限校验
- * @doc https://umijs.org/docs/guides/routes
- */
- export default [
- {
- path: '/passport',
- routes: [
- {
- name: '登录',
- path: '/passport/login',
- component: './passport/Login',
- },
- {
- path: '/passport',
- redirect: '/passport/login',
- },
- ],
- },
- {
- path: '/',
- name: '主界面',
- component: '../layouts/BaseLayout',
- routes: [
- {
- path: '/dashboard',
- name: '仪表板',
- component: './dashboard',
- access: 'canDashboard',
- },
- {
- path: '/customer',
- name: '客户查询',
- access: 'canCustomer',
- routes: [
- {
- path: '/customer/order',
- name: '订单查询',
- component: './customer/Order',
- },
- {
- path: '/customer/bill',
- name: '账单查询',
- component: './customer/Bill',
- },
- {
- path: '/customer/vehicle',
- name: '车辆查询',
- component: './customer/Vehicle',
- },
- {
- path: '/customer/battery',
- name: '电池查询',
- component: './customer/Battery',
- },
- {
- path: '/customer/driver',
- name: '司机查询',
- component: './customer/Driver',
- },
- {
- path: '/customer',
- redirect: '/customer/order',
- },
- ],
- },
- {
- path: '/station',
- name: '电站监控',
- access: 'canStation',
- routes: [
- {
- path: '/station/order',
- name: '订单查询',
- component: './station/Order',
- },
- {
- path: '/station/alarm',
- name: '设备告警',
- component: './station/Alarm',
- },
- {
- path: '/station/power',
- name: '机组充电',
- component: './station/Power',
- },
- {
- path: '/station/measure',
- name: '设备度量',
- component: './station/Measure',
- },
- {
- path: '/station/battery',
- name: '电站电池',
- component: './station/Battery',
- },
- {
- path: '/station/device',
- name: '电站设备',
- component: './station/Device',
- },
- {
- path: '/station',
- redirect: '/station/order',
- },
- ],
- },
- {
- path: '/operator',
- name: '运营管理',
- access: 'canOperator',
- routes: [
- {
- path: '/operator/order',
- name: '订单管理',
- component: './operator/Order',
- },
- {
- path: '/operator/bill',
- name: '账单管理',
- component: './operator/Bill',
- },
- {
- path: '/operator/customer',
- name: '客户管理',
- component: './operator/Customer',
- },
- {
- path: '/operator/customer/:id',
- name: '客户详情',
- component: './operator/Customer/Detail',
- },
- {
- path: '/operator/rule',
- name: '计费规则',
- component: './operator/Rule',
- },
- {
- path: '/operator/vehicle',
- name: '车辆管理',
- component: './operator/Vehicle',
- },
- {
- path: '/operator/battery',
- name: '电池管理',
- component: './operator/Battery',
- },
- {
- path: '/operator/device',
- name: '电站设备',
- component: './operator/Device',
- },
- {
- path: '/operator/station',
- name: '电站查询',
- component: './operator/Station',
- },
- {
- path: '/operator/price',
- name: '电网电价',
- component: './operator/Price',
- },
- {
- path: '/operator',
- redirect: '/operator/order',
- },
- ],
- },
- {
- path: '/admin',
- name: '平台管理',
- access: 'canAdmin',
- routes: [
- {
- path: '/admin/tenant',
- name: '运营商管理',
- component: './admin/Tenant',
- },
- {
- path: '/admin/station',
- name: '电站管理',
- component: './admin/Station',
- },
- {
- path: '/admin/station/:id',
- name: '电站详情',
- component: './admin/Device',
- },
- {
- path: '/admin',
- redirect: '/admin/tenant',
- },
- ],
- },
- {
- path: '/system',
- name: '系统管理',
- routes: [
- {
- path: '/system/account',
- name: '我的账号',
- component: './system/Account',
- },
- {
- path: '/system/user',
- name: '用户管理',
- component: './system/User',
- access: 'canCommon',
- },
- {
- path: '/system/setting',
- name: '系统设置',
- component: './system/Setting',
- access: 'canAdmin',
- },
- {
- path: '/system/dict',
- name: '数据字典',
- component: './system/Dict',
- access: 'canRoot',
- },
- {
- path: '/system',
- redirect: '/system/account',
- },
- ],
- },
- {
- path: '/welcome',
- name: '欢迎登录',
- component: './Welcome',
- },
- {
- path: '/',
- redirect: '/welcome',
- },
- ],
- },
- {
- path: '*',
- layout: false,
- component: './404',
- },
- ];
|