653 lines
15 KiB
TypeScript
653 lines
15 KiB
TypeScript
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;
|
||
isPublic?: boolean;
|
||
}
|
||
}
|
||
|
||
/**
|
||
* 定义动态路由
|
||
* 前端添加路由,请在顶级节点的 `children 数组` 里添加
|
||
* @description 未开启 isRequestRoutes 为 true 时使用(前端控制路由),开启时第一个顶级 children 的路由将被替换成接口请求回来的路由数据
|
||
* @description 各字段请查看 `/@/views/system/menu/component/addMenu.vue 下的 ruleForm`
|
||
* @returns 返回路由菜单数据
|
||
*/
|
||
export const dynamicRoutes: Array<RouteRecordRaw> = [
|
||
{
|
||
path: '/',
|
||
name: '/',
|
||
component: () => import('/@/layout/index.vue'),
|
||
redirect: '/personal',
|
||
meta: {
|
||
isKeepAlive: true,
|
||
},
|
||
children: [
|
||
{
|
||
path: '/scoring/cast',
|
||
name: 'scoringCast',
|
||
component: () => import('/@/views/scoring/cast/index.vue'),
|
||
meta: {
|
||
title: '赛事大屏',
|
||
isKeepAlive: true,
|
||
},
|
||
},
|
||
{
|
||
path: '/match',
|
||
name: '/match',
|
||
component: () => import('/@/layout/index.vue'),
|
||
redirect: '/',
|
||
meta: {
|
||
isKeepAlive: true,
|
||
},
|
||
children: [],
|
||
}
|
||
],
|
||
},
|
||
{
|
||
path: '/project',
|
||
name: 'project',
|
||
component: () => import('/@/views/match/project/index.vue'),
|
||
meta: {
|
||
title: '项目管理',
|
||
isLink: '',
|
||
isHide: false,
|
||
isKeepAlive: true,
|
||
isAffix: false,
|
||
isIframe: false,
|
||
roles: ['admin', 'common'],
|
||
icon: 'iconfont icon-shouye',
|
||
},
|
||
},
|
||
{
|
||
path: '/order',
|
||
name: 'order',
|
||
component: () => import('/@/views/match/order/index.vue'),
|
||
meta: {
|
||
title: '订单管理',
|
||
isLink: '',
|
||
isHide: false,
|
||
isKeepAlive: true,
|
||
isAffix: false,
|
||
isIframe: false,
|
||
roles: ['admin', 'common'],
|
||
icon: 'iconfont icon-shouye',
|
||
},
|
||
},
|
||
{
|
||
path: '/merchant',
|
||
name: 'merchant',
|
||
component: () => import('/@/views/match/shop/index.vue'),
|
||
meta: {
|
||
title: '商户管理',
|
||
isLink: '',
|
||
isHide: false,
|
||
isKeepAlive: true,
|
||
isAffix: false,
|
||
isIframe: false,
|
||
roles: ['admin', 'common'],
|
||
icon: 'iconfont icon-shouye',
|
||
},
|
||
},
|
||
{
|
||
path: '/certificate',
|
||
name: 'certificate',
|
||
component: () => import('/@/views/match/book/index.vue'),
|
||
meta: {
|
||
title: '证书管理',
|
||
isLink: '',
|
||
isHide: false,
|
||
isKeepAlive: true,
|
||
isAffix: false,
|
||
isIframe: false,
|
||
roles: ['admin', 'common'],
|
||
icon: 'iconfont icon-shouye',
|
||
},
|
||
},
|
||
{
|
||
path: '/event',
|
||
name: 'event',
|
||
component: () => import('/@/views/match/manage/index.vue'),
|
||
meta: {
|
||
title: '赛事管理',
|
||
isLink: '',
|
||
isHide: false,
|
||
isKeepAlive: true,
|
||
isAffix: false,
|
||
isIframe: false,
|
||
roles: ['admin', 'common'],
|
||
icon: 'iconfont icon-shouye',
|
||
},
|
||
},
|
||
{
|
||
path: '/coupon',
|
||
name: 'coupon',
|
||
component: () => import('/@/views/match/coupon/index.vue'),
|
||
meta: {
|
||
title: '优惠券管理',
|
||
isLink: '',
|
||
isHide: false,
|
||
isKeepAlive: true,
|
||
isAffix: false,
|
||
isIframe: false,
|
||
roles: ['admin', 'common'],
|
||
icon: 'iconfont icon-shouye',
|
||
},
|
||
},
|
||
{
|
||
path: '/user/points',
|
||
name: 'userpoints',
|
||
component: () => import('/@/views/marchant/points/index.vue'),
|
||
meta: {
|
||
title: '积分管理',
|
||
isLink: '',
|
||
isHide: false,
|
||
isKeepAlive: true,
|
||
isAffix: false,
|
||
isIframe: false,
|
||
roles: ['admin', 'common'],
|
||
icon: 'iconfont icon-shouye',
|
||
},
|
||
},
|
||
{
|
||
path: '/personnel',
|
||
name: 'personnel',
|
||
component: () => import('/@/views/match/personnel/index.vue'),
|
||
meta: {
|
||
isKeepAlive: true,
|
||
},
|
||
children: [
|
||
{
|
||
path: '/personnel/coach',
|
||
name: 'coach',
|
||
component: () => import('/@/views/team/trainer/index.vue'),
|
||
meta: {
|
||
title: '教练管理',
|
||
isLink: '',
|
||
isHide: false,
|
||
isKeepAlive: true,
|
||
isAffix: false,
|
||
isIframe: false,
|
||
roles: ['admin', 'common'],
|
||
icon: 'iconfont icon-shouye',
|
||
},
|
||
},
|
||
{
|
||
path: '/personnel/leader',
|
||
name: 'teamLeader',
|
||
component: () => import('/@/views/team/leader/index.vue'),
|
||
meta: {
|
||
title: '领队管理',
|
||
isLink: '',
|
||
isHide: false,
|
||
isKeepAlive: true,
|
||
isAffix: false,
|
||
isIframe: false,
|
||
roles: ['admin', 'common'],
|
||
icon: 'iconfont icon-shouye',
|
||
},
|
||
},
|
||
{
|
||
path: '/personnel/athlete',
|
||
name: 'athlete',
|
||
component: () => import('/@/views/team/athlete/index.vue'),
|
||
meta: {
|
||
title: '运动员管理',
|
||
isLink: '',
|
||
isHide: false,
|
||
isKeepAlive: true,
|
||
isAffix: false,
|
||
isIframe: false,
|
||
roles: ['admin', 'common'],
|
||
icon: 'iconfont icon-shouye',
|
||
},
|
||
},
|
||
]
|
||
},
|
||
{
|
||
path: '/points',
|
||
name: 'points',
|
||
component: () => import('/@/views/points/record/index.vue'),
|
||
meta: {
|
||
isKeepAlive: true,
|
||
},
|
||
children: [
|
||
{
|
||
path: '/points/record',
|
||
name: 'record',
|
||
component: () => import('/@/views/points/record/index.vue'),
|
||
meta: {
|
||
title: '积分记录',
|
||
isLink: '',
|
||
isHide: false,
|
||
isKeepAlive: true,
|
||
isAffix: false,
|
||
isIframe: false,
|
||
roles: ['admin', 'common'],
|
||
icon: 'iconfont icon-shouye',
|
||
},
|
||
},
|
||
{
|
||
path: '/points/config',
|
||
name: 'config',
|
||
component: () => import('/@/views/points/config/index.vue'),
|
||
meta: {
|
||
title: '积分配置',
|
||
isLink: '',
|
||
isHide: false,
|
||
isKeepAlive: true,
|
||
isAffix: false,
|
||
isIframe: false,
|
||
roles: ['admin', 'common'],
|
||
icon: 'iconfont icon-shouye',
|
||
},
|
||
},
|
||
]
|
||
},
|
||
{
|
||
path: '/permission',
|
||
name: 'permission',
|
||
component: () => import('/@/views/permission/account/index.vue'),
|
||
meta: {
|
||
isKeepAlive: true,
|
||
},
|
||
children: [
|
||
{
|
||
path: '/permission/account',
|
||
name: 'account',
|
||
component: () => import('/@/views/permission/account/index.vue'),
|
||
meta: {
|
||
title: '账户管理',
|
||
isLink: '',
|
||
isHide: false,
|
||
isKeepAlive: true,
|
||
isAffix: false,
|
||
isIframe: false,
|
||
roles: ['admin', 'common'],
|
||
icon: 'iconfont icon-shouye',
|
||
},
|
||
},
|
||
{
|
||
path: '/permission/role',
|
||
name: 'role',
|
||
component: () => import('/@/views/permission/role/index.vue'),
|
||
meta: {
|
||
title: '角色管理',
|
||
isLink: '',
|
||
isHide: false,
|
||
isKeepAlive: true,
|
||
isAffix: false,
|
||
isIframe: false,
|
||
roles: ['admin', 'common'],
|
||
icon: 'iconfont icon-shouye',
|
||
},
|
||
},
|
||
]
|
||
},
|
||
{
|
||
path: '/user',
|
||
name: 'user',
|
||
component: () => import('/@/views/match/user/general/index.vue'),
|
||
meta: {
|
||
isKeepAlive: true,
|
||
},
|
||
children: [
|
||
{
|
||
path: '/user/general',
|
||
name: 'usergeneral',
|
||
component: () => import('/@/views/match/user/general/index.vue'),
|
||
meta: {
|
||
title: '用户管理',
|
||
isLink: '',
|
||
isHide: false,
|
||
isKeepAlive: true,
|
||
isAffix: false,
|
||
isIframe: false,
|
||
roles: ['admin', 'common'],
|
||
icon: 'iconfont icon-shouye',
|
||
},
|
||
},
|
||
{
|
||
path: '/user/unit',
|
||
name: 'userunit',
|
||
component: () => import('/@/views/match/user/unit/index.vue'),
|
||
meta: {
|
||
title: '单位用户',
|
||
isLink: '',
|
||
isHide: false,
|
||
isKeepAlive: true,
|
||
isAffix: false,
|
||
isIframe: false,
|
||
roles: ['admin', 'common'],
|
||
icon: 'iconfont icon-shouye',
|
||
},
|
||
},
|
||
]
|
||
},
|
||
{
|
||
path: '/integral',
|
||
name: "integral",
|
||
component: () => import('/@/views/match/points/config/index.vue'),
|
||
meta: {
|
||
isKeepAlive: true,
|
||
},
|
||
children: [
|
||
{
|
||
path: '/integral/config',
|
||
name: 'integralconfig',
|
||
component: () => import('/@/views/match/points/config/index.vue'),
|
||
meta: {
|
||
title: '积分配置',
|
||
isLink: '',
|
||
isHide: false,
|
||
isKeepAlive: true,
|
||
isAffix: false,
|
||
isIframe: false,
|
||
roles: ['admin', 'common'],
|
||
icon: 'iconfont icon-shouye',
|
||
},
|
||
},
|
||
{
|
||
path: '/integral/record',
|
||
name: 'integralrecord',
|
||
component: () => import('/@/views/match/user/unit/index.vue'),
|
||
meta: {
|
||
isKeepAlive: true,
|
||
},
|
||
children:[
|
||
{
|
||
path: '/integral/record/general',
|
||
name: 'integralrecordgeneral',
|
||
component: () => import('/@/views/match/points/general/index.vue'),
|
||
meta: {
|
||
title: '用户积分记录',
|
||
isLink: '',
|
||
isHide: false,
|
||
isKeepAlive: true,
|
||
isAffix: false,
|
||
isIframe: false,
|
||
}
|
||
},
|
||
{
|
||
path: '/integral/record/unit',
|
||
name: 'integralrecordunit',
|
||
component: () => import('/@/views/match/points/unit/index.vue'),
|
||
meta: {
|
||
title: '单位积分记录',
|
||
isLink: '',
|
||
isHide: false,
|
||
isKeepAlive: true,
|
||
isAffix: false,
|
||
isIframe: false,
|
||
}
|
||
}
|
||
]
|
||
},
|
||
]
|
||
},
|
||
//单位认证
|
||
{
|
||
path: '/user/certification',
|
||
name: 'usercertification',
|
||
component: () => import('/@/views/marchant/certification/index.vue'),
|
||
meta: {
|
||
title: '单位认证',
|
||
isLink: '',
|
||
isHide: false,
|
||
isKeepAlive: false,
|
||
isAffix: false,
|
||
isIframe: false,
|
||
roles: ['admin', 'common'],
|
||
icon: 'iconfont icon-shouye',
|
||
},
|
||
},
|
||
//订单管理
|
||
{
|
||
path: '/user/order',
|
||
name: 'userorder',
|
||
component: () => import('/@/views/marchant/order/index.vue'),
|
||
meta: {
|
||
title: '订单管理',
|
||
isLink: '',
|
||
isHide: false,
|
||
isKeepAlive: false,
|
||
isAffix: false,
|
||
isIframe: false,
|
||
roles: ['admin', 'common'],
|
||
icon: 'iconfont icon-shouye',
|
||
},
|
||
},
|
||
{
|
||
path: '/banner',
|
||
name: 'banner',
|
||
component: () => import('/@/views/match/banner/index.vue'),
|
||
meta: {
|
||
title: '轮播图管理',
|
||
isLink: '',
|
||
isHide: false,
|
||
isKeepAlive: false,
|
||
isAffix: false,
|
||
isIframe: false,
|
||
roles: ['admin', 'common'],
|
||
icon: 'iconfont icon-shouye',
|
||
},
|
||
},
|
||
{
|
||
path: '/refund',
|
||
name: 'refund',
|
||
component: () => import('/@/views/match/refund/index.vue'),
|
||
meta: {
|
||
title: '退款配置',
|
||
isLink: '',
|
||
isHide: false,
|
||
isKeepAlive: false,
|
||
isAffix: false,
|
||
isIframe: false,
|
||
roles: ['admin', 'common'],
|
||
icon: 'iconfont icon-shouye',
|
||
},
|
||
},
|
||
//人员管理
|
||
{
|
||
path: '/user/personnel',
|
||
name: 'userpersonnel',
|
||
component: () => import('/@/views/team/trainer/index.vue'),
|
||
meta: {
|
||
isKeepAlive: true,
|
||
},
|
||
children: [
|
||
{
|
||
path: '/user/personnel/coach',
|
||
name: 'userpersonnelcoach',
|
||
component: () => import('/@/views/team/trainer/index.vue'),
|
||
meta: {
|
||
title: '教练管理',
|
||
isLink: '',
|
||
isHide: false,
|
||
isKeepAlive: true,
|
||
isAffix: false,
|
||
isIframe: false,
|
||
roles: ['admin', 'common'],
|
||
icon: 'iconfont icon-shouye',
|
||
},
|
||
},
|
||
{
|
||
path: '/user/personnel/leader',
|
||
name: 'userpersonnelleader',
|
||
component: () => import('/@/views/team/leader/index.vue'),
|
||
meta: {
|
||
title: '领队管理',
|
||
isLink: '',
|
||
isHide: false,
|
||
isKeepAlive: true,
|
||
isAffix: false,
|
||
isIframe: false,
|
||
roles: ['admin', 'common'],
|
||
icon: 'iconfont icon-shouye',
|
||
},
|
||
},
|
||
{
|
||
path: '/user/personnel/team',
|
||
name: 'userpersonnelteam',
|
||
component: () => import('/@/views/team/athlete/index.vue'),
|
||
meta: {
|
||
title: '运动员管理',
|
||
isLink: '',
|
||
isHide: false,
|
||
isKeepAlive: true,
|
||
isAffix: false,
|
||
isIframe: false,
|
||
roles: ['admin', 'common'],
|
||
icon: 'iconfont icon-shouye',
|
||
},
|
||
},
|
||
]
|
||
},
|
||
//人员管理
|
||
{
|
||
path: '/user/event',
|
||
name: 'userevent',
|
||
component: () => import('/@/views/user/registration/index.vue'),
|
||
meta: {
|
||
isKeepAlive: true,
|
||
},
|
||
children: [
|
||
{
|
||
path: '/user/event/registration',
|
||
name: 'usereventregistration',
|
||
component: () => import('/@/views/user/registration/index.vue'),
|
||
meta: {
|
||
title: '赛事报名',
|
||
isLink: '',
|
||
isHide: false,
|
||
isKeepAlive: true,
|
||
isAffix: false,
|
||
isIframe: false,
|
||
roles: ['admin', 'common'],
|
||
icon: 'iconfont icon-shouye',
|
||
},
|
||
},
|
||
{
|
||
path: '/user/event/record',
|
||
name: 'usereventrecord',
|
||
component: () => import('/@/views/user/record/index.vue'),
|
||
meta: {
|
||
title: '参赛记录',
|
||
isLink: '',
|
||
isHide: false,
|
||
isKeepAlive: true,
|
||
isAffix: false,
|
||
isIframe: false,
|
||
roles: ['admin', 'common'],
|
||
icon: 'iconfont icon-shouye',
|
||
},
|
||
},
|
||
]
|
||
},
|
||
];
|
||
|
||
/**
|
||
* 定义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: '登录',
|
||
},
|
||
},
|
||
{
|
||
path: '/scoring/screen',
|
||
name: 'scoringScreen',
|
||
component: () => import('/@/views/scoring/cast/index.vue'),
|
||
meta: {
|
||
title: '成绩大屏',
|
||
isPublic: true,
|
||
},
|
||
},
|
||
{
|
||
path: '/scoring/checkin-screen',
|
||
name: 'scoringCheckinScreen',
|
||
redirect: (to) => ({ path: '/scoring/screen', query: { ...to.query, castMode: 'checkin' } }),
|
||
meta: {
|
||
title: '检录进度大屏',
|
||
isPublic: true,
|
||
},
|
||
},
|
||
/**
|
||
* 提示:写在这里的为全屏界面,不建议写在这里
|
||
* 请写在 `dynamicRoutes` 路由数组中
|
||
*/
|
||
// {
|
||
// path: '/visualizingDemo1',
|
||
// name: 'visualizingDemo1',
|
||
// component: () => import('/@/views/visualizing/demo1.vue'),
|
||
// meta: {
|
||
// title: 'message.router.visualizingLinkDemo1',
|
||
// },
|
||
// },
|
||
// {
|
||
// path: '/visualizingDemo2',
|
||
// name: 'visualizingDemo2',
|
||
// component: () => import('/@/views/visualizing/demo2.vue'),
|
||
// meta: {
|
||
// title: 'message.router.visualizingLinkDemo2',
|
||
// },
|
||
// },
|
||
];
|