|
@@ -1,73 +1,46 @@
|
|
|
import { createRouter, createWebHashHistory } from 'vue-router'
|
|
|
import Layout from '@/layout'
|
|
|
|
|
|
-export const constantRoutes = [{
|
|
|
+export const constantRoutes = [
|
|
|
+ {
|
|
|
path: '/login',
|
|
|
component: () =>
|
|
|
- import ('@/views/login'),
|
|
|
+ import('@/views/login'),
|
|
|
hidden: true,
|
|
|
},
|
|
|
{
|
|
|
path: '/403',
|
|
|
name: '403',
|
|
|
component: () =>
|
|
|
- import ('@/views/403'),
|
|
|
+ import('@/views/403'),
|
|
|
hidden: true,
|
|
|
},
|
|
|
-
|
|
|
{
|
|
|
path: '/401',
|
|
|
name: '401',
|
|
|
component: () =>
|
|
|
- import ('@/views/401'),
|
|
|
+ import('@/views/401'),
|
|
|
hidden: true,
|
|
|
},
|
|
|
{
|
|
|
path: '/404',
|
|
|
name: '404',
|
|
|
component: () =>
|
|
|
- import ('@/views/404'),
|
|
|
+ import('@/views/404'),
|
|
|
+ hidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ path: '/*',
|
|
|
+ redirect: '/404',
|
|
|
hidden: true,
|
|
|
},
|
|
|
// { path: '*', redirect: '/404', hidden: true }
|
|
|
]
|
|
|
-export const asyncRoutes = [
|
|
|
-
|
|
|
- // {
|
|
|
- // path: '/',
|
|
|
- // component: Layout,
|
|
|
- // redirect: '/index',
|
|
|
- // meta: {
|
|
|
- // title: '首页',
|
|
|
- // icon: 'home',
|
|
|
- // affix: true,
|
|
|
- // },
|
|
|
- // children: [{
|
|
|
- // path: 'index',
|
|
|
- // name: 'Index',
|
|
|
- // component: () =>
|
|
|
- // import ('@/views/index'),
|
|
|
- // meta: {
|
|
|
- // title: '首页',
|
|
|
- // icon: 'home',
|
|
|
- // affix: true,
|
|
|
- // },
|
|
|
- // }, ],
|
|
|
- // },
|
|
|
-
|
|
|
-
|
|
|
- // {
|
|
|
- // path: 'external-link',
|
|
|
- // component: Layout,
|
|
|
- // children: [{
|
|
|
- // path: '/home',
|
|
|
- // meta: { title: '首页', icon: 'home', }
|
|
|
- // }]
|
|
|
- // },
|
|
|
|
|
|
+export const asyncRoutes = [
|
|
|
{
|
|
|
path: '/',
|
|
|
- redirect: '/alarmManage/index',
|
|
|
+ redirect: '/',
|
|
|
meta: {
|
|
|
title: '告警管理',
|
|
|
icon: 'alarmManage',
|
|
@@ -79,32 +52,12 @@ export const asyncRoutes = [
|
|
|
title: '告警管理',
|
|
|
icon: 'alarmManage',
|
|
|
},
|
|
|
- path: '/alarmManage/index',
|
|
|
+ path: '/',
|
|
|
component: () =>
|
|
|
- import ('@/views/alarmManage/index'),
|
|
|
- }, ]
|
|
|
+ import('@/views/alarmManage/index'),
|
|
|
+ },]
|
|
|
},
|
|
|
- // {
|
|
|
- // path: '/alarmManage',
|
|
|
- // redirect: '/alarmManage/index',
|
|
|
- // meta: {
|
|
|
- // title: '告警管理',
|
|
|
- // icon: 'alarmManage',
|
|
|
- // affix: true,
|
|
|
- // },
|
|
|
- // component: Layout,
|
|
|
- // children: [{
|
|
|
- // meta: {
|
|
|
- // title: '告警管理',
|
|
|
- // icon: 'alarmManage',
|
|
|
- // affix: true,
|
|
|
- // },
|
|
|
- // path: 'alarmManage',
|
|
|
- // component: () =>
|
|
|
- // import ('@/views/alarmManage/index'),
|
|
|
-
|
|
|
- // }, ]
|
|
|
- // },
|
|
|
+
|
|
|
{
|
|
|
path: '/siteManage',
|
|
|
redirect: '/siteManage/index',
|
|
@@ -120,7 +73,7 @@ export const asyncRoutes = [
|
|
|
},
|
|
|
path: '/siteManage',
|
|
|
component: () =>
|
|
|
- import ('@/views/siteManage/index'),
|
|
|
+ import('@/views/siteManage/index'),
|
|
|
hidden: true
|
|
|
}]
|
|
|
},
|
|
@@ -140,7 +93,7 @@ export const asyncRoutes = [
|
|
|
},
|
|
|
path: '/stationManage',
|
|
|
component: () =>
|
|
|
- import ('@/views/stationManage/index'),
|
|
|
+ import('@/views/stationManage/index'),
|
|
|
hidden: true
|
|
|
}]
|
|
|
},
|
|
@@ -168,7 +121,7 @@ export const asyncRoutes = [
|
|
|
},
|
|
|
path: '/deviceManage',
|
|
|
component: () =>
|
|
|
- import ('@/views/deviceManage/powerEquip'),
|
|
|
+ import('@/views/deviceManage/powerEquip'),
|
|
|
hidden: true
|
|
|
}]
|
|
|
},
|
|
@@ -203,56 +156,77 @@ export const asyncRoutes = [
|
|
|
* demandAnalysis 需量分析
|
|
|
* consumConfig 能耗分析配置
|
|
|
*/
|
|
|
-
|
|
|
-
|
|
|
{
|
|
|
meta: { icon: 'dataManage', title: '数据管理', },
|
|
|
path: '/dataManage',
|
|
|
component: Layout,
|
|
|
redirect: '/dataManage/sameAnalysis/index',
|
|
|
children: [{
|
|
|
- meta: { icon: 'sameAnalysis', title: '同比分析报表', },
|
|
|
- path: 'sameAnalysis',
|
|
|
- component: () =>
|
|
|
- import ('@/views/dataManage/sameAnalysis/index'),
|
|
|
- },
|
|
|
- {
|
|
|
- meta: { icon: 'chainAnalysis', title: '环比分析报表', },
|
|
|
- path: 'chainAnalysis',
|
|
|
- component: () =>
|
|
|
- import ('@/views/dataManage/chainAnalysis/index'),
|
|
|
- },
|
|
|
+ meta: { icon: 'sameAnalysis', title: '同比分析报表', },
|
|
|
+ path: 'sameAnalysis',
|
|
|
+ component: () =>
|
|
|
+ import('@/views/dataManage/sameAnalysis/index'),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ meta: { icon: 'chainAnalysis', title: '环比分析报表', },
|
|
|
+ path: 'chainAnalysis',
|
|
|
+ component: () =>
|
|
|
+ import('@/views/dataManage/chainAnalysis/index'),
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // meta: { icon: 'handOpera', title: '手动抄表', },
|
|
|
+ // title: 'index-layout.menu.dataManage.handOpera',
|
|
|
+ // path: 'handOpera',
|
|
|
+ // component: () =>
|
|
|
+ // import ('@/views/dataManage/handOpera/index.vue'),
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ meta: { icon: 'energyReport', title: '用能月报', },
|
|
|
+ title: 'index-layout.menu.dataManage.energyReport',
|
|
|
+ path: 'energyReport',
|
|
|
+ component: () =>
|
|
|
+ import('@/views/dataManage/energyReport/index'),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ meta: { icon: 'demandAnalysis', title: '需量分析', },
|
|
|
+ title: 'index-layout.menu.dataManage.demandAnalysis',
|
|
|
+ path: 'demandAnalysis',
|
|
|
+ component: () =>
|
|
|
+ import('@/views/dataManage/demandAnalysis/index'),
|
|
|
+ },
|
|
|
// {
|
|
|
- // meta: { icon: 'handOpera', title: '手动抄表', },
|
|
|
- // title: 'index-layout.menu.dataManage.handOpera',
|
|
|
- // path: 'handOpera',
|
|
|
+ // meta: { icon: 'consumConfig', title: '能耗分析配置', },
|
|
|
+ // title: 'index-layout.menu.dataManage.consumConfig',
|
|
|
+ // path: 'consumConfig',
|
|
|
// component: () =>
|
|
|
- // import ('@/views/dataManage/handOpera/index.vue'),
|
|
|
- // },
|
|
|
+ // import ('@/views/dataManage/consumConfig/index.vue'),
|
|
|
+ // }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ {
|
|
|
+ meta: { icon: 'energyManage', title: '能源管理', },
|
|
|
+ path: '/energyManage',
|
|
|
+ component: Layout,
|
|
|
+ redirect: '/energyManage/totalEnergyC/index',
|
|
|
+ children: [
|
|
|
{
|
|
|
- meta: { icon: 'energyReport', title: '用能月报', },
|
|
|
- title: 'index-layout.menu.dataManage.energyReport',
|
|
|
- path: 'energyReport',
|
|
|
+ meta: { icon: 'totalEnergyC', title: '总能耗', },
|
|
|
+ path: 'totalEnergyC',
|
|
|
component: () =>
|
|
|
- import ('@/views/dataManage/energyReport/index'),
|
|
|
+ import('@/views/energyManage/totalEnergyC/index'),
|
|
|
},
|
|
|
{
|
|
|
- meta: { icon: 'demandAnalysis', title: '需量分析', },
|
|
|
- title: 'index-layout.menu.dataManage.demandAnalysis',
|
|
|
- path: 'demandAnalysis',
|
|
|
+ meta: { icon: 'totalEnergyC', title: '同比分析报表', },
|
|
|
+ path: 'totalEnergyC1',
|
|
|
component: () =>
|
|
|
- import ('@/views/dataManage/demandAnalysis/index'),
|
|
|
+ import('@/views/energyManage/totalEnergyC/index'),
|
|
|
},
|
|
|
- // {
|
|
|
- // meta: { icon: 'consumConfig', title: '能耗分析配置', },
|
|
|
- // title: 'index-layout.menu.dataManage.consumConfig',
|
|
|
- // path: 'consumConfig',
|
|
|
- // component: () =>
|
|
|
- // import ('@/views/dataManage/consumConfig/index.vue'),
|
|
|
- // }
|
|
|
]
|
|
|
},
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* powerQuality 电能质量
|
|
|
* harmonicReport 谐波报表
|
|
@@ -266,29 +240,29 @@ export const asyncRoutes = [
|
|
|
component: Layout,
|
|
|
redirect: '/powerQuality/harmonicReport/index',
|
|
|
children: [{
|
|
|
- meta: { icon: 'harmonicReport', title: '谐波报表', },
|
|
|
- path: 'harmonicReport',
|
|
|
- component: () =>
|
|
|
- import ('@/views/powerQuality/harmonicReport/index'),
|
|
|
- },
|
|
|
- {
|
|
|
- meta: { icon: 'realTimeMonitoring', title: '实时监测' },
|
|
|
- path: 'realTimeMonitoring',
|
|
|
- component: () =>
|
|
|
- import ('@/views/powerQuality/realTimeMonitoring/index'),
|
|
|
- },
|
|
|
- {
|
|
|
- meta: { icon: 'asseReport', title: '评估报告', },
|
|
|
- path: 'asseReport',
|
|
|
- component: () =>
|
|
|
- import ('@/views/powerQuality/asseReport/index'),
|
|
|
- },
|
|
|
- {
|
|
|
- meta: { icon: 'unbalanceAnalysis', title: '三相不平衡分析', },
|
|
|
- path: 'unbalanceAnalysis',
|
|
|
- component: () =>
|
|
|
- import ('@/views/powerQuality/unbalanceAnalysis/index'),
|
|
|
- },
|
|
|
+ meta: { icon: 'harmonicReport', title: '谐波报表', },
|
|
|
+ path: 'harmonicReport',
|
|
|
+ component: () =>
|
|
|
+ import('@/views/powerQuality/harmonicReport/index'),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ meta: { icon: 'realTimeMonitoring', title: '实时监测' },
|
|
|
+ path: 'realTimeMonitoring',
|
|
|
+ component: () =>
|
|
|
+ import('@/views/powerQuality/realTimeMonitoring/index'),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ meta: { icon: 'asseReport', title: '评估报告', },
|
|
|
+ path: 'asseReport',
|
|
|
+ component: () =>
|
|
|
+ import('@/views/powerQuality/asseReport/index'),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ meta: { icon: 'unbalanceAnalysis', title: '三相不平衡分析', },
|
|
|
+ path: 'unbalanceAnalysis',
|
|
|
+ component: () =>
|
|
|
+ import('@/views/powerQuality/unbalanceAnalysis/index'),
|
|
|
+ },
|
|
|
|
|
|
]
|
|
|
},
|
|
@@ -329,7 +303,7 @@ export const asyncRoutes = [
|
|
|
meta: { title: '计划停电', icon: 'planOutage', },
|
|
|
path: '/planOutage',
|
|
|
component: () =>
|
|
|
- import ('@/views/planOutage/index'),
|
|
|
+ import('@/views/planOutage/index'),
|
|
|
hidden: true
|
|
|
}],
|
|
|
},
|
|
@@ -439,17 +413,17 @@ export const asyncRoutes = [
|
|
|
component: Layout,
|
|
|
redirect: '/systemManage/userManage/index',
|
|
|
children: [{
|
|
|
- meta: { title: '用户管理', icon: 'userManage', },
|
|
|
- path: 'userManage',
|
|
|
- component: () =>
|
|
|
- import ('@/views/systemManage/userManage/index'),
|
|
|
- },
|
|
|
- {
|
|
|
- meta: { title: '权限管理', icon: 'rolePermission', },
|
|
|
- path: 'rolePermission',
|
|
|
- component: () =>
|
|
|
- import ('@/views/systemManage/rolePermission/index'),
|
|
|
- },
|
|
|
+ meta: { title: '用户管理', icon: 'userManage', },
|
|
|
+ path: 'userManage',
|
|
|
+ component: () =>
|
|
|
+ import('@/views/systemManage/userManage/index'),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ meta: { title: '权限管理', icon: 'rolePermission', },
|
|
|
+ path: 'rolePermission',
|
|
|
+ component: () =>
|
|
|
+ import('@/views/systemManage/rolePermission/index'),
|
|
|
+ },
|
|
|
]
|
|
|
},
|
|
|
|
|
@@ -508,16 +482,19 @@ export const asyncRoutes = [
|
|
|
// },
|
|
|
// ],
|
|
|
// },
|
|
|
- {
|
|
|
- path: '/*',
|
|
|
- redirect: '/404',
|
|
|
- hidden: true,
|
|
|
- },
|
|
|
+
|
|
|
]
|
|
|
|
|
|
const router = createRouter({
|
|
|
history: createWebHashHistory(),
|
|
|
routes: constantRoutes,
|
|
|
+ scrollBehavior(to, from, savedPosition) {
|
|
|
+ if (savedPosition) {
|
|
|
+ return savedPosition
|
|
|
+ } else {
|
|
|
+ return { top: 0 }
|
|
|
+ }
|
|
|
+ },
|
|
|
})
|
|
|
|
|
|
export default router
|