index.js 15 KB

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