import Vue from 'vue'
import Router from 'vue-router'

// 解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单报错问题
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}

Vue.use(Router)

import H5HomeRoot from '@/views/H5RootContainer.vue';
import HomeRoot from '@/views/RootContainer.vue';

export default new Router({
    routes: [
    //     {
    //     path: "/",
    //     name: "home",
    //     redirect: "/login",
    // },
    {
        path: "/login",
        name: "Login",
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () =>
            import ("@/views/login/Login.vue")
    },{
        path: '/h5',
        name: 'H5Home',
        redirect: '/h5/home/app',
        component: H5HomeRoot,
        children: [{
            path: "/h5/home/app",
            name: "H5HomeApp",
            component: () =>
                import ( /* webpackChunkName: "home" */ './views/h5/Home.vue'),
        },{
            path: "/h5/home/app_install",
            name: "H5HomeAppInstall",
            component: () =>
                import ( /* webpackChunkName: "home" */ './views/h5/AppInstall.vue'),
        }]
    }, {
        path: '/',
        name: 'Home',
        redirect: '/home',
        component: HomeRoot,
        children: [{
            path: "/home",
            name: "HomeOverview",
            meta: {
                paths: [{
                    title: '首页',
                    path: '/'
                }, {
                    title: '概览'
                }],
            },
            component: () =>
                import ( /* webpackChunkName: "home" */ './views/home/HomeOverview.vue'),
        }, {
            path: "/exam",
            name: "AutoExam",
            meta: {
                paths: [{
                    title: '首页',
                    path: '/'
                }, {
                    title: '考试'
                }, {
                    title: '一键考试'
                }],
            },
            component: () =>
                import ( /* webpackChunkName: "home" */ './views/exam/AutoExam.vue'),
        }, {
            path: "/app/details",
            name: "AppDetails",
            meta: {
                paths: [{
                    title: '首页',
                    path: '/'
                }, {
                    title: 'APP概览'
                }, {
                    title: 'APP列表',
                    path: '/app/list'
                }, {
                    title: 'APP详情'
                }],
            },
            component: () =>
                import ( /* webpackChunkName: "home" */ './views/app/AppDetails.vue'),
        },{
            path: "/apk/info",
            name: "ApkInfo",
            meta: {
                paths: [{
                    title: '首页',
                    path: '/'
                }, {
                    title: '实用工具'
                }, {
                    title: 'Apk信息',
                    path: '/apk/info'
                }],
            },
            component: () =>
                import ( /* webpackChunkName: "home" */ './views/apk/ApkInfo.vue'),
        },{
            path: "/apk/classify/list",
            name: "ApkClassifyList",
            meta: {
                paths: [{
                    title: '首页',
                    path: '/'
                }, {
                    title: '应用分发'
                }, {
                    title: 'Apk分类列表',
                    path: '/apk/classify/list'
                }],
            },
            component: () =>
                import ( /* webpackChunkName: "home" */ './views/apk/ApkClassifyList.vue'),
        }, {
            path: "/custom/log/list",
            name: "CustomLogList",
            meta: {
                paths: [{
                    title: '首页',
                    path: '/'
                }, {
                    title: '自定义日志'
                }, {
                    title: '日志列表'
                }],
            },
            component: () =>
                import ( /* webpackChunkName: "home" */ './views/log/CustomLogList.vue'),
        }, {
            path: "/device/search",
            name: "DeviceSearch",
            meta: {
                paths: [{
                    title: '首页',
                    path: '/'
                }, {
                    title: '查询设备信息'
                }],
            },
            component: () =>
                import ( /* webpackChunkName: "home" */ './views/device/DeviceSearch.vue'),
        }, {
            path: "/mock/list",
            name: "MockList",
            meta: {
                paths: [{
                    title: '首页',
                    path: '/'
                }, {
                    title: 'Mock数据'
                }],
            },
            component: () =>
                import ( /* webpackChunkName: "home" */ './views/mock/MockList.vue'),
        },{
            path: "/logcat/info",
            name: "LogcatPrev",
            meta: {
                paths: [{
                    title: '首页',
                    path: '/'
                }, {
                    title: '云日志'
                }],
            },
            component: () =>
                import ( /* webpackChunkName: "home" */ './views/log/LogcatPrev.vue'),
        },{
            path: "/logcat/devices",
            name: "LogDeviceList",
            meta: {
                paths: [{
                    title: '首页',
                    path: '/'
                }, {
                    title: '设备列表'
                }],
            },
            component: () =>
                import ( /* webpackChunkName: "home" */ './views/log/LogDeviceList.vue'),
        }, {
            path: "/logcat/list",
            name: "CustomLogList",
            meta: {
                paths: [{
                    title: '首页',
                    path: '/'
                }, {
                    title: '云日志'
                }],
            },
            component: () =>
                import ( /* webpackChunkName: "home" */ './views/log/CustomLogList.vue'),
        }, {
            path: "/user/list",
            name: "UserConfigList",
            meta: {
                paths: [{
                    title: '首页',
                    path: '/'
                }, {
                    title: 'APP列表',
                    path: '/app/list'
                }, {
                    title: '用户列表'
                }],
            },
            component: () =>
                import ( /* webpackChunkName: "home" */ './views/user/UserConfigList.vue'),
        }, {
            path: "/excess/list",
            name: "ExcessWarningList",
            meta: {
                paths: [{
                    title: '首页',
                    path: '/'
                }, {
                    title: 'APP列表',
                    path: '/app/list'
                }, {
                    title: '超量列表'
                }],
            },
            component: () =>
                import ( /* webpackChunkName: "home" */ './views/excess/ExcessWarningList.vue'),
        }, {
            path: "/work/commit/list",
            name: "WorkCommitList",
            meta: {
                paths: [{
                    title: '首页',
                    path: '/'
                }, {
                    title: '作业提交统计'
                }],
            },
            component: () =>
                import ( /* webpackChunkName: "home" */ './views/work_commit/WorkCommitList.vue'),
        }, {
            path: "/itv/check",
            name: "ItvCheck",
            meta: {
                paths: [{
                    title: '首页',
                    path: '/'
                }, {
                    title: 'ITV检测'
                }],
            },
            component: () =>
                import ( /* webpackChunkName: "home" */ './views/itv/ItvCheck.vue'),
        }, {
            path: "/translate/list",
            name: "TranslateList",
            meta: {
                paths: [{
                    title: '首页',
                    path: '/'
                }, {
                    title: '国际化翻译系统'
                }],
            },
            component: () =>
                import ( /* webpackChunkName: "home" */ './views/translate/Translate.vue'),
        }, {
            path: "/translate/tools",
            name: "TranslateTools",
            meta: {
                paths: [{
                    title: '首页',
                    path: '/'
                }, {
                    title: '翻译工具下载'
                }],
            },
            component: () =>
                import ( /* webpackChunkName: "home" */ './views/translate/TranslateTools.vue'),
        }, {
            path: "/translate/modules",
            name: "TranslateModules",
            meta: {
                paths: [{
                    title: '首页',
                    path: '/'
                }, {
                    title: '翻译模块配置'
                }],
            },
            component: () =>
                import ( /* webpackChunkName: "home" */ './views/translate/TranslateModules.vue'),
        }]
    }]
})

