feat: 重构课程准备页面,更新导航结构并添加新页面

This commit is contained in:
Timothy Yin 2025-04-17 20:17:00 +08:00
parent 9e094896bc
commit d81ec9a62b
Signed by: HoshinoSuzumi
GPG Key ID: 4052E565F04B122A
9 changed files with 89 additions and 51 deletions

View File

@ -1,7 +1,6 @@
{
"eslint.useFlatConfig": true,
"prettier.bracketSameLine": true,
"prettier.requireConfig": true,
"prettier.semi": false,
"prettier.singleAttributePerLine": true,
"prettier.singleQuote": true

View File

@ -30,7 +30,7 @@ export const topbarNavDefaults = [
},
{
title: 'AI 备课',
to: '/course/prepare',
to: '/course/prep/',
icon: 'tabler:clipboard-list',
},
{

View File

@ -11,8 +11,6 @@ const {
} = useRoute()
const router = useRouter()
// const course = await getCourseDetail(id as string);
const {
data: course,
status: courseStatus,
@ -73,6 +71,12 @@ onMounted(() => {
router.replace(`/course/${id}/chapters`)
}
})
watch(() => useRoute().fullPath, (newPath) => {
if (newPath === `/course/${id}`) {
router.replace(`/course/${id}/chapters`)
}
})
</script>
<template>

View File

@ -0,0 +1,26 @@
export const nav = [
{
items: [
{
title: 'AI 教学设计',
url: '/course/prep/teach',
icon: 'tabler:calendar-cog',
},
{
title: 'AI 课件设计',
url: '/course/prep/deck',
icon: 'tabler:book-2',
},
{
title: 'AI 出题',
url: '/course/prep/quiz',
icon: 'tabler:notebook',
},
{
title: '微视频制作',
url: '/course/prep/test',
icon: 'tabler:video',
},
],
},
]

View File

@ -0,0 +1,15 @@
<script lang="ts" setup>
import { nav } from './config'
definePageMeta({
requiresAuth: true,
})
</script>
<template>
<AppPageWithSidebar :sidebar-nav="nav">
<h1>deck</h1>
</AppPageWithSidebar>
</template>
<style scoped></style>

View File

@ -0,0 +1,7 @@
<script lang="ts" setup>
definePageMeta({
redirect: {
name: 'course-prep-teach',
},
})
</script>

View File

@ -0,0 +1,15 @@
<script lang="ts" setup>
import { nav } from './config'
definePageMeta({
requiresAuth: true,
})
</script>
<template>
<AppPageWithSidebar :sidebar-nav="nav">
<h1>quiz</h1>
</AppPageWithSidebar>
</template>
<style scoped></style>

View File

@ -0,0 +1,19 @@
<script lang="ts" setup>
import { nav } from './config'
definePageMeta({
requiresAuth: true,
})
useHead({
title: 'AI 教学设计 | 备课',
})
</script>
<template>
<AppPageWithSidebar :sidebar-nav="nav">
<h1>teach</h1>
</AppPageWithSidebar>
</template>
<style scoped></style>

View File

@ -1,47 +0,0 @@
<script lang="ts" setup>
import { Settings } from 'lucide-vue-next'
definePageMeta({
requiresAuth: true,
})
const nav = [
{
items: [
{
title: 'AI 教案设计',
url: '/test',
icon: Settings,
},
{
title: 'AI 案例设计',
url: '/test',
icon: 'tabler:settings',
},
{
title: 'AI 课件设计',
url: '/test',
icon: 'tabler:settings',
},
{
title: 'AI 出题',
url: '/test',
icon: 'tabler:settings',
},
{
title: '微视频制作',
url: '/test',
icon: 'tabler:settings',
},
],
},
]
</script>
<template>
<AppPageWithSidebar :sidebar-nav="nav">
<h1>Prepare</h1>
</AppPageWithSidebar>
</template>
<style scoped></style>