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

Vue.use(Router)

/* Layout */
import Layout from '@/layout'
import Layoutt from '@/layoutt'


import grainTemperatureDetection from '@/views/grainDetection/grainTemperatureDetection/index'
import commonPage from '@/views/grainDetection/gasDetection/gas'
import reservesTabs from '@/views/equipConfig/equipConfiguration/reservesTabs'
import alarmReservesTabs from '@/views/equipConfig/alarmThresholdSetting/reservesTabs'
/**
 * Note: sub-menu only appear when route children.length >= 1
 * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
 *
 * hidden: true                   if set true, item will not show in the sidebar(default is false)
 * alwaysShow: true               if set true, will always show the root menu
 *                                if not set alwaysShow, when item has more than one children route,
 *                                it will becomes nested mode, otherwise not show the root menu
 * redirect: noRedirect           if set noRedirect will no redirect in the breadcrumb
 * name:'router-name'             the name is used by <keep-alive> (must set!!!)
 * meta : {
    roles: ['admin','editor']    control the page roles (you can set multiple roles)
    title: 'title'               the name show in sidebar and breadcrumb (recommend set)
    icon: 'svg-name'/'el-icon-x' the icon show in the sidebar
    breadcrumb: false            if set false, the item will hidden in breadcrumb(default is true)
    activeMenu: '/example/list'  if set path, the sidebar will highlight the path you set
  }
 */

/**
 * constantRoutes
 * a base page that does not have permission requirements
 * all roles can be accessed
 */
export const constantRoutes = [
  {
    path: '/',
    // redirect: '/login',
    name: 'Login',
    component: () => import('@/views/login/index'),
    hidden: true
  },

  {
    path: '/404',
    component: () => import('@/views/404'),
    hidden: true
  },

  {
    path: '/dashboard',
    component: Layout,
    // redirect: '/dashboard',
    children: [{
      path: 'dashboard',
      name: 'Dashboard',
      hidden: true,
      component: () => import('@/views/dashboard/index'),
      meta: { title: '首页', icon: 'dashboard' }
    }]
  },
  {
    path: '/statisticalAnalysis',
    component: Layoutt,
    redirect: '/statisticalAnalysis/graph',
    name: 'StatisticalAnalysis',
    meta: { title: '统计分析', icon: 'el-icon-s-data' },
    children: [
      {
        path: 'graph',
        name: 'Graph',
        component: () => import('@/views/statisticalAnalysis/graph/index'),
        meta: { title: '图形统计' }
      },
      {
        path: 'energyConsumption',
        name: 'EnergyConsumption',
        component: () => import('@/views/statisticalAnalysis/energyConsumption/index'),
        meta: { title: '能耗统计' }
      },
      {
        path: 'warrantyManagement',
        name: 'WarrantyManagement',
        component: () => import('@/views/statisticalAnalysis/warrantyManagement/index'),
        meta: { title: '质保管理' }
      },
      {
        path: 'maintenanceManagement',
        name: 'MaintenanceManagement',
        component: () => import('@/views/statisticalAnalysis/maintenanceManagement/index'),
        meta: { title: '保养管理' }
      },
    ]
  },
  {
    path: '/grainDetection',
    component: Layoutt,
    redirect: '/grainDetection/grainTemperatureDetection',
    name: 'GrainDetection',
    meta: { title: '粮情监测', icon: 'monitor' },
    children: [
      {
        path: 'grainTemperatureDetection',
        name: 'GrainTemperatureDetection',
        component: grainTemperatureDetection,
        meta: { title: '粮温检测' },
      },
      {
        path: 'grainDetail',
        component: () => import('@/views/grainDetection/grainTemperatureDetection/detail'),
        name: 'GrainDetail',
        hidden: true,
        meta: { title: '详情', activeMenu: '/grainDetection/grainTemperatureDetection' }
      },
      {
        path: 'abnormalList',
        component: () => import('@/views/grainDetection/grainTemperatureDetection/abnormalList'),
        name: 'AbnormalList',
        hidden: true,
        meta: { title: '粮温异常列表', activeMenu: '/grainDetection/grainTemperatureDetection' }
      },
      {
        path: 'historyTendency',
        component: () => import('@/views/grainDetection/grainTemperatureDetection/history'),
        name: 'HistoryTendency',
        hidden: true,
        meta: { title: '历史温度趋势', activeMenu: '/grainDetection/grainTemperatureDetection' }
      },
      // 气体检测
      {
        path: 'gas',
        name: 'Gas',
        component: commonPage,
        // redirect: '/grainDetection/gasDetection/index',
        meta: { title: '气体检测' },
        children: [
          {
            path: 'gasDetection',
            name: 'GasDetection',
            component: () => import('@/views/grainDetection/gasDetection/index'),
            // hidden:true,
            meta: { title: '气体检测', activeMenu: '/grainDetection/gas/gasDetection' }
          },
          {
            path: 'gasDetectionDetail',
            name: 'GasDetectionDetail',
            component: () => import('@/views/grainDetection/gasDetection/detail'),
            hidden: true,
            meta: { title: '详情', activeMenu: '/grainDetection/gas/gasDetection' }
          },
          {
            path: 'gasAbnormalList',
            component: () => import('@/views/grainDetection/gasDetection/abnormalList'),
            name: 'GasAbnormalList',
            hidden: true,
            meta: { title: '气体异常列表', activeMenu: '/grainDetection/gas/gasDetection' }
          },
        ]
      },
      // 虫情检测
      {
        path: 'pest',
        name: 'Pest',
        component: commonPage,
        meta: { title: '虫情检测' },
        children: [
          {
            path: 'pestDetection',
            name: 'PestDetection',
            // hidden:true,
            component: () => import('@/views/grainDetection/pestDetection/index'),
            meta: { title: '虫情检测', activeMenu: '/grainDetection/pest/pestDetection' }
          },
          {
            path: 'pestDetectionDetail',
            name: 'PestDetectionDetail',
            component: () => import('@/views/grainDetection/pestDetection/detail'),
            hidden: true,
            meta: { title: '详情', activeMenu: '/grainDetection/pest/pestDetection' }
          },
          {
            path: 'pestAbnormalList',
            name: 'PestAbnormalList',
            component: () => import('@/views/grainDetection/pestDetection/abnormalList'),
            hidden: true,
            meta: { title: '虫情异常列表', activeMenu: '/grainDetection/pest/pestDetection' }
          },
        ]
      },
      // 能耗监测
      {
        path: 'energy',
        name: 'Energy',
        component: commonPage,
        meta: { title: '能耗监测' },
        children: [
          {
            path: 'energyConsumptionMonitoring',
            name: 'EnergyConsumptionMonitoring',
            component: () => import('@/views/grainDetection/energyConsumptionMonitoring/index'),
            meta: { title: '能耗监测', activeMenu: '/grainDetection/energy/energyConsumptionMonitoring' },
          },
          {
            path: 'energyConsumptionDetail',
            name: 'EnergyConsumptionDetail',
            component: () => import('@/views/grainDetection/energyConsumptionMonitoring/detail'),
            hidden: true,
            meta: { title: '详情', activeMenu: '/grainDetection/energy/energyConsumptionMonitoring' }
          },
          {
            path: 'energyConsumptionAbnormalList',
            name: 'EnergyConsumptionAbnormalList',
            component: () => import('@/views/grainDetection/energyConsumptionMonitoring/abnormalList'),
            hidden: true,
            meta: { title: '历史记录', activeMenu: '/grainDetection/energy/energyConsumptionMonitoring' }
          },
        ]

      },
      // 气象站数据
      {
        path: 'weather',
        name: 'Weather',
        component: commonPage,
        meta: { title: '气象站数据' },
        children: [
          {
            path: 'weatherStationData',
            name: 'WeatherStationData',
            component: () => import('@/views/grainDetection/weatherStationData/index'),
            meta: { title: '气象站数据', }
          },
          {
            path: 'weatherStationDataDetail',
            name: 'WeatherStationDataDetail',
            component: () => import('@/views/grainDetection/weatherStationData/detail'),
            hidden: true,
            meta: { title: '详情', activeMenu: '/grainDetection/weather/weatherStationData' }
          },
        ]
      },
      // 气密性检测
      {
        path: 'airTightnessTest',
        name: 'AirTightnessTest',
        component: () => import('@/views/grainDetection/airTightnessTest/index'),
        meta: { title: '气密性检测' }
      }
    ]
  },
  {
    path: '/equipControl',
    component: Layoutt,
    redirect: '/equipControl/equipOverview',
    name: 'EquipControl',
    meta: { title: '设备控制', icon: 'el-icon-s-platform' },
    children: [
      {
        path: 'equipOverview',
        name: 'EquipOverview',
        // component: grainTemperatureDetection,
        component: () => import('@/views/equipControl/equipOverview/index'),
        meta: { title: '设备概览' }
      },

      // 气体检测
      {
        path: 'ventilation',
        name: 'Ventilation',
        // component: commonPage,
        component: () => import('@/views/equipControl/ventilation/index'),
        meta: { title: '通风设备' },
      },
      {
        path: 'ventilationLog',
        name: 'VentilationLog',
        // component: commonPage,
        hidden:true,
        component: () => import('@/views/equipControl/ventilation/log'),
        meta: { title: '通风设备运行记录',activeMenu: '/equipControl/ventilation' },
      },
      {
        path: 'lighting',
        name: 'Lighting',
        // component: commonPage,
        component: () => import('@/views/equipControl/lighting/index'),
        meta: { title: '照明设备' },
      },
      {
        path: 'lightingLog',
        name: 'LightingLog',
        // component: commonPage,
        hidden:true,
        component: () => import('@/views/equipControl/ventilation/log'),
        meta: { title: '照明设备运行记录',activeMenu: '/equipControl/lighting' },
      },
      {
        path: 'temperatureControl',
        name: 'TemperatureControl',
        // component: commonPage,
        component: () => import('@/views/equipControl/temperatureControl/index'),
        meta: { title: '控温设备' },
      },
      {
        path: 'temperatureControlLog',
        name: 'TemperatureControlLog',
        // component: commonPage,
        hidden:true,
        component: () => import('@/views/equipControl/ventilation/log'),
        meta: { title: '控温设备运行记录',activeMenu: '/equipControl/temperatureControl' },
      },
      {
        path: 'operationalLog',
        name: 'OperationalLog',
        // component: commonPage,
        component: () => import('@/views/equipControl/operationalLog/index'),
        meta: { title: '运行记录' },
      },
    ]
  },
  {
    path: '/equipConfig',
    component: Layoutt,
    redirect: '/equipConfig/equipConfigHome',
    name: 'EquipConfig',
    meta: { title: '设备配置', icon: 'el-icon-s-platform' },
    children: [
      {
        path: 'equipConfiguration',
        component: () => import('@/views/equipConfig/equipConfiguration/index'),
        //component:alarmReservesTabs,
        redirect: 'equipConfiguration/equipGrainDetection',
        name: 'EquipConfiguration',
        // hidden: true,
        meta: { title: '设备配置',}
      },
      {
        path: 'alarmThresholdSetting',
        // component: () => import('@/views/equipConfig/alarmThresholdSetting/index'),
        component: alarmReservesTabs,
        redirect: 'alarmThresholdSetting/temperatureAlarm',
        name: 'AlarmThresholdSetting',
        meta: { title: '报警阈值设置',},
        children:[
          //   报警阈值设置/温度报警
          {
            path: 'temperatureAlarm',
            component: () => import('@/views/equipConfig/alarmThresholdSetting/temperatureAlarm/index'),
            name: 'TemperatureAlarm',
            hidden: true,
            meta: { title: '温度报警', activeMenu: '/equipConfig/alarmThresholdSetting'}
          },
          //   报警阈值设置/虫情报警
          {
            path: 'pestAlarm',
            component: () => import('@/views/equipConfig/alarmThresholdSetting/pestAlarm/index'),
            name: 'PestAlarm',
            hidden: true,
            meta: { title: '虫情报警', activeMenu: '/equipConfig/alarmThresholdSetting'}
          },
          //   报警阈值设置/能耗报警
          {
            path: 'energyAlarm',
            component: () => import('@/views/equipConfig/alarmThresholdSetting/energyAlarm/index'),
            name: 'EnergyAlarm',
            hidden: true,
            meta: { title: '能耗报警', activeMenu: '/equipConfig/alarmThresholdSetting'}
          },
          //   报警阈值设置/气密性报警
          {
            path: 'gasTightnessAlarm',
            component: () => import('@/views/equipConfig/alarmThresholdSetting/gasTightnessAlarm/index'),
            name: 'GasTightnessAlarm',
            hidden: true,
            meta: { title: '气密性报警', activeMenu: '/equipConfig/alarmThresholdSetting'}
          },
          //   报警阈值设置/气体报警
          {
            path: 'gasAlarm',
            component: () => import('@/views/equipConfig/alarmThresholdSetting/gasAlarm/index'),
            name: 'GasAlarm',
            hidden: true,
            meta: { title: '气体报警', activeMenu: '/equipConfig/alarmThresholdSetting'}
          },
        ]
      },
      {
        path: 'equipClassification',
        component: () => import('@/views/equipConfig/equipClassification/index'),
        name: 'EquipClassification',
        meta: { title: '设备分类',}
      },
      {
        path: 'tabsManagement',
        component: () => import('@/views/equipConfig/tabsManagement/index'),
        name: 'TabsManagement',
        meta: { title: '标签管理',},
      },
      {
        path: 'timedTask',
        component: () => import('@/views/equipConfig/timedTask/index'),
        name: 'TimedTask',
        meta: { title: '定时任务设置',},
      },
      {
        path: 'protocolMannagement',
        component: () => import('@/views/equipConfig/protocolMannagement/index'),
        name: 'ProtocolMannagement',
        meta: { title: '协议管理',},
      },
      {
        path: 'dataDictionary',
        component: () => import('@/views/equipConfig/dataDictionary/index'),
        name: 'DataDictionary',
        meta: { title: '数据字典',},
      },
      {
        path: 'barnBasicInfo',
        component: () => import('@/views/equipConfig/barnBasicInfo/index'),
        name: 'BarnBasicInfo',
        meta: { title: '仓房基本信息',},
      },
      {
        path: 'equipConfiguration',
        component: reservesTabs,
        name: 'EquipConfiguration',
        redirect: 'equipConfiguration/equipGrainDetection',
        meta: { title: '设备配置',  },
        hidden:true,
        children: [
          //   设备配置/粮情检测
          {
            path: 'equipGrainDetection',
            component: () => import('@/views/equipConfig/equipConfiguration/grainCheck/index'),
            name: 'EquipGrainDetection',
            hidden: true,
            meta: { title: '粮情检测设备', activeMenu: '/equipConfig/equipConfigHome'}
          },
          {
            path: 'airHandling',
            component: () => import('@/views/equipConfig/equipConfiguration/airHandling/index'),
            name: 'AirHandling',
            hidden: true,
            meta: { title: '气调', activeMenu: '/equipConfig/equipConfigHome'}
          },
          {
            path: 'nitrogen',
            component: () => import('@/views/equipConfig/equipConfiguration/nitrogen/index'),
            name: 'Nitrogen',
            hidden: true,
            meta: { title: '氮气', activeMenu: '/equipConfig/equipConfigHome'}
          },
          {
            path: 'gasDetectionEquip',
            component: () => import('@/views/equipConfig/equipConfiguration/gasDetection/index'),
            name: 'GasDetectionEquip',
            hidden: true,
            meta: { title: '气体检测', activeMenu: '/equipConfig/equipConfigHome'}
          },
          {
            path: 'pestDetectionEquip',
            component: () => import('@/views/equipConfig/equipConfiguration/pestDetection/index'),
            name: 'PestDetectionEquip',
            hidden: true,
            meta: { title: '虫情检测', activeMenu: '/equipConfig/equipConfigHome'}
          },
          {
            path: 'energyMonitoring',
            component: () => import('@/views/equipConfig/equipConfiguration/energy/index'),
            name: 'EnergyMonitoring',
            hidden: true,
            meta: { title: '能耗监测', activeMenu: '/equipConfig/equipConfigHome'}
          },
          {
            path: 'weatherStation',
            component: () => import('@/views/equipConfig/equipConfiguration/weatherStation/index'),
            name: 'WeatherStation',
            hidden: true,
            meta: { title: '气象站', activeMenu: '/equipConfig/equipConfigHome'}
          },
          {
            path: 'gasTightness',
            component: () => import('@/views/equipConfig/equipConfiguration/gasTightness/index'),
            name: 'GasTightness',
            hidden: true,
            meta: { title: '气密性检测', activeMenu: '/equipConfig/equipConfigHome'}
          },
          {
            path: 'ventilationEquip',
            component: () => import('@/views/equipConfig/equipConfiguration/ventilation/index'),
            name: 'VentilationEquip',
            hidden: true,
            meta: { title: '通风设备', activeMenu: '/equipConfig/equipConfigHome'}
          },
          {
            path: 'lightingEquip',
            component: () => import('@/views/equipConfig/equipConfiguration/lighting/index'),
            name: 'LightingEquip',
            hidden: true,
            meta: { title: '照明设备', activeMenu: '/equipConfig/equipConfigHome'}
          },
          {
            path: 'temperatureControlEquip',
            component: () => import('@/views/equipConfig/equipConfiguration/temperatureControl/index'),
            name: 'TemperatureControlEquip',
            hidden: true,
            meta: { title: '控温设备', activeMenu: '/equipConfig/equipConfigHome'}
          },
        ]
      },
      // 粮情检测
      {
        path: 'grainDetectionDetail',
        component: () => import('@/views/equipConfig/equipConfiguration/grainCheck/details'),
        name: 'GrainDetectionDetail',
        hidden: true,
        meta: { title: '粮情检测设备详情', activeMenu: '/equipConfig/equipConfigHome'}
      },
      {
        path: 'grainDetectionAdd',
        component: () => import('@/views/equipConfig/equipConfiguration/grainCheck/add'),
        name: 'GrainDetectionAdd',
        hidden: true,
        meta: { title: '粮情检测设备新增', activeMenu: '/equipConfig/equipConfigHome'}
      },
      {
        path: 'grainDetectionEdit',
        component: () => import('@/views/equipConfig/equipConfiguration/grainCheck/edit'),
        name: 'GrainDetectionEdit',
        hidden: true,
        meta: { title: '粮情检测设备修改', activeMenu: '/equipConfig/equipConfigHome'}
      },
      // 粮情检测 end
      // 气调
      {
        path: 'airHandlingDetail',
        component: () => import('@/views/equipConfig/equipConfiguration/airHandling/details'),
        name: 'AirHandlingDetail',
        hidden: true,
        meta: { title: '气调设备详情', activeMenu: '/equipConfig/equipConfigHome'}
      },
      {
        path: 'airHandlingAdd',
        component: () => import('@/views/equipConfig/equipConfiguration/airHandling/add'),
        name: 'AirHandlingAdd',
        hidden: true,
        meta: { title: '气调设备新增', activeMenu: '/equipConfig/equipConfigHome'}
      },
      {
        path: 'airHandlingEdit',
        component: () => import('@/views/equipConfig/equipConfiguration/airHandling/edit'),
        name: 'AirHandlingEdit',
        hidden: true,
        meta: { title: '气调设备修改', activeMenu: '/equipConfig/equipConfigHome'}
      },
      // ---- End----
      // 氮气
      {
        path: 'nitrogenDetail',
        component: () => import('@/views/equipConfig/equipConfiguration/nitrogen/details'),
        name: 'NitrogenDetail',
        hidden: true,
        meta: { title: '氮气设备详情', activeMenu: '/equipConfig/equipConfigHome'}
      },
      {
        path: 'nitrogenAdd',
        component: () => import('@/views/equipConfig/equipConfiguration/nitrogen/add'),
        name: 'NitrogenAdd',
        hidden: true,
        meta: { title: '氮气设备新增', activeMenu: '/equipConfig/equipConfigHome'}
      },
      {
        path: 'nitrogenEdit',
        component: () => import('@/views/equipConfig/equipConfiguration/nitrogen/edit'),
        name: 'NitrogenEdit',
        hidden: true,
        meta: { title: '氮气设备修改', activeMenu: '/equipConfig/equipConfigHome'}
      },
      // ---- End----
      // 气体检测 -
      {
        path: 'gasDetectionEquipDetail',
        component: () => import('@/views/equipConfig/equipConfiguration/gasDetection/details'),
        name: 'GasDetectionEquipDetail',
        hidden: true,
        meta: { title: '气体检测设备详情', activeMenu: '/equipConfig/equipConfigHome'}
      },
      {
        path: 'gasDetectionEquipAdd',
        component: () => import('@/views/equipConfig/equipConfiguration/gasDetection/add'),
        name: 'GasDetectionEquipAdd',
        hidden: true,
        meta: { title: '气体检测设备新增', activeMenu: '/equipConfig/equipConfigHome'}
      },
      {
        path: 'gasDetectionEquipEdit',
        component: () => import('@/views/equipConfig/equipConfiguration/gasDetection/edit'),
        name: 'GasDetectionEquipEdit',
        hidden: true,
        meta: { title: '气体检测设备修改', activeMenu: '/equipConfig/equipConfigHome'}
      },
      // ----气体检测 End----
      // 虫情检测设备 -
      {
        path: 'pestDetectionEquipDetail',
        component: () => import('@/views/equipConfig/equipConfiguration/pestDetection/details'),
        name: 'PestDetectionEquipDetail',
        hidden: true,
        meta: { title: '虫情监测设备详情', activeMenu: '/equipConfig/equipConfigHome'}
      },
      {
        path: 'pestDetectionEquipAdd',
        component: () => import('@/views/equipConfig/equipConfiguration/pestDetection/add'),
        name: 'PestDetectionEquipAdd',
        hidden: true,
        meta: { title: '虫情监测设备新增', activeMenu: '/equipConfig/equipConfigHome'}
      },
      {
        path: 'pestDetectionEquipEdit',
        component: () => import('@/views/equipConfig/equipConfiguration/pestDetection/edit'),
        name: 'PestDetectionEquipEdit',
        hidden: true,
        meta: { title: '虫情监测设备修改', activeMenu: '/equipConfig/equipConfigHome'}
      },
      // ----虫情检测设备 End----
      // 能耗检测设备 -
      {
        path: 'energyMonitoringDetail',
        component: () => import('@/views/equipConfig/equipConfiguration/energy/details'),
        name: 'EnergyMonitoringDetail',
        hidden: true,
        meta: { title: '能耗监测设备详情', activeMenu: '/equipConfig/equipConfigHome'}
      },
      {
        path: 'energyMonitoringAdd',
        component: () => import('@/views/equipConfig/equipConfiguration/energy/add'),
        name: 'EnergyMonitoringAdd',
        hidden: true,
        meta: { title: '能耗监测设备新增', activeMenu: '/equipConfig/equipConfigHome'}
      },
      {
        path: 'energyMonitoringEdit',
        component: () => import('@/views/equipConfig/equipConfiguration/energy/edit'),
        name: 'EnergyMonitoringEdit',
        hidden: true,
        meta: { title: '能耗监测设备修改', activeMenu: '/equipConfig/equipConfigHome'}
      },
      // ----能耗检测 End----
      // 气象站检测设备 -
      {
        path: 'weatherStationDetail',
        component: () => import('@/views/equipConfig/equipConfiguration/weatherStation/details'),
        name: 'WeatherStationDetail',
        hidden: true,
        meta: { title: '气象站设备详情', activeMenu: '/equipConfig/equipConfigHome'}
      },
      {
        path: 'weatherStationAdd',
        component: () => import('@/views/equipConfig/equipConfiguration/weatherStation/add'),
        name: 'WeatherStationAdd',
        hidden: true,
        meta: { title: '气象站设备新增', activeMenu: '/equipConfig/equipConfigHome'}
      },
      {
        path: 'weatherStationEdit',
        component: () => import('@/views/equipConfig/equipConfiguration/weatherStation/edit'),
        name: 'WeatherStationEdit',
        hidden: true,
        meta: { title: '气象站设备修改', activeMenu: '/equipConfig/equipConfigHome'}
      },
      // ----气象站检测 End----
      // 气密性检测设备 -
      {
        path: 'gasTightnessDetail',
        component: () => import('@/views/equipConfig/equipConfiguration/gasTightness/details'),
        name: 'GasTightnessDetail',
        hidden: true,
        meta: { title: '气密性检测设备详情', activeMenu: '/equipConfig/equipConfigHome'}
      },
      {
        path: 'gasTightnessAdd',
        component: () => import('@/views/equipConfig/equipConfiguration/gasTightness/add'),
        name: 'GasTightnessAdd',
        hidden: true,
        meta: { title: '气密性检测设备新增', activeMenu: '/equipConfig/equipConfigHome'}
      },
      {
        path: 'gasTightnessEdit',
        component: () => import('@/views/equipConfig/equipConfiguration/gasTightness/edit'),
        name: 'GasTightnessEdit',
        hidden: true,
        meta: { title: '气密性检测设备修改', activeMenu: '/equipConfig/equipConfigHome'}
      },
      // ----气密性检测设备 End----
      // 通风检测设备 -
      {
        path: 'ventilationEquipDetail',
        component: () => import('@/views/equipConfig/equipConfiguration/ventilation/details'),
        name: 'VentilationEquipDetail',
        hidden: true,
        meta: { title: '通风设备详情', activeMenu: '/equipConfig/equipConfigHome'}
      },
      {
        path: 'ventilationEquipAdd',
        component: () => import('@/views/equipConfig/equipConfiguration/ventilation/add'),
        name: 'VentilationEquipAdd',
        hidden: true,
        meta: { title: '通风设备新增', activeMenu: '/equipConfig/equipConfigHome'}
      },
      {
        path: 'ventilationEquipEdit',
        component: () => import('@/views/equipConfig/equipConfiguration/ventilation/edit'),
        name: 'VentilationEquipEdit',
        hidden: true,
        meta: { title: '通风设备修改', activeMenu: '/equipConfig/equipConfigHome'}
      },
      // ----通风检测设备 End----
      // 照明检测设备 -
      {
        path: 'lightingEquipDetail',
        component: () => import('@/views/equipConfig/equipConfiguration/lighting/details'),
        name: 'LightingEquipDetail',
        hidden: true,
        meta: { title: '照明设备详情', activeMenu: '/equipConfig/equipConfigHome'}
      },
      {
        path: 'lightingEquipAdd',
        component: () => import('@/views/equipConfig/equipConfiguration/lighting/add'),
        name: 'LightingEquipAdd',
        hidden: true,
        meta: { title: '照明设备新增', activeMenu: '/equipConfig/equipConfigHome'}
      },
      {
        path: 'lightingEquipEdit',
        component: () => import('@/views/equipConfig/equipConfiguration/lighting/edit'),
        name: 'LightingEquipEdit',
        hidden: true,
        meta: { title: '照明设备修改', activeMenu: '/equipConfig/equipConfigHome'}
      },
      // ----通风检测设备 End----
      // 控温检测设备 -
      {
        path: 'temperatureControlEquipDetail',
        component: () => import('@/views/equipConfig/equipConfiguration/temperatureControl/details'),
        name: 'TemperatureControlEquipDetail',
        hidden: true,
        meta: { title: '控温设备详情', activeMenu: '/equipConfig/equipConfigHome'}
      },
      {
        path: 'temperatureControlEquipAdd',
        component: () => import('@/views/equipConfig/equipConfiguration/temperatureControl/add'),
        name: 'TemperatureControlEquipAdd',
        hidden: true,
        meta: { title: '控温设备新增', activeMenu: '/equipConfig/equipConfigHome'}
      },
      {
        path: 'temperatureControlEquipEdit',
        component: () => import('@/views/equipConfig/equipConfiguration/temperatureControl/edit'),
        name: 'TemperatureControlEquipEdit',
        hidden: true,
        meta: { title: '控温设备修改', activeMenu: '/equipConfig/equipConfigHome'}
      },
      // ----通风检测设备 End----

      // <------------------ 报警阈值设置-新增、修改、详情  --------------------->
      // 温度报警 -
      {
        path: 'temperatureAlarmDetail',
        component: () => import('@/views/equipConfig/alarmThresholdSetting/temperatureAlarm/details'),
        name: 'TemperatureAlarmDetail',
        hidden: true,
        meta: { title: '温度报警详情', activeMenu: '/equipConfig/alarmThresholdSetting'}
      },
      {
        path: 'temperatureAlarmAdd',
        component: () => import('@/views/equipConfig/alarmThresholdSetting/temperatureAlarm/add'),
        name: 'TemperatureAlarmAdd',
        hidden: true,
        meta: { title: '温度报警新增', activeMenu: '/equipConfig/alarmThresholdSetting'}
      },
      {
        path: 'temperatureAlarmEdit',
        component: () => import('@/views/equipConfig/alarmThresholdSetting/temperatureAlarm/edit'),
        name: 'TemperatureAlarmEdit',
        hidden: true,
        meta: { title: '温度报警修改', activeMenu: '/equipConfig/alarmThresholdSetting'}
      },
      // ----温度报警 End----
      // 虫情报警 -
      {
        path: 'pestAlarmDetail',
        component: () => import('@/views/equipConfig/alarmThresholdSetting/pestAlarm/details'),
        name: 'PestAlarmDetail',
        hidden: true,
        meta: { title: '虫情报警详情', activeMenu: '/equipConfig/alarmThresholdSetting'}
      },
      {
        path: 'pestAlarmAdd',
        component: () => import('@/views/equipConfig/alarmThresholdSetting/pestAlarm/add'),
        name: 'PestAlarmAdd',
        hidden: true,
        meta: { title: '虫情报警新增', activeMenu: '/equipConfig/alarmThresholdSetting'}
      },
      {
        path: 'pestAlarmEdit',
        component: () => import('@/views/equipConfig/alarmThresholdSetting/pestAlarm/edit'),
        name: 'PestAlarmEdit',
        hidden: true,
        meta: { title: '虫情报警修改', activeMenu: '/equipConfig/alarmThresholdSetting'}
      },
      // ----虫情报警 End----
      // 能耗报警 -
      {
        path: 'energyAlarmDetail',
        component: () => import('@/views/equipConfig/alarmThresholdSetting/energyAlarm/details'),
        name: 'EnergyAlarmDetail',
        hidden: true,
        meta: { title: '能耗报警详情', activeMenu: '/equipConfig/alarmThresholdSetting'}
      },
      {
        path: 'energyAlarmAdd',
        component: () => import('@/views/equipConfig/alarmThresholdSetting/energyAlarm/add'),
        name: 'EnergyAlarmAdd',
        hidden: true,
        meta: { title: '能耗报警新增', activeMenu: '/equipConfig/alarmThresholdSetting'}
      },
      {
        path: 'energyAlarmEdit',
        component: () => import('@/views/equipConfig/alarmThresholdSetting/energyAlarm/edit'),
        name: 'EnergyAlarmEdit',
        hidden: true,
        meta: { title: '能耗报警修改', activeMenu: '/equipConfig/alarmThresholdSetting'}
      },
      // ----能耗报警 End----
      // 气密性报警 -
      {
        path: 'gasTightnessAlarmDetail',
        component: () => import('@/views/equipConfig/alarmThresholdSetting/gasTightnessAlarm/details'),
        name: 'GasTightnessAlarmDetail',
        hidden: true,
        meta: { title: '气密性报警详情', activeMenu: '/equipConfig/alarmThresholdSetting'}
      },
      {
        path: 'gasTightnessAlarmAdd',
        component: () => import('@/views/equipConfig/alarmThresholdSetting/gasTightnessAlarm/add'),
        name: 'GasTightnessAlarmAdd',
        hidden: true,
        meta: { title: '气密性报警新增', activeMenu: '/equipConfig/alarmThresholdSetting'}
      },
      {
        path: 'gasTightnessAlarmEdit',
        component: () => import('@/views/equipConfig/alarmThresholdSetting/gasTightnessAlarm/edit'),
        name: 'GasTightnessAlarmEdit',
        hidden: true,
        meta: { title: '气密性报警修改', activeMenu: '/equipConfig/alarmThresholdSetting'}
      },
      // ----气密性报警 End----
      // 气体报警 -
      {
        path: 'gasAlarmDetail',
        component: () => import('@/views/equipConfig/alarmThresholdSetting/gasAlarm/details'),
        name: 'GasAlarmDetail',
        hidden: true,
        meta: { title: '气体报警详情', activeMenu: '/equipConfig/alarmThresholdSetting'}
      },
      {
        path: 'gasAlarmAdd',
        component: () => import('@/views/equipConfig/alarmThresholdSetting/gasAlarm/add'),
        name: 'GasAlarmAdd',
        hidden: true,
        meta: { title: '气体报警新增', activeMenu: '/equipConfig/alarmThresholdSetting'}
      },
      {
        path: 'gasAlarmEdit',
        component: () => import('@/views/equipConfig/alarmThresholdSetting/gasAlarm/edit'),
        name: 'GasAlarmEdit',
        hidden: true,
        meta: { title: '气体报警修改', activeMenu: '/equipConfig/alarmThresholdSetting'}
      },
      // ----气密性报警 End----

      // ------------------------------------  标签管理-新增、修改、详情        ----------------------------------------------
      {
        path: 'tabsManagementDetail',
        component: () => import('@/views/equipConfig/tabsManagement/details'),
        name: 'TabsManagementDetail',
        hidden: true,
        meta: { title: '标签详情', activeMenu: '/equipConfig/tabsManagement'}
      },
      {
        path: 'tabsManagementAdd',
        component: () => import('@/views/equipConfig/tabsManagement/add'),
        name: 'TabsManagementAdd',
        hidden: true,
        meta: { title: '标签管理新增', activeMenu: '/equipConfig/tabsManagement'}
      },
      {
        path: 'tabsManagementEdit',
        component: () => import('@/views/equipConfig/tabsManagement/edit'),
        name: 'TabsManagementEdit',
        hidden: true,
        meta: { title: '标签管理修改', activeMenu: '/equipConfig/tabsManagement'}
      },
      // ------------------------------------  标签管理-新增、修改、详情    EDN    ----------------------------------------------

      // ------------------------------------  定时任务设置-新增、修改、详情        ----------------------------------------------
      {
        path: 'timedTaskDetail',
        component: () => import('@/views/equipConfig/timedTask/details'),
        name: 'TimedTaskDetail',
        hidden: true,
        meta: { title: '定时任务详情', activeMenu: '/equipConfig/timedTask'}
      },
      {
        path: 'timedTaskAdd',
        component: () => import('@/views/equipConfig/timedTask/add'),
        name: 'TimedTaskAdd',
        hidden: true,
        meta: { title: '定时任务新增', activeMenu: '/equipConfig/timedTask'}
      },
      {
        path: 'timedTaskEdit',
        component: () => import('@/views/equipConfig/timedTask/edit'),
        name: 'TimedTaskEdit',
        hidden: true,
        meta: { title: '定时任务修改', activeMenu: '/equipConfig/timedTask'}
      },
      // ------------------------------------ 定时任务设置-新增、修改、详情    EDN    ----------------------------------------------

      // ------------------------------------  仓房基本信息-新增、修改、详情        ----------------------------------------------
      {
        path: 'barnBasicInfoDetail',
        component: () => import('@/views/equipConfig/barnBasicInfo/details'),
        name: 'BarnBasicInfoDetail',
        hidden: true,
        meta: { title: '仓房基本信息详情', activeMenu: '/equipConfig/barnBasicInfo'}
      },
      {
        path: 'barnBasicInfoAdd',
        component: () => import('@/views/equipConfig/barnBasicInfo/add'),
        name: 'BarnBasicInfoAdd',
        hidden: true,
        meta: { title: '仓房基本信息新增', activeMenu: '/equipConfig/barnBasicInfo'}
      },
      {
        path: 'barnBasicInfoEdit',
        component: () => import('@/views/equipConfig/barnBasicInfo/edit'),
        name: 'BarnBasicInfoEdit',
        hidden: true,
        meta: { title: '仓房基本信息修改', activeMenu: '/equipConfig/barnBasicInfo'}
      },
      // ------------------------------------ 仓房基本信息-新增、修改、详情    EDN    ----------------------------------------------

      // {
      //   path: 'grainDetail',
      //   component: () => import('@/views/grainDetection/grainTemperatureDetection/detail'),
      //   name: 'GrainDetail',
      //   hidden: true,
      //   meta: { title: '详情', activeMenu: '/grainDetection/grainTemperatureDetection' }
      // },
    ]
  },
  {
    path: '/dataSynchronism',
    component: Layoutt,
    redirect: '/dataSynchronism/record',
    name: 'DataSynchronism',
    meta: { title: '数据同步', icon: 'el-icon-refresh' },
    children: [
      {
        path: 'record',
        name: 'DataSynchronismRecord',
        // component: grainTemperatureDetection,
        component: () => import('@/views/dataSynchronism/record/index'),
        meta: { title: '数据同步记录' }
      },
      {
        path: 'dataExchangeConfiguration',
        name: 'DataExchangeConfiguration',
        // component: commonPage,
        component: () => import('@/views/dataSynchronism/dataExchangeConfiguration/index'),
        meta: { title: '数据交换配置' },
      },
    ]
  },
  {
    path: '/system',
    component: Layoutt,
    redirect: '/system/depotShow',
    name: 'System',
    meta: { title: '系统管理', icon: 'xitong' },
    children: [
      {
        path: 'depotShow',
        name: 'depotShow',
        // component: grainTemperatureDetection,
        component: () => import('@/views/system/depotShow/index'),
        meta: { title: '库区展示' }
      },
      {
        path: 'unitInfo',
        name: 'UnitInfo',
        component: () => import('@/views/system/unitInfo/index'),
        meta: { title: '单位信息' },
      },
      {
        path: '/OrgInfoAdd/:onlyFlag?/:orgInfo?',
        name: 'OrgInfoAdd',
        hidden:true,
        component: () => import('@/views/system/unitInfo/edit'),
        meta: { title: '单位新增',activeMenu: '/system/unitInfo/edit' },
      },
      {
        path: '/OrgInfoEdit/:onlyFlag?/:orgInfo?',
        name: 'OrgInfoEdit',
        hidden:true,
        component: () => import('@/views/system/unitInfo/edit'),
        meta: { title: '单位修改',activeMenu: '/system/unitInfo/edit' },
      },
      {
        path: '/OrgInfoCheck/:onlyFlag?/:orgInfo?',
        name: 'OrgInfoCheck',
        hidden:true,
        component: () => import('@/views/system/unitInfo/edit'),
        meta: { title: '单位详情',activeMenu: '/system/unitInfo/edit' },
      },
      {
        path: 'userManagement',
        name: 'UserManagement',
        component: () => import('@/views/system/userManagement/index'),
        meta: { title: '用户管理' },
      },
      {
        path: 'logManagement',
        name: 'LogManagement',
        component: () => import('@/views/system/logManagement/index'),
        meta: { title: '日志管理' },
      },
      {
        path: 'authorizationManagement',
        name: 'AuthorizationManagement',
        component: () => import('@/views/system/authorizationManagement/index'),
        meta: { title: '授权管理' },
      },
      {
        path: 'userManagementDetails',
        name: 'UserManagementDetails',
        hidden:true,
        component: () => import('@/views/system/userManagement/detail'),
        meta: { title: '用户管理详情',activeMenu: '/system/userManagement' },
      },
      {
        path: 'userManagementAdd',
        name: 'UserManagementAdd',
        hidden:true,
        component: () => import('@/views/system/userManagement/add'),
        meta: { title: '新增用户',activeMenu: '/system/userManagement' },
      },
      {
        path: 'userManagementEdit',
        name: 'UserManagementEdit',
        hidden:true,
        component: () => import('@/views/system/userManagement/edit'),
        meta: { title: '用户管理编辑',activeMenu: '/system/userManagement' },
      },
    ]
  },



  // 404 page must be placed at the end !!!
  // { path: '*', redirect: '/404', hidden: true }
]

const createRouter = () => new Router({
  // mode: 'history', // require service support
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRoutes
})

const router = createRouter()

// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter () {
  const newRouter = createRouter()
  router.matcher = newRouter.matcher // reset router
}

export default router
