import { RouteRecordRaw } from 'vue-router';

export const constantRoutes: RouteRecordRaw[] = [
  {
    name: 'login',
    path: '/login',
    component: () => import('@/views/login/index'),
    meta: {
      title: '登录',
      singleLayout: 'blank'
    }
  },
  {
    name: '/Layout',
    path: '/',
    component: () => import('@/components/layout/index'),
    children: [
      {
        //默认 显示home组件
        path: '',
        name: 'Home',
        component: () => import('@/views/home/index'),
        meta: {
          title: '主页',
          singleLayout: 'blank'
        }
      },
      {
        name: 'prepare-lessons',
        path: '/prepare-lessons',
        component: () => import('@/views/prepare-lessons/index'),
        meta: {
          title: '备课',
          singleLayout: 'blank'
        }
      },
      {
        path: '/studentList',
        name: 'studentList',
        component: () => import('@/views/studentList/index'),
        meta: {
          title: '学生列表',
          singleLayout: 'blank'
        }
      },
      {
        path: '/classList',
        name: 'classList',
        component: () => import('@/views/classList/index'),
        meta: {
          title: '班级列表',
          singleLayout: 'blank'
        }
      },
      {
        path: '/classDetail',
        name: 'classDetail',
        component: () => import('@/views/classList/classDetail'),
        meta: {
          title: '班级详情',
          singleLayout: 'blank'
        }
      },
      {
        path: '/classStudentDetail',
        name: 'classStudentDetail',
        component: () => import('@/views/studentList/studentDetail'),
        meta: {
          title: '学员详情',
          singleLayout: 'blank',
          isClass: true
        }
      },
      {
        path: '/studentDetail',
        name: 'studentDetail',
        component: () => import('@/views/studentList/studentDetail'),
        meta: {
          title: '学员详情',
          singleLayout: 'blank',
          isClass: false
        }
      },

      {
        path: '/afterWorkDetail',
        name: 'afterWorkDetail',
        component: () => import('@/views/classList/components/afterWorkDetail'),
        meta: {
          title: '作业详情',
          singleLayout: 'blank'
        }
      },
      {
        path: '/classStudentRecode',
        name: 'classStudentRecode',
        component: () =>
          import('@/views/classList/components/classStudentRecode'),
        meta: {
          title: '练习记录',
          singleLayout: 'blank'
        }
      },
      {
        path: '/xiaoku-ai',
        name: 'xiaoku-ai',
        component: () => import('@/views/xiaoku-ai/index'),
        meta: {
          title: 'AI学练'
        }
      },
      {
        path: '/xiaoku-music',
        name: 'xiaoku-music',
        component: () => import('@/views/xiaoku-music/index'),
        meta: {
          title: '曲谱库'
        }
      },
      {
        path: '/xiaoku-list',
        name: 'xiaoku-list',
        component: () => import('@/views/xiaoku-list/index'),
        meta: {
          title: 'AI学练'
        }
      },
      {
        path: '/xiaoku-detail',
        name: 'xiaoku-detail',
        component: () => import('@/views/xiaoku-list/detail'),
        meta: {
          title: 'AI学练'
        }
      },
      {
        path: '/setting',
        name: 'base-setting',
        component: () => import('@/views/setting/index'),
        meta: {
          title: '设置'
        }
      },
      {
        path: '/aboutUs',
        name: 'aboutUs',
        component: () => import('@/views/aboutUs/index'),
        meta: {
          title: '关于我们'
        }
      },
      {
        path: '/data-module',
        name: 'data-module',
        component: () => import('@/views/data-module/index'),
        meta: {
          title: '数据'
        }
      },
      {
        path: '/natural-resources',
        name: 'natural-resources',
        component: () => import('@/views/natural-resources/index'),
        meta: {
          title: '资源'
        }
      },
      {
        path: '/notation',
        name: 'notation',
        component: () => import('@/views/notation/index'),
        meta: {
          title: '制谱'
        }
      },
      {
        path: '/content-instruments',
        name: 'content-instruments',
        component: () =>
          import('@/views/content-information/content-instrument'),
        meta: {
          title: '乐器百科'
        }
      },
      {
        path: '/content-instruments-detail',
        name: 'content-instruments-detail',
        component: () =>
          import('@/views/content-information/content-instrument/detail'),
        meta: {
          title: '乐器百科详情'
        }
      },
      {
        path: '/content-musician',
        name: 'content-musician',
        component: () => import('@/views/content-information/content-musician'),
        meta: {
          title: '音乐家'
        }
      },
      {
        path: '/content-musician-detail',
        name: 'content-musician-detail',
        component: () =>
          import('@/views/content-information/content-instrument/detail'),
        meta: {
          title: '音乐家详情'
        }
      },
      {
        path: '/content-music',
        name: 'content-music',
        component: () => import('@/views/content-information/content-music'),
        meta: {
          title: '名曲鉴赏'
        }
      },
      {
        path: '/content-music-detail',
        name: 'content-music-detail',
        component: () =>
          import('@/views/content-information/content-music/detail'),
        meta: {
          title: '名曲鉴赏'
        }
      },
      {
        path: '/content-knowledge',
        name: 'content-knowledge',
        component: () =>
          import('@/views/content-information/content-knowledge'),
        meta: {
          title: '乐理知识'
        }
      },
      {
        path: '/homework-record',
        name: 'homework-record',
        component: () => import('@/views/homework-record'),
        meta: {
          title: '作业'
        }
      },
      {
        path: '/homework-record-detail',
        name: 'homework-record-detail',
        component: () => import('@/views/homework-record/detail'),
        meta: {
          title: '作业详情'
        }
      }
    ]
  },
  {
    name: 'pptResources',
    path: '/pptResources',
    component: () => import('@/views/pptResources'),
    meta: {
      title: 'ppt资源',
      singleLayout: 'blank'
    }
  },
  {
    name: 'attend-class',
    path: '/attend-class',
    component: () => import('@/views/attend-class/index'),
    meta: {
      title: '开始上课',
      singleLayout: 'blank'
    }
  },
  {
    name: '404',
    path: '/404',
    component: () => import('@/views/404/index'),
    meta: {
      title: '未找到',
      singleLayout: 'blank'
    }
  },
  // 匹配无效路径的路由
  {
    name: 'not-found',
    path: '/:path(.*)*',
    component: () => import('@/views/404/index'),
    meta: {
      title: '未找到',
      singleLayout: 'blank'
    }
  }
];
