index.js 4.11 KB
import {createRouter, createWebHashHistory} from 'vue-router'
import * as Cookies from 'js-cookie'
const menuRoute = [
    {
        path: '/Main',
        component: () => import("@/views/Main/Main.vue"),
        children: [
            {
                path: 'DataRerun',
                component: () => import("@/views/DataRerun/DataRerun.vue"),
            },
						{
						    path: 'dayAnalysisRerun',
						    component: () => import("@/views/dayAnalysisRerun/dayAnalysisRerun.vue"),
						},
            {
                path: 'DataRepair',
                component: () => import("@/views/DataRepair/DataRepair.vue"),
            },
            {
                path: 'FeatureReExtract',
                component: () => import("@/views/FeatureReExtract/FeatureReExtract.vue"),
            },
            {
                path: 'FeatureLibraryRebuild',
                component: () => import("@/views/FeatureLibraryRebuild/FeatureLibraryRebuild.vue"),
            },
            {
                path: 'PeopleReContrast',
                component: () => import("@/views/PeopleReContrast/PeopleReContrast.vue"),
            },
            {
                path: 'SnapshotCluster',
                component: () => import("@/views/SnapshotCluster/SnapshotCluster.vue"),
            },
						{
						    path: 'batchesResult',
						    component: () => import("@/views/batchesResult/batchesResult.vue"),
						},
            {
                path: 'SnapshotCluster1',
                component: () => import("@/views/SnapshotCluster1/SnapshotCluster.vue"),
            },
						{
						    path: 'TestDriveHospitality',
						    component: () => import("@/views/TestDriveHospitality/SnapshotCluster.vue"),
						},
						{
						    path: 'SourceTrajectoryAnalysis',
						    component: () => import("@/views/SourceTrajectoryAnalysis/index.vue"),
						},
            {
                path: 'EquipmentTimeErrorVerification',
                component: () => import("@/views/EquipmentTimeErrorVerification/EquipmentTimeErrorVerification.vue"),
            },
            {
                path: 'FeatureComparisonVerification',
                component: () => import("@/views/FeatureComparisonVerification/FeatureComparisonVerification.vue"),
            },
            {
                path: 'ComparisonCapturedPictures',
                component: () => import("@/views/ComparisonCapturedPictures/ComparisonCapturedPictures.vue"),
            },
            {
                path: 'MinutePassenger',
                component: () => import("@/views/MinutePassenger/MinutePassenger.vue"),
            },
            {
                path: 'SystemLog',
                component: () => import("@/views/SystemLog/index.vue"),
            },
            {
                path: 'DataReplay',
                component: () => import("@/views/DataReplay/DataReplay.vue"),
            },
			{
			    path: 'Featurematching',
			    component: () => import("@/views/Featurematching/Featurematching.vue")
			},
            {
                path: 'equipmentDataRetransmission',
                component: () => import("@/views/equipmentDataRetransmission/equipmentDataRetransmission.vue"),
            },
            {
                path: 'FeatureMatchingAccuracy',
                component: () => import("@/views/FeatureMatchingAccuracy/FeatureMatchingAccuracy.vue")
            },
            {
                path: 'newMenu',
                component: () => import("@/views/newMenu/index.vue")
            },
        ]
    },
]

const route = [
    {
        path: '/',
        redirect: '/Main/SnapshotCluster',
    },
		{
		    path: '/404',
		    name: '404',
		    component: () =>
		        import ('@/views/error-page/404')
		},
    {
        path: '/test',
        component: () => import("@/views/Test/Test.vue"),
    },
    ...menuRoute
]

const router = createRouter(
    {
        history: createWebHashHistory(),
        routes: route
    }
)
// 全局路由守卫
router.beforeEach((to, from, next) => {
	if ((Cookies.get('userrole_type')&&Cookies.get('userrole_type')==-1)||to.path == '/404') {
			next();
	} else {
		router.push('/404');
	}
});
export default router