Blame view

website/src/router/index.js 3.13 KB
1 2 3 4 5 6 7 8 9 10 11 12
const routes = [
    {
        path: '/',
        name: 'home',
        component: () => myImport('views/home/index')
    },
    {
        path: '/services',
        name: 'services',
        component: () => myImport('views/services/index')
    },
    {
13
        path: '/about/:id',
14 15 16 17 18 19
        name: 'about',
        component: () => myImport('views/about/index')
    },
    {
        path: '/concat',
        name: 'concat',
zhangtianqi authored
20 21 22
        component: () => myImport('views/concat/index'),
    },
    {
23
        path:"/concat/recruit/:job",
zhangtianqi authored
24 25
        name:"Recruit",
        component: () => myImport('views/serviceSecond/recruit/index')
26 27 28 29 30 31 32 33 34 35 36 37 38
    },
    //信息化协同管理支撑平台
    {
        path: '/services/information',
        name: 'information',
        component: () => myImport('views/serviceSecond/information/index')
    },
    //安全日志分析管理系统
    {
        path: '/services/securityLog',
        name: 'securityLog',
        component: () => myImport('views/serviceSecond/securityLog/index')
    },
39 40 41 42 43 44
    //业务及应用综合分析平台
    {
        path: '/services/businessApp',
        name: 'businessApp',
        component: () => myImport('views/serviceSecond/businessApp/index')
    },
45 46 47 48 49 50
    //魔镜智能运维管理一体机
    {
        path: '/services/maintenance',
        name: 'maintenance',
        component: () => myImport('views/serviceSecond/maintenance/index')
    },
51 52 53 54 55 56 57 58 59 60 61 62
    //综合告警智能算法平台
    {
        path: '/services/alarm',
        name: 'alarm',
        component: () => myImport('views/serviceSecond/alarm/index')
    },
    //综合监控管理A-view
    {
        path: '/services/Aview',
        name: 'Aview',
        component: () => myImport('views/serviceSecond/Aview/index')
    },
63
    //面向应用的CMDB资产管理
64 65 66 67 68 69 70 71 72 73 74
    {
        path: '/services/cmdb',
        name: 'cmdb',
        component: () => myImport('views/serviceSecond/cmdb/index')
    },
    //魔镜智能多云运维平台
    {
        path: '/services/cloud',
        name: 'cloud',
        component: () => myImport('views/serviceSecond/cloud/index')
    },
75 76 77 78 79 80 81
];

const router = VueRouter.createRouter({
    history: VueRouter.createWebHashHistory(),
    routes
});
wangtao authored
82 83

router.beforeEach(async (to, from, next) => {
84 85 86 87 88 89 90
    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];
91 92 93 94 95 96
            //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');
97 98
        }
    }
wangtao authored
99
    $('[top-nav]').removeClass('current');
100
    $('[top-nav="'+toPath+'"]').addClass('current');
wangtao authored
101
    // 回到顶部
102
    //lsq 跳转页面后页面滚动到顶部不增加滚动效果,延时减小 2022-10-14
wangtao authored
103 104
    $('html, body').animate({
        scrollTop: 0
105
    }, 100);
106
    $('.collapse').removeClass('show');
wangtao authored
107 108 109
    next();
})
110
export default router