import Login from '@/view/login/Index.vue'
import ServerSideLogin from '@/view/serverside/login'
import Main from '@/components/public/main'
// import HTTP404 from '@/view/404'
import { resolve } from 'url';

export const routes = [
  { path: '*', redirect: '/404'},
  { name: '404', path: '/404', component: resolve => require(['@/view/404.vue'], resolve) },
  { name: 'index', path: '', component: resolve => require(['@/view/404'], resolve) },
  { name: 'selectModule', path: '/selectModule', component: resolve => require(['@/view/index'], resolve) },
  { name: 'login', path: '/login', component: Login },
  { name: 'ServerSideLogin', path: '/serverside/login', component: ServerSideLogin },    
  // { name: 'smartschooldashboard', path: '/smartschooldashboard', component: resolve => require(['@/view/smartschooldashboard'], resolve), },
  { name: 'smartclassdashboard', path: '/smartclassdashboard', component: resolve => require(['@/view/smartclassdashboard/Index.vue'], resolve), },  
    { name: 'embedschooldashboard', path: '/embedclassdashboard/:schoolshortcode', component: resolve => require(['@/view/smartclassdashboard/Index.vue'], resolve), }, // IES 呼叫專用
  { // 共用組件試用
    path: '/teachermgmt',
    component: Main,
    children: [
      {
        path: '/',
        component: () => import('@/view/teachermgmt/Index.vue')
      }
    ]
  },
  //学情分析
  {
    name: 'saindex',
    path: '/saindex',
    component: resolve => require(['@/view/student-analysis/index/SAindex.vue'], resolve),
  },
  {
    name: 'teach',
    path: '/teach',
    component: resolve => require(['@/view/student-analysis/index/SAteach.vue'], resolve),
  },
  {
    name: 'totalIndex',
    path: '/totalIndex',
    component: resolve => require(['@/view/student-analysis/total-analysis/TotalIndex/TotalIndex.vue'], resolve),
    children: [{
      path: '/totalIndex',
      component: resolve => require(['@/view/student-analysis/total-analysis/EvaluationList/EvaluationList.vue'], resolve),
    }]
  },
  {
    name: 'total',
    path: '/total',
    component: resolve => require(['@/view/student-analysis/total-analysis/index.vue'], resolve),
    children: [
      {
        path: '/total',
        component: resolve => require(['@/view/student-analysis/total-analysis/AchievementAnalysis/AchievementAnalysis.vue'], resolve),
      },
      {
        path: '/total/evaluationList',
        component: resolve => require(['@/view/student-analysis/total-analysis/EvaluationList/EvaluationList.vue'], resolve),
      },
      {
        path: '/total/achievement',
        component: resolve => require(['@/view/student-analysis/total-analysis/AchievementAnalysis/AchievementAnalysis.vue'], resolve),
      },
      {
        path: '/total/achievement/entryTables',
        component: resolve => require(['@/view/student-analysis/total-analysis/AchievementAnalysis/EntryTables.vue'], resolve),
      },
      {
        name:'earlyWarning',
        path: '/total/achievement/earlyWarning',
        component: resolve => require(['@/view/student-analysis/total-analysis/AchievementAnalysis/EarlyWarning.vue'], resolve),
      },
      {
        path: '/total/scatter',
        component: resolve => require(['@/view/student-analysis/total-analysis/ScatterAnalysis/ScatterAnalysis.vue'], resolve),
      },
      {
        path: '/total/knowledge',
        component: resolve => require(['@/view/student-analysis/total-analysis/KnowledgeAnalysis/KnowledgeAnalysis.vue'], resolve),
      },
      {
        path: '/total/knowledge/details',
        component: resolve => require(['@/view/student-analysis/total-analysis/KnowledgeAnalysis/ScoreDetails.vue'], resolve),
      },
      {
        path: '/total/test',
        component: resolve => require(['@/view/student-analysis/total-analysis/TestAnalysis/TestAnalysis.vue'], resolve),
      },
      {
        path: '/total/questionList',
        component: resolve => require(['@/view/student-analysis/total-analysis/TestAnalysis/QuestionList.vue'], resolve),
      }
    ]
  },



  //学校区校班管理
  {
    name: 'schoolIndex',
    path: '/school',
    component: resolve => require(['@/view/school-mgmt/Index.vue'], resolve),
    children: [
      {
        name: 'school',
        path: '/school',
        redirect:'/school/system'
      },
      {
        name: 'system',
        path: '/school/system',
        component: resolve => require(['@/view/school-mgmt/SystemSetting/SystemSetting.vue'], resolve)
      },
      {
        name: 'classroom',
        path: '/school/classroom',
        component: resolve => require(['@/view/school-mgmt/ClassroomSetting/ClassroomSetting.vue'], resolve)
      }
    ]
  },
  //学生账号管理
  {
    path: '/studentAccount',
    component: resolve => require(['@/view/student-account/Index.vue'], resolve),
  },

  //课纲管理
  {
    path: '/syllabus',
    component: resolve => require(['@/view/syllabus/index/index.vue'], resolve),
  },


  //评测
  {
    path: '/evaluation',
    name: 'evaluation',
    component: resolve => require(['@/view/evaluation/index/index.vue'], resolve),
    children: [
      {
        path: '/evaluation',
        component: resolve => require(['@/view/evaluation/index/CreateExercises.vue'], resolve),
      },
      {
        path: '/createExercises',
        name: 'createExercises',
        component: resolve => require(['@/view/evaluation/index/CreateExercises.vue'], resolve),
      },
      {
        path: '/exercisesList',
        name:'exercisesList',
        component: resolve => require(['@/view/evaluation/index/ExercisesList.vue'], resolve),
      },
      {
        path: '/testPaper',
        name:'testPaper',
        component: resolve => require(['@/view/evaluation/index/TestPaper.vue'], resolve),
      },
      {
        path: '/createTest',
        name: 'createTest',
        component: resolve => require(['@/view/evaluation/index/CreateTest.vue'], resolve),
      },
      {
        path: '/testPaperList',
        name: 'testPaperList',
        component: resolve => require(['@/view/evaluation/index/TestPaperList.vue'], resolve),
      },
      {
        path: '/createCompose',
        name: 'createCompose',
        component: resolve => require(['@/view/evaluation/index/CreateCompose.vue'], resolve),
      },
      {
        path: '/editChild',
        name: 'editChild',
        component: resolve => require(['@/view/evaluation/index/EditChild.vue'], resolve),
      },

    ]
  }
]
