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.
 
 
 
 

461 lines
9.5 KiB

import Vue from "vue";
import Router from "vue-router";
Vue.use(Router);
/* Layout */
import Layout from "@/layout";
/* 所有角色可以访问/没有权限要求的基页 */
import codemenu from "./modules/codemenu";
export const constantRoutes = [
{
path: "/redirect",
component: Layout,
hidden: true,
children: [
{
path: "/redirect/:path(.*)",
component: () => import("@/views/redirect/index.vue"),
},
],
},
{
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",
component: Layout,
redirect: "/index",
children: [
{
path: "/index",
component: () => import("@/views/index.vue"),
name: "index",
meta: {
title: "主页",
noCache: true,
affix: true,
},
},
],
},
{
path: "/call",
component: Layout,
redirect: "/call",
children: [
{
path: "/call",
component: () => import("@/views/call.vue"),
name: "call",
meta: {
title: "报警",
noCache: true,
affix: true,
},
},
],
},
{
path: "/index1",
component: Layout,
redirect: "/index1",
children: [
{
path: "/index1",
component: () => import("@/views/index1.vue"),
name: "index1",
meta: {
title: "报警",
noCache: true,
affix: true,
},
}]
},
{
path: "/index2",
component: Layout,
redirect: "/index2",
children: [
{
path: "/index2",
component: () => import("@/views/index2.vue"),
name: "index2",
meta: {
title: "报警",
noCache: true,
affix: true,
},
}
],
},
{
path: "/index3",
component: Layout,
redirect: "/index3",
children: [
{
path: "/index3",
component: () => import("@/views/index3.vue"),
name: "index3",
meta: {
title: "报警",
noCache: true,
affix: true,
},
}
],
},
{
path: "/index4",
component: Layout,
redirect: "/index4",
children: [
{
path: "/index4",
component: () => import("@/views/index4.vue"),
name: "index4",
meta: {
title: "报警",
noCache: true,
affix: true,
},
}
],
},
{
path: "/index5",
component: Layout,
redirect: "/index5",
children: [
{
path: "/index5",
component: () => import("@/views/index5.vue"),
name: "index5",
meta: {
title: "报警",
noCache: true,
affix: true,
},
}
],
},
{
path: "/index6",
component: Layout,
redirect: "/index6",
children: [
{
path: "/index6",
component: () => import("@/views/index6.vue"),
name: "index6",
meta: {
title: "报警",
noCache: true,
affix: true,
},
}
],
},
{
path: "/monitor",
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: "/zhiwujianceList",
component: Layout,
redirect: "/zhiwujiance/zhiwujianceList",
meta: {
title: "质物监测",
},
children: [
{
path: "/zhiwujiance/zhiwujianceList",
component: () => import("@/views/zhiwujiance/zhiwujianceList.vue"),
name: "zhiwujianceList",
meta: {
title: "质物监测",
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: "/cangkuguanliList",
component: Layout,
redirect: "/cangkuguanli/cangkuguanliList",
meta: {
title: "仓库管理",
},
children: [
{
path: "/cangkuguanli/cangkuguanliList",
component: () => import("@/views/cangkuguanli/cangkuguanliList.vue"),
name: "cangkuguanliList",
meta: {
title: "仓库管理",
noCache: true,
},
},
{
path: "/cangkuguanli/shebeiList",
component: () => import("@/views/cangkuguanli/shebei/shebeiList.vue"),
name: "shebeiList",
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: "设备状态",
},
children: [
{
path: "/shebeizhuangtai/shebeizhuangtaiList",
component: () =>
import("@/views/shebeizhuangtai/shebeizhuangtaiList.vue"),
name: "shebeizhuangtaiList",
meta: {
title: "设备状态",
noCache: true,
},
},
],
},
////设备日志
{
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,
},
},
],
},
////
...codemenu,
{
path: "/404",
component: () => import("@/views/404"),
hidden: true,
},
// 404 page must be placed at the end !!!
// { path: '*', redirect: '/404', hidden: true }
];
const createRouter = () =>
new Router({
// mode: 'history', // require service support
scrollBehavior: () => ({
y: 0,
}),
routes: constantRoutes,
});
const router = createRouter();
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() {
const newRouter = createRouter();
router.matcher = newRouter.matcher; // reset router
}
export default router;