index.js 7.11 KB
import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

export const constantRouterMap = [
  {
    path: "/",
    name: "首页",
    component: resolve => require(["../views/Layout/index.vue"], resolve),
    redirect: "/trficcshow",
    children: [
      {
        path: "/trficcshow",
        name: "交通展示",
        component: resolve =>
          require(["../views/trafficShow/index.vue"], resolve)
      },
      {
        path: "/behaviorshow",
        name: "综治展示",
        component: resolve =>
          require(["../views/behaviorShow/index.vue"], resolve)
      }
    ]
  },
  {
    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: resolve => require(["../views/Login.vue"], resolve)
  },
  {
    path: "/show",
    name: "show",
    // 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: resolve => require(["../views/Show.vue"], resolve)
  }
];
export const asyncRouterMap = [
  {
    path: "/video_task",
    name: "任务管理",
    component: resolve => require(["../views/Layout/index.vue"], resolve),
    meta: {
      icon: "icon-fanxing-iconxuanzhongrenwuguanli1"
    },
    children: [
      {
        path: "/video_task/config",
        name: "场景设置",
        meta: {
          icon: "el-icon-location"
        },
        component: resolve =>
          require(["../views/sceneManage/index.vue"], resolve)
      },
      {
        path: "/video_task/manage",
        name: "任务设置",
        meta: {
          icon: "el-icon-location"
        },
        component: resolve =>
          require(["../views/taskManage/index.vue"], resolve)
      }
    ]
  },
  {
    path: "/search",
    name: "智能检索",
    component: resolve => require(["../views/Layout/index.vue"], resolve),
    meta: {
      icon: "icon-fanxing-iconxuanzhongzhinengjiansuo1"
    },
    children: [
      {
        path: "/search/vehicle",
        name: "过车检索",
        meta: {
          icon: "el-icon-location"
        },
        component: resolve =>
          require(["../views/search/vehicleSearch.vue"], resolve)
      },
      {
        path: "/search/xcycle",
        name: "行人非机动车检索",
        meta: {
          icon: "el-icon-user"
        },
        component: resolve => require(["../views/search/xcycle.vue"], resolve)
      },
      //       {
      //         path: "/search/pedestrian",
      //         name: "行人检索",
      //         meta: {
      //           icon: "el-icon-location"
      //         },
      //         component: resolve =>
      //           require(["../views/search/pedestrian.vue"], resolve)
      //       },
      {
        path: "/search/event",
        name: "事件检索",
        meta: {
          icon: "el-icon-location"
        },
        component: resolve => require(["../views/search/event.vue"], resolve)
      },
      {
        path: "/search/illegal",
        name: "违法检索",
        meta: {
          icon: "el-icon-location"
        },
        component: resolve => require(["../views/search/illegal.vue"], resolve)
      },
      {
        path: "/search/traficflow",
        name: "流量检索",
        meta: {
          icon: "el-icon-location"
        },
        component: resolve =>
          require(["../views/search/traficflow.vue"], resolve)
      }
      // 	  {
      //         path: "/search/flow",
      //         name: "公共客流",
      // 		meta: {
      // 		  icon: "el-icon-location"
      // 		},
      //          component: resolve => require(["../views/search/publicFlow.vue"], resolve),
      //       }
    ]
  },
  {
    path: "/resource",
    name: "资源管理",
    component: resolve => require(["../views/Layout/index.vue"], resolve),
    meta: {
      icon: "icon-fanxing-iconxuanzhongziyuanguanli1"
    },
    children: [
      {
        path: "/resource/video",
        name: "视频设备",
        meta: {
          icon: "el-icon-location"
        },
        component: resolve =>
          require(["../views/resource/videoEquipment.vue"], resolve)
      },
      {
        path: "/resource/equipment",
        name: "分析设备",
        meta: {
          icon: "el-icon-location"
        },
        component: resolve =>
          require(["../views/resource/analysis.vue"], resolve)
      },
      {
        path: "/resource/store_confs",
        name: "存储配置",
        meta: {
          icon: "el-icon-location"
        },
        component: resolve =>
          require(["../views/resource/store_confs.vue"], resolve)
      },
      {
        path: "/resource/author",
        name: "授权管理",
        meta: {
          icon: "el-icon-location"
        },
        component: resolve =>
          require(["../views/resource/Author/author.vue"], resolve)
      },
      {
        path: "/resource/nationalStandard",
        name: "国标配置",
        meta: {
          icon: "el-icon-location"
        },
        component: resolve =>
          require(["../views/resource/nationalStandard.vue"], resolve)
      },
      {
        path: "/resource/codes",
        name: "字典管理",
        meta: {
          icon: "el-icon-location"
        },
        component: resolve =>
          require(["../views/resource/Codes/codes.vue"], resolve)
      }
    ]
  },
  {
    path: "/ops",
    name: "系统运维",
    component: resolve => require(["../views/Layout/index.vue"], resolve),
    meta: {
      icon: "icon-fanxing-iconxuanzhongxitongyunwei"
    },
    children: [
      {
        path: "/ops/equipment_manage",
        name: "设备管理",
        meta: {
          icon: "el-icon-location"
        },
        component: resolve =>
          require(["../views/ops/equipment_manage"], resolve)
      },
      {
        path: "/ops/system_manage",
        name: "系统配置",
        meta: {
          icon: "el-icon-location"
        },
        component: resolve => require(["../views/ops/system_manage"], resolve)
      },
      {
        path: "/ops/user_manage",
        name: "用户管理",
        meta: {
          icon: "el-icon-location"
        },
        component: resolve => require(["../views/ops/user_manage.vue"], resolve)
      },
      {
        path: "/ops/role_manage",
        name: "角色管理",
        meta: {
          icon: "el-icon-location"
        },
        component: resolve => require(["../views/ops/role_manage.vue"], resolve)
      },
      {
        path: "/ops/batch_upgrade",
        name: "批量升级",
        meta: {
          icon: "el-icon-location"
        },
        component: resolve => require(["../views/ops/log_manage.vue"], resolve)
      },
      {
        path: "/ops/log_manage",
        name: "日志管理",
        meta: {
          icon: "el-icon-location"
        },
        component: resolve => require(["../views/ops/log_manage.vue"], resolve)
      }
    ]
  }
];
const router = new VueRouter({
  // mode: "history",
  // base: process.env.BASE_URL,
  routes: constantRouterMap
});

export default router;