index.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. import Vue from 'vue'
  2. import Router from 'vue-router'
  3. const _import = require('./_import_' + process.env.NODE_ENV)
  4. // in development-env not use lazy-loading, because lazy-loading too many pages will cause webpack hot update too slow. so only in production use lazy-loading;
  5. // detail: https://panjiachen.github.io/vue-element-admin-site/#/lazy-loading
  6. Vue.use(Router)
  7. /* Layout */
  8. import Layout from '../views/layout/Layout'
  9. /** note: submenu only apppear when children.length>=1
  10. * detail see https://panjiachen.github.io/vue-element-admin-site/#/router-and-nav?id=sidebar
  11. **/
  12. /**
  13. * hidden: true if `hidden:true` will not show in the sidebar(default is false)
  14. * alwaysShow: true if set true, will always show the root menu, whatever its child routes length
  15. * if not set alwaysShow, only more than one route under the children
  16. * it will becomes nested mode, otherwise not show the root menu
  17. * redirect: noredirect if `redirect:noredirect` will no redirct in the breadcrumb
  18. * name:'router-name' the name is used by <keep-alive> (must set!!!)
  19. * meta : {
  20. roles: ['admin','editor'] will control the page roles (you can set multiple roles)
  21. title: 'title' the name show in submenu and breadcrumb (recommend set)
  22. icon: 'svg-name' the icon show in the sidebar,
  23. noCache: true if fasle ,the page will no be cached(default is false)
  24. }
  25. **/
  26. export const constantRouterMap = [
  27. { path: '/login', component: _import('login/index'), hidden: true },
  28. { path: '/authredirect', component: _import('login/authredirect'), hidden: true },
  29. { path: '/404', component: _import('error/404'), hidden: true },
  30. { path: '/401', component: _import('error/401'), hidden: true },
  31. {
  32. path: '',
  33. component: Layout,
  34. redirect: 'dashboard',
  35. children: [{
  36. path: 'dashboard',
  37. component: _import('dashboard/index'),
  38. name: 'dashboard',
  39. meta: { title: '首页', icon: 'dashboard', noCache: true }
  40. }]
  41. }
  42. ]
  43. export default new Router({
  44. // mode: 'history', // require service support
  45. scrollBehavior: () => ({ y: 0 }),
  46. routes: constantRouterMap
  47. })
  48. export const asyncRouterMap = [
  49. {
  50. path: '/pointManage',
  51. component: Layout,
  52. redirect: 'noredirect',
  53. name: 'pointManage',
  54. meta: {
  55. title: '积分管理',
  56. icon: 'jifen'
  57. },
  58. children: [
  59. { path: 'pointInstructions', component: _import('pointManage/pointInstructions'), name: 'pointInstructions', meta: { title: '积分规则说明书', noCache: true }},
  60. { path: 'pointRulesList', component: _import('pointManage/pointRulesList'), name: 'pointRulesList', meta: { title: '积分规则列表', noCache: true }},
  61. { path: 'pointList', component: _import('pointManage/pointList'), name: 'pointList', meta: { title: '积分列表', noCache: true }},
  62. { path: 'pointsDetailList', component: _import('pointManage/pointsDetailList'), name: 'pointsDetailList', meta: { title: '积分明细列表', noCache: true }},
  63. { path: 'pointsPlusOrMinus', component: _import('pointManage/pointsPlusOrMinus'), name: 'pointsPlusOrMinus', meta: { title: '积分加减列表', noCache: true }},
  64. ]
  65. },
  66. {
  67. path: '/goodsManage',
  68. component: Layout,
  69. redirect: 'noredirect',
  70. name: 'goodsManage',
  71. meta: {
  72. title: '商品管理',
  73. icon: 'shangpin'
  74. },
  75. children: [
  76. { path: 'goodsExchangeRules', component: _import('goodsManage/goodsExchangeRules'), name: 'goodsExchangeRules', meta: { title: '兑换须知', noCache: true }},
  77. { path: 'goodsList', component: _import('goodsManage/goodsList'), name: 'goodsList', meta: { title: '商品列表', noCache: true }},
  78. ]
  79. },
  80. {
  81. path: '/giftManage',
  82. component: Layout,
  83. redirect: 'noredirect',
  84. name: 'giftManage',
  85. meta: {
  86. title: '礼品管理',
  87. icon: 'lipin'
  88. },
  89. children: [
  90. { path: 'giftExchangeRules', component: _import('giftManage/giftExchangeRules'), name: 'giftExchangeRules', meta: { title: '兑换须知', noCache: true }},
  91. { path: 'giftList', component: _import('giftManage/giftList'), name: 'giftList', meta: { title: '礼品列表', noCache: true }},
  92. ]
  93. },
  94. {
  95. path: '/welfareManage',
  96. component: Layout,
  97. redirect: 'noredirect',
  98. name: 'welfareManage',
  99. meta: {
  100. title: '福利管理',
  101. icon: 'fuli'
  102. },
  103. children: [
  104. { path: 'welfareList', component: _import('welfareManage/welfareList'), name: 'welfareList', meta: { title: '福利列表', icon: 'lipin', noCache: true }},
  105. // { path: 'welfareList', component: _import('welfareManage/welfareList'), name: 'welfareList', meta: { title: '福利列表', noCache: false, hideTag: true, hidden: true}},
  106. ]
  107. },
  108. {
  109. path: '/exchangeManage',
  110. component: Layout,
  111. redirect: 'noredirect',
  112. name: 'exchangeManage',
  113. meta: {
  114. title: '兑换管理',
  115. icon: 'duihuan'
  116. },
  117. children: [
  118. { path: 'exchangeList', component: _import('exchangeManage/exchangeList'), name: 'exchangeList', meta: { title: '兑换列表', noCache: true }},
  119. { path: 'cancelledList', component: _import('exchangeManage/cancelledList'), name: 'cancelledList', meta: { title: '已作废列表', noCache: true }},
  120. { path: 'approvalList', component: _import('exchangeManage/approvalList'), name: 'approvalList', meta: { title: '待审批列表', noCache: true }},
  121. { path: 'pasList', component: _import('exchangeManage/pasList'), name: 'pasList', meta: { title: '待发货列表', noCache: true }},
  122. { path: 'voidList', component: _import('exchangeManage/voidList'), name: 'voidList', meta: { title: '订单已完成列表', noCache: true }},
  123. ]
  124. },
  125. {
  126. path: '/activityManage',
  127. component: Layout,
  128. redirect: 'noredirect',
  129. name: 'activityManage',
  130. meta: {
  131. title: '活动管理',
  132. icon: 'huodong'
  133. },
  134. children: [
  135. { path: 'activityList', component: _import('activityManage/activityList'), name: 'activityList', meta: { title: '活动列表', icon: 'huodong', noCache: true }},
  136. // { path: 'activityList', component: _import('activityManage/activityList'), name: 'activityList', meta: { title: '活动列表', noCache: false, hideTag: true, hidden: true}},
  137. ]
  138. },
  139. {
  140. path: '/answerGame',
  141. component: Layout,
  142. redirect: 'noredirect',
  143. name: 'answerGame',
  144. meta: {
  145. title: '答题管理',
  146. icon: 'huodong'
  147. },
  148. children: [
  149. { path: 'answerList', component: _import('answerGame/answerList'), name: 'answerList', meta: { title: '答题列表', icon: 'huodong', noCache: true }},
  150. ]
  151. },
  152. {
  153. path: '/noticeManage',
  154. component: Layout,
  155. redirect: 'noredirect',
  156. name: 'noticeManage',
  157. meta: {
  158. title: '通知管理',
  159. icon: 'tongzhi'
  160. },
  161. children: [
  162. { path: 'noticeList', component: _import('noticeManage/noticeList'), name: 'noticeList', meta: { title: '通知列表', icon: 'tongzhi', noCache: true }},
  163. // { path: 'noticeList', component: _import('noticeManage/noticeList'), name: 'noticeList', meta: { title: '通知列表', noCache: false, hideTag: true, hidden: true}},
  164. ]
  165. },
  166. {
  167. path: '/ranking',
  168. component: Layout,
  169. redirect: 'noredirect',
  170. name: 'ranking',
  171. meta: {
  172. title: '积分排行',
  173. icon: 'paihang'
  174. },
  175. children: [
  176. { path: 'rankingList', component: _import('ranking/rankingList'), name: 'rankingList', meta: { title: '积分排行', icon: 'paihang', noCache: true }},
  177. ]
  178. },
  179. {
  180. path: '/medalManage',
  181. component: Layout,
  182. redirect: 'noredirect',
  183. name: 'medalManage',
  184. meta: {
  185. title: '勋章管理',
  186. icon: 'xunzhang'
  187. },
  188. children: [
  189. { path: 'medalList', component: _import('medalManage/medalList'), name: 'medalList', meta: { title: '勋章列表', noCache: true }},
  190. { path: 'medalDataList/:id', component: _import('medalManage/medalDataList'), name: 'medalDataList', meta: { title: '勋章等级列表', noCache: false, hideTag: true, hidden: true }},
  191. ]
  192. },
  193. {
  194. path: '/raffleManage',
  195. component: Layout,
  196. redirect: 'noredirect',
  197. name: 'raffleManage',
  198. meta: {
  199. title: '抽奖管理',
  200. icon: 'huodong'
  201. },
  202. children: [
  203. { path: 'raffleList', component: _import('raffleManage/raffleList'), name: 'raffleList', meta: { title: '奖池列表', noCache: true }},
  204. { path: 'raffleLogsList', component: _import('raffleManage/raffleLogsList'), name: 'raffleLogsList', meta: { title: '抽奖记录', noCache: true }},
  205. { path: 'raffleDataList/:id', component: _import('raffleManage/raffleDataList'), name: 'raffleDataList', meta: { title: '奖池奖品', noCache: false, hideTag: true, hidden: true }},
  206. ]
  207. },
  208. {
  209. path: '/couponsManage',
  210. component: Layout,
  211. redirect: 'noredirect',
  212. name: 'couponsManage',
  213. meta: {
  214. title: '兑换卷管理',
  215. icon: 'huodong'
  216. },
  217. children: [
  218. { path: 'couponsList', component: _import('couponsManage/couponsList'), name: 'couponsList', meta: { title: '兑换卷列表', icon: 'huodong', noCache: true }},
  219. ]
  220. },
  221. {
  222. path: '/commendManage',
  223. component: Layout,
  224. redirect: 'noredirect',
  225. name: 'commendManage',
  226. meta: {
  227. title: '表彰管理',
  228. icon: 'xunzhang'
  229. },
  230. children: [
  231. { path: 'commendList', component: _import('commendManage/commendList'), name: 'commendList', meta: { title: '表彰列表', noCache: true }},
  232. { path: 'commendDataList/:id', component: _import('commendManage/commendDataList'), name: 'commendDataList', meta: { title: '表彰人员', noCache: false, hideTag: true, hidden: true }},
  233. { path: 'citeList', component: _import('commendManage/citeList'), name: 'citeList', meta: { title: '客户表彰列表', noCache: true }},
  234. { path: 'operateCiteList', component: _import('commendManage/operateCiteList'), name: 'operateCiteList', meta: { title: '客户表彰审批列表', noCache: true }},
  235. { path: 'ceoCiteList', component: _import('commendManage/ceoCiteList'), name: 'ceoCiteList', meta: { title: '客户表彰确认列表', noCache: true }},
  236. ]
  237. },
  238. {
  239. path: '/trainManage',
  240. component: Layout,
  241. redirect: 'noredirect',
  242. name: 'trainManage',
  243. meta: {
  244. title: '培训管理',
  245. icon: 'xunzhang'
  246. },
  247. children: [
  248. { path: 'upLoadFileRules', component: _import('trainManage/upLoadFileRules'), name: 'upLoadFileRules', meta: { title: '培训材料备注', noCache: true }},
  249. { path: 'trainList', component: _import('trainManage/trainList'), name: 'trainList', meta: { title: '培训列表', noCache: true }},
  250. { path: 'operateTrainList', component: _import('trainManage/operateTrainList'), name: 'operateTrainList', meta: { title: '培训审批列表', noCache: true }},
  251. { path: 'ceoTrainList', component: _import('trainManage/ceoTrainList'), name: 'ceoTrainList', meta: { title: '培训确认列表', noCache: true }},
  252. ]
  253. },
  254. {
  255. path: '/festivalManage',
  256. component: Layout,
  257. redirect: 'noredirect',
  258. name: 'festivalManage',
  259. meta: {
  260. title: '节日管理',
  261. icon: 'lipin'
  262. },
  263. children: [
  264. { path: 'festivalList', component: _import('festivalManage/festivalList'), name: 'festivalList', meta: { title: '节日列表', icon: 'lipin', noCache: true }},
  265. ]
  266. },
  267. {
  268. path: '/certManage',
  269. component: Layout,
  270. redirect: 'noredirect',
  271. name: 'certManage',
  272. meta: {
  273. title: '证书管理',
  274. icon: 'zhengshu'
  275. },
  276. children: [
  277. { path: 'certSetList', component: _import('certManage/certSetList'), name: 'certSetList', meta: { title: '证书配置列表', noCache: true }},
  278. { path: 'certRules', component: _import('certManage/certRules'), name: 'certRules', meta: { title: '积分获取规则', noCache: true }},
  279. { path: 'certList', component: _import('certManage/certList'), name: 'certList', meta: { title: '证书列表', noCache: true }},
  280. ]
  281. },
  282. {
  283. path: '/dictManage',
  284. component: Layout,
  285. redirect: 'noredirect',
  286. name: 'dictManage',
  287. meta: {
  288. title: '字典管理',
  289. icon: 'zidian'
  290. },
  291. children: [
  292. { path: 'dictList', component: _import('dictManage/dictList'), name: 'dictList', meta: { title: '字典列表', noCache: true }},
  293. { path: 'dictDataList/:id', component: _import('dictManage/dictDataList'), name: 'dictDataList', meta: { title: '字典数据', noCache: false, hideTag: true, hidden: true }},
  294. ]
  295. },
  296. {
  297. path: '/postManage',
  298. component: Layout,
  299. redirect: 'noredirect',
  300. name: 'postManage',
  301. meta: {
  302. title: '帖子管理',
  303. icon: 'fuli'
  304. },
  305. children: [
  306. { path: 'postList', component: _import('postManage/postList'), name: 'postList', meta: { title: '帖子列表', noCache: true }},
  307. { path: 'postApprovalList', component: _import('postManage/postApprovalList'), name: 'postApprovalList', meta: { title: '回复列表', noCache: true}},
  308. ]
  309. },
  310. {
  311. path: '/rankingManage',
  312. component: Layout,
  313. redirect: 'noredirect',
  314. name: 'rankingManage',
  315. meta: {
  316. title: '排行管理',
  317. icon: 'zhengshu'
  318. },
  319. children: [
  320. { path: 'answerRanking', component: _import('rankingManage/answerRanking'), name: 'answerRanking', meta: { title: '答题排行', noCache: true }},
  321. { path: 'gameRanking', component: _import('rankingManage/gameRanking'), name: 'gameRanking', meta: { title: '游戏排行', noCache: true}},
  322. ]
  323. },
  324. {
  325. path: '/user',
  326. component: Layout,
  327. redirect: 'noredirect',
  328. name: 'userManage',
  329. meta: {
  330. title: '用户管理',
  331. icon: 'people'
  332. },
  333. children: [
  334. { path: 'user', component: _import('user/user'), name: 'user', meta: { title: '联系人', noCache: true }},
  335. { path: 'checkUser', component: _import('user/checkUser'), name: 'checkUser', meta: { title: '待审核', noCache: true }},
  336. { path: 'approveHistory', component: _import('user/approveHistory'), name: 'approveHistory', meta: { title: '驳回记录', noCache: true }},
  337. { path: 'userDetail', component: _import('user/userDetail'), name: 'userDetail', meta: { title: '用户详情', noCache: false, hideTag: true, hidden: true }},
  338. { path: 'welfare', component: _import('user/welfare'), name: 'welfare', meta: { title: '用户福利', noCache: true }},
  339. ]
  340. },
  341. {
  342. path: '/community',
  343. component: Layout,
  344. redirect: 'noredirect',
  345. name: 'communityManage',
  346. meta: {
  347. title: '圈子管理',
  348. icon: 'example'
  349. },
  350. children: [
  351. { path: 'local', component: _import('organize/organizePlace'), name: 'local', meta: { title: '部门专委会', noCache: true }},
  352. { path: 'industry', component: _import('organize/organizeTrade'), name: 'industry', meta: { title: '技术专委会', noCache: true }},
  353. { path: 'interest', component: _import('organize/organizeInterest'), name: 'interest', meta: { title: '兴趣小组', noCache: true }}
  354. ]
  355. },
  356. {
  357. path: '/content',
  358. component: Layout,
  359. redirect: 'noredirect',
  360. name: 'contentManage',
  361. meta: {
  362. title: '内容&互动',
  363. icon: 'language'
  364. },
  365. children: [
  366. { path: 'bannerManage', component: _import('content/banner'), name: 'bannerManage', meta: { title: 'Banner管理', noCache: true }},
  367. { path: 'schoolInfo', component: _import('content/index'), name: 'schoolInfo', meta: { title: '公司动态', noCache: true }},
  368. { path: 'newsCenter', component: _import('content/newsCenter'), name: 'newsCenter', meta: { title: '新闻中心', noCache: true }},
  369. { path: 'customerStories', component: _import('content/customerStories'), name: 'customerStories', meta: { title: '客户案例', noCache: true }},
  370. { path: 'alumniInfo', component: _import('content/index'), name: 'alumniInfo', meta: { title: '员工风采', noCache: true }},
  371. { path: 'recruitInfo', component: _import('content/index'), name: 'recruitInfo', meta: { title: '招聘季度之星', noCache: true }},
  372. { path: 'video', component: _import('content/index'), name: 'video', meta: { title: '年会视频', noCache: true }},
  373. { path: 'activityNews', component: _import('content/index'), name: 'activityNews', meta: { title: '公司活动', noCache: true }},
  374. { path: 'activity', component: _import('content/index'), name: 'activity', meta: { title: '互动', noCache: true }},
  375. { path: 'lecture', component: _import('content/index'), name: 'lecture', meta: { title: '信息中心', noCache: true }},
  376. { path: 'reading', component: _import('content/index'), name: 'reading', meta: { title: '季刊', noCache: true }},
  377. { path: 'manual', component: _import('content/index'), name: 'manual', meta: { title: '操作手册', noCache: true }},
  378. { path: 'rules', component: _import('content/index'), name: 'rules', meta: { title: '规章制度', noCache: true }},
  379. { path: 'notice', component: _import('content/index'), name: 'notice', meta: { title: '公告管理', noCache: true }},
  380. { path: 'comment', component: _import('content/comment'), name: 'comment', meta: { title: '评论管理', noCache: true }},
  381. { path: 'questions', component: _import('content/questions'), name: 'questions', meta: { title: '提问管理', noCache: true }},
  382. { path: 'contribute', component: _import('content/contribute'), name: 'contribute', meta: { title: '投稿管理', noCache: true }},
  383. { path: 'questionSort', component: _import('content/questionSort'), name: 'questionSort', meta: { title: 'PK类别管理', noCache: true }},
  384. { path: 'questionDetail', component: _import('content/questionDetail'), name: 'questionDetail', meta: { title: 'PK题目管理', noCache: true }},
  385. ]
  386. },
  387. {
  388. path: '/visitor',
  389. component: Layout,
  390. redirect: 'noredirect',
  391. name: 'visitorManage',
  392. meta: {
  393. title: '访客管理',
  394. icon: 'people'
  395. },
  396. children: [
  397. { path: 'visitorList', component: _import('visitor/visitorList'), name: 'visitorList', meta: { title: '访客', noCache: true }},
  398. { path: 'visitorDetail', component: _import('visitor/visitorDetail'), name: 'visitorDetail', meta: { title: '访客详情', noCache: false, hideTag: true, hidden: true }}
  399. ]
  400. },
  401. {
  402. path: '/sys',
  403. component: Layout,
  404. redirect: 'noredirect',
  405. name: 'sysManage',
  406. meta: {
  407. title: '系统管理',
  408. icon: 'chart'
  409. },
  410. children: [
  411. { path: 'admin', component: _import('sys/admin'), name: 'admin', meta: { title: '管理员', noCache: true }},
  412. { path: 'role', component: _import('sys/role'), name: 'role', meta: { title: '角色管理', noCache: true }},
  413. // { path: 'message', component: _import('sys/admin'), name: 'message', meta: { title: '系统消息', noCache: true, hideTag: true }}
  414. // { path: 'sms', component: _import('sys/admin'), name: 'sms', meta: { title: '短信通知', noCache: true, hideTag: true }},
  415. // { path: 'os', component: _import('sys/os'), name: 'os', meta: { title: '对象存储', noCache: true, hideTag: true }}
  416. ]
  417. },
  418. { path: '*', redirect: '/404', hidden: true }
  419. ]