routes.js 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  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: '/visualized',
  10. name: 'visualized',
  11. meta: {
  12. auth: true
  13. },
  14. component: _import('system/visualized')
  15. },
  16. {
  17. path: '/',
  18. redirect: { name: 'index' },
  19. component: layoutHeaderAside,
  20. children: [
  21. // 大屏首页
  22. // {
  23. // path: 'visualized',
  24. // name: 'visualized',
  25. // meta: {
  26. // auth: true
  27. // },
  28. // component: _import('system/visualized')
  29. // },
  30. // 首页
  31. {
  32. path: 'index',
  33. name: 'index',
  34. meta: {
  35. auth: true
  36. },
  37. component: _import('system/index')
  38. },
  39. // 首页
  40. {
  41. path: 'feedBack',
  42. name: 'feedback',
  43. meta: {
  44. auth: true
  45. },
  46. component: _import('system/feedback')
  47. },
  48. // 仓房展示/仓内遨游
  49. {
  50. path: 'warehouseTravel',
  51. name: 'warehouseTravel',
  52. meta: {
  53. title: '仓内遨游',
  54. auth: true
  55. },
  56. component: _import('demo/warehouseShow/warehouseTravel')
  57. },
  58. // 仓房展示/仓房信息
  59. {
  60. path: 'warehouseInfo',
  61. name: 'warehouseInfo',
  62. meta: {
  63. title: '仓房信息',
  64. auth: true
  65. },
  66. component: _import('demo/warehouseShow/warehouseInfo')
  67. },
  68. // 仓房展示/仓房信息详情
  69. {
  70. path: 'warehouseInfo-check',
  71. name: 'warehouseInfo-check',
  72. meta: {
  73. title: '仓房信息详情',
  74. auth: true
  75. },
  76. component: _import('demo/warehouseShow/warehouseInfo/warehouseInfo-check.vue')
  77. },
  78. // 产品管理/产品
  79. {
  80. path: 'product',
  81. name: 'product',
  82. meta: {
  83. title: '产品',
  84. auth: true,
  85. parent:'产品管理',
  86. },
  87. component: _import('demo/productManage/product')
  88. },
  89. // 产品管理/产品详情
  90. {
  91. path: 'productInfo',
  92. name: 'productInfo',
  93. meta: {
  94. title: '产品详情',
  95. auth: true
  96. },
  97. component: _import('demo/productManage/productInfo')
  98. },
  99. // 产品管理/产品
  100. {
  101. path: 'productClassify',
  102. name: 'productClassify',
  103. meta: {
  104. title: '产品分类',
  105. auth: true,
  106. parent:'产品管理',
  107. },
  108. component: _import('demo/productManage/productClassify')
  109. },
  110. // 设备管理/设备
  111. {
  112. path: 'equipment',
  113. name: 'equipment',
  114. meta: {
  115. title: '设备',
  116. auth: true,
  117. parent:'设备管理',
  118. },
  119. component: _import('demo/equipmentManage/equipment')
  120. },
  121. // 设备管理/设备标签
  122. {
  123. path: 'equipmentTag',
  124. name: 'equipmentTag',
  125. meta: {
  126. title: '设备标签',
  127. auth: true,
  128. parent:'设备管理',
  129. },
  130. component: _import('demo/equipmentManage/equipmentTag')
  131. },
  132. // 设备管理/设备详情
  133. {
  134. path: 'equipmentInfo',
  135. name: 'equipmentInfo',
  136. meta: {
  137. title: '设备详情',
  138. auth: true
  139. },
  140. component: _import('demo/equipmentManage/equipmentInfo')
  141. },
  142. //报警记录
  143. {
  144. path: 'alarmRecord',
  145. name: 'alarmRecord',
  146. meta: {
  147. auth: true
  148. },
  149. component: _import('demo/alarmRecord/index')
  150. },
  151. //数据查询
  152. {
  153. path: 'dataQuery',
  154. name: 'dataQuery',
  155. meta: {
  156. auth: true
  157. },
  158. component: _import('demo/dataQuery/index')
  159. },
  160. // 系统管理/组织机构
  161. {
  162. path: 'organization',
  163. name: 'organization',
  164. meta: {
  165. title: '组织机构',
  166. auth: true,
  167. parent:'系统管理',
  168. },
  169. component: _import('demo/system/organization')
  170. },
  171. // 系统管理/用户管理
  172. {
  173. path: 'userManagement',
  174. name: 'userManagement',
  175. meta: {
  176. title: '用户管理',
  177. auth: true,
  178. parent:'系统管理',
  179. },
  180. component: _import('demo/system/userManagement')
  181. },
  182. // 系统管理/角色管理
  183. {
  184. path: 'roleManagement',
  185. name: 'roleManagement',
  186. meta: {
  187. title: '角色管理',
  188. auth: true,
  189. parent:'系统管理',
  190. },
  191. component: _import('demo/system/roleManagement')
  192. },
  193. // 系统管理/公告管理
  194. {
  195. path: 'announcementManagement',
  196. name: 'announcementManagement',
  197. meta: {
  198. title: '公告管理',
  199. auth: true,
  200. parent:'系统管理',
  201. },
  202. component: _import('demo/system/announcementManagement')
  203. },
  204. // 系统管理/操作日志
  205. {
  206. path: 'operationLog',
  207. name: 'operationLog',
  208. meta: {
  209. title: '操作日志',
  210. auth: true,
  211. parent:'系统管理',
  212. },
  213. component: _import('demo/system/operationLog')
  214. },
  215. // 参数设置/硬件参数
  216. {
  217. path: 'hardwareParame',
  218. name: 'hardwareParame',
  219. meta: {
  220. title: '硬件参数',
  221. auth: true,
  222. parent:'参数设置',
  223. },
  224. component: _import('demo/parameManagement/hardwareParame')
  225. },
  226. // 参数设置/硬件参数
  227. {
  228. path: 'scanParame',
  229. name: 'scanParame',
  230. meta: {
  231. title: '扫描参数',
  232. auth: true,
  233. parent:'参数设置',
  234. },
  235. component: _import('demo/parameManagement/scanParame')
  236. },
  237. // 参数设置/报警参数
  238. {
  239. path: 'alarmParame',
  240. name: 'alarmParame',
  241. meta: {
  242. title: '扫描参数',
  243. auth: true,
  244. parent:'参数设置',
  245. },
  246. component: _import('demo/parameManagement/alarmParame')
  247. },
  248. // 参数设置/数据字典
  249. {
  250. path: 'dataDictionary',
  251. name: 'dataDictionary',
  252. meta: {
  253. title: '数据字典',
  254. auth: true,
  255. parent:'参数设置',
  256. },
  257. component: _import('demo/parameManagement/dataDictionary')
  258. },
  259. // 参数设置/定时任务设置
  260. {
  261. path: 'timingTask',
  262. name: 'timingTask',
  263. meta: {
  264. title: '数据字典',
  265. auth: true,
  266. parent:'参数设置',
  267. },
  268. component: _import('demo/parameManagement/timingTask')
  269. },
  270. // 参数设置/协议管理
  271. {
  272. path: 'agreement',
  273. name: 'agreement',
  274. meta: {
  275. title: '协议管理',
  276. auth: true,
  277. parent:'参数设置',
  278. },
  279. component: _import('demo/parameManagement/agreement')
  280. },
  281. // 系统 前端日志
  282. {
  283. path: 'log',
  284. name: 'log',
  285. meta: {
  286. title: '前端日志',
  287. auth: true
  288. },
  289. component: _import('system/log')
  290. },
  291. // 刷新页面 必须保留
  292. {
  293. path: 'refresh',
  294. name: 'refresh',
  295. hidden: true,
  296. component: _import('system/function/refresh')
  297. },
  298. // 页面重定向 必须保留
  299. {
  300. path: 'redirect/:route*',
  301. name: 'redirect',
  302. hidden: true,
  303. component: _import('system/function/redirect')
  304. }
  305. ]
  306. }
  307. ]
  308. /**
  309. * 在主框架之外显示
  310. */
  311. const frameOut = [
  312. // { // 大屏首页
  313. // path: '/visualized',
  314. // name: 'visualized',
  315. // // meta: {
  316. // // auth: true
  317. // // },
  318. // component: _import('system/visualized')
  319. // },
  320. // 登录
  321. {
  322. path: '/login',
  323. name: 'login',
  324. component: _import('system/login')
  325. },
  326. //空白页
  327. {
  328. path: '/abc',
  329. name: 'Abc',
  330. meta: {
  331. auth: true
  332. },
  333. component: _import('system/abc')
  334. },
  335. ]
  336. /**
  337. * 错误页面
  338. */
  339. const errorPage = [
  340. {
  341. path: '*',
  342. name: '404',
  343. component: _import('system/error/404')
  344. }
  345. ]
  346. // 导出需要显示菜单的
  347. export const frameInRoutes = frameIn
  348. // 重新组织后导出
  349. export default [
  350. ...frameIn,
  351. ...frameOut,
  352. ...errorPage
  353. ]