routes.js 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. import layoutHeaderAside from '@/layout/header-aside'
  2. // 由于懒加载页面太多的话会造成webpack热更新太慢,所以开发环境不使用懒加载,只有生产环境使用懒加载
  3. const _import = require('@/libs/util.import.' + process.env.NODE_ENV)
  4. /**
  5. * 在主框架内显示
  6. */
  7. const frameIn = [
  8. {
  9. path: '/',
  10. redirect: { name: 'index' },
  11. component: layoutHeaderAside,
  12. children: [
  13. // 首页
  14. {
  15. path: 'index_1',
  16. name: 'index_1',
  17. meta: {
  18. auth: true
  19. },
  20. component: _import('system/index')
  21. },
  22. {
  23. path: 'index',
  24. name: 'index',
  25. meta: {
  26. auth: true
  27. },
  28. component: _import('system/index')
  29. },
  30. {
  31. path: 'page2',
  32. name: 'page2',
  33. meta: {
  34. title: '页面 2',
  35. auth: true
  36. },
  37. component: _import('demo/page2')
  38. },
  39. {
  40. path: 'page3',
  41. name: 'page3',
  42. meta: {
  43. title: '页面 3',
  44. auth: true
  45. },
  46. component: _import('demo/page3')
  47. },
  48. // 设备管理
  49. {
  50. path: 'instrument',
  51. name: 'instrument',
  52. meta: {
  53. title: '设备管理',
  54. auth: true
  55. },
  56. component: _import('instrument')
  57. },
  58. // 人员管理
  59. {
  60. path: 'personnel',
  61. name: 'personnel',
  62. meta: {
  63. title: '人员管理',
  64. auth: true
  65. },
  66. component: _import('personnel')
  67. },
  68. // 班级管理
  69. {
  70. path: 'class',
  71. name: 'class',
  72. meta: {
  73. title: '班级管理',
  74. auth: true
  75. },
  76. component: _import('class')
  77. },
  78. // 值班管理
  79. {
  80. path: 'duty',
  81. name: 'duty',
  82. meta: {
  83. title: '值班管理',
  84. auth: true
  85. },
  86. component: _import('duty')
  87. },
  88. {
  89. path: '/duty/detail',
  90. name: 'dutyDetailEdit',
  91. meta: {
  92. title: '值班详情',
  93. auth: true,
  94. cache: true
  95. },
  96. component: _import('duty/detail/index')
  97. },
  98. // 信息发布
  99. {
  100. path: 'information',
  101. name: 'information',
  102. meta: {
  103. title: '信息发布',
  104. auth: true
  105. },
  106. component: _import('information')
  107. },
  108. // 课程管理
  109. {
  110. path: 'course',
  111. name: 'course',
  112. meta: {
  113. title: '课程管理',
  114. auth: true
  115. },
  116. component: _import('course')
  117. },
  118. // 课程详情
  119. {
  120. path: '/course/detail',
  121. name: 'courseDetailEdit',
  122. meta: {
  123. title: '课程详情',
  124. auth: true,
  125. cache: true
  126. },
  127. component: _import('course/detail/index')
  128. },
  129. // 系统 前端日志
  130. {
  131. path: 'log',
  132. name: 'log',
  133. meta: {
  134. title: '前端日志',
  135. auth: true
  136. },
  137. component: _import('system/log')
  138. },
  139. // 刷新页面 必须保留
  140. {
  141. path: 'refresh',
  142. name: 'refresh',
  143. hidden: true,
  144. component: _import('system/function/refresh')
  145. },
  146. // 页面重定向 必须保留
  147. {
  148. path: 'redirect/:route*',
  149. name: 'redirect',
  150. hidden: true,
  151. component: _import('system/function/redirect')
  152. },
  153. // mypage
  154. {
  155. path: '/mypage',
  156. name: 'mypage',
  157. meta: {
  158. title: 'mypage-示例页面',
  159. auth: true
  160. },
  161. component: _import('mypage')
  162. },
  163. {
  164. path: 'sysadmin/organize',
  165. name: 'organizes',
  166. meta: {
  167. title: '部门管理',
  168. auth: true,
  169. cache: true
  170. },
  171. component: _import('sysadmin/organize/index')
  172. },
  173. {
  174. path: 'sysadmin/user',
  175. name: 'user',
  176. meta: {
  177. title: '用户管理',
  178. auth: true,
  179. cache: true
  180. },
  181. component: _import('sysadmin/user/index')
  182. },
  183. {
  184. path: 'sysadmin/role',
  185. name: 'role',
  186. meta: {
  187. title: '角色管理',
  188. auth: true,
  189. cache: true
  190. },
  191. component: _import('sysadmin/role/index')
  192. },
  193. {
  194. path: 'sysadmin/menu',
  195. name: 'menu',
  196. meta: {
  197. title: '菜单管理',
  198. auth: true,
  199. cache: true
  200. },
  201. component: _import('sysadmin/menu/index')
  202. },
  203. {
  204. path: 'module01',
  205. name: 'module01',
  206. meta: {
  207. title: 'frame测试',
  208. auth: true,
  209. cache: true
  210. },
  211. component: _import('system/module/module01')
  212. },
  213. {
  214. path: '/setuser/userset',
  215. name: 'setuser',
  216. meta: {
  217. title: '设置用户信息',
  218. auth: true
  219. },
  220. component: _import('setuser/userset')
  221. },
  222. {
  223. path: '/setuser/passwordset',
  224. name: 'setuserpassword',
  225. meta: {
  226. title: '密码修改',
  227. auth: true
  228. },
  229. component: _import('setuser/passwordset')
  230. }, // 工作流
  231. {
  232. path: '/workflow/edit',
  233. name: 'editWorkflow',
  234. meta: {
  235. title: '部门管理',
  236. auth: true,
  237. cache: true
  238. },
  239. component: _import('workflow/edit/index')
  240. }, // 测试相关--学生
  241. {
  242. path: '/demo/student',
  243. name: 'student',
  244. meta: {
  245. title: '学生管理',
  246. auth: true,
  247. cache: true
  248. },
  249. component: _import('demo/student/index')
  250. }, // 测试相关调用微服务接口--学生
  251. {
  252. path: '/micro/student',
  253. name: 'student2',
  254. meta: {
  255. title: '学生管理2',
  256. auth: true,
  257. cache: true
  258. },
  259. component: _import('micro/student/index')
  260. },
  261. // ================== add 字典分类 08-12 s ====================
  262. {
  263. path: '/sysadmin/item',
  264. name: 'itemEdit',
  265. meta: {
  266. title: '字典分类',
  267. auth: true,
  268. cache: true
  269. },
  270. component: _import('sysadmin/item/index')
  271. },
  272. // 字典项
  273. {
  274. path: '/sysadmin/itemdetail',
  275. name: 'itemDetailEdit',
  276. meta: {
  277. title: '字典项',
  278. auth: true,
  279. cache: true
  280. },
  281. component: _import('sysadmin/item_detail/index')
  282. },
  283. // 房间管理
  284. {
  285. path: 'managingrooms',
  286. name: 'managingrooms',
  287. meta: {
  288. title: '实验室管理',
  289. auth: true
  290. },
  291. component: _import('managingrooms')
  292. },
  293. // 运行记录
  294. {
  295. path: 'instrument/instrumenrunrecord',
  296. name: 'instrument/instrumenrunrecord',
  297. meta: {
  298. title: '运行记录',
  299. auth: true
  300. },
  301. component: _import('instrument/instrumenrunrecord')
  302. },
  303. // 维护保养
  304. {
  305. path: 'instrument/maintainlog',
  306. name: 'instrument/maintainlog',
  307. meta: {
  308. title: '维护保养',
  309. auth: true
  310. },
  311. component: _import('instrument/maintainlog')
  312. },
  313. // 确认及报废
  314. {
  315. path: 'instrument/confirmandscrap',
  316. name: 'instrument/confirmandscrap',
  317. meta: {
  318. title: '确认及报废',
  319. auth: true
  320. },
  321. component: _import('instrument/confirmandscrap')
  322. }
  323. ]
  324. }
  325. ]
  326. /**
  327. * 在主框架之外显示
  328. */
  329. const frameOut = [
  330. // 登录
  331. {
  332. path: '/login',
  333. name: 'login',
  334. component: _import('system/login')
  335. },
  336. {
  337. path: '/page1',
  338. name: 'page1',
  339. component: _import('demo/page1')
  340. }
  341. ]
  342. /**
  343. * 错误页面
  344. */
  345. const errorPage = [
  346. {
  347. path: '*',
  348. name: '404',
  349. component: _import('system/error/404')
  350. }
  351. ]
  352. // 导出需要显示菜单的
  353. export const frameInRoutes = frameIn
  354. // 重新组织后导出
  355. export default [...frameIn, ...frameOut, ...errorPage]