You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

291 lines
6.3 KiB

import Vue from "vue";
import Router from "vue-router";
2 years ago
Vue.use(Router);
2 years ago
/* Layout */
import Layout from "@/layout";
2 years ago
/* 所有角色可以访问/没有权限要求的基页 */
import codemenu from "./modules/codemenu";
2 years ago
export const constantRoutes = [
{
path: "/redirect",
2 years ago
component: Layout,
hidden: true,
children: [
{
path: "/redirect/:path(.*)",
component: () => import("@/views/redirect/index.vue"),
},
],
2 years ago
},
{
path: "/",
redirect: "index",
},
{
path: "/login",
component: () => import("@/views/login/login.vue"),
},
{
path: "/daping",
component: () => import("@/views/daping/daping.vue"),
name: "daping",
},
{
path: "/home",
component: () => import("@/views/Home/Home.vue"),
name: "home",
},
{
path: "/index",
2 years ago
component: Layout,
redirect: "/index",
children: [
{
path: "/index",
component: () => import("@/views/index.vue"),
name: "index",
meta: {
title: "主页",
noCache: true,
affix: true,
},
},
],
2 years ago
},
2 years ago
{
path: "/monitor",
2 years ago
component: Layout,
redirect: null,
meta: {
title: "视频中心",
},
children: [
{
path: "/monitor/videos",
component: () => import("@/views/monitor/videos/index.vue"),
name: "index",
meta: {
title: "视频中心",
},
},
],
},
////
// {
// path: "/gongyingshanggaunli",
// component: Layout,
// redirect: "/gongyingshang/gongyingshanggaunli",
// meta: {
// title: "视频中心1",
// },
// children: [
// {
// path: "/gongyingshang/gongyingshanggaunli",
// component: () =>
// import("@/views/gongyingshang/gongyingshanggaunli.vue"),
// name: "gongyingshanggaunli",
// meta: {
// title: "视频中心1",
// noCache: true,
// },
// },
// ],
// },
////人脸识别
{
path: "/renlianshibieList",
component: Layout,
redirect: "/renlianshibie/renlianshibieList",
meta: {
title: "人脸识别",
},
children: [
{
path: "/renlianshibie/renlianshibieList",
component: () => import("@/views/renlianshibie/renlianshibieList.vue"),
name: "renlianshibieList",
meta: {
title: "人脸识别",
noCache: true,
},
},
],
},
//设备台账
{
path: "/shebeitaizhangList",
component: Layout,
redirect: "/shebeitaizhang/shebeitaizhangList",
meta: {
title: "设备台账",
},
children: [
{
path: "/shebeitaizhang/shebeitaizhangList",
component: () =>
import("@/views/shebeitaizhang/shebeitaizhangList.vue"),
name: "shebeitaizhangList",
meta: {
title: "设备台账",
noCache: true,
},
},
],
},
////报警查询
{
path: "/baojingchaxunList",
component: Layout,
redirect: "/baojingchaxun/baojingchaxunList",
meta: {
title: "报警查询",
},
children: [
{
path: "/baojingchaxun/baojingchaxunList",
component: () => import("@/views/baojingchaxun/baojingchaxunList.vue"),
name: "baojingchaxunList",
meta: {
title: "报警查询",
noCache: true,
},
},
],
},
////设备状态
{
path: "/shebeizhuangtaiList",
component: Layout,
redirect: "/shebeizhuangtai/shebeizhuangtaiList",
meta: {
title: "设备状态",
2 years ago
},
children: [
{
path: "/shebeizhuangtai/shebeizhuangtaiList",
2 years ago
component: () =>
import("@/views/shebeizhuangtai/shebeizhuangtaiList.vue"),
name: "shebeizhuangtaiList",
2 years ago
meta: {
title: "设备状态",
noCache: true,
},
},
],
2 years ago
},
////设备日志
{
path: "/shebeirizhiList",
component: Layout,
redirect: "/shebeirizhi/shebeirizhiList",
meta: {
title: "设备日志",
},
children: [
{
path: "/shebeirizhi/shebeirizhiList",
component: () => import("@/views/shebeirizhi/shebeirizhiList.vue"),
name: "shebeirizhiList",
meta: {
title: "设备日志",
noCache: true,
},
},
],
},
////电子巡更
// {
// path: "/dianzixungengL",
// component: Layout,
// redirect: "/dianzixungeng/dianzixungengL",
// meta: {
// title: "电子巡更",
// },
// children: [
// {
// path: "/dianzixungeng/dianzixungengL",
// component: () => import("@/views/dianzixungeng/dianzixungengL.vue"),
// name: "dianzixungengL",
// meta: {
// title: "电子巡更",
// noCache: true,
// },
// },
// ],
// },
////消防报警
{
path: "/xiaofangbaojingL",
component: Layout,
redirect: "/xiaofangbaojing/xiaofangbaojingL",
meta: {
title: "消防报警",
},
children: [
{
path: "/xiaofangbaojing/xiaofangbaojingL",
component: () => import("@/views/xiaofangbaojing/xiaofangbaojingL.vue"),
name: "xiaofangbaojingL",
meta: {
title: "消防报警",
noCache: true,
},
},
],
},
////消息
{
path: "/xiaoxiList",
component: Layout,
redirect: "/xiaoxi/xiaoxiList",
meta: {
title: "消息",
},
children: [
{
path: "/xiaoxi/xiaoxiList",
component: () => import("@/views/xiaoxi/xiaoxiList.vue"),
name: "xiaoxiList",
meta: {
title: "消息",
noCache: true,
},
},
],
},
////
2 years ago
...codemenu,
{
path: "/404",
component: () => import("@/views/404"),
hidden: true,
},
2 years ago
// 404 page must be placed at the end !!!
// { path: '*', redirect: '/404', hidden: true }
];
2 years ago
const createRouter = () =>
new Router({
// mode: 'history', // require service support
scrollBehavior: () => ({
y: 0,
}),
routes: constantRoutes,
});
2 years ago
const router = createRouter();
2 years ago
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() {
const newRouter = createRouter();
router.matcher = newRouter.matcher; // reset router
2 years ago
}
export default router;