新增路由

dev
Your Name 7 months ago
parent be31783972
commit fdef8ce4d4
  1. 4
      mock/user.ts
  2. 2
      src/layout/index.vue
  3. 8
      src/layout/menu/index.vue
  4. 154
      src/router/routers.ts
  5. 14
      src/views/MyCourseStudy/Courselikes.vue
  6. 14
      src/views/MyCourseStudy/courseCollections.vue
  7. 14
      src/views/MyCourseStudy/learningProcess.vue
  8. 14
      src/views/course/CourseObjectives.vue
  9. 14
      src/views/course/basicCourseInformation.vue
  10. 14
      src/views/course/courseChapters.vue
  11. 14
      src/views/course/curriculumMap.vue
  12. 14
      src/views/course/knowledgePoints.vue
  13. 14
      src/views/portal/LearningPathRecommendations.vue
  14. 14
      src/views/portal/courseHomepage.vue
  15. 14
      src/views/portal/courseReports.vue
  16. 14
      src/views/portal/index.vue
  17. 14
      src/views/portal/knowledgePointLearning.vue

@ -10,7 +10,7 @@ function createUserList() {
desc: '平台管理员', desc: '平台管理员',
roles: ['平台管理员'], roles: ['平台管理员'],
buttons: ['cuser.detail'], buttons: ['cuser.detail'],
routes: ['Home', 'Course', 'Student', 'Group', 'Message'], routes: ['Home', 'Course', 'Student', 'Group', 'Message','BasicCourseInformation','CourseObjectives','CourseChapters','KnowledgePoints','CurriculumMap'], //老师权限
token: 'Admin Token', token: 'Admin Token',
}, },
{ {
@ -22,7 +22,7 @@ function createUserList() {
desc: '系统管理员', desc: '系统管理员',
roles: ['系统管理员'], roles: ['系统管理员'],
buttons: ['cuser.detail', 'cuser.user'], buttons: ['cuser.detail', 'cuser.user'],
routes: ['Home', 'MyCourseStudy', 'CourseResources', 'Message'], routes: ['Home', 'MyCourseStudy', 'CourseResources', 'Message','LearningProcess','CourseCollections','Courselikes','WebHome','CourseHome','LearningPathRecommendations','KnowledgePointLearning','CourseReports'], //学生权限
token: 'System Token', token: 'System Token',
}, },
] ]

@ -15,7 +15,7 @@
:default-active="$route.path" :default-active="$route.path"
background-color="#001529" background-color="#001529"
text-color="#fff" text-color="#fff"
:collapse="LayoutSettingStoe.fold"
> >
<Menu :menuList="usePermissionStore.asyncRouter" /> <Menu :menuList="usePermissionStore.asyncRouter" />
</el-menu> </el-menu>

@ -15,12 +15,10 @@
<!-- <el-icon> <!-- <el-icon>
<component :is="item.meta.icon"></component> <component :is="item.meta.icon"></component>
</el-icon> --> </el-icon> -->
<span v-show="!fold">{{ item.meta.title }}</span> <span v-show="!fold">{{ item.meta.title }}</span>
</template> </template>
</el-menu-item> </el-menu-item>
</template> </template>
<!-- 有子路由但是只有一个子路由 --> <!-- 有子路由但是只有一个子路由 -->
<template v-if="item.children && item.children.length === 1"> <template v-if="item.children && item.children.length === 1">
<el-menu-item <el-menu-item
@ -36,7 +34,6 @@
</template> </template>
</el-menu-item> </el-menu-item>
</template> </template>
<!-- 有子路由且有多个 --> <!-- 有子路由且有多个 -->
<el-sub-menu <el-sub-menu
:index="item.path" :index="item.path"
@ -52,17 +49,14 @@
</el-sub-menu> </el-sub-menu>
</template> </template>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { watch, ref } from 'vue' import { watch, ref } from 'vue'
import useLayoutSettingStoe from '@/store/modules/setting' import useLayoutSettingStoe from '@/store/modules/setting'
const LayoutSettingStoe = useLayoutSettingStoe() const LayoutSettingStoe = useLayoutSettingStoe()
// import { onMounted, reactive, ref, toRefs, watch } from 'vue' // import { onMounted, reactive, ref, toRefs, watch } from 'vue'
// //
defineProps(['menuList']) defineProps(['menuList'])
const $router = useRouter() const $router = useRouter()
const goToRoute = (vc: any) => { const goToRoute = (vc: any) => {
$router.push(vc.index) $router.push(vc.index)
@ -79,7 +73,7 @@ watch(
</script> </script>
<script lang="ts"> <script lang="ts">
export default { export default {
name: 'app-Menu', name: 'Menu',
} }
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>

@ -24,20 +24,72 @@ export const constantRoute: any = [
}, },
{ {
path: '/curriculumCenter', path: '/curriculumCenter',
redirect: '/curriculumCenter/basicCourseInformation',
component: () => import('@/layout/index.vue'), component: () => import('@/layout/index.vue'),
name: 'CurriculumCenter', name: 'CurriculumCenter',
meta: { meta: {
title: '', title: '课程',
hidden: false, hidden: false,
icon: 'HomeFilled', // 菜单图标 icon: 'HomeFilled', // 菜单图标
}, },
children: [ children: [
// {
// path: '/curriculumCenter/course',
// redirect: '/curriculumCenter/basicCourseInformation',
// component: () => import('@/views/course/index.vue'),
// name: 'Course',
// meta: {
// title: '课程',
// hidden: false,
// icon: 'Notebook',
// },
// },
{ {
path: '/curriculumCenter/course', path: '/curriculumCenter/basicCourseInformation',
component: () => import('@/views/course/index.vue'), component: () => import('@/views/course/basicCourseInformation.vue'),
name: 'Course', name: 'BasicCourseInformation',
meta: { meta: {
title: '课程', title: '课程基本信息',
hidden: false,
icon: 'Notebook',
},
},
{
path: '/curriculumCenter/CourseObjectives',
component: () => import('@/views/course/CourseObjectives.vue'),
name: 'CourseObjectives',
meta: {
title: '课程目标',
hidden: false,
icon: 'Notebook',
},
},
{
path: '/curriculumCenter/courseChapters',
component: () => import('@/views/course/courseChapters.vue'),
name: 'CourseChapters',
meta: {
title: '课程章节',
hidden: false,
icon: 'Notebook',
},
},
{
path: '/curriculumCenter/knowledgePoints',
component: () => import('@/views/course/knowledgePoints.vue'),
name: 'KnowledgePoints', // name 要与权限一致
meta: {
title: '知识点',
hidden: false,
icon: 'Notebook',
},
},
{
path: '/curriculumCenter/curriculumMap',
component: () => import('@/views/course/curriculumMap.vue'),
name: 'CurriculumMap', // name 要与权限一致
meta: {
title: '课程图谱',
hidden: false, hidden: false,
icon: 'Notebook', icon: 'Notebook',
}, },
@ -115,17 +167,37 @@ export const constantRoute: any = [
component: () => import('@/layout/index.vue'), component: () => import('@/layout/index.vue'),
name: 'MyCourseStudyManagement', name: 'MyCourseStudyManagement',
meta: { meta: {
title: '', title: '学习过程',
hidden: false, hidden: false,
icon: 'HomeFilled', // 菜单图标 icon: 'HomeFilled', // 菜单图标
}, },
children: [ children: [
{ {
path: '/myCourseStudyManagement/myCourseStudy', path: '/myCourseStudyManagement/learningProcess',
component: () => import('@/views/MyCourseStudy/index.vue'), component: () => import('@/views/MyCourseStudy/learningProcess.vue'),
name: 'MyCourseStudy', name: 'LearningProcess',
meta: {
title: '课程学习记录',
hidden: false,
icon: 'StarFilled',
},
},
{
path: '/myCourseStudyManagement/courseCollections',
component: () => import('@/views/MyCourseStudy/courseCollections.vue'),
name: 'CourseCollections',
meta: {
title: '课程收藏',
hidden: false,
icon: 'StarFilled',
},
},
{
path: '/myCourseStudyManagement/Courselikes',
component: () => import('@/views/MyCourseStudy/Courselikes.vue'),
name: 'Courselikes',
meta: { meta: {
title: '我学习的课程', title: '课程点赞',
hidden: false, hidden: false,
icon: 'StarFilled', icon: 'StarFilled',
}, },
@ -154,4 +226,66 @@ export const constantRoute: any = [
}, },
], ],
}, },
{
path: '/portal',
component: () => import('@/layout/index.vue'),
name: 'Portal',
meta: {
title: '门户',
hidden: false,
icon: 'HomeFilled', // 菜单图标
},
children: [
{
path: '/portal/webHome',
component: () => import('@/views/portal/index.vue'),
name: 'WebHome',
meta: {
title: '网站首页',
hidden: false,
icon: 'Reading',
},
},
{
path: '/portal/courseHome',
component: () => import('@/views/portal/courseHomepage.vue'),
name: 'CourseHome',
meta: {
title: '课程首页',
hidden: false,
icon: 'Reading',
},
},
{
path: '/portal/LearningPathRecommendations',
component: () => import('@/views/portal/LearningPathRecommendations.vue'),
name: 'LearningPathRecommendations',
meta: {
title: '学习路径推荐',
hidden: false,
icon: 'Reading',
},
},
{
path: '/portal/knowledgePointLearning',
component: () => import('@/views/portal/knowledgePointLearning.vue'),
name: 'KnowledgePointLearning',
meta: {
title: '知识点学习',
hidden: false,
icon: 'Reading',
},
},
{
path: '/portal/courseReports',
component: () => import('@/views/portal/courseReports.vue'),
name: 'CourseReports',
meta: {
title: '课程报告',
hidden: false,
icon: 'Reading',
},
},
],
},
] ]

@ -0,0 +1,14 @@
<template>
<div>
课程点赞
</div>
</template>
<script lang='ts' setup>
import { } from 'vue'
</script>
<style lang='scss' scoped>
</style>

@ -0,0 +1,14 @@
<template>
<div>
课程收藏
</div>
</template>
<script lang='ts' setup>
import { } from 'vue'
</script>
<style lang='scss' scoped>
</style>

@ -0,0 +1,14 @@
<template>
<div>
学习过程
</div>
</template>
<script lang='ts' setup>
import { } from 'vue'
</script>
<style lang='scss' scoped>
</style>

@ -0,0 +1,14 @@
<template>
<div>
课程目标
</div>
</template>
<script lang='ts' setup>
import { } from 'vue'
</script>
<style lang='scss' scoped>
</style>

@ -0,0 +1,14 @@
<template>
<div>
课程基本信息
</div>
</template>
<script lang='ts' setup>
import { } from 'vue'
</script>
<style lang='scss' scoped>
</style>

@ -0,0 +1,14 @@
<template>
<div>
课程章节
</div>
</template>
<script lang='ts' setup>
import { } from 'vue'
</script>
<style lang='scss' scoped>
</style>

@ -0,0 +1,14 @@
<template>
<div>
课程图谱
</div>
</template>
<script lang='ts' setup>
import { } from 'vue'
</script>
<style lang='scss' scoped>
</style>

@ -0,0 +1,14 @@
<template>
<div>
知识点
</div>
</template>
<script lang='ts' setup>
import { } from 'vue'
</script>
<style lang='scss' scoped>
</style>

@ -0,0 +1,14 @@
<template>
<div>
学习路径推荐
</div>
</template>
<script lang='ts' setup>
import { } from 'vue'
</script>
<style lang='scss' scoped>
</style>

@ -0,0 +1,14 @@
<template>
<div>
课程首页
</div>
</template>
<script lang='ts' setup>
import { } from 'vue'
</script>
<style lang='scss' scoped>
</style>

@ -0,0 +1,14 @@
<template>
<div>
课程报告
</div>
</template>
<script lang='ts' setup>
import { } from 'vue'
</script>
<style lang='scss' scoped>
</style>

@ -0,0 +1,14 @@
<template>
<div>
网站首页
</div>
</template>
<script lang='ts' setup>
import { } from 'vue'
</script>
<style lang='scss' scoped>
</style>

@ -0,0 +1,14 @@
<template>
<div>
知识点学习
</div>
</template>
<script lang='ts' setup>
import { } from 'vue'
</script>
<style lang='scss' scoped>
</style>
Loading…
Cancel
Save