123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515 |
- import Vue from 'vue'
- import VueRouter from 'vue-router'
- /* Layout */
- import performanceRouter from '@/router/performanceRouter'
- import okrRouter from '@/router/okrRouter'
- import examineRouter from '@/router/examineRouter'
- import courseRouter from '@/router/course'
- /* 角色*/
- /*
- 创始人 creator
- 公司管理员 admin
- 积分专员 point_manager
- 部门管理员 dept_manager
- 员工 employee
- */
- //解决重复点击导航栏报错问题
- const originalPush = VueRouter.prototype.push
- VueRouter.prototype.push = function push(location) {
- return originalPush.call(this, location).catch(err => err)
- }
- Vue.use(VueRouter)
- const constantRouterMap = [
- {
- path: '/',
- name: '初始页',
- component: () => import( /* webpackChunkName: "index" */ '@/index'),
- redirect: "index",
- children: [
- {
- path: '/index',
- name: '首页',
- component: () => import( /* webpackChunkName: "home" */ '@/home'),
- },
- {
- path: '/pointIndex',
- name: 'pointIndex',
- label: '积分初始化',
- component: () => import( /* webpackChunkName: "index" */ '@/point/views/pointIndex'),
- children: [
- {
- path: '/pointHome',
- name: '积分首页',
- component: () => import( /* webpackChunkName: "home" */ '@/point/views/pointHome'),
- meta: {
- groupCode: 'home'
- }
- },
- {
- path: '/jfRule',
- name: '积分规则',
- component: () => import( /* webpackChunkName: "jfRule" */ '@/point/views/setting/jfRule'),
- meta: {
- groupCode: 'basics',
- jurisdiction: ['creator', 'admin', 'point_manager']
- }
- },
- {
- path: '/set_role',
- name: '角色权限',
- component: () => import( /* webpackChunkName: "set_role" */ '@/point/views/setting/set_role'),
- meta: {
- groupCode: 'basics',
- jurisdiction: ['creator', 'admin', 'point_manager']
- }
- },
- {
- path: '/set_basics',
- name: '个性化设置',
- component: () => import( /* webpackChunkName: "set_basics" */ '@/point/views/setting/set_basics'),
- meta: {
- groupCode: 'basics',
- jurisdiction: ['creator', 'admin', 'point_manager']
- }
- },
- {
- path: '/screenSet',
- name: '数据大屏',
- component: () => import( /* webpackChunkName: "screenSet" */ '@/point/views/setting/screenSet'),
- meta: {
- groupCode: 'basics',
- jurisdiction: ['creator', 'admin', 'point_manager']
- }
- },
- // {
- // path: '/company_info',
- // name: '公司信息',
- // component: () => import( /* webpackChunkName: "company_info" */ '@/point/views/setting/company_info'),
- // meta: {
- // groupCode: 'basics',
- // jurisdiction: ['creator', 'admin', 'point_manager']
- // }
- // },
- // 积分管理
- {
- path: '/award_punish',
- name: '奖扣积分',
- component: () => import( /* webpackChunkName: "award_punish" */ '@/point/views/workbench/grade/award_punish'),
- meta: {
- groupCode: 'integral',
- jurisdiction: ['creator', 'admin', 'point_manager', 'dept_manager']
- }
- },
- {
- path: '/apply_list',
- name: '申请积分',
- component: () => import( /* webpackChunkName: "apply_list" */ '@/point/views/workbench/grade/apply_list'),
- meta: {
- groupCode: 'integral',
- jurisdiction: ['admin', 'point_manager', 'dept_manager', 'employee']
- }
- },
- {
- path: '/approval_list',
- name: '审批积分',
- component: () => import( /* webpackChunkName: "approval_list" */ '@/point/views/workbench/approval_list'),
- meta: {
- groupCode: 'integral',
- jurisdiction: ['creator', 'admin', 'point_manager', 'dept_manager']
- }
- },
- {
- path: '/integral_event',
- name: '积分事件',
- component: () => import( /* webpackChunkName: "integral_event" */ '@/point/views/statistics/integral_event'),
- meta: {
- groupCode: 'integral'
- }
- },
- {
- path: '/integral_event_two',
- name: '积分事件详情',
- component: () => import( /* webpackChunkName: "integral_event_two" */ '@/point/views/statistics/integral_event_two'),
- hidden: true,
- meta: {
- groupCode: 'integral'
- }
- },
- {
- path: '/manager_statistics',
- name: '奖扣目标',
- component: () => import( /* webpackChunkName: "manager_statistics" */'@/point/views/statistics/manager_statistics'),
- meta: {
- groupCode: 'integral',
- jurisdiction: ['creator', 'admin', 'point_manager', 'dept_manager']
- }
- },
- // 任务管理
- {
- path: '/my_issue',
- name: '发布任务',
- component: () => import( /* webpackChunkName: "my_issue" */ '@/point/views/workbench/task/my_issue'),
- meta: {
- groupCode: 'task',
- jurisdiction: ['creator', 'admin', 'point_manager', 'dept_manager']
- }
- },
- {
- path: '/get_task',
- name: '领任务',
- component: () => import( /* webpackChunkName: "get_task" */ '@/point/views/workbench/task/get_task'),
- meta: {
- groupCode: 'task'
- }
- },
- {
- path: '/my_task',
- name: '我负责的',
- component: () => import( /* webpackChunkName: "individual_statistics" */ '@/point/views/workbench/task/my_task'),
- meta: {
- groupCode: 'task',
- jurisdiction: ['admin', 'point_manager', 'dept_manager', 'employee']
- }
- },
- {
- path: '/myExamine',
- name: '我审批的',
- component: () => import( /* webpackChunkName: "myExamine" */ '@/point/views/workbench/task/myExamine'),
- meta: {
- groupCode: 'task',
- jurisdiction: ['creator', 'admin', 'point_manager', 'dept_manager']
- }
- },
- {
- path: '/allTask',
- name: '全部任务',
- component: () => import( /* webpackChunkName: "allTask" */ '@/point/views/workbench/task/allTask'),
- meta: {
- groupCode: 'task',
- jurisdiction: ['creator', 'admin', 'point_manager', 'dept_manager']
- }
- },
- // 考勤管理
- {
- path: '/attendanceSet',
- name: '考勤设置',
- component: () => import('@/point/views/attendance/attendanceSet'),
- meta: {
- groupCode: 'attendance',
- jurisdiction: ['creator', 'admin', 'point_manager']
- }
- },
- // {
- // path: '/attendance_classnew',
- // name: '班次管理',
- // component: () => import('@/point/views/attendance/attendance_classnew'),
- // meta: {
- // groupCode: 'attendance',
- // jurisdiction: ['creator', 'admin', 'point_manager']
- // }
- // },
- // {
- // path: '/attendance_overtime_rulenew',
- // name: '加班规则',
- // component: () => import('@/point/views/attendance/attendance_overtime_rulenew'),
- // meta: {
- // groupCode: 'attendance',
- // jurisdiction: ['creator', 'admin', 'point_manager']
- // }
- // },
- // {
- // path: '/attendance_groupnew',
- // name: '考勤组',
- // component: () => import('@/point/views/attendance/attendance_groupnew'),
- // meta: {
- // groupCode: 'attendance',
- // jurisdiction: ['creator', 'admin', 'point_manager']
- // }
- // },
- // {
- // path: '/attendance_machinenew',
- // name: '考勤机',
- // component: () => import('@/point/views/attendance/attendance_machinenew'),
- // meta: {
- // groupCode: 'attendance',
- // jurisdiction: ['creator', 'admin', 'point_manager']
- // }
- // },
- {
- path: '/attendance_reviewnew',
- name: '考勤审批',
- component: () => import('@/point/views/attendance/attendance_reviewnew'),
- meta: {
- groupCode: 'attendance',
- jurisdiction: ['creator', 'admin', 'point_manager']
- }
- },
- {
- path: '/attendanceStatistics',
- name: '考勤统计',
- component: () => import('@/point/views/attendance/attendanceStatistics'),
- meta: {
- groupCode: 'attendance',
- jurisdiction: ['creator', 'admin', 'point_manager']
- }
- },
- // {
- // path: '/attendance_datanew',
- // name: '日打卡明细',
- // component: () => import('@/point/views/attendance/attendance_datanew'),
- // meta: {
- // groupCode: 'attendance',
- // jurisdiction: ['creator', 'admin', 'point_manager']
- // }
- // },
- // {
- // path: '/attendance_statisticnew',
- // name: '月报表',
- // component: () => import('@/point/views/attendance/attendance_statisticnew'),
- // meta: {
- // groupCode: 'attendance',
- // jurisdiction: ['creator', 'admin', 'point_manager']
- // }
- // },
- // {
- // path: '/attendance_rating',
- // name: '考勤分排名',
- // component: () => import('@/point/views/attendance/attendance_rating'),
- // meta: {
- // groupCode: 'attendance',
- // jurisdiction: ['creator', 'admin', 'point_manager']
- // }
- // },
- // {
- // path: '/attendance_integral_event',
- // name: '考勤积分事件',
- // component: () => import('@/point/views/attendance/attendance_integral_event'),
- // meta: {
- // groupCode: 'attendance',
- // jurisdiction: ['creator', 'admin', 'point_manager']
- // }
- // },
- {
- path: '/attendance_hioldaynew',
- name: '假期管理',
- component: () => import('@/point/views/attendance/attendance_hiolday'),
- meta: {
- groupCode: 'attendance',
- jurisdiction: ['creator', 'admin', 'point_manager']
- }
- },
- // 数据统计
- {
- path: '/dept_rank',
- name: '阶段排名',
- component: () => import('@/point/views/statistics/dept_rank'),
- meta: {
- groupCode: 'statistics'
- }
- },
- {
- path: '/total_rank',
- name: '累计B分排名',
- component: () => import('@/point/views/statistics/total_rank'),
- meta: {
- groupCode: 'statistics'
- }
- },
- {
- path: '/custom_rank',
- name: '自定义B分排名',
- component: () => import('@/point/views/statistics/custom_rank'),
- meta: {
- groupCode: 'statistics'
- }
- },
- {
- path: '/department_statistics',
- name: '部门统计',
- component: () => import('@/point/views/statistics/department_statistics'),
- meta: {
- groupCode: 'statistics',
- jurisdiction: ['creator', 'admin', 'point_manager', 'dept_manager']
- }
- },
- {
- path: '/individual_statistics',
- name: '个人统计',
- component: () => import('@/point/views/statistics/individual_statistics'),
- meta: {
- groupCode: 'statistics'
- }
- },
- {
- path: '/lotteryTicket_statistics',
- name: '奖票统计',
- component: () => import('@/point/views/statistics/lotteryTicket_statistics'),
- meta: {
- groupCode: 'statistics',
- jurisdiction: ['creator', 'admin', 'point_manager', 'dept_manager']
- }
- },
- {
- path: '/integral_statistics',
- name: 'A&B分统计',
- component: () => import('@/point/views/statistics/integral_statistics'),
- meta: {
- groupCode: 'statistics',
- jurisdiction: ['creator', 'admin', 'point_manager', 'dept_manager']
- }
- },
- // A分
- {
- path: '/balanceA',
- name: 'A分余额',
- component: () => import('@/point/views/statistics/balanceA'),
- meta: {
- groupCode: 'statistics',
- jurisdiction: ['creator', 'admin', 'point_manager']
- }
- },
- ]
- },
- {
- path: '/update_notice',
- name: '公告列表',
- component: () => import( /* webpackChunkName: "update_notice" */ '@/views/update_notice'),
- },
- {
- path: '/inform',
- name: '公告',
- component: () => import( /* webpackChunkName: "inform" */ '@/views/inform'),
- },
- {
- path: '/organization',
- name: '组织',
- component: () => import( /* webpackChunkName: "organization" */ '@/views/organization'),
- },
- {
- path: '/new_employee',
- name: '新成员列表',
- component: () => import('@/views/new_employee'),
- },
- {
- path: '/system',
- name: '设置',
- component: () => import( /* webpackChunkName: "system" */ '@/views/system'),
- },
- ]
- },
- {
- path: '/course',
- component: () => import('@/course/index'),
- children: []
- },
- {
- path: '/courseLogin',
- name: 'courseLogin',
- component: () => import('@/course/user/login'),
- label: '课程营销登录',
- meta: {},
- beforeEnter: (to, from, next) => {
- // 判断是否需要鉴定一下权限
- if (localStorage.getItem('Course-Token')&&localStorage.getItem('Course-Id')) {
- next('/course')
- } else {
- next()
- }
- }
- },
- {
- path: '/login',
- name: 'login',
- component: () => import('@/views/login'),
- },
- {
- path: '/tySelect',
- name: 'tySelect',
- component: () => import('@/views/tySelect'),
- },
- {
- path: '/screen',
- name: 'screen',
- component: () => import('@/views/screen'),
- },
- {
- path: '/weixin',
- name: 'weixin', component: () => import('@/views/weixin'),
- },
- {
- path: '/reg',
- name: 'reg',
- component: () => import('@/views/reg'),
- },
- {
- path: '/forgetPwd',
- name: 'forgetPwd',
- component: () => import('@/views/forgetPwd'),
- },
- {
- path: '/bindingPhone',
- name: 'bindingPhone',
- component: () => import('@/views/bindingPhone'),
- },
- {
- path: '/resetPwd',
- name: 'resetPwd',
- component: () => import('@/views/resetPwd'),
- },
- {
- path: '/deptRankSwiper',
- name: 'deptRankSwiper',
- component: () => import('@/views/deptRankSwiper'),
- },
- {
- path: '/android',
- name: 'android',
- component: () => import('@/views/android_and_ios'),
- },
- {
- path: '/authredirect',
- component: () => import('@/views/authredirect'),
- },
- {
- path: '/demo',
- component: () => import('@/views/demo'),
- },
- {
- path: '/404',
- component: () => import('@/views/404'),
- },
- {
- path: '/401',
- component: () => import('@/views/401'),
- },
- {
- path: '*',
- redirect: '/login'
- },
- ]
- constantRouterMap[0].children.push(...performanceRouter, ...okrRouter, ...examineRouter);
- constantRouterMap[1].children.push(...courseRouter);
- export default new VueRouter({
- // mode: 'history',
- routes: constantRouterMap,
- })
|