import Auth from '@/views/layout/auth'
import { router, rootRouter } from './routes-common'

type metaType = {
  isRegister: boolean
}

// 不需要登录的路由
// companion-teacher-register
const noLoginRouter = [
  {
    path: '/companion-teacher-register',
    name: 'companion-teacher-register',
    component: () => import('@/school/companion-teacher/companion-teacher-register'),
    meta: {
      title: '乐团伴学老师注册'
    }
  },
  {
    path: '/manage-teacher-register',
    name: 'manage-teacher-register',
    component: () => import('@/school/manage-teacher/manage-teacher-register'),
    meta: {
      title: '乐团管理老师注册'
    }
  }
]

export default [
  {
    path: '/',
    component: Auth,
    children: [
      ...router,
      {
        path: '/login',
        name: 'login',
        component: () => import('@/views/layout/login'),
        meta: {
          isRegister: false
        } as metaType
      },
      {
        path: '/home',
        name: 'home',
        component: () => import('@/school/home/index')
      },
      {
        path: '/my-orchestra',
        name: 'my-orchestra',
        component: () => import('@/school/orchestra/index'),
        meta: {
          title: '我的乐团'
        }
      },
      {
        path: '/create-orchestra',
        name: 'create-orchestra',
        component: () => import('@/school/orchestra/create-orchestra/index'),
        meta: {
          title: '新建乐团'
        }
      },
      {
        path: '/create-orchestra-teacher',
        name: 'create-orchestra-teacher',
        component: () => import('@/school/orchestra/create-orchestra/select-teacher'),
        meta: {
          title: '选择老师'
        }
      },
      {
        path: '/orchestra-detail',
        name: 'orchestra-detail',
        component: () => import('@/school/orchestra/orchestra-detail'),
        meta: {
          title: '乐团详情'
        }
      },
      {
        path: '/photo-detail',
        name: 'photo-detail',
        component: () => import('@/school/orchestra/compontent/photo-detail'),
        meta: {
          title: '相册详情'
        }
      },
      {
        path: '/mass-message',
        name: 'mass-message',
        component: () => import('@/school/mass-message/index'),
        meta: {
          title: '群发记录'
        }
      },
      {
        path: '/create-message',
        name: 'create-message',
        component: () => import('@/school/mass-message/create-message'),
        meta: {
          title: '群发消息'
        }
      },
      {
        path: '/content-information',
        name: 'content-information',
        component: () => import('@/school/content-information/index'),
        meta: {
          title: '资讯管理'
        }
      },
      {
        path: '/companion-teacher',
        name: 'companion-teacher',
        component: () => import('@/school/companion-teacher/index'),
        meta: {
          title: '伴学老师'
        }
      },
      {
        path: '/companion-teacher-detail',
        name: 'companion-teacher-detail',
        component: () => import('@/school/companion-teacher/companion-detail'),
        meta: {
          title: '伴学老师详情'
        }
      },
      {
        path: '/companion-unbind',
        name: 'companion-unbind',
        component: () => import('@/school/companion-teacher/unbind'),
        meta: {
          title: '课程交接'
        }
      },
      {
        path: '/manage-teacher',
        name: 'manage-teacher',
        component: () => import('@/school/manage-teacher/index'),
        meta: {
          title: '管理老师'
        }
      },
      {
        path: '/manage-teacher-detail',
        name: 'manage-teacher-detail',
        component: () => import('@/school/manage-teacher/manage-detail'),
        meta: {
          title: '管理老师详情'
        }
      },
      {
        path: '/orchestra-information',
        name: 'orchestra-information',
        component: () => import('@/school/orchestra/orchestra-information'),
        meta: {
          title: '乐团资讯'
        }
      },
      {
        path: '/exercise-record',
        name: 'exercise-record',
        component: () => import('@/views/exercise-record'),
        meta: {
          title: '练习记录'
        }
      },
      {
        path: '/exercis-detail',
        name: 'exercis-detail',
        component: () => import('@/views/exercise-record/exercis-detail'),
        meta: {
          title: '测评详情'
        }
      },
      {
        path: '/attendance',
        name: 'attendance',
        component: () => import('@/school/attendance/index'),
        meta: {
          title: '异常考勤'
        }
      },
      {
        path: '/student-att-day',
        name: 'student-att-day',
        component: () => import('@/school/attendance/student-att-day'),
        meta: {
          title: '考勤详情'
        }
      },
      {
        path: '/teacher-attendDetail',
        name: 'teacher-attendDetail',
        component: () => import('@/school/attendance/components/teacher-attendDetail'),
        meta: {
          title: '考勤详情'
        }
      },
      //
      {
        path: '/ranking-list',
        name: 'ranking-list',
        component: () => import('@/school/ranking-list/index'),
        meta: {
          title: '排行榜'
        }
      },
      {
        path: '/approval-manage',
        name: 'approval-manage',
        component: () => import('@/school/approval-manage/index'),
        meta: {
          title: '我的审批'
        }
      },
      {
        path: '/student-leave',
        name: 'student-leave',
        component: () => import('@/school/approval-manage/components/student-leave'),
        meta: {
          title: '审批详情'
        }
      },
      {
        path: '/train-planning',
        name: 'train-planning',
        component: () => import('@/school/train-planning/index'),
        meta: {
          title: '训练规划'
        }
      },
      {
        path: '/train-content',
        name: 'train-content',
        component: () => import('@/school/train-planning/component/train-content'),
        meta: {
          title: '训练内容'
        }
      },
      {
        path: '/practice-detail',
        name: 'practice-detail',
        component: () => import('@/school/train-planning/component/practice-detail'),
        meta: {
          title: '训练详情'
        }
      },
      {
        path: '/course-preview',
        name: 'course-preview',
        component: () => import('@/school/train-planning/component/course-preview'),
        meta: {
          title: '课程预览'
        }
      },
      {
        path: '/course-adjust',
        name: 'course-adjust',
        component: () => import('@/school/approval-manage/course-adjust'),
        meta: {
          title: '课程调整'
        }
      },
      {
        path: '/batch-adjust',
        name: 'batch-adjust',
        component: () => import('@/school/approval-manage/batch-adjust'),
        meta: {
          title: '批量调整'
        }
      },
      {
        path: '/school-detail',
        name: 'school-detail',
        component: () => import('@/school/school-detail/index'),
        meta: {
          title: '学校信息'
        }
      },
      {
        path: '/school-eidt',
        name: 'school-eidt',
        component: () => import('@/school/school-detail/eidt-school'),
        meta: {
          title: '修改学校地址'
        }
      },
      {
        path: '/attendance-rule',
        name: 'attendance-rule',
        component: () => import('@/views/attendance-rule/index'),
        meta: {
          title: '考勤规则'
        }
      }

      //
    ]
  },

  ...rootRouter,
  ...noLoginRouter
]
