import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/components/Index'
import Login from '@/components/Login'
import Register from '@/components/Register'
import Welcome from '@/components/Welcome'


import Role from '@/components/system/Role'
import RoleTemplateSet from '@/components/system/RoleTemplateSet'
import RoleTemplateSetDetail from '@/components/system/RoleTemplateSetDetail'
import PresetRoleManagement from '@/components/system/PresetRoleManagement'
// import Warrant from '@/components/system/Warrant'
import EmployeeAccount from '@/components/system/EmployeeAccount'
import OperationLog from '@/components/system/OperationLog'
import DataDictionary from '@/components/system/DataDictionary'
import DataDictionaryDetail from '@/components/system/DataDictionaryDetail'
import OrgManagement from '@/components/system/OrgManagement'
import MenuManagement from '@/components/system/menuManagement'
import MenuResource from '@/components/system/MenuResource'
import MicroServiceManagement from '@/components/system/microServiceManagement'
import ResourceManagement from '@/components/system/resourceManagement'
import SessionManagement from '@/components/system/SessionManagement'//会话管理
import LoginLog from '@/components/system/LoginLog'//登录日志
import InterfaceExceptionLog from '@/components/system/InterfaceExceptionLog'//接口异常日志

import Appointment from '@/components/hospital/Appointment' //预约规则配置
import AppointmentChild from '@/components/hospital/AppointmentChild' //预约规则配置详情页

import wechatUser from '@/components/wechatinfo/wechatUser' //微信用户信息查询
import wechatCode from '@/components/wechatinfo/wechatCode'  //微信用户验证码查询
import information from '@/components/wechatinfo/information'  //预约信息查询

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/login',
      meta:{title:'登录'},
      name: 'Login',
      component: Login
    },
    {
      path: '/register',
      meta:{title:'注册'},
      name: 'Register',
      component: Register
    },
    {
      path: '/index',
      name: 'Index',
      component: Index,
      children:[
        {
          path: 'welcome/:id/:current',/*首页*/
          meta:{title:'首页'},
          name: 'Welcome',
          component: Welcome
        },

        /*系统管理 */
        {
          path:'system/role/:id/:current',/*角色管理*/
          meta:{title:'系统管理-角色管理'},
          name:'Role',
          component:Role
        },
        {
          path:'system/roleTemplateSet/:id/:current',/*角色模板设置*/
          meta:{title:'系统管理-角色模板设置'},
          name:'RoleTemplateSet',
          component:RoleTemplateSet
        },
        {
          path:'system/roleTemplateSetDetail/:id/:current/:tempId/:tempName',/*角色模板设置明细*/
          meta:{title:'系统管理-角色模板设置明细'},
          name:'RoleTemplateSetDetail',
          component:RoleTemplateSetDetail
        },
        {
          path:'system/presetRoleManagement/:id/:current',/*预设角色管理*/
          meta:{title:'系统管理-预设角色管理'},
          name:'PresetRoleManagement',
          component:PresetRoleManagement
        },
        // {
        //   path:'system/role/warrant/:id/:current',/*授权*/
        //   meta:{title:'系统管理-角色管理-授权'},
        //   name:'Warrant',
        //   component:Warrant
        // },
        {
          path:'system/employeeAccount/:id/:current',/*用户管理*/
          meta:{title:'系统管理-员工账号'},
          name:'EmployeeAccount',
          component:EmployeeAccount
        },
        {
          path:'system/orgManagement/:id/:current',/*系统设置----组织管理*/
          meta:{title:'系统管理-组织管理'},
          name:'OrgManagement',
          component:OrgManagement
        },
        {
          path:'system/operationLog/:id/:current',/*操作日志*/
          meta:{title:'系统管理-操作日志'},
          name:'OperationLog',
          component:OperationLog
        },
        {
          path:'system/dataDictionary/:id/:current',/*数据字典*/
          meta:{title:'系统管理-数据字典'},
          name:'DataDictionary',
          component:DataDictionary
        },
        {
          path:'system/dataDictionaryDetail/:id/:dictTypeId/:dictTypeCode/:current',/*数据字典明细*/
          meta:{title:'系统管理-数据字典-明细'},
          name:'DataDictionaryDetail',
          component:DataDictionaryDetail
        },
        {
          path:'system/menuManagement/:id/:current',/*菜单管理*/
          meta:{title:'系统管理-菜单管理'},
          name:'MenuManagement',
          component:MenuManagement
        },
        {
          path: 'system/menuResource/:id/:menuId/:menuName',/*菜单管理----资源管理*/
          meta: { title: '系统管理-菜单资源管理' },
          name: 'MenuResource',
          component: MenuResource
        },

        {
          path:'system/resourceManagement/:id/:current',/*资源管理*/
          meta:{title:'系统管理-资源管理'},
          name:'ResourceManagement',
          component:ResourceManagement
        },
        {
          path: 'system/sessionManagement/:id/:current',/*会话管理*/
          meta: { title: '系统管理-会话管理' },
          name: 'SessionManagement',
          component: SessionManagement
        },
        {
          path: 'system/loginLog/:id/:current',/*登录日志*/
          meta: { title: '系统管理-登录日志' },
          name: 'LoginLog',
          component: LoginLog
        },
        {
          path:'system/microServiceManagement/:id/:current',/*微服务管理*/
          meta:{title:'系统管理-微服务管理'},
          name:'MicroServiceManagement',
          component:MicroServiceManagement
        },
        {
          path:'system/interfaceExceptionLog/:id/:current',/*接口异常日志*/
          meta:{title:'系统管理-接口异常日志'},
          name:'InterfaceExceptionLog',
          component:InterfaceExceptionLog
        },

        /*医院管理*/
        {
          path:'hospital/appointment/:id/:current',/*预约规则配置*/
          meta:{title:'医院管理-预约规则配置'},
          name:'Appointment',
          component:Appointment
        },
        {
          path:'hospital/appointmentChild/:id/:current',/*预约规则配置跳转详情页*/
          meta:{title:'医院管理-预约规则配置跳转详情页'},
          name:'AppointmentChild',
          component:AppointmentChild
        },

        // 微信信息
        {
          path:'wechatinfo/wechatUser/:id/:current',/*微信用户信息查询*/
          meta:{title:'微信信息-微信用户信息查询'},
          name:'wechatUser',
          component:wechatUser
        },
        {
          path:'wechatinfo/wechatCode/:id/:current',/*微信用户验证码查询*/
          meta:{title:'微信信息-微信用户验证码查询'},
          name:'wechatCode',
          component:wechatCode
        },
        {
          path:'wechatinfo/information/:id/:current',/*预约信息查询*/
          meta:{title:'微信信息-预约信息查询'},
          name:'information',
          component:information
        },
      ]
    },
    {
      path: '*',
      redirect: '/login'
    },
  ]
})
