index.js
3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
const routes = [
{
path: '/',
name: 'home',
component: () => myImport('views/home/index')
},
{
path: '/services',
name: 'services',
component: () => myImport('views/services/index')
},
{
path: '/about/:id',
name: 'about',
component: () => myImport('views/about/index')
},
{
path: '/concat',
name: 'concat',
component: () => myImport('views/concat/index'),
},
{
path:"/concat/recruit/:job",
name:"Recruit",
component: () => myImport('views/serviceSecond/recruit/index')
},
//信息化协同管理支撑平台
{
path: '/services/information',
name: 'information',
component: () => myImport('views/serviceSecond/information/index')
},
//安全日志分析管理系统
{
path: '/services/securityLog',
name: 'securityLog',
component: () => myImport('views/serviceSecond/securityLog/index')
},
//业务及应用综合分析平台
{
path: '/services/businessApp',
name: 'businessApp',
component: () => myImport('views/serviceSecond/businessApp/index')
},
//魔镜智能运维管理一体机
{
path: '/services/maintenance',
name: 'maintenance',
component: () => myImport('views/serviceSecond/maintenance/index')
},
//综合告警智能算法平台
{
path: '/services/alarm',
name: 'alarm',
component: () => myImport('views/serviceSecond/alarm/index')
},
//综合监控管理A-view
{
path: '/services/Aview',
name: 'Aview',
component: () => myImport('views/serviceSecond/Aview/index')
},
//面向应用的CMDB资产管理
{
path: '/services/cmdb',
name: 'cmdb',
component: () => myImport('views/serviceSecond/cmdb/index')
},
//魔镜智能多云运维平台
{
path: '/services/cloud',
name: 'cloud',
component: () => myImport('views/serviceSecond/cloud/index')
},
];
const router = VueRouter.createRouter({
history: VueRouter.createWebHashHistory(),
routes
});
router.beforeEach(async (to, from, next) => {
let toPath=to.name;
let path=to.path;
if(path){
//lsq 产品二级页时顶部的导航高亮显示 2022-09-19
let pathArr=path.split('/');
if(pathArr.length>2){
toPath=pathArr[1];
//lsq 设置二级页面时的导航样式
$('.logo-outer .hg-logo').attr('src','assets/img/logo.png');
$('.navigation').removeClass('navigation-white');
}else{
$('.logo-outer .hg-logo').attr('src','assets/img/logo-footer.png');
$('.navigation').addClass('navigation-white');
}
}
$('[top-nav]').removeClass('current');
$('[top-nav="'+toPath+'"]').addClass('current');
// 回到顶部
//lsq 跳转页面后页面滚动到顶部不增加滚动效果,延时减小 2022-10-14
$('html, body').animate({
scrollTop: 0
}, 100);
$('.collapse').removeClass('show');
next();
})
export default router