index.js 16 KB

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