import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'

Vue.use(VueRouter)
//vue-router在3.0版本以上重复点菜单报错问题
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
const routes = [
  {
    path: '/',
    name: 'Index',
    component: () =>import('@/views/configuration/ParamsConfig.vue')
  },
  {
    path: '/toplogyView/workspace',
    name: 'Workspace',
    component: () =>import('@/views/topology/Workspace.vue')
  },
  {
    path: '/toplogyView/preview',
    name: 'Preview',
    component: () =>import('@/views/topology/Preview.vue')
  },
  {
    path: '/toplogyView/job',
    name: 'Job',
    component: () =>import('@/views/job/index.vue')
  },
  {
    path: '/toplogyView/dict/data/:dictId',
    name: 'DictData',
    component: () =>import('@/views/dict/data.vue')
  },
  {
    path: '/toplogyView/dict/type',
    name: 'DictType',
    component: () =>import('@/views/dict/index.vue')
  }
]

const router = new VueRouter({
  mode: 'hash',
  routes
})

export default router
