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

Vue.use(Router)

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

/**
 * 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'             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: '/main',
  //   component: Layout,
  //   hidden: false,
  //   children: [
  //     {
  //       name: '首页',
  //       path: 'main',
  //       component: () => import('@/views/main/index'),
  //       hidden: false,
  //     }
  //   ]
  // },
  // {
  //   path: '/timedtask', // 定时任务列表
  //   component: Layout,
  //   // component: () => import('@/views/timedTask/index'),
  //   hidden: false,
  //   children: [
  //     {
  //       name: '定时任务',
  //       path: 'timedtask',
  //       component: () => import('@/views/timedTask/index'),
  //       hidden: true,
  //       meta: {
  //         title: '定时任务'
  //       }
  //     }
  //   ]
  // },
  {
    path: '/setSilder', // 侧边栏
    component: Layout,
    hidden: true,
    children: [
      {
        name: '侧边栏',
        path: 'setSilder',
        component: () => import('@/views/setSilder/addSilder'),
        hidden: true,
        meta: {
          noCache: '1',
          title: '侧边栏'
        }
      }
    ]
  },
  {
    path: '/login',
    name: '登录',
    component: () => import('@/views/login/index'),
    hidden: true
  },
  {
    path: '/',
    redirect: '/main/main'
  },
  {
    path: '/404',
    component: () => import('@/views/404'),
    hidden: true
  }, 
  // {
  //   path: '/sporadicManager',
  //   component: Layout,
  //   hidden: false,
  //   children: [
  //     {
  //       name: '零星收费',
  //       path: 'sporadicList',
  //       component: () => import('@/views/setSilder/addSilder'),
  //       hidden: false,
  //     }
  //   ]
  // },
  // { path: '*', redirect: '/404', hidden: true }
]
// export const constantRoutes = [{
//   path: '/',
//   redirect: '/upms',
// }]
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 const asyncRoutes = {
  Layout: Layout,
  // 首页
  main: () => import('@/views/main/index'),
  // 内容管理
  contentManager: () => import('@/views/contentManager/index'),
  contentOperation: () => import('@/views/contentManager/contentOperation'),
  // 系统日志
  journal: () => import('@/views/journal/index'),
  // 乐团管理
  teamDetail: () => import('@/views/teamDetail/teamList'),
  teamBuild: () => import('@/views/teamBuild/index'),
  // VIP管理
  vipList: () => import('@/views/vipClass/vipList'),
  // vip修改
  vipReset: () => import('@/views/vipClass/vipReset'),
  // vip详情
  // @/views/buildVip/index   @/views/vipClass/vipDetail
  vipDetail: () => import('@/views/vipClass/vipDetail'),
  buildVip: () => import('@/views/buildVip/index'),
  // 教师管理
  teacherList: () => import('@/views/teacherManager/teacherList'),
  // 新增&修改教师
  teacherOperation: () => import('@/views/teacherManager/teacherOperation/index'),
  teacherOperationUpdate: () => import('@/views/teacherManager/teacherOperation/index'),
  // 老师详情
  teacherDetail: () => import('@/views/teacherManager/teacherDetail/index'),
  // 学员管理
  studentList: () => import('@/views/studentManager/studentList'),
  // 学员详情
  studentDetail: () => import('@/views/studentManager/index'),
  // 订单管理
  orderList: () => import('@/views/businessManager/orderManager/index'),
  // 订单列表
  income: () => import('@/views/businessManager/orderManager/income'),
  incomeOne: () => import('@/views/businessManager/orderManager/incomeOne'),
  incomeTwo: () => import('@/views/businessManager/orderManager/incomeTwo'),
  // 充值列表
  incomebuy: () => import('@/views/businessManager/orderManager/incomebuy'),
  // 退费订单
  backOrder: () => import('@/views/businessManager/orderManager/backMoney'),
  // 支出
  expend: () => import('@/views/businessManager/orderManager/expend'),
  // 商品管理
  shopManager: () => import('@/views/businessManager/shopManager/shopList'),
  // 商品修改（添加）
  shopOperation: () => import('@/views/businessManager/shopManager/shopOperation'),
  // 商品类型管理
  shopCategory: () => import('@/views/businessManager/shopManager/shopCategory'),
  // 报表中心
  reportForm: () => import('@/views/reportForm/index'),
  musicalManager: () => import('@/views/categroyManager/specialSetup/musicalManager'),
  // 系统管理
  specialSetup: () => import('@/views/categroyManager/specialSetup/index'),
  // 类型管理
  typesManager: () => import('@/views/categroyManager/specialSetup/typesManager'),
  tryClass: () => import('@/views/categroyManager/specialSetup/tryClass'),
  activityManager: () => import('@/views/categroyManager/specialSetup/activityManager'),
  tempalteManager: () => import('@/views/categroyManager/specialSetup/tempalteManager'),
  bannerManager: () => import('@/views/categroyManager/specialSetup/bannerManager'),
  holidayManager: () => import('@/views/categroyManager/specialSetup/holidayManager'),
  branchSetting: () => import('@/views/categroyManager/specialSetup/branchSetting'),
  jobTemplateSetting: () => import('@/views/categroyManager/specialSetup/jobTemplateSetting'),
  generalSettings: () => import('@/views/categroyManager/generalSettings/index'),
  siginManager: () => import('@/views/categroyManager/generalSettings/siginManager'),
  leaveManager: () => import('@/views/categroyManager/generalSettings/leaveManager'),
  cycleManager: () => import('@/views/categroyManager/generalSettings/cycleManager'),
  overallManager: () => import('@/views/categroyManager/generalSettings/overallManager'),
  payManager: () => import('@/views/categroyManager/generalSettings/payManager'),
  insideSetting: () => import('@/views/categroyManager/insideSetting/index'),
  adminManager: () => import('@/views/categroyManager/insideSetting/adminManager'),
  adminOperation: () => import('@/views/categroyManager/insideSetting/adminOperation'),
  staffManager: () => import('@/views/categroyManager/insideSetting/staffManager'),
  branchManager: () => import('@/views/categroyManager/insideSetting/branchManager'),
  addressManager: () => import('@/views/categroyManager/insideSetting/addressManager'),
  branchActive: () => import('@/views/categroyManager/insideSetting/branchActive'),
  branchActiveOperation: () => import('@/views/categroyManager/insideSetting/branchActiveOperation'),
  vipChargeSeting: () => import('@/views/categroyManager/vipChargeSeting'),
  vipActiveList: () => import('@/views/categroyManager/vipActiveList'),
  vipNewActive: () => import('@/views/categroyManager/vipNewActive'),
  vipParameterManager: () => import('@/views/categroyManager/generalSettings/vipParameterManager'),
  globalConfig: () => import('@/views/categroyManager/globalConfig'),
  // 侧边栏管理
  setSilder: () => import('@/views/setSilder/addSilder'),
  // 乐团老师点名记录
  teamTeacherRecord: () => import('@/views/teamDetail/components/teamTeacherRecord'),
  // 乐团筹备中 报名中
  signupList: () => import('@/views/teamBuild/signupList'),
  // 乐团筹备设置 (班级 老师 小课)
  teamSeting: () => import('@/views/teamBuild/teamSeting/'),
  //乐团详情
  teamDetails: () => import('@/views/teamDetail'),
  // 乐团课表详情
  teamDetailCourse: () => import('@/views/teamDetail/indexCourse'),
  // 学生点名总汇
  studentSignin: () => import('@/views/teamDetail/components/studentSignin'),
  // 班级调整
  resetClass: () => import('@/views/teamDetail/components/resetClass'),
  // 发放清单
  teamDetailedList: () => import('@/views/teamDetail/teamDetailedList'),
  // 基础技能班设置
  setImprovement: () => import('@/views/teamBuild/teamSeting/components/setImprovement'),
  // 乐团修改 @/views/resetTeaming/index
  resetTeaming: () => import('@/views/resetTeaming/index'),
  // 乐团课排课
  coursePlan: () => import('@/views/teamBuild/teamSeting/components/coursePlan'),
  // 收费分润管理
  chargeProfitManager: () => import('../views/categroyManager/insideSetting/chargeProfitManager'),
  // 零星管理
  sporadicManager: () => import('@/views/sporadicManager/sporadicList'),
  // 课表列表
  teamCourseList: () => import('@/views/teamDetail/teamCourseList'),
  // 运营预警
  operationalList: () => import('@/views/operationalEarly/operationalList'),
  // 网管课列表
  accompanyList:()=> import('@/views/accompanyManager/accompanyList'),
  // 网管课详情
  accompanys:()=> import('@/views/accompanyManager/accompanys'),
  // 版本控制
  editionList:()=> import('@/views/editionManager/editionList'),
  // 定时任务
  timedTask:()=> import('@/views/timedTask/index'),
  // 月报
  evaluateList:()=> import('@/views/evaluateManager/evaluateList'),
  // 月报详情
  evaluateDetail:()=> import('@/views/evaluateManager/evaluateDetail'),
  // 评价管理
  commentManager:()=>import('@/views/evaluateManager'),
  // 网管课评价
  networkList:()=>import('@/views/evaluateManager/networkList'),
  // 时间充值活动
  entryActivities:()=>import('@/views/app/entryActivities'),
  // 添加或修改
  entryOperation:()=>import('@/views/app/entryOperation'),
  // 帮助分类
  helpCategory:()=>import('@/views/helpCenter/helpCategory'),
  // 帮助内容
  helpContent:()=>import('@/views/helpCenter/helpContent'),
}
export default router
