travel/admin/src/router/index.js

406 lines
8.9 KiB
JavaScript
Raw Normal View History

2024-06-24 11:52:30 +08:00
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
/* Layout */
import Layout from '@/layout'
/**
* constantRoutes
* a base page that does not have permission requirements
* all roles can be accessed
*/
export const constantRoutes = [
{
path: '/redirect',
component: Layout,
hidden: true,
children: [
{
path: '/redirect/:path(.*)',
component: () => import('@/views/redirect/index')
}
]
},
{
path: '/login',
component: () => import('@/views/login/index'),
hidden: true
},
2024-07-15 15:18:47 +08:00
{
path: '/home',
component: () => import('@/views/home/index'),
hidden: true
},
{
path: '/line_on_sale',
component: () => import('@/views/home/line_on_sale'),
hidden: true
},
2024-06-24 11:52:30 +08:00
{
path: '/auth-redirect',
component: () => import('@/views/login/auth-redirect'),
hidden: true
},
{
path: '/404',
component: () => import('@/views/error-page/404'),
hidden: true
},
{
path: '/401',
component: () => import('@/views/error-page/401'),
hidden: true
},
{
path: '/',
component: Layout,
redirect: '/dashboard',
children: [
{
path: 'dashboard',
component: () => import('@/views/dashboard/index'),
name: 'Dashboard',
meta: { title: '系统面板', icon: 'dashboard', affix: true }
}
]
}
]
/**
* asyncRoutes
* the routes that need to be dynamically loaded based on user roles
*/
export const asyncRoutes = [
{
path: '/system',
component: Layout,
redirect: '/system',
alwaysShow: true,
name: 'System',
meta: {
title: '系统管理',
icon: 'el-icon-s-home',
roles: ['admin']
},
children: [
{
path: 'admin',
component: () => import('@/views/admin/index'),
name: 'Admin',
meta: {
title: '管理员',
roles: ['admin']
}
},
{
path: 'works',
component: () => import('@/views/admin/works'),
name: 'Works',
meta: {
title: '排班表',
roles: ['admin']
}
},
2024-09-19 18:16:35 +08:00
{
path: 'scheduling',
component: () => import('@/views/scheduling/index'),
name: 'scheduling',
meta: {
title: '直播排班',
roles: ['admin']
}
},
2024-06-24 11:52:30 +08:00
{
path: 'onlines',
component: () => import('@/views/onlines/online.vue'),
name: 'onlines',
meta: {
2024-06-26 15:38:38 +08:00
title: '在线客服',
2024-06-24 11:52:30 +08:00
roles: ['admin']
}
2024-06-24 20:58:23 +08:00
}/*,
2024-06-24 11:52:30 +08:00
{
path: 'shortcut',
component: () => import('@/views/shortcut/shortcutContent.vue'),
name: 'shortcut',
meta: {
title: '快捷内容设置',
roles: ['admin']
}
2024-06-24 20:58:23 +08:00
},
2024-06-24 11:52:30 +08:00
{
path: 'teams',
component: () => import('@/views/admin/teams'),
name: 'Teams',
meta: {
title: '团队',
roles: ['admin']
}
}*/
]
},
{
path: '/order',
component: Layout,
redirect: '/order/index',
alwaysShow: true,
name: 'Orders',
meta: {
title: '订单管理',
icon: 'money',
2024-06-24 20:58:23 +08:00
roles: ['order_index', 'editor']
2024-06-24 11:52:30 +08:00
},
children: [
{
path: 'index',
component: () => import('@/views/order/index'),
name: 'OrderList',
meta: {
title: '订单列表',
2024-06-24 20:58:23 +08:00
roles: ['order_pub', 'editor']
2024-06-24 11:52:30 +08:00
}
},
/* {
path: 'pub',
component: () => import('@/views/order/pub'),
name: 'OrderPub',
meta: {
title: '公海订单',
roles: ['order_pub','editor']
}
},*/
{
path: 'back',
component: () => import('@/views/order/back'),
name: 'OrderBack',
meta: {
title: '流转订单',
2024-06-24 20:58:23 +08:00
roles: ['order_back', 'editor']
2024-06-24 11:52:30 +08:00
}
2024-06-25 14:40:30 +08:00
},
{
2024-06-28 17:30:56 +08:00
path: 'abandoned',
component: () => import('@/views/order/abandoned'),
name: 'OrderBack',
2024-06-25 14:40:30 +08:00
meta: {
2024-06-28 17:30:56 +08:00
title: '已放弃订单',
roles: ['order_back', 'editor']
}
},
{
path: 'used',
component: () => import('@/views/order/used'),
name: 'OrderBack',
meta: {
title: '已使用订单',
roles: ['order_back', 'editor']
2024-06-25 14:40:30 +08:00
}
},
2024-10-13 17:01:24 +08:00
{
path: 'refunded',
component: () => import('@/views/order/refunded'),
name: 'OrderBack',
meta: {
title: '已退款订单',
roles: ['order_back', 'editor']
}
},
2024-10-21 11:07:09 +08:00
{
path: 'appointment',
component: () => import('@/views/order/appointment'),
name: 'appointment',
meta: {
title: '预约记录',
roles: ['order_back', 'editor']
}
},
2024-06-24 11:52:30 +08:00
]
},
2024-06-27 17:34:53 +08:00
{
path: '/qa',
component: Layout,
redirect: '/qa/qa',
alwaysShow: true,
name: 'Qa',
meta: {
title: 'QA管理',
icon: 'el-icon-question',
2024-07-31 16:45:54 +08:00
roles: ['order_index', 'editor', 'franchisee']
2024-06-27 17:34:53 +08:00
},
children: [
2024-06-27 18:57:13 +08:00
{
path: 'problem',
component: () => import('@/views/qa/problem.vue'),
name: 'problem',
meta: {
title: 'QA常见问题',
2024-07-31 16:45:54 +08:00
roles: ['order_pub', 'editor', 'franchisee']
2024-06-27 18:57:13 +08:00
}
},
2024-06-27 17:34:53 +08:00
{
path: 'qa',
component: () => import('@/views/qa/qa.vue'),
name: 'qa',
meta: {
2024-06-28 17:30:56 +08:00
title: 'QA管理列表',
2024-06-27 17:34:53 +08:00
roles: ['admin']
}
},
{
path: 'city',
component: () => import('@/views/qa/city.vue'),
name: 'city',
meta: {
2024-06-28 17:30:56 +08:00
title: '城市管理列表',
2024-06-27 17:34:53 +08:00
roles: ['admin']
}
}
]
},
2024-06-24 11:52:30 +08:00
{
path: '/data',
component: Layout,
redirect: '/data/index',
alwaysShow: true,
name: 'Data',
meta: {
title: '数据统计',
icon: 'chart',
roles: ['data_index']
},
children: [
2024-06-28 17:30:56 +08:00
{
path: 'product',
component: () => import('@/views/order/product'),
name: 'productNameList',
meta: {
title: '产品统计',
roles: ['order_pub', 'editor']
}
},
2024-06-24 11:52:30 +08:00
{
path: 'index',
component: () => import('@/views/data/index'),
name: 'Index',
meta: {
title: '跟进统计',
roles: ['data_index']
}
},
2024-06-24 20:58:23 +08:00
/* {
2024-06-24 11:52:30 +08:00
path: 'online',
component: () => import('@/views/data/online'),
name: 'Index',
meta: {
title: '在线时长',
roles: ['data_online']
}
},
{
path: 'anchor',
component: () => import('@/views/data/anchor'),
name: 'Anchor',
meta: {
title: '主播概况',
roles: ['data_anchor']
}
2024-06-24 20:58:23 +08:00
},*/
2024-06-24 11:52:30 +08:00
{
path: 'sale',
component: () => import('@/views/data/sale'),
name: 'Sale',
meta: {
title: '销售统计',
roles: ['data_sale']
}
}
]
2024-07-15 15:18:47 +08:00
}, {
2024-06-28 17:30:56 +08:00
path: '/log',
component: Layout,
redirect: '/log/index',
alwaysShow: true,
name: 'Log',
meta: {
title: '日志记录',
icon: 'nested',
2024-07-31 16:45:54 +08:00
roles: ['follow_index', 'log_index', 'editor', 'franchisee']
2024-06-28 17:30:56 +08:00
},
children: [
{
path: 'follow',
component: () => import('@/views/log/follow'),
name: 'Follow',
meta: {
title: '跟进记录',
2024-07-31 16:45:54 +08:00
roles: ['follow_index', 'editor', 'franchisee']
2024-06-28 17:30:56 +08:00
}
},
{
path: 'index',
component: () => import('@/views/log/index'),
name: 'LogIndex',
meta: {
title: '日志记录',
roles: ['log_index']
}
}
]
2024-06-24 11:52:30 +08:00
},
2024-07-29 14:00:55 +08:00
{
path: '/announcements',
component: Layout,
redirect: '/announcements/index',
alwaysShow: true,
name: 'announcements',
meta: {
title: '公告管理',
icon: 'el-icon-s-promotion',
2024-07-31 16:45:54 +08:00
roles: ['admin']
2024-07-29 14:00:55 +08:00
},
children: [
{
path: 'list',
component: () => import('@/views/announcements/list'),
name: 'list',
meta: {
title: '公告列表',
2024-07-31 16:45:54 +08:00
roles: ['admin']
2024-07-29 14:00:55 +08:00
}
}
]
},
2024-06-24 11:52:30 +08:00
{
path: '/icon',
component: Layout,
children: [
{
path: 'index',
component: () => import('@/views/icons/index'),
name: 'Icons',
meta: { title: 'Icons', icon: 'icon', noCache: true }
}
]
},
// 404 page must be placed at the end !!!
{ path: '*', redirect: '/404', hidden: true }
]
const createRouter = () => new Router({
// mode: 'history', // require service support
scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes
})
const router = createRouter()
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() {
const newRouter = createRouter()
router.matcher = newRouter.matcher // reset router
}
export default router