| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311 |
- import {RouteRecordRaw} from 'vue-router';
- /**
- * 建议:路由 path 路径与文件夹名称相同,找文件可浏览器地址找,方便定位文件位置
- *
- * 路由meta对象参数说明
- * meta: {
- * title: 菜单栏及 tagsView 栏、菜单搜索名称(国际化)
- * isLink: 是否超链接菜单,开启外链条件,`1、isLink: 链接地址不为空 2、isIframe:false`
- * isHide: 是否隐藏此路由
- * isKeepAlive: 是否缓存组件状态
- * isAffix: 是否固定在 tagsView 栏上
- * isIframe: 是否内嵌窗口,开启条件,`1、isIframe:true 2、isLink:链接地址不为空`
- * roles: 当前路由权限标识,取角色管理。控制路由显示、隐藏。超级管理员:admin 普通角色:common
- * icon: 菜单、tagsView 图标,阿里:加 `iconfont xxx`,fontawesome:加 `fa xxx`
- * }
- */
- // 扩展 RouteMeta 接口
- declare module 'vue-router' {
- interface RouteMeta {
- title?: string;
- isLink?: string;
- isHide?: boolean;
- isKeepAlive?: boolean;
- isAffix?: boolean;
- isIframe?: boolean;
- roles?: string[];
- icon?: string;
- }
- }
- /**
- * 定义404、401界面
- * @link 参考:https://next.router.vuejs.org/zh/guide/essentials/history-mode.html#netlify
- */
- export const notFoundAndNoPower = [
- {
- path: '/:path(.*)*',
- name: 'notFound',
- component: () => import('/@/views/error/404.vue'),
- meta: {
- title: 'message.staticRoutes.notFound',
- isHide: true,
- },
- },
- {
- path: '/401',
- name: 'noPower',
- component: () => import('/@/views/error/401.vue'),
- meta: {
- title: 'message.staticRoutes.noPower',
- isHide: true,
- },
- },
- ];
- /**
- * 前端路由
- * 此路由不要动,前端添加路由的话,请在 `dynamicRoutes 数组` 中添加
- * @description 前端控制直接改 dynamicRoutes 中的路由,后端控制不需要修改,请求接口路由数据时,会覆盖 dynamicRoutes 第一个顶级 children 的内容(全屏,不包含 layout 中的路由出口)
- * @returns 返回路由菜单数据
- */
- export const staticRoutes: Array<RouteRecordRaw> = [
- {
- path: '/login',
- name: 'login',
- component: () => import('/@/views/login/index.vue'),
- meta: {
- title: '登录',
- },
- },
- ];
- /**
- * 管理后台的路由 },
- */
- export const adminRoutes: Array<RouteRecordRaw> = [
- {
- path: '/',
- name: 'admin',
- component: () => import('/@/layout/index.vue'),
- redirect: '/home',
- meta: {
- isKeepAlive: true,
- title: '管理后台'
- },
- children: [
- {
- path: '/home',
- name: 'adminHome1',
- component: () => import('/@/views/admin/index.vue'),
- meta: {
- title: '信息总览',
- isLink: '',
- isHide: false,
- isKeepAlive: true,
- isAffix: false,
- isIframe: false,
- icon: 'ele-Monitor',
- color: 'yellow'
- // perm:'admin'
- }
- },
- {
- path: '/station',
- name: 'adminStation',
- component: () => import('/@/layout/routerView/parent.vue'),
- redirect: '/admin/station/list',
- meta: {
- title: '电站电桩',
- isLink: '',
- isHide: false,
- isKeepAlive: true,
- isAffix: false,
- isIframe: false,
- icon: 'ele-MapLocation',
- perm:"equipment.list,station.list",
- },
- children: [
- {
- path: '/station/list',
- name: 'adminStationList',
- component: () => import('/@/views/admin/station/list/index.vue'),
- meta: {
- title: '电站监控',
- isLink: '',
- isHide: false,
- isKeepAlive: true,
- isAffix: false,
- isIframe: false,
- perm:"station.list",
- icon: 'ele-OfficeBuilding',
- },
- },
- {
- path: '/station/endpoint/:id',
- name: 'adminStationEndpoint',
- component: () => import('/@/views/admin/station/endpoint/index.vue'),
- meta: {
- title: '电桩监控',
- isLink: '',
- isHide: false,
- isKeepAlive: true,
- isAffix: false,
- isIframe: false,
- perm:"equipment.list",
- icon: 'ele-User',
- },
- },
- /* {
- path: '/station/stat',
- name: 'adminStationStat',
- component: () => import('/@/views/admin/station/stat/index.vue'),
- meta: {
- title: '营收概览',
- isLink: '',
- isHide: false,
- isKeepAlive: true,
- isAffix: false,
- isIframe: false,
- icon: 'ele-Compass',
- },
- },*/
- ]
- },
- /* {
- path: '/marketing',
- name: 'adminMarketing',
- component: () => import('/@/views/admin/marketing/index.vue'),
- meta: {
- title: '营销活动',
- isLink: '',
- isHide: false,
- isKeepAlive: true,
- isAffix: false,
- isIframe: false,
- icon: 'ele-PieChart',
- }
- },*/
- {
- path: '/ordering',
- name: 'adminOrdering',
- component: () => import('/@/views/admin/ordering/index.vue'),
- meta: {
- title: '订单管理',
- isLink: '',
- isHide: false,
- isKeepAlive: true,
- isAffix: false,
- isIframe: false,
- icon: 'ele-Money',
- perm:"order.list",
- }
- },
- {
- path: '/account',
- name: 'adminAccount',
- component: () => import('/@/views/admin/account/index.vue'),
- meta: {
- title: '用户列表',
- isLink: '',
- isHide: false,
- isKeepAlive: true,
- isAffix: false,
- isIframe: false,
- icon: 'ele-User',
- perm:"account.list",
- }
- },
- {
- path: '/finance',
- name: 'adminFinance',
- component: () => import('/@/views/admin/finance/index.vue'),
- meta: {
- title: '充值记录',
- isLink: '',
- isHide: false,
- isKeepAlive: true,
- isAffix: false,
- isIframe: false,
- icon: 'ele-Wallet',
- perm:"recharge.list",
- },
- },
- {
- path: '/refund',
- name: 'adminRefund',
- component: () => import('/@/views/admin/refund/index.vue'),
- meta: {
- title: '退款记录',
- isLink: '',
- isHide: false,
- isKeepAlive: true,
- isAffix: false,
- isIframe: false,
- icon: 'ele-Cloudy',
- perm:"refund.list",
- },
- },
- {
- path: '/org',
- name: 'adminOrg',
- component: () => import('/@/layout/routerView/parent.vue'),
- redirect: '/admin/org/department',
- meta: {
- title: '系统配置',
- isLink: '',
- isHide: false,
- isKeepAlive: true,
- isAffix: false,
- isIframe: false,
- icon: 'ele-Tools',
- perm:"user.list,role.list",
- },
- children: [
- {
- path: '/org/user',
- name: 'orgUser',
- component: () => import('/@/views/admin/user/index.vue'),
- meta: {
- title: '运维用户',
- isLink: '',
- isHide: false,
- isKeepAlive: true,
- isAffix: false,
- isIframe: false,
- perm:"user.list",
- icon: 'ele-User',
- },
- },
- {
- path: '/org/role',
- name: 'orgRole',
- component: () => import('/@/views/admin/role/index.vue'),
- meta: {
- title: '角色权限',
- isLink: '',
- isHide: false,
- isKeepAlive: true,
- isAffix: false,
- isIframe: false,
- perm:"role.list",
- icon: 'ele-Compass',
- },
- },
- ]
- },
- /* {
- path: '/optList',
- name: 'adminOptList',
- component: () => import('/@/views/admin/log/opt/index.vue'),
- meta: {
- title: '操作日志',
- isLink: '',
- isHide: false,
- isKeepAlive: true,
- isAffix: false,
- isIframe: false,
- icon: 'ele-Cpu',
- }
- },*/
- ],
- },
- ]
|