import Vue from 'vue'
import Router from 'vue-router'
import Login from './../views/Login.vue'
import Main from './../views/Main.vue'
import Indes from './../views/indes.vue'//首页
import My from './../views/my.vue'//我的
import IncidentList from './../views/incidentList.vue'//事件列表
import WorkList from './../views/workList.vue'//上下班记录查看
import NewIncident from './../views/newIncident.vue'//新建事件
import Inspection from './../views/inspection.vue'//巡检列表
import InspectionDetail from './../views/inspectionDetail.vue'//巡检详情
import InspectionDoneDetail from './../views/inspectionDoneDetail.vue'//已完成巡检详情
import NoticeDetails from './../views/noticeDetails.vue'//公告详情
import NoticeList from './../views/noticeList.vue'//公告列表
import KnowList from './../views/knowList.vue'//知识库列表（点赞）
import KnowDetails from './../views/knowDetails.vue'//知识库详情（点赞）
import ReferenceList from './../views/referenceList.vue'//知识库列表（引用）
import ReferenceDetail from './../views/referenceDetail.vue'//知识库详情（引用）
import Guide from './../views/guide.vue'//公告公示
import GuideDetail from './../views/guideDetail.vue'//常见问题
import Order from './../views/order.vue' //接单页面
import GrabSheet from './../views/grabSheet.vue' //抢单页面
import AgainAssign from './../views/againAssign.vue' //重新指派页面
import Processing from './../views/processing.vue' //处理中页面
import Solved from './../views/solved.vue' //已解决页面
import Closed from './../views/closed.vue' //已关闭页面
import WaitConfirm from './../views/waitConfirm.vue' //待审核页面
import ScanResult from './../views/scanResult.vue' //扫一扫结果页面
Vue.use(Router)

export default new Router({
  routes: [{
    path: '/login',
    component: Login,
    name: '',
    hidden: true
  },
  {
    path: '/main',
    component: Main,
    name: '',
    hidden: true,
    children: [{
      path: '/',
      redirect: '/main/indes'
    },
    {
      path: '/main/indes',
      component: Indes,
      meta: {
        allowBack: false
      },
    },
    {
      path: '/main/incidentList/:type',
      name: 'IncidentList',
      component: IncidentList,
      meta: {
        allowBack: false
      },
      children: []
    },
    {
      path: '/main/workList/:type/:status',
      name: 'WorkList',
      component: WorkList,
      meta: {
        allowBack: false
      },
      children: []
    },
    {
      path: '/main/inspection',
      name: 'Inspection',
      component: Inspection,
      meta: {
        allowBack: false
      },
    },
    {
      path: '/main/inspectionDoneDetail',
      name: 'InspectionDoneDetail',
      component: InspectionDoneDetail,
      meta: {
        allowBack: false
      },
    },
    {
      path: '/main/inspectionDetail',
      name: 'InspectionDetail',
      component: InspectionDetail,
      meta: {
        allowBack: false
      },
    },
    {
      path: '/main/my',
      component: My,
      meta: {
        allowBack: false
      },
    },
    ]
  },
  {
    path: '/order',
    name: 'Order',
    component: Order,
    meta: {
      allowBack: false
    },
  }, {
    path: '/grabSheet',
    name: 'GrabSheet',
    component: GrabSheet,
    meta: {
      allowBack: false
    },
  },
  {
    path: '/againAssign',
    name: 'AgainAssign',
    component: AgainAssign,
    meta: {
      allowBack: false
    },
  },
  {
    path: '/processing',
    name: 'Processing',
    component: Processing,
    meta: {
      allowBack: false
    },
  },
  {
    path: '/solved',
    name: 'Solved',
    component: Solved,
    meta: {
      allowBack: false
    },
  },
  {
    path: '/closed',
    name: 'Closed',
    component: Closed,
    meta: {
      allowBack: false
    },
  },
  {
    path: '/waitConfirm',
    name: 'WaitConfirm',
    component: WaitConfirm,
    meta: {
      allowBack: false
    },
  },
  {
    path: '/newIncident',
    name: 'NewIncident',
    component: NewIncident,
    meta: {
      allowBack: false
    },
  },
  {
    path: '/noticeDetails/:data',
    name: 'NoticeDetails',
    component: NoticeDetails,
    meta: {
      allowBack: false
    },
  },
  {
    path: '/noticeList',
    component: NoticeList,
    meta: {
      allowBack: false
    },
  },
  {
    path: '/knowList',
    name: 'KnowList',
    component: KnowList,
    meta: {
      allowBack: false
    },
  },
  {
    path: '/knowDetails/:data',
    name: 'KnowDetails',
    component: KnowDetails,
    meta: {
      allowBack: false
    },
  },
  {
    path: '/referenceList',
    name: 'ReferenceList',
    component: ReferenceList,
    meta: { allowBack: false },
  },
  {
    path: '/referenceDetail/:data',
    name: 'ReferenceDetail',
    component: ReferenceDetail,
    meta: { allowBack: false },
  },

  {
    path: '/guide',
    component: Guide,
    meta: {
      allowBack: false
    },
  },
  {
    path: '/guideDetail',
    name: 'GuideDetail',
    component: GuideDetail,
    meta: {
      allowBack: false
    },
  },
  {
    path: '/scanResult/:data',
    name: 'ScanResult',
    component: ScanResult,
    meta: {
      allowBack: false
    },
  },
  {
    path: '*',
    hidden: true,
    redirect: {
      path: '/login'
    }
  }
  ]
})
