import type { RouteRecordRaw } from 'vue-router'
import { LogType } from '@/hooks'
import subject_c from './index.vue'
import textbook_c from './textbook/index.vue'
import learningArtifact_c from './learningArtifact/index.vue'
import happyRead_c from './happyRead/index.vue'
import sentenceSort_c from './languageSense/sentenceSort/index.vue'
import freeHome_c from './freeStudy/views/home/index.vue'
import freeTextbookDetail_c from './freeStudy/views/textbookDetail/index.vue'
import freeKnowledgePoints_c from './freeStudy/views/knowledgePoints/index.vue'
import wrongBook_c from './wrongBook/index.vue'
import aiStudy_c from './aiStudy/index.vue'
import doWorkParent_c from './doWork/parent.vue'
import doWorkById_c from './doWork/index.vue'
import wordDetails_c from './wordDetails/index.vue'
import learnWord_c from './learnWord/index.vue'
import NormalMode_c from './learnWord/normalMode/normalMode.vue'
import HardMode_c from './learnWord/hardMode/hardMode.vue'
import wordTableTest_c from './learnWord/word-table/test/index.vue'
import wordTable_c from './learnWord/word-table/index.vue'
import ClassicReading_c from './happyRead/classicReading/read/read.vue'
import singleBookIntroduction_c from './happyRead/classicReading/singleBookIntroduction/singleBookIntroduction.vue'
import BookDetail_c from './happyRead/classicReading/readDetail/PlayBooks.vue'
import phonics_c from './happyRead/phonics/index.vue'
import shortReading_c from './happyRead/shortReading/index.vue'
import shortReadingDetail_c from './happyRead/shortReading/readTopic/index.vue'
import shortReadingRecord_c from './happyRead/shortReading/readRecord/index.vue'
import phonicsDetail_c from './happyRead/phonics/blankFill/index.vue'
import GroupHome_c from './groupPaper/home/index.vue'
import GroupCombination_c from './groupPaper/combination/index.vue'
import GroupHisDetail_c from './groupPaper/historyDetail/index.vue'
import studyVideo_c from './studyVideo/index.vue'
import explainParent_c from './explain/parent.vue'
import explainIndex_c from './explain/index.vue'

const routes: RouteRecordRaw = {
  path: 'subject',
  children: [
    {
      name: 'subject',
      path: '',
      // component: () => import('./index.vue'),
      component: subject_c,
      meta: { title: '学科' },
    },
    {
      name: 'user-word-book',
      path: 'user-word-book',
      component: () => import('../subject/user-word-book/index.vue'),
      meta: { title: '学员单词书' },
    },
    {
      name: 'textbook',
      path: 'textbook',
      // component: () => import('./textbook/index.vue'),
      component: textbook_c,
      meta: { title: '教材' },
    },
    {
      name: 'LearningArtifact',
      path: 'learningArtifact',
      // component: () => import('./learningArtifact/index.vue'),
      component: learningArtifact_c,
      meta: { title: '学习神器' },
    },
    {
      name: 'StudyVideo',
      path: 'studyVideo/:textBookId',
      // component: () => import('./learningArtifact/index.vue'),
      component: studyVideo_c,
      meta: { title: '学习视频' },
    },
    {
      path: 'happyRead',
      children: [
        {
          name: 'HappyRead',
          path: '',
          component: happyRead_c,
          meta: { title: '乐读' },
        },
        {
          path: 'phonics',
          children: [
            {
              name: 'Phonics',
              path: '',
              component: phonics_c,
              meta: { title: '自然拼读首页' },
            },
            {
              name: 'PhonicsDetail',
              path: 'PhonicsDetail',
              component: phonicsDetail_c,
              meta: { title: '自然拼读详情' },
            },
          ],
        },
        {
          path: 'shortReading',
          children: [
            {
              name: 'shortReading',
              path: '',
              component: shortReading_c,
              meta: { title: '短片阅读统计' },
            },
            {
              name: 'shortReadingDetail',
              path: 'shortReadingDetail',
              component: shortReadingDetail_c,
              meta: { title: '短片阅读练习详情' },
            },
            {
              name: 'shortReadingRecord',
              path: 'shortReadingRecord',
              component: shortReadingRecord_c,
              meta: { title: '短片阅读练习记录' },
            },
          ],
        },
        {
          path: 'classicRead',
          children: [
            {
              name: 'classicRead',
              path: '',
              component: ClassicReading_c,
              meta: { title: '名著阅读' },
            },
            {
              name: 'singleBookIntroduction',
              path: 'singleBookIntroduction',
              component: singleBookIntroduction_c,
              meta: { title: '系列书介绍' },
            },
            {
              path: 'readDetail',
              name: 'readDetail',
              component: BookDetail_c,
              meta: { title: '章节详情' },
            },
          ],
        },
      ],
    },
    {
      path: 'languageSense',
      children: [
        {
          name: 'LanguageSense',
          path: '',
          component: () => import('./languageSense/home/index.vue'),
          meta: { title: '语感' },
        },
        {
          name: 'SentenceSort',
          path: 'sentenceSort',
          // component: () => import('./languageSense/sentenceSort/index.vue'),
          component: sentenceSort_c,
          meta: { title: '句子排序' },
        },
        {
          name: 'SentenceSortStatistics',
          path: 'statistics',
          component: () => import('./languageSense/sentenceSortStatistics/index.vue'),
          meta: { title: '句子排序统计' },
        },
        {
          name: 'sentenceCollect',
          path: 'sentenceCollect',
          component: () => import('./languageSense/sentenceCollect/index.vue'),
          meta: { title: '句子箱' },
        },
      ],
    },
    {
      path: 'learnWord',
      children: [
        {
          name: 'LearnWord',
          path: '',
          component: learnWord_c,
          meta: { title: '单词闯关' },
        },
        {
          name: 'NormalMode',
          path: 'normalMode',
          component: NormalMode_c,
          meta: { title: '普通模式' },
        },
        {
          name: 'HardMode',
          path: 'hardMode',
          component: HardMode_c,
          meta: { title: '困难模式' },
        },
        {
          name: 'testRecords',
          path: 'testRecords',
          component: () => import('./learnWord/word-table/test/testRecords.vue'),
          meta: { title: '单词测试记录' },
        },
        {
          name: 'word-review',
          path: 'word-review',
          component: () => import('./learnWord/word-review/index.vue'),
          meta: { title: '单词复习' },
        },
        {
          name: 'word-test',
          path: 'word-test',
          component: () => import('./learnWord/word-test/index.vue'),
          meta: { title: '单词测评' },
        },
        {
          name: 'word-test-records',
          path: 'word-test-records',
          component: () => import('./learnWord/word-test-records/index.vue'),
          meta: { title: '单词测评记录' },
        },
        {
          name: 'word-test-class-records',
          path: 'word-test-class-records',
          component: () => import('./learnWord/word-test-class-records/index.vue'),
          meta: { title: '班级单词测评记录' },
        },
        {
          name: 'word-table-test',
          path: 'word-table-test',
          component: wordTableTest_c,
          meta: { title: '单词测试' },
        },
        {
          name: 'word-table',
          path: 'word-table',
          component: wordTable_c,
          meta: { title: '单词书' },
        },
      ],
    },
    {
      path: 'freeStudy',
      children: [
        {
          name: 'FreeHome',
          path: ':subjectId',
          // component: () => import('./freeStudy/views/home/index.vue'),
          component: freeHome_c,
          meta: { title: '自由学' },
        },
        {
          name: 'FreeTextbookDetail',
          path: 'textbookDetail/:subjectId/:textBookId',
          // component: () => import('./freeStudy/views/textbookDetail/index.vue'),
          component: freeTextbookDetail_c,
          meta: {
            logType: LogType.StudyTime,
            // extra: {
            //     resourceType: 0,
            // },
          },
        },
        {
          name: 'FreeKnowledgePoints',
          path: 'knowledgePoints/:subjectId/:knowledgeId',
          // component: () => import('./freeStudy/views/knowledgePoints/index.vue'),
          meta: {
            logType: LogType.StudyTime,
          },
          component: freeKnowledgePoints_c,
        },
      ],
    },
    {
      name: 'WrongBook',
      path: 'wrongBook/:subjectId',
      // component: () => import('./wrongBook/index.vue'),
      component: wrongBook_c,
      meta: { title: '错题本' },
    },
    {
      name: 'AiStudy',
      path: 'aiStudy/:subjectId',
      // component: () => import('./aiStudy/index.vue'),
      component: aiStudy_c,
      meta: { title: 'AI精准学' },
    },
    {
      path: 'groupPaper',
      children: [
        {
          name: 'GroupHome',
          path: '',
          component: GroupHome_c,
          meta: { title: '自由组卷' },
        },
        {
          name: 'GroupCombination',
          path: 'combination/:type',
          component: GroupCombination_c,
          meta: { title: '组合组卷' },
        },
        {
          name: 'GroupHistory',
          path: 'history',
          component: () => import('./groupPaper/history/index.vue'),
          meta: { title: '历史组卷' },
        },
        {
          name: 'GroupHisDetail',
          path: 'hisDetail/:id',
          component: GroupHisDetail_c,
          meta: { title: '查看报告' },
        },
      ],
    },
    {
      name: 'DoWorkParent',
      path: 'doWork',
      // component: () => import('./doWork/parent.vue'),
      component: doWorkParent_c,
      children: [
        {
          name: 'DoWorkById',
          path: ':id',
          // component: () => import('./doWork/index.vue'),
          component: doWorkById_c,
          meta: { title: '答题' },
        },
        {
          name: 'DoWork',
          path: '',
          // component: () => import('./doWork/index.vue'),
          component: doWorkById_c,
          meta: {
            title: '答题',
            logType: LogType.StudyTime,
          },
        },
      ],
    },
    {
      name: 'ExplainParent',
      path: 'explain',
      component: explainParent_c,
      children: [
        {
          name: 'QuestionExplain',
          path: '',
          component: explainIndex_c,
          meta: { title: '讲解' },
        },
      ],
    },
    {
      name: 'dictionaries',
      path: 'dictionaries',
      component: () => import('./dictionaries/index.vue'),
      meta: { title: '词典' },
    },
    {
      name: 'WordDetails',
      path: 'wordDetails',
      // component: () => import('./wordDetails/index.vue'),
      component: wordDetails_c,
      meta: { title: '单词详情' },
    },
    {
      name: 'strangeBook',
      path: 'strangeBook',
      component: () => import('./strangeBook/index.vue'),
      meta: { title: '生词本' },
    },
    {
      path: 'phoneticTranscription',
      children: [
        {
          path: '',
          name: 'phoneticTranscription',
          component: () => import('./phoneticTranscription/index.vue'),
          meta: { title: '音标' },
        },
        {
          name: 'phoneticTranscriptionDetail',
          path: ':title',
          component: () => import('./phoneticTranscription/detail/index.vue'),
          meta: { title: '音标详情' },
        },
      ],
    },
    {
      name: 'englishBasic',
      path: 'englishBasic',
      component: () => import('./englishBasic/index.vue'),
      meta: { title: '零基础' },
    },
  ],
}

export default routes
