index.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524
  1. import Vue from 'vue'
  2. import VueRouter from 'vue-router'
  3. /* Layout */
  4. import performanceRouter from '@/router/performanceRouter'
  5. import okrRouter from '@/router/okrRouter'
  6. import examineRouter from '@/router/examineRouter'
  7. import courseRouter from '@/router/course'
  8. /* 角色*/
  9. /*
  10. 创始人 creator
  11. 公司管理员 admin
  12. 积分专员 point_manager
  13. 部门管理员 dept_manager
  14. 员工 employee
  15. */
  16. //解决重复点击导航栏报错问题
  17. const originalPush = VueRouter.prototype.push
  18. VueRouter.prototype.push = function push(location) {
  19. return originalPush.call(this, location).catch(err => err)
  20. }
  21. Vue.use(VueRouter)
  22. const constantRouterMap = [
  23. {
  24. path: '/',
  25. name: '初始页',
  26. component: () => import( /* webpackChunkName: "index" */ '@/index'),
  27. redirect: "index",
  28. children: [
  29. {
  30. path: '/index',
  31. name: '首页',
  32. component: () => import( /* webpackChunkName: "home" */ '@/home'),
  33. },
  34. {
  35. path: '/pointIndex',
  36. name: 'pointIndex',
  37. label: '积分初始化',
  38. component: () => import( /* webpackChunkName: "index" */ '@/point/views/pointIndex'),
  39. children: [
  40. {
  41. path: '/pointHome',
  42. name: '积分首页',
  43. component: () => import( /* webpackChunkName: "home" */ '@/point/views/pointHome'),
  44. meta: {
  45. groupCode: 'home'
  46. }
  47. },
  48. {
  49. path: '/jfRule',
  50. name: '积分规则',
  51. component: () => import( /* webpackChunkName: "jfRule" */ '@/point/views/setting/jfRule'),
  52. meta: {
  53. groupCode: 'basics',
  54. jurisdiction: ['creator', 'admin', 'point_manager']
  55. }
  56. },
  57. {
  58. path: '/set_role',
  59. name: '角色权限',
  60. component: () => import( /* webpackChunkName: "set_role" */ '@/point/views/setting/set_role'),
  61. meta: {
  62. groupCode: 'basics',
  63. jurisdiction: ['creator', 'admin', 'point_manager']
  64. }
  65. },
  66. {
  67. path: '/set_basics',
  68. name: '个性化设置',
  69. component: () => import( /* webpackChunkName: "set_basics" */ '@/point/views/setting/set_basics'),
  70. meta: {
  71. groupCode: 'basics',
  72. jurisdiction: ['creator', 'admin', 'point_manager']
  73. }
  74. },
  75. {
  76. path: '/screenSet',
  77. name: '数据大屏',
  78. component: () => import( /* webpackChunkName: "screenSet" */ '@/point/views/setting/screenSet'),
  79. meta: {
  80. groupCode: 'basics',
  81. jurisdiction: ['creator', 'admin', 'point_manager']
  82. }
  83. },
  84. {
  85. path: '/teamPk',
  86. name: '团队PK',
  87. component: () => import('@/point/views/setting/pk'),
  88. meta: {
  89. groupCode: 'basics',
  90. jurisdiction: ['creator', 'admin', 'point_manager']
  91. }
  92. },
  93. // {
  94. // path: '/company_info',
  95. // name: '公司信息',
  96. // component: () => import( /* webpackChunkName: "company_info" */ '@/point/views/setting/company_info'),
  97. // meta: {
  98. // groupCode: 'basics',
  99. // jurisdiction: ['creator', 'admin', 'point_manager']
  100. // }
  101. // },
  102. // 积分管理
  103. {
  104. path: '/award_punish',
  105. name: '奖扣积分',
  106. component: () => import( /* webpackChunkName: "award_punish" */ '@/point/views/workbench/grade/award_punish'),
  107. meta: {
  108. groupCode: 'integral',
  109. jurisdiction: ['creator', 'admin', 'point_manager', 'dept_manager']
  110. }
  111. },
  112. {
  113. path: '/apply_list',
  114. name: '申请积分',
  115. component: () => import( /* webpackChunkName: "apply_list" */ '@/point/views/workbench/grade/apply_list'),
  116. meta: {
  117. groupCode: 'integral',
  118. jurisdiction: ['admin', 'point_manager', 'dept_manager', 'employee']
  119. }
  120. },
  121. {
  122. path: '/approval_list',
  123. name: '审批积分',
  124. component: () => import( /* webpackChunkName: "approval_list" */ '@/point/views/workbench/approval_list'),
  125. meta: {
  126. groupCode: 'integral',
  127. jurisdiction: ['creator', 'admin', 'point_manager', 'dept_manager']
  128. }
  129. },
  130. {
  131. path: '/integral_event',
  132. name: '积分事件',
  133. component: () => import( /* webpackChunkName: "integral_event" */ '@/point/views/statistics/integral_event'),
  134. meta: {
  135. groupCode: 'integral'
  136. }
  137. },
  138. {
  139. path: '/integral_event_two',
  140. name: '积分事件详情',
  141. component: () => import( /* webpackChunkName: "integral_event_two" */ '@/point/views/statistics/integral_event_two'),
  142. hidden: true,
  143. meta: {
  144. groupCode: 'integral'
  145. }
  146. },
  147. {
  148. path: '/manager_statistics',
  149. name: '奖扣目标',
  150. component: () => import( /* webpackChunkName: "manager_statistics" */'@/point/views/statistics/manager_statistics'),
  151. meta: {
  152. groupCode: 'integral',
  153. jurisdiction: ['creator', 'admin', 'point_manager', 'dept_manager']
  154. }
  155. },
  156. // 任务管理
  157. {
  158. path: '/my_issue',
  159. name: '发布任务',
  160. component: () => import( /* webpackChunkName: "my_issue" */ '@/point/views/workbench/task/my_issue'),
  161. meta: {
  162. groupCode: 'task',
  163. jurisdiction: ['creator', 'admin', 'point_manager', 'dept_manager']
  164. }
  165. },
  166. {
  167. path: '/get_task',
  168. name: '领任务',
  169. component: () => import( /* webpackChunkName: "get_task" */ '@/point/views/workbench/task/get_task'),
  170. meta: {
  171. groupCode: 'task'
  172. }
  173. },
  174. {
  175. path: '/my_task',
  176. name: '我负责的',
  177. component: () => import( /* webpackChunkName: "individual_statistics" */ '@/point/views/workbench/task/my_task'),
  178. meta: {
  179. groupCode: 'task',
  180. jurisdiction: ['admin', 'point_manager', 'dept_manager', 'employee']
  181. }
  182. },
  183. {
  184. path: '/myExamine',
  185. name: '我审批的',
  186. component: () => import( /* webpackChunkName: "myExamine" */ '@/point/views/workbench/task/myExamine'),
  187. meta: {
  188. groupCode: 'task',
  189. jurisdiction: ['creator', 'admin', 'point_manager', 'dept_manager']
  190. }
  191. },
  192. {
  193. path: '/allTask',
  194. name: '全部任务',
  195. component: () => import( /* webpackChunkName: "allTask" */ '@/point/views/workbench/task/allTask'),
  196. meta: {
  197. groupCode: 'task',
  198. jurisdiction: ['creator', 'admin', 'point_manager', 'dept_manager']
  199. }
  200. },
  201. // 考勤管理
  202. {
  203. path: '/attendanceSet',
  204. name: '考勤设置',
  205. component: () => import('@/point/views/attendance/attendanceSet'),
  206. meta: {
  207. groupCode: 'attendance',
  208. jurisdiction: ['creator', 'admin', 'point_manager']
  209. }
  210. },
  211. // {
  212. // path: '/attendance_classnew',
  213. // name: '班次管理',
  214. // component: () => import('@/point/views/attendance/attendance_classnew'),
  215. // meta: {
  216. // groupCode: 'attendance',
  217. // jurisdiction: ['creator', 'admin', 'point_manager']
  218. // }
  219. // },
  220. // {
  221. // path: '/attendance_overtime_rulenew',
  222. // name: '加班规则',
  223. // component: () => import('@/point/views/attendance/attendance_overtime_rulenew'),
  224. // meta: {
  225. // groupCode: 'attendance',
  226. // jurisdiction: ['creator', 'admin', 'point_manager']
  227. // }
  228. // },
  229. // {
  230. // path: '/attendance_groupnew',
  231. // name: '考勤组',
  232. // component: () => import('@/point/views/attendance/attendance_groupnew'),
  233. // meta: {
  234. // groupCode: 'attendance',
  235. // jurisdiction: ['creator', 'admin', 'point_manager']
  236. // }
  237. // },
  238. // {
  239. // path: '/attendance_machinenew',
  240. // name: '考勤机',
  241. // component: () => import('@/point/views/attendance/attendance_machinenew'),
  242. // meta: {
  243. // groupCode: 'attendance',
  244. // jurisdiction: ['creator', 'admin', 'point_manager']
  245. // }
  246. // },
  247. {
  248. path: '/attendance_reviewnew',
  249. name: '考勤审批',
  250. component: () => import('@/point/views/attendance/attendance_reviewnew'),
  251. meta: {
  252. groupCode: 'attendance',
  253. jurisdiction: ['creator', 'admin', 'point_manager']
  254. }
  255. },
  256. {
  257. path: '/attendanceStatistics',
  258. name: '考勤统计',
  259. component: () => import('@/point/views/attendance/attendanceStatistics'),
  260. meta: {
  261. groupCode: 'attendance',
  262. jurisdiction: ['creator', 'admin', 'point_manager']
  263. }
  264. },
  265. // {
  266. // path: '/attendance_datanew',
  267. // name: '日打卡明细',
  268. // component: () => import('@/point/views/attendance/attendance_datanew'),
  269. // meta: {
  270. // groupCode: 'attendance',
  271. // jurisdiction: ['creator', 'admin', 'point_manager']
  272. // }
  273. // },
  274. // {
  275. // path: '/attendance_statisticnew',
  276. // name: '月报表',
  277. // component: () => import('@/point/views/attendance/attendance_statisticnew'),
  278. // meta: {
  279. // groupCode: 'attendance',
  280. // jurisdiction: ['creator', 'admin', 'point_manager']
  281. // }
  282. // },
  283. // {
  284. // path: '/attendance_rating',
  285. // name: '考勤分排名',
  286. // component: () => import('@/point/views/attendance/attendance_rating'),
  287. // meta: {
  288. // groupCode: 'attendance',
  289. // jurisdiction: ['creator', 'admin', 'point_manager']
  290. // }
  291. // },
  292. // {
  293. // path: '/attendance_integral_event',
  294. // name: '考勤积分事件',
  295. // component: () => import('@/point/views/attendance/attendance_integral_event'),
  296. // meta: {
  297. // groupCode: 'attendance',
  298. // jurisdiction: ['creator', 'admin', 'point_manager']
  299. // }
  300. // },
  301. {
  302. path: '/attendance_hioldaynew',
  303. name: '假期管理',
  304. component: () => import('@/point/views/attendance/attendance_hiolday'),
  305. meta: {
  306. groupCode: 'attendance',
  307. jurisdiction: ['creator', 'admin', 'point_manager']
  308. }
  309. },
  310. // 数据统计
  311. {
  312. path: '/dept_rank',
  313. name: '阶段排名',
  314. component: () => import('@/point/views/statistics/dept_rank'),
  315. meta: {
  316. groupCode: 'statistics'
  317. }
  318. },
  319. {
  320. path: '/total_rank',
  321. name: '累计B分排名',
  322. component: () => import('@/point/views/statistics/total_rank'),
  323. meta: {
  324. groupCode: 'statistics'
  325. }
  326. },
  327. {
  328. path: '/custom_rank',
  329. name: '自定义B分排名',
  330. component: () => import('@/point/views/statistics/custom_rank'),
  331. meta: {
  332. groupCode: 'statistics'
  333. }
  334. },
  335. {
  336. path: '/department_statistics',
  337. name: '部门统计',
  338. component: () => import('@/point/views/statistics/department_statistics'),
  339. meta: {
  340. groupCode: 'statistics',
  341. jurisdiction: ['creator', 'admin', 'point_manager', 'dept_manager']
  342. }
  343. },
  344. {
  345. path: '/individual_statistics',
  346. name: '个人统计',
  347. component: () => import('@/point/views/statistics/individual_statistics'),
  348. meta: {
  349. groupCode: 'statistics'
  350. }
  351. },
  352. {
  353. path: '/lotteryTicket_statistics',
  354. name: '奖票统计',
  355. component: () => import('@/point/views/statistics/lotteryTicket_statistics'),
  356. meta: {
  357. groupCode: 'statistics',
  358. jurisdiction: ['creator', 'admin', 'point_manager', 'dept_manager']
  359. }
  360. },
  361. {
  362. path: '/integral_statistics',
  363. name: 'A&B分统计',
  364. component: () => import('@/point/views/statistics/integral_statistics'),
  365. meta: {
  366. groupCode: 'statistics',
  367. jurisdiction: ['creator', 'admin', 'point_manager', 'dept_manager']
  368. }
  369. },
  370. // A分
  371. {
  372. path: '/balanceA',
  373. name: 'A分余额',
  374. component: () => import('@/point/views/statistics/balanceA'),
  375. meta: {
  376. groupCode: 'statistics',
  377. jurisdiction: ['creator', 'admin', 'point_manager']
  378. }
  379. },
  380. ]
  381. },
  382. {
  383. path: '/update_notice',
  384. name: '公告列表',
  385. component: () => import( /* webpackChunkName: "update_notice" */ '@/views/update_notice'),
  386. },
  387. {
  388. path: '/inform',
  389. name: '公告',
  390. component: () => import( /* webpackChunkName: "inform" */ '@/views/inform'),
  391. },
  392. {
  393. path: '/organization',
  394. name: '组织',
  395. component: () => import( /* webpackChunkName: "organization" */ '@/views/organization'),
  396. },
  397. {
  398. path: '/new_employee',
  399. name: '新成员列表',
  400. component: () => import('@/views/new_employee'),
  401. },
  402. {
  403. path: '/system',
  404. name: '设置',
  405. component: () => import( /* webpackChunkName: "system" */ '@/views/system'),
  406. },
  407. ]
  408. },
  409. {
  410. path: '/course',
  411. component: () => import('@/course/index'),
  412. children: []
  413. },
  414. {
  415. path: '/courseLogin',
  416. name: 'courseLogin',
  417. component: () => import('@/course/user/login'),
  418. label: '课程营销登录',
  419. meta: {},
  420. beforeEnter: (to, from, next) => {
  421. // 判断是否需要鉴定一下权限
  422. if (localStorage.getItem('Course-Token')&&localStorage.getItem('Course-Id')) {
  423. next('/course')
  424. } else {
  425. next()
  426. }
  427. }
  428. },
  429. {
  430. path: '/login',
  431. name: 'login',
  432. component: () => import('@/views/login'),
  433. },
  434. {
  435. path: '/tySelect',
  436. name: 'tySelect',
  437. component: () => import('@/views/tySelect'),
  438. },
  439. {
  440. path: '/screen',
  441. name: 'screen',
  442. component: () => import('@/views/screen'),
  443. },
  444. {
  445. path: '/weixin',
  446. name: 'weixin', component: () => import('@/views/weixin'),
  447. },
  448. {
  449. path: '/reg',
  450. name: 'reg',
  451. component: () => import('@/views/reg'),
  452. },
  453. {
  454. path: '/forgetPwd',
  455. name: 'forgetPwd',
  456. component: () => import('@/views/forgetPwd'),
  457. },
  458. {
  459. path: '/bindingPhone',
  460. name: 'bindingPhone',
  461. component: () => import('@/views/bindingPhone'),
  462. },
  463. {
  464. path: '/resetPwd',
  465. name: 'resetPwd',
  466. component: () => import('@/views/resetPwd'),
  467. },
  468. {
  469. path: '/deptRankSwiper',
  470. name: 'deptRankSwiper',
  471. component: () => import('@/views/deptRankSwiper'),
  472. },
  473. {
  474. path: '/android',
  475. name: 'android',
  476. component: () => import('@/views/android_and_ios'),
  477. },
  478. {
  479. path: '/authredirect',
  480. component: () => import('@/views/authredirect'),
  481. },
  482. {
  483. path: '/demo',
  484. component: () => import('@/views/demo'),
  485. },
  486. {
  487. path: '/404',
  488. component: () => import('@/views/404'),
  489. },
  490. {
  491. path: '/401',
  492. component: () => import('@/views/401'),
  493. },
  494. {
  495. path: '*',
  496. redirect: '/login'
  497. },
  498. ]
  499. constantRouterMap[0].children.push(...performanceRouter, ...okrRouter, ...examineRouter);
  500. constantRouterMap[1].children.push(...courseRouter);
  501. export default new VueRouter({
  502. // mode: 'history',
  503. routes: constantRouterMap,
  504. })