index.js 14 KB

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