index.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  1. import { createRouter, createWebHashHistory } from 'vue-router'
  2. import Layout from '@/layout'
  3. export const constantRoutes = [
  4. {
  5. path: '/login',
  6. component: () =>
  7. import('@/views/login'),
  8. hidden: true,
  9. },
  10. {
  11. path: '/403',
  12. name: '403',
  13. component: () =>
  14. import('@/views/403'),
  15. hidden: true,
  16. },
  17. {
  18. path: '/401',
  19. name: '401',
  20. component: () =>
  21. import('@/views/401'),
  22. hidden: true,
  23. },
  24. {
  25. path: '/404',
  26. name: '404',
  27. component: () =>
  28. import('@/views/404'),
  29. hidden: true,
  30. },
  31. {
  32. path: '/*',
  33. redirect: '/404',
  34. hidden: true,
  35. },
  36. // { path: '*', redirect: '/404', hidden: true }
  37. ]
  38. export const asyncRoutes = [
  39. {
  40. path: '/',
  41. redirect: '/',
  42. meta: {
  43. title: '告警管理',
  44. icon: 'alarmManage',
  45. affix: true,
  46. },
  47. component: Layout,
  48. children: [{
  49. meta: {
  50. title: '告警管理',
  51. icon: 'alarmManage',
  52. },
  53. path: '/',
  54. component: () =>
  55. import('@/views/alarmManage/index'),
  56. },]
  57. },
  58. {
  59. path: '/siteManage',
  60. redirect: '/siteManage/index',
  61. meta: {
  62. title: '站点管理',
  63. icon: 'siteManage',
  64. },
  65. component: Layout,
  66. children: [{
  67. meta: {
  68. title: '站点管理',
  69. icon: 'siteManage',
  70. },
  71. path: '/siteManage',
  72. component: () =>
  73. import('@/views/siteManage/index'),
  74. hidden: true
  75. }]
  76. },
  77. {
  78. path: '/stationManage',
  79. redirect: '/stationManage/index',
  80. meta: {
  81. title: '台区管理',
  82. icon: 'stationManage',
  83. },
  84. component: Layout,
  85. children: [{
  86. meta: {
  87. title: '台区管理',
  88. icon: 'stationManage',
  89. },
  90. path: '/stationManage',
  91. component: () =>
  92. import('@/views/stationManage/index'),
  93. hidden: true
  94. }]
  95. },
  96. /**
  97. * deviceManage 设备管理
  98. * powerEquip 电力监测设备
  99. * videoEquip 视频监测设备
  100. * communicateEquip 通信设备
  101. * channelList 通道列表
  102. * attribTemplate 属性模板
  103. */
  104. {
  105. path: '/deviceManage',
  106. redirect: '/deviceManage/powerEquip',
  107. meta: {
  108. title: '设备管理',
  109. icon: 'deviceManage',
  110. },
  111. component: Layout,
  112. children: [{
  113. meta: {
  114. title: '设备管理',
  115. icon: 'deviceManage',
  116. },
  117. path: '/deviceManage',
  118. component: () =>
  119. import('@/views/deviceManage/powerEquip'),
  120. hidden: true
  121. }]
  122. },
  123. // {
  124. // meta: { icon: 'deviceManage', title: '设备管理', },
  125. // path: '/deviceManage',
  126. // component: Layout,
  127. // redirect: '/deviceManage/powerEquip',
  128. // children: [{
  129. // meta: { icon: 'powerEquip', title: '设备管理', },
  130. // path: 'powerEquip',
  131. // component: () =>
  132. // import ('@/views/deviceManage/powerEquip/index.vue'),
  133. // },
  134. // {
  135. // meta: { icon: 'attribTemplate', title: '属性模板', },
  136. // path: 'attribTemplate',
  137. // component: () =>
  138. // import ('@/views/deviceManage/attribTemplate/index.vue'),
  139. // }
  140. // ]
  141. // },
  142. /**
  143. * dataManage 数据管理
  144. * sameAnalysis 同比分析报表
  145. * chainAnalysis 环比分析报表
  146. * handOpera 手动抄表
  147. * energyReport 用能月报
  148. * demandAnalysis 需量分析
  149. * consumConfig 能耗分析配置
  150. */
  151. {
  152. meta: { icon: 'dataManage', title: '数据管理', },
  153. path: '/dataManage',
  154. component: Layout,
  155. redirect: '/dataManage/sameAnalysis/index',
  156. children: [{
  157. meta: { icon: 'sameAnalysis', title: '同比分析报表', },
  158. path: 'sameAnalysis',
  159. component: () =>
  160. import('@/views/dataManage/sameAnalysis/index'),
  161. },
  162. {
  163. meta: { icon: 'chainAnalysis', title: '环比分析报表', },
  164. path: 'chainAnalysis',
  165. component: () =>
  166. import('@/views/dataManage/chainAnalysis/index'),
  167. },
  168. // {
  169. // meta: { icon: 'handOpera', title: '手动抄表', },
  170. // title: 'index-layout.menu.dataManage.handOpera',
  171. // path: 'handOpera',
  172. // component: () =>
  173. // import ('@/views/dataManage/handOpera/index.vue'),
  174. // },
  175. {
  176. meta: { icon: 'energyReport', title: '用能月报', },
  177. title: 'index-layout.menu.dataManage.energyReport',
  178. path: 'energyReport',
  179. component: () =>
  180. import('@/views/dataManage/energyReport/index'),
  181. },
  182. {
  183. meta: { icon: 'demandAnalysis', title: '需量分析', },
  184. title: 'index-layout.menu.dataManage.demandAnalysis',
  185. path: 'demandAnalysis',
  186. component: () =>
  187. import('@/views/dataManage/demandAnalysis/index'),
  188. },
  189. // {
  190. // meta: { icon: 'consumConfig', title: '能耗分析配置', },
  191. // title: 'index-layout.menu.dataManage.consumConfig',
  192. // path: 'consumConfig',
  193. // component: () =>
  194. // import ('@/views/dataManage/consumConfig/index.vue'),
  195. // }
  196. ]
  197. },
  198. // {
  199. // meta: { icon: 'dataManage', title: '能源管理', },
  200. // path: '/energyManage',
  201. // component: Layout,
  202. // redirect: '/energyManage/totalEnergyC/index',
  203. // children: [
  204. // {
  205. // meta: { icon: 'totalEnergyC', title: '总能耗', },
  206. // path: 'totalEnergyC',
  207. // component: () =>
  208. // import('@/views/energyManage/totalEnergyC/index'),
  209. // },
  210. // {
  211. // meta: { icon: 'energyStatistics', title: '能源统计', },
  212. // path: 'energyStatistics',
  213. // component: () =>
  214. // import('@/views/energyManage/energyStatistics/index'),
  215. // },
  216. // {
  217. // meta: { icon: 'energyReport', title: '能源报表', },
  218. // path: 'energyReport',
  219. // component: () =>
  220. // import('@/views/energyManage/energyReport/index'),
  221. // },
  222. // ]
  223. // },
  224. {
  225. meta: { icon: 'realMonitored', title: '实时监测', },
  226. path: '/realMonitored',
  227. component: Layout,
  228. redirect: '/realMonitored/loadAnalysis/index',
  229. children: [
  230. {
  231. meta: { icon: 'loadAnalysis', title: '负载分析', },
  232. path: 'loadAnalysis',
  233. component: () =>
  234. import('@/views/realMonitored/loadAnalysis/index'),
  235. },
  236. {
  237. meta: { icon: 'loadAnalysis', title: '同比分析报表', },
  238. path: 'loadAnalysis1',
  239. component: () =>
  240. import('@/views/realMonitored/loadAnalysis/index'),
  241. },
  242. ]
  243. },
  244. {
  245. meta: { icon: 'dataManage', title: '历史数据', },
  246. path: '/historyData',
  247. component: Layout,
  248. redirect: '/historyData/curve/index',
  249. children: [
  250. {
  251. meta: { icon: 'curve', title: '历史曲线', },
  252. path: 'curve',
  253. component: () =>
  254. import('@/views/historyData/curve/index'),
  255. },
  256. {
  257. meta: { icon: 'report', title: '历史报表', },
  258. path: 'report',
  259. component: () =>
  260. import('@/views/historyData/report/index'),
  261. },
  262. ]
  263. },
  264. /**
  265. * powerQuality 电能质量
  266. * harmonicReport 谐波报表
  267. * realTimeMonitoring 实时监测
  268. * asseReport 评估报告
  269. * unbalanceAnalysis 三相不平衡分析
  270. */
  271. {
  272. meta: { icon: 'powerQuality', title: '电能质量', },
  273. path: '/powerQuality',
  274. component: Layout,
  275. redirect: '/powerQuality/harmonicReport/index',
  276. children: [{
  277. meta: { icon: 'harmonicReport', title: '谐波报表', },
  278. path: 'harmonicReport',
  279. component: () =>
  280. import('@/views/powerQuality/harmonicReport/index'),
  281. },
  282. {
  283. meta: { icon: 'realTimeMonitoring', title: '实时监测' },
  284. path: 'realTimeMonitoring',
  285. component: () =>
  286. import('@/views/powerQuality/realTimeMonitoring/index'),
  287. },
  288. {
  289. meta: { icon: 'asseReport', title: '评估报告', },
  290. path: 'asseReport',
  291. component: () =>
  292. import('@/views/powerQuality/asseReport/index'),
  293. },
  294. {
  295. meta: { icon: 'unbalanceAnalysis', title: '三相不平衡分析', },
  296. path: 'unbalanceAnalysis',
  297. component: () =>
  298. import('@/views/powerQuality/unbalanceAnalysis/index'),
  299. },
  300. ]
  301. },
  302. /**
  303. * monthReport 月度报告
  304. */
  305. {
  306. path: '/monthReport',
  307. redirect: '/monthReport',
  308. meta: { title: '月度报告', icon: 'monthReport', },
  309. component: Layout,
  310. children: [{
  311. meta: { title: '月度报告', icon: 'monthReport', },
  312. path: '/monthReport',
  313. component: () =>
  314. import('@/views/monthReport/index'),
  315. hidden: true
  316. },
  317. {
  318. meta: { title: '月报模板', icon: 'reportModel', },
  319. path: '/reportModel',
  320. component: () =>
  321. import('@/views/monthReport/reportModel'),
  322. hidden: true
  323. }
  324. ]
  325. },
  326. {
  327. path: '/planOutage',
  328. redirect: '/planOutage/index',
  329. meta: { title: '计划停电', icon: 'planOutage', },
  330. component: Layout,
  331. children: [{
  332. meta: { title: '计划停电', icon: 'planOutage', },
  333. path: '/planOutage',
  334. component: () =>
  335. import('@/views/planOutage/index'),
  336. hidden: true
  337. }],
  338. },
  339. /**
  340. * patrolManage 巡检管理
  341. * patrolPlan 巡检计划
  342. * patrolRecord 巡检记录
  343. * patrolContent 巡检内容
  344. * checkEntries 检查条目
  345. */
  346. // {
  347. // meta: { title: '巡检管理', icon: 'patrolManage', },
  348. // path: '/patrolManage',
  349. // component: Layout,
  350. // redirect: '/patrolManage/patrolPlan',
  351. // name: 'patrolManage',
  352. // children: [{
  353. // meta: { title: '巡检计划', icon: 'patrolPlan' },
  354. // path: 'patrolPlan',
  355. // name: 'patrolPlan',
  356. // component: () =>
  357. // import ('@/views/patrolManage/patrolPlan/index.vue'),
  358. // },
  359. // {
  360. // meta: { title: '巡检记录', icon: 'patrolRecord' },
  361. // path: 'patrolRecord',
  362. // name: 'patrolRecord',
  363. // component: () =>
  364. // import ('@/views/patrolManage/patrolRecord/index.vue'),
  365. // },
  366. // {
  367. // meta: { title: '巡检内容', icon: '巡检内容' },
  368. // path: 'patrolContent',
  369. // name: 'patrolContent',
  370. // component: () =>
  371. // import ('@/views/patrolManage/patrolContent/index.vue'),
  372. // },
  373. // {
  374. // meta: { title: '检查条目', icon: '检查条目' },
  375. // path: 'checkEntries',
  376. // name: 'checkEntries',
  377. // component: () =>
  378. // import ('@/views/patrolManage/checkEntries/index.vue'),
  379. // },
  380. // ]
  381. // },
  382. /**
  383. * operManage 运维管理
  384. * siteAchives 现场档案
  385. * defectManage 缺陷管理
  386. * workManage 工单管理
  387. * operStatistics 运维统计
  388. * workStatistics 工作量统计
  389. */
  390. // {
  391. // meta: { title: '运维管理', icon: 'operManage', },
  392. // path: '/operManage',
  393. // component: Layout,
  394. // redirect: '/operManage/siteAchives',
  395. // name: 'operManage',
  396. // children: [{
  397. // meta: { title: '现场档案', icon: 'siteAchives', },
  398. // path: 'siteAchives',
  399. // component: () =>
  400. // import ('@/views/operManage/siteAchives/index.vue'),
  401. // },
  402. // {
  403. // meta: { title: '缺陷管理', icon: 'defectManage', },
  404. // path: 'defectManage',
  405. // component: () =>
  406. // import ('@/views/operManage/defectManage/index.vue'),
  407. // },
  408. // {
  409. // meta: { title: '工单管理', icon: 'workManage', },
  410. // path: 'workManage',
  411. // component: () =>
  412. // import ('@/views/operManage/workManage/index.vue'),
  413. // },
  414. // {
  415. // meta: { title: '运维统计', icon: 'operStatistics', },
  416. // path: 'operStatistics',
  417. // component: () =>
  418. // import ('@/views/operManage/operStatistics/index.vue'),
  419. // },
  420. // {
  421. // meta: { title: '工作量统计', icon: 'workStatistics', },
  422. // path: 'workStatistics',
  423. // component: () =>
  424. // import ('@/views/operManage/workStatistics/index.vue'),
  425. // },
  426. // ]
  427. // },
  428. /**
  429. * systemManage 系统管理
  430. * userManage 用户管理
  431. * rolePermission 权限管理
  432. */
  433. {
  434. meta: { title: '系统管理', icon: 'systemManage', },
  435. path: '/systemManage',
  436. component: Layout,
  437. redirect: '/systemManage/userManage/index',
  438. children: [{
  439. meta: { title: '用户管理', icon: 'userManage', },
  440. path: 'userManage',
  441. component: () =>
  442. import('@/views/systemManage/userManage/index'),
  443. },
  444. {
  445. meta: { title: '权限管理', icon: 'rolePermission', },
  446. path: 'rolePermission',
  447. component: () =>
  448. import('@/views/systemManage/rolePermission/index'),
  449. },
  450. ]
  451. },
  452. // {
  453. // path: '/test',
  454. // component: Layout,
  455. // redirect: '/test/test',
  456. // meta: {
  457. // title: '动态路由测试',
  458. // icon: 'test-tube-line',
  459. // },
  460. // children: [
  461. // {
  462. // path: 'test',
  463. // name: 'Test',
  464. // component: () => import('@/views/test'),
  465. // meta: {
  466. // title: '动态路由测试',
  467. // icon: 'test-tube-line',
  468. // },
  469. // },
  470. // ],
  471. // },
  472. ]
  473. const router = createRouter({
  474. history: createWebHashHistory(),
  475. routes: constantRoutes,
  476. scrollBehavior(to, from, savedPosition) {
  477. if (savedPosition) {
  478. return savedPosition
  479. } else {
  480. return { top: 0 }
  481. }
  482. },
  483. })
  484. export default router