import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [{
      path: '/login',
      name: 'login',
      component: () => import('./views/Login.vue'),
      show: 0,
    },
    {
      path: '/',
      name: '概览',
      icon: 'el-icon-s-data',
      component: () => import('./views/Home.vue'),
      show: 1,
      isLeaf: 1,
      children: [{
        path: '/',
        component: () => import('./views/Data.vue'),
        name: '概览'
      }, ]
    },
    {
      path: '/govermentData',
      name: '政府概览',
      icon: 'el-icon-s-data',
      component: () => import('./views/Home.vue'),
      show: 1,
      isLeaf: 1,
      children: [{
        path: '/govermentData',
        component: () => import('./views/GovermentData.vue'),
        name: '政府概览'
      }, ]
    },
    {
      path: '/companyData',
      name: '企业概览',
      icon: 'el-icon-s-data',
      component: () => import('./views/Home.vue'),
      show: 1,
      isLeaf: 1,
      children: [{
        path: '/companyData',
        component: () => import('./views/CompanyData.vue'),
        name: '企业概览'
      }, ]
    },
    {
      path: '/government',
      name: '政府管理',
      change:1,
      icon: 'el-icon-office-building',
      component: () => import('./views/Home.vue'),
      show: 1,
      isLeaf: 1,
      children: [{
        path: '/government',
        component: () => import('./views/government/Index.vue'),
        name: '政府管理'
      }, ]
    },
    {
      path: '/',
      name: '企业管理',
      change:1,
      icon: 'el-icon-s-home',
      component: () => import('./views/Home.vue'),
      show: 1,
      isLeaf: 0,
      children: [{
        path: '/company',
        component: () => import('./views/company/Company.vue'),
        name: '公司管理',
        meta: {
          keepAlive: true, 
          isBack: false
        }
      },{
        path: '/company/add',
        hide:1,
        component: () => import('./views/company/Add.vue'),
        name: '新增企业'
      },{
        path: '/company/detail',
        hide:1,
        component: () => import('./views/company/Detail.vue'),
        name: '新增企业'
      },{
        path: '/department',
        component: () => import('./views/company/Department.vue'),
        name: '部门管理'
      },{
        path: '/staff',
        component: () => import('./views/company/Staff.vue'),
        name: '员工管理'
      }]
    },
    {
      path: '/',
      name: '任务管理',
      change:1,
      icon: 'el-icon-s-flag',
      component: () => import('./views/Home.vue'),
      show: 1,
      isLeaf: 0,
      children: [{
        path: '/danger',
        component: () => import('./views/task/Danger.vue'),
        name: '风险点管理'
      },{
        path: '/dangertask',
        component: () => import('./views/task/DangerTask.vue'),
        name: '风险点任务'
      },{
        path: '/monitjob',
        component: () => import('./views/task/Monitjob.vue'),
        name: '巡检记录'
      }]
    },
    {
      path: '/',
      name: '消息管理',
      change:1,
      icon: 'el-icon-message',
      component: () => import('./views/Home.vue'),
      show: 1,
      isLeaf: 0,
      children: [{
        path: '/notice',
        component: () => import('./views/message/Index.vue'),
        name: '通知消息'
      },{
        path: '/system',
        component: () => import('./views/message/System.vue'),
        name: '系统消息'
      },{
        path: '/warning',
        component: () => import('./views/message/WarningList.vue'),
        name: '告警消息'
      }]
    },
    {
      path: '/merterial',
      name: '资料管理',
      change:1,
      icon: 'el-icon-document-copy',
      component: () => import('./views/Home.vue'),
      show: 1,
      isLeaf: 1,
      children: [{
        path: '/merterial',
        component: () => import('./views/material/Index.vue'),
        name: '资料管理'
      }]
    },
    {
      path: '/billlist',
      name: '清单管理',
      change:1,
      icon: 'el-icon-document-copy',
      component: () => import('./views/Home.vue'),
      show: 1,
      isLeaf: 1,
      children: [{
        path: '/billlist',
        component: () => import('./views/material/BillList.vue'),
        name: '清单管理'
      }]
    },
    {
      path: '/frendlink',
      name: '友情链接',
      change:1,
      icon: 'el-icon-paperclip',
      component: () => import('./views/Home.vue'),
      show: 1,
      isLeaf: 1,
      children: [{
        path: '/frendlink',
        component: () => import('./views/material/Frendlink.vue'),
        name: '友情链接'
      }]
    },
  ]
})