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

/**
 * 配置类型
 */
type metaType = {
  isRegister: boolean // 是否可注册
}

// 不需要登录的路由
const noLoginRouter = []

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('@/teacher/home/index')
      },
      {
        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('@/teacher/attendance/index'),
        meta: {
          title: '我的考勤'
        }
      },
      {
        path: '/teacher-attendDetail',
        name: 'teacher-attendDetail',
        component: () => import('@/school/attendance/components/teacher-attendDetail'),
        meta: {
          title: '考勤详情'
        }
      },
      {
        path: '/attendance-rule',
        name: 'attendance-rule',
        component: () => import('@/views/attendance-rule/index'),
        meta: {
          title: '考勤规则'
        }
      },
      {
        path: '/screen-projection',
        name: 'screen-projection',
        component: () => import('@/teacher/screen-projection/index'),
        meta: {
          title: '教学课件'
        }
      },

      {
        path: '/unit-list',
        name: 'unit-list',
        component: () => import('@/views/unit-test/unit-list/index'),
        meta: {
          title: '单元测验'
        }
      },
      {
        path: '/unit-create',
        name: 'unit-create',
        component: () => import('@/views/unit-test/unit-create/index'),
        meta: {
          title: '新增测验'
        }
      },
      {
        path: '/unit-Lesson',
        name: 'unit-Lesson',
        component: () => import('@/views/unit-test/unit-create/unit-Lesson'),
        meta: {
          title: '选择教材'
        }
      },
      {
        path: '/uni-test',
        name: 'uni-test',
        component: () => import('@/views/unit-test/unit-create/uni-test'),
        meta: {
          title: '选择教材'
        }
      },
      {
        path: '/uni-last',
        name: 'uni-last',
        component: () => import('@/views/unit-test/unit-create/uni-last'),
        meta: {
          title: '单元测验'
        }
      },
      {
        path: '/unitDetail',
        name: 'unitDetail',
        component: () => import('@/views/unit-test/unit-list/unitDetail'),
        meta: {
          title: '测验详情'
        }
      }

      //unitDetail 选择单元测验
    ]
  },
  ...rootRouter,
  ...noLoginRouter
]
