diff --git a/public/images/teacher/路径 19.png b/public/images/teacher/collapse.png similarity index 100% rename from public/images/teacher/路径 19.png rename to public/images/teacher/collapse.png diff --git a/public/images/teacher/路径(4).png b/public/images/teacher/关闭-灰.png similarity index 100% rename from public/images/teacher/路径(4).png rename to public/images/teacher/关闭-灰.png diff --git a/src/components/CustomDropdown.vue b/src/components/CustomDropdown.vue new file mode 100644 index 0000000..5f68e06 --- /dev/null +++ b/src/components/CustomDropdown.vue @@ -0,0 +1,179 @@ + + + + + diff --git a/src/components/CustomPagination.vue b/src/components/CustomPagination.vue new file mode 100644 index 0000000..fdd14a1 --- /dev/null +++ b/src/components/CustomPagination.vue @@ -0,0 +1,201 @@ + + + + + diff --git a/src/components/ExamPaperLibraryModal.vue b/src/components/ExamPaperLibraryModal.vue new file mode 100644 index 0000000..85d16b0 --- /dev/null +++ b/src/components/ExamPaperLibraryModal.vue @@ -0,0 +1,589 @@ + + + + + diff --git a/src/components/HomeworkDropdown.vue b/src/components/HomeworkDropdown.vue new file mode 100644 index 0000000..2d5bb70 --- /dev/null +++ b/src/components/HomeworkDropdown.vue @@ -0,0 +1,173 @@ + + + + + diff --git a/src/components/HomeworkLibraryModal.vue b/src/components/HomeworkLibraryModal.vue new file mode 100644 index 0000000..c132254 --- /dev/null +++ b/src/components/HomeworkLibraryModal.vue @@ -0,0 +1,487 @@ + + + + + diff --git a/src/views/teacher/AdminDashboard.vue b/src/views/teacher/AdminDashboard.vue index e469175..5727b13 100644 --- a/src/views/teacher/AdminDashboard.vue +++ b/src/views/teacher/AdminDashboard.vue @@ -33,31 +33,20 @@ - + @@ -88,12 +77,14 @@ @@ -132,7 +123,7 @@ const setActiveNavItem = (index: number) => { const toggleExamMenu = () => { examMenuExpanded.value = !examMenuExpanded.value; activeNavItem.value = 4; - + // 如果展开且没有选中子菜单,默认选中第一个 if (examMenuExpanded.value && !activeSubNavItem.value) { activeSubNavItem.value = 'question-management'; @@ -155,8 +146,8 @@ const handleBreadcrumbClick = (path: string) => { // 判断是否隐藏左侧侧边栏 const hideSidebar = computed(() => { const currentPath = route.path - // 当进入课程管理相关页面时隐藏侧边栏 - return currentPath.includes('course-editor') + // 当进入课程管理相关页面或章节编辑页面时隐藏侧边栏 + return currentPath.includes('course-editor') || currentPath.includes('chapter-editor-teacher') }) // 动态生成面包屑 @@ -165,6 +156,10 @@ const breadcrumbItems = computed(() => { // 如果在课程编辑器相关页面,强制添加课程管理面包屑 if (currentPath.includes('course-editor')) { + // 从路径中提取课程ID + const courseIdMatch = currentPath.match(/\/course-editor\/(\d+)/); + const courseId = courseIdMatch ? courseIdMatch[1] : '未知'; + let breadcrumbs = [ { title: '课程管理', @@ -174,72 +169,300 @@ const breadcrumbItems = computed(() => { // 根据当前路径添加子页面标题 if (currentPath.includes('courseware')) { - breadcrumbs.push({ - title: '课件管理', - path: currentPath - }); + breadcrumbs.push( + { + title: '课件管理', + path: currentPath + }, + { + title: `课程${courseId}`, + path: `/teacher/course-editor/${courseId}` + } + ); + breadcrumbs.push( + { + title: '课件管理', + path: currentPath + }, + { + title: `课程${courseId}`, + path: `/teacher/course-editor/${courseId}` + } + ); } else if (currentPath.includes('question-bank')) { - breadcrumbs.push({ - title: '题库管理', - path: currentPath - }); + breadcrumbs.push( + { + title: '题库管理', + path: currentPath + }, + { + title: `课程${courseId}`, + path: `/teacher/course-editor/${courseId}` + } + ); + breadcrumbs.push( + { + title: '题库管理', + path: currentPath + }, + { + title: `课程${courseId}`, + path: `/teacher/course-editor/${courseId}` + } + ); } else if (currentPath.includes('add-question')) { breadcrumbs.push( { title: '题库管理', path: currentPath.replace('/add-question', '/question-bank') }, + { + title: `课程${courseId}`, + path: `/teacher/course-editor/${courseId}` + }, + { + title: `课程${courseId}`, + path: `/teacher/course-editor/${courseId}` + }, { title: '新增试题', path: currentPath } ); } else if (currentPath.includes('chapters')) { - breadcrumbs.push({ - title: '章节管理', - path: currentPath - }); + breadcrumbs.push( + { + title: '章节管理', + path: currentPath + }, + { + title: `课程${courseId}`, + path: `/teacher/course-editor/${courseId}` + } + ); + breadcrumbs.push( + { + title: '章节管理', + path: currentPath + }, + { + title: `课程${courseId}`, + path: `/teacher/course-editor/${courseId}` + } + ); } else if (currentPath.includes('homework')) { - breadcrumbs.push({ - title: '作业管理', - path: currentPath - }); + breadcrumbs.push( + { + title: '作业管理', + path: currentPath + }, + { + title: `课程${courseId}`, + path: `/teacher/course-editor/${courseId}` + } + ); + breadcrumbs.push( + { + title: '作业管理', + path: currentPath + }, + { + title: `课程${courseId}`, + path: `/teacher/course-editor/${courseId}` + } + ); } else if (currentPath.includes('practice')) { - breadcrumbs.push({ - title: '练考通', - path: currentPath - }); + breadcrumbs.push( + { + title: '练考通', + path: currentPath + }, + { + title: `课程${courseId}`, + path: `/teacher/course-editor/${courseId}` + } + ); + breadcrumbs.push( + { + title: '练考通', + path: currentPath + }, + { + title: `课程${courseId}`, + path: `/teacher/course-editor/${courseId}` + } + ); } else if (currentPath.includes('certificate')) { - breadcrumbs.push({ - title: '证书管理', - path: currentPath - }); + breadcrumbs.push( + { + title: '证书管理', + path: currentPath + }, + { + title: `课程${courseId}`, + path: `/teacher/course-editor/${courseId}` + } + ); + breadcrumbs.push( + { + title: '证书管理', + path: currentPath + }, + { + title: `课程${courseId}`, + path: `/teacher/course-editor/${courseId}` + } + ); } else if (currentPath.includes('discussion')) { - breadcrumbs.push({ - title: '讨论管理', - path: currentPath - }); + breadcrumbs.push( + { + title: '讨论管理', + path: currentPath + }, + { + title: `课程${courseId}`, + path: `/teacher/course-editor/${courseId}` + } + ); + breadcrumbs.push( + { + title: '讨论管理', + path: currentPath + }, + { + title: `课程${courseId}`, + path: `/teacher/course-editor/${courseId}` + } + ); } else if (currentPath.includes('statistics')) { - breadcrumbs.push({ - title: '统计管理', - path: currentPath - }); + breadcrumbs.push( + { + title: '统计管理', + path: currentPath + }, + { + title: `课程${courseId}`, + path: `/teacher/course-editor/${courseId}` + } + ); + breadcrumbs.push( + { + title: '统计管理', + path: currentPath + }, + { + title: `课程${courseId}`, + path: `/teacher/course-editor/${courseId}` + } + ); } else if (currentPath.includes('notification')) { - breadcrumbs.push({ - title: '通知管理', - path: currentPath - }); + breadcrumbs.push( + { + title: '通知管理', + path: currentPath + }, + { + title: `课程${courseId}`, + path: `/teacher/course-editor/${courseId}` + } + ); + breadcrumbs.push( + { + title: '通知管理', + path: currentPath + }, + { + title: `课程${courseId}`, + path: `/teacher/course-editor/${courseId}` + } + ); } else if (currentPath.includes('management')) { - breadcrumbs.push({ - title: '综合管理', - path: currentPath - }); + breadcrumbs.push( + { + title: '综合管理', + path: currentPath + }, + { + title: `课程${courseId}`, + path: `/teacher/course-editor/${courseId}` + } + ); + breadcrumbs.push( + { + title: '综合管理', + path: currentPath + }, + { + title: `课程${courseId}`, + path: `/teacher/course-editor/${courseId}` + } + ); } console.log('课程编辑器页面面包屑:', breadcrumbs); return breadcrumbs; } + // 如果在章节编辑页面,显示课程管理>课程管理>课程名称>章节>章节名称 格式 + if (currentPath.includes('chapter-editor-teacher')) { + const courseId = route.params.courseId; + let breadcrumbs = [ + { + title: '课程管理', + path: '/teacher/course-management' + }, + { + title: '课程管理', + path: '/teacher/course-management' + }, + { + title: `课程${courseId}`, + path: `/teacher/course-editor/${courseId}` + }, + { + title: '章节', + path: `/teacher/course-editor/${courseId}/chapters` + }, + { + title: '章节名称', + path: currentPath + } + ]; + + console.log('章节编辑页面面包屑:', breadcrumbs); + return breadcrumbs; + } + + // 如果在章节编辑页面,显示课程管理>课程管理>课程名称>章节>章节名称 格式 + if (currentPath.includes('chapter-editor-teacher')) { + const courseId = route.params.courseId; + let breadcrumbs = [ + { + title: '课程管理', + path: '/teacher/course-management' + }, + { + title: '课程管理', + path: '/teacher/course-management' + }, + { + title: `课程${courseId}`, + path: `/teacher/course-editor/${courseId}` + }, + { + title: '章节', + path: `/teacher/course-editor/${courseId}/chapters` + }, + { + title: '章节名称', + path: currentPath + } + ]; + + console.log('章节编辑页面面包屑:', breadcrumbs); + return breadcrumbs; + } + // 其他页面的面包屑逻辑 const matchedRoutes = route.matched; let breadcrumbs = matchedRoutes @@ -512,7 +735,7 @@ const updateActiveNavItem = () => { margin: 0 10px 15px; } - .submenu-container{ + .submenu-container { width: 200px; } } @@ -594,37 +817,60 @@ const updateActiveNavItem = () => { } .breadcrumb-separator { - width: 4px; - height: 17px; margin-right: 10px; - background-color: #0C99DA; } - @media screen and (max-width: 480px) { - .nav-container .nav-item { - width: 150px; - height: 45px; - margin: 0 5px 10px; - } - - .nav-container .nav-item img { - margin-left: 20px; - } - - .submenu-container{ - width: 150px; - } +@media screen and (max-width: 480px) { + .nav-container .nav-item { + width: 150px; + height: 45px; + margin: 0 5px 10px; } -/* 可点击的面包屑项样式 */ -.breadcrumb :deep(.n-breadcrumb-item.clickable) { - cursor: pointer; - color: #0C99DA; + .nav-container .nav-item img { + margin-left: 20px; + } + + .submenu-container { + width: 150px; + } } -.breadcrumb :deep(.n-breadcrumb-item.clickable:hover) { - color: #0277BD; +/* 面包屑样式 */ +.custom-breadcrumb { + display: flex; + align-items: center; + gap: 8px; +} + +.breadcrumb-item { + display: flex; + align-items: center; + font-size: 14px; + color: #666; + cursor: pointer; + transition: color 0.3s ease; +} + +.breadcrumb-item.clickable:hover { + color: #0C99DA; text-decoration: underline; } + +.breadcrumb-item.last-item { + color: #999; + cursor: default; +} + +.breadcrumb-item.last-item:hover { + color: #999; + text-decoration: none; +} + +.breadcrumb-separator { + color: #666; + margin: 0 4px; + font-weight: normal; +} diff --git a/src/views/teacher/course/ChapterEditor.vue b/src/views/teacher/course/ChapterEditor.vue index 843a536..f867b71 100644 --- a/src/views/teacher/course/ChapterEditor.vue +++ b/src/views/teacher/course/ChapterEditor.vue @@ -26,15 +26,16 @@ 添加章节 -
- +
+ 第一章 课前准备 - - + +
- -
+
1.开课彩蛋:新开始 第一节课程定位程定位与目标 @@ -45,14 +46,47 @@
-
- - 第二章 课前准备 +
+ + 第二章 课前准备 + + +
-
- - 第三章 课前准备 +
+
+ 2.课程导入:基础知识 + 第二节课程基础知识讲解 +
+
+ 重命名 + 删除 +
+
+ + 第三章 课前准备 + + + +
+
+
+ 3.实践操作:技能训练 + 第三节实践操作技能训练 +
+
+ 重命名 + 删除 +
+
+
@@ -98,12 +132,7 @@ @@ -122,16 +151,37 @@
添加考试/练习:
- + + + +
+
+ + +
+ 已上传文件: +
+
+ {{ file.name }} + +
添加作业:
- + + +
@@ -148,6 +198,12 @@ + + + + + +
@@ -156,6 +212,10 @@