import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: () => import('components/login/index.vue'),
    meta: { title: '登录', keepAlive: false, hidden: false }
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('components/login/index.vue'),
    meta: { title: '登录', keepAlive: false, hidden: false }
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('views/home/index.vue'),
    meta: { title: '工作台', keepAlive: false, hidden: true }
  },
  {
    path: '/addDanger',
    name: 'addDanger',
    component: () => import('views/home/danger/addDanger.vue'),
    meta: { title: '添加隐患', keepAlive: false, hidden: false }
  },
  {
    path: '/dangerList',
    name: 'dangerList',
    component: () => import('views/home/danger/dangerList.vue'),
    meta: { title: '隐患列表', keepAlive: false, hidden: false }
  },
  {
    path: '/licenseList',
    name: 'licenseList',
    component: () => import('views/home/jobReservation/licenseList/index.vue'),
    meta: { title: '作业列表', keepAlive: false, hidden: false }
  },
  {
    path: '/licenseDetails',
    name: 'licenseDetails',
    component: () => import('views/home/jobReservation/licenseList/licenseDetails.vue'),
    meta: { title: '作业详情', keepAlive: false, hidden: false }
  },
  {
    path: '/jobReservationFrom',
    name: 'jobReservationFrom',
    component: () => import('views/home/jobReservation/jobReservationFrom.vue'),
    meta: { title: '作业申请', keepAlive: false, hidden: false }
  },
  {
    path: '/dangerDetails',
    name: 'dangerDetails',
    component: () => import('views/home/danger/dangerDetails.vue'),
    meta: { title: '隐患详情', keepAlive: false, hidden: false }
  },
  {
    path: '/task',
    name: 'task',
    component: () => import('views/home/polling/task.vue'),
    meta: { title: '巡检任务', keepAlive: false, hidden: false }
  },
  {
    path: '/inspect',
    name: 'inspect',
    component: () => import('views/home/polling/inspect.vue'),
    meta: { title: '检查计划', keepAlive: false, hidden: false }
  },
  {
    path: '/meet',
    name: 'meet',
    component: () => import('views/home/emergencies/meet.vue'),
    meta: { title: '应急演习', keepAlive: false, hidden: false }
  },
  {
    path: '/details',
    name: 'details',
    component: () => import('views/home/emergencies/details.vue'),
    meta: { title: '演习详情', keepAlive: false, hidden: false }
  },
  {
    path: '/news',
    name: 'news',
    component: () => import('views/news/index.vue'),
    meta: { title: '消息', keepAlive: false, hidden: true }
  },
  {
    path: '/homePage',
    name: 'homePage',
    component: () => import('views/homePage/index.vue'),
    meta: { title: '首页', keepAlive: false, hidden: true }
  },
  {
    path: '/inform',
    name: 'inform',
    component: () => import('views/news/inform.vue'),
    meta: { title: '通知公告', keepAlive: false, hidden: false }
  },
  {
    path: '/information',
    name: 'information',
    component: () => import('views/news/information.vue'),
    meta: { title: '个人消息', keepAlive: false, hidden: false }
  },
  {
    path: '/backlog',
    name: 'backlog',
    component: () => import('views/backlog/index.vue'),
    meta: { title: '待办事项', keepAlive: false, hidden: true }
  },
  {
    path: '/trainList',
    name: 'trainList',
    component: () => import('views/train/trainList.vue'),
    meta: { title: '培训', keepAlive: true, hidden: false }
  },
  {
    path: '/course',
    name: 'course',
    component: () => import('views/train/course.vue'),
    meta: { title: '课程列表', keepAlive: false, hidden: false }
  },
  {
    path: '/courseDetails',
    name: 'courseDetails',
    component: () => import('views/train/courseDetails.vue'),
    meta: { title: '课程详情', keepAlive: false, hidden: false }
  },
  {
    path: '/examination',
    name: 'examination',
    component: () => import('views/train/examination.vue'),
    meta: { title: '考试', keepAlive: false, hidden: false }
  },
  {
    path: '/examinationDetail',
    name: 'examinationDetail',
    component: () => import('views/train/examinationDetail.vue'),
    meta: { title: '考试记录', keepAlive: false, hidden: false }
  }

]

const router = new VueRouter({
  routes,
  scrollBehavior: () => ({ y: 0 })
})

export default router
