|
|
@@ -1,6 +1,6 @@
|
|
|
import Vue from 'vue'
|
|
|
import Router from 'vue-router'
|
|
|
-import { Role } from '@/constant'
|
|
|
+import { Access } from '@/constant'
|
|
|
import Layout from '@/layout'
|
|
|
import Solo from '@/layout/Solo'
|
|
|
|
|
|
@@ -8,15 +8,16 @@ Vue.use(Router)
|
|
|
|
|
|
/**
|
|
|
* sub-menu only appear when route children.length >= 1
|
|
|
- * dev: true if set true, item will not show in production
|
|
|
- * hidden: true if set true, item will not show in the sidebar(default is false)
|
|
|
- * name:'router-name' the name is used by <keep-alive> (must set!!!)
|
|
|
+ * dev: true, if set true, item will not show in production
|
|
|
+ * hidden: true, if set true, item will not show in the sidebar(default is false)
|
|
|
+ * name:'router-name' , if it is not a wrapping layer(Layout or Solo), it must be set!!!
|
|
|
+ * include: ['admin'], control the page roles (you can set multiple roles)
|
|
|
+ * access: 'manage-profile', control the page access
|
|
|
* meta : {
|
|
|
- * include: ['admin'], control the page roles (you can set multiple roles)
|
|
|
- * exclude: ['visitor'], control the page roles (you can set multiple roles)
|
|
|
* title: 'title', the name show in sidebar and breadcrumb (recommend set)
|
|
|
* icon: 'svg-name'/'el-icon-x', the icon show in the sidebar
|
|
|
- * activeMenu: '/example/list' if set path, the sidebar will highlight the path you set
|
|
|
+ * activeMenu: '/example/list', if set path, the sidebar will highlight the path you set
|
|
|
+ * cache: 'router-name' if set, the router will be cached (only in Solo)
|
|
|
* }
|
|
|
*/
|
|
|
|
|
|
@@ -53,6 +54,7 @@ export const asyncRoutes = [
|
|
|
name: 'profile',
|
|
|
path: 'profile',
|
|
|
component: () => import('@/views/profile/index'),
|
|
|
+ access: Access.MANAGE_PROFILE,
|
|
|
meta: { title: '个人设置' },
|
|
|
hidden: true
|
|
|
}
|
|
|
@@ -67,18 +69,20 @@ export const asyncRoutes = [
|
|
|
name: 'media',
|
|
|
path: 'media',
|
|
|
component: () => import('@/views/media/index'),
|
|
|
- exclude: [Role.VISITOR],
|
|
|
+ access: Access.VIEW_ASSETS,
|
|
|
meta: { title: '媒资管理' }
|
|
|
},
|
|
|
{
|
|
|
name: 'program',
|
|
|
path: 'program',
|
|
|
component: () => import('@/views/bigscreen/index'),
|
|
|
+ access: Access.VIEW_CALENDAR,
|
|
|
meta: { title: '节目编排' }
|
|
|
},
|
|
|
{
|
|
|
path: 'schedule',
|
|
|
component: Solo,
|
|
|
+ access: Access.VIEW_CALENDAR,
|
|
|
meta: { title: '节目排期' },
|
|
|
children: [
|
|
|
{
|
|
|
@@ -92,7 +96,7 @@ export const asyncRoutes = [
|
|
|
name: 'schedule-design',
|
|
|
path: ':id',
|
|
|
component: () => import('@/views/schedule/designer/index'),
|
|
|
- exclude: [Role.VISITOR],
|
|
|
+ access: Access.MANAGE_CALENDAR,
|
|
|
meta: { title: '排期编辑', activeMenu: '/cm/schedule', cache: 'ScheduleList' },
|
|
|
hidden: true
|
|
|
}
|
|
|
@@ -102,20 +106,21 @@ export const asyncRoutes = [
|
|
|
name: 'schedule-deploy',
|
|
|
path: 'deploy',
|
|
|
component: () => import('@/views/schedule/deploy/index'),
|
|
|
- exclude: [Role.VISITOR],
|
|
|
+ access: Access.PUBLISH_CALENDAR,
|
|
|
meta: { title: '排期发布' }
|
|
|
},
|
|
|
{
|
|
|
name: 'review',
|
|
|
path: 'review',
|
|
|
component: () => import('@/views/review/index'),
|
|
|
- include: [Role.SUPERVISOR],
|
|
|
+ access: Access.REVIEW,
|
|
|
meta: { title: '审核管理' }
|
|
|
},
|
|
|
{
|
|
|
name: 'schedule-deploy-history',
|
|
|
path: 'history',
|
|
|
component: () => import('@/views/schedule/history/index'),
|
|
|
+ access: Access.VIEW_CALENDAR,
|
|
|
meta: { title: '发布历史' }
|
|
|
}
|
|
|
]
|
|
|
@@ -123,6 +128,7 @@ export const asyncRoutes = [
|
|
|
{
|
|
|
path: '/dm',
|
|
|
component: Layout,
|
|
|
+ access: Access.VIEW_DEVICE,
|
|
|
meta: { title: '大屏设备', icon: 'el-icon-monitor' },
|
|
|
children: [
|
|
|
{
|
|
|
@@ -155,14 +161,14 @@ export const asyncRoutes = [
|
|
|
name: 'category',
|
|
|
path: 'category',
|
|
|
component: () => import('@/views/device/category/index'),
|
|
|
- include: [Role.ADMIN],
|
|
|
+ access: Access.VIEW_PRODUCTS,
|
|
|
meta: { title: '产品分类' }
|
|
|
},
|
|
|
{
|
|
|
name: 'product',
|
|
|
path: 'product',
|
|
|
component: () => import('@/views/device/product/index'),
|
|
|
- include: [Role.ADMIN],
|
|
|
+ access: Access.VIEW_PRODUCTS,
|
|
|
meta: { title: '产品管理' }
|
|
|
},
|
|
|
{
|
|
|
@@ -174,6 +180,7 @@ export const asyncRoutes = [
|
|
|
name: 'device-list',
|
|
|
path: '',
|
|
|
component: () => import('@/views/device/index'),
|
|
|
+ access: Access.VIEW_DEVICES,
|
|
|
meta: { cache: 'DeviceList' },
|
|
|
hidden: true
|
|
|
},
|
|
|
@@ -181,6 +188,7 @@ export const asyncRoutes = [
|
|
|
name: 'device-detail',
|
|
|
path: ':id',
|
|
|
component: () => import('@/views/device/detail/index'),
|
|
|
+ access: Access.VIEW_DEVICE,
|
|
|
meta: { title: '设备详情', activeMenu: '/m/device', cache: 'DeviceList' },
|
|
|
hidden: true
|
|
|
}
|
|
|
@@ -190,7 +198,7 @@ export const asyncRoutes = [
|
|
|
name: 'group',
|
|
|
path: 'group',
|
|
|
component: () => import('@/views/device/group/index'),
|
|
|
- exclude: [Role.VISITOR],
|
|
|
+ access: Access.VIEW_GROUPS,
|
|
|
meta: { title: '分组管理' }
|
|
|
}
|
|
|
]
|
|
|
@@ -198,6 +206,7 @@ export const asyncRoutes = [
|
|
|
{
|
|
|
path: '/l',
|
|
|
component: Layout,
|
|
|
+ access: Access.VIEW_LOGS,
|
|
|
meta: { icon: 'el-icon-edit-outline' },
|
|
|
children: [
|
|
|
{
|
|
|
@@ -211,7 +220,7 @@ export const asyncRoutes = [
|
|
|
{
|
|
|
path: '/d',
|
|
|
component: Layout,
|
|
|
- include: [Role.ADMIN],
|
|
|
+ access: Access.DEBUG,
|
|
|
meta: { icon: 'bug' },
|
|
|
children: [
|
|
|
{
|
|
|
@@ -225,7 +234,7 @@ export const asyncRoutes = [
|
|
|
{
|
|
|
path: '/u',
|
|
|
component: Layout,
|
|
|
- include: [Role.ADMIN],
|
|
|
+ access: Access.VIEW_UPGRADE,
|
|
|
meta: { title: '升级管理', icon: 'el-icon-upload' },
|
|
|
children: [
|
|
|
{
|
|
|
@@ -246,7 +255,7 @@ export const asyncRoutes = [
|
|
|
name: 'design',
|
|
|
path: '/design/:id',
|
|
|
component: () => import('@/views/bigscreen/designer/index'),
|
|
|
- exclude: [Role.VISITOR],
|
|
|
+ access: Access.MANAGE_CALENDAR,
|
|
|
hidden: true
|
|
|
},
|
|
|
{
|