index.js 3.69 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),
    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: "/",
    name: "tanskmanage",
    component: resolve => require(["../views/Layout/index.vue"], resolve),
    meta: {
      icon: "el-icon-location"
    },
    children: [
      {
        path: "/task/sceneSet",
        name: "sceneSet",
        meta: {
          icon: "el-icon-location"
        },
        component: resolve => require(["../views/sceneManage/index.vue"], resolve)
      },
      {
        path: "/task/taskSet",
        name: "taskSet",
        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: "el-icon-location"
    },
    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/param",
        name: "交通参数",
        meta: {
          icon: "el-icon-user"
        },
        component: resolve => require(["../views/search/publicFlow.vue"], resolve)
      }
    ]
  }
];
console.log(process.env.BASE_URL);
const router = new VueRouter({
  // mode: "history",
  // base: process.env.BASE_URL,
  routes: constantRouterMap
});

export default router;