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-manage',
        name: 'attendance-manage',
        component: () => import('@/teacher/attendance-manage/index'),
        meta: {
          title: '考勤管理'
        }
      },
      {
        path: '/student-att-day',
        name: 'student-att-day',
        component: () => import('@/school/attendance/student-att-day'),
        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: '/unit-edit-test',
        name: 'unit-edit-test',
        component: () => import('@/views/unit-test/unit-create/unit-edit-test'),
        meta: {
          title: '编辑内容'
        }
      },
      {
        path: '/add-unit-item',
        name: 'add-unit-item',
        component: () => import('@/views/unit-test/unit-create/unit-edit-test/add-unit-item'),
        meta: {
          title: '添加测验曲目'
        }
      },
      {
        path: '/unitDetail',
        name: 'unitDetail',
        component: () => import('@/views/unit-test/unit-list/unitDetail'),
        meta: {
          title: '测验详情'
        }
      },
      {
        path: '/subsidy-exercise-details',
        name: 'subsidy-exercise-details',
        component: () => import('@/school/approval-manage/subsidy/details'),
        meta: {
          title: '补助明细'
        }
      }

      //unitDetail 选择阶段自测
    ]
  },
  ...rootRouter,
  ...noLoginRouter
]
