From bff716f6b6a02da68e49c421be70fb9c838c0659 Mon Sep 17 00:00:00 2001 From: yuk255 Date: Tue, 16 Sep 2025 19:42:33 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8D=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E5=88=A0=E9=99=A4=E6=8A=A5=E9=94=99=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E8=AF=BE=E7=A8=8B=E7=BC=96=E8=BE=91=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=9B=9E=E6=98=BE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/modules/teachCourse.ts | 4 +- .../admin/CourseComponents/CourseCategory.vue | 528 +++++++++--------- .../admin/CourseComponents/CourseCreate.vue | 242 +++++--- src/views/teacher/AdminDashboard.vue | 26 +- 4 files changed, 439 insertions(+), 361 deletions(-) diff --git a/src/api/modules/teachCourse.ts b/src/api/modules/teachCourse.ts index cbe3d66..5788fe3 100644 --- a/src/api/modules/teachCourse.ts +++ b/src/api/modules/teachCourse.ts @@ -193,9 +193,7 @@ export class TeachCourseApi { try { console.log('🚀 发送删除课程请求:', { url: '/aiol/aiolCourse/delete', id }) - const response = await ApiRequest.delete('/aiol/aiolCourse/delete', { - params: { id } - }) + const response = await ApiRequest.delete(`/aiol/aiolCourse/delete?id=${id}`, ) console.log('🗑️ 删除课程响应:', response) return response diff --git a/src/components/admin/CourseComponents/CourseCategory.vue b/src/components/admin/CourseComponents/CourseCategory.vue index e5d0ddc..eb57239 100644 --- a/src/components/admin/CourseComponents/CourseCategory.vue +++ b/src/components/admin/CourseComponents/CourseCategory.vue @@ -2,7 +2,7 @@
- + @@ -24,14 +24,10 @@
- +
- +
- +
- +
- +
{{ course.statusText }}
- +
@@ -117,8 +105,17 @@ @@ -804,28 +862,28 @@ onMounted(() => { .header-left { - display: flex; - align-items: center; - gap: 16px; + display: flex; + align-items: center; + gap: 16px; } .page-title { - margin: 0; - font-size: 18px; - font-weight: 600; - color: #333; + margin: 0; + font-size: 18px; + font-weight: 600; + color: #333; } .title { - margin: 0; - font-size: 20px; - font-weight: 500; - color: #333; + margin: 0; + font-size: 20px; + font-weight: 500; + color: #333; } .header-actions { - display: flex; - gap: 12px; + display: flex; + gap: 12px; } .form-row { diff --git a/src/views/teacher/AdminDashboard.vue b/src/views/teacher/AdminDashboard.vue index 20308fd..41876d9 100644 --- a/src/views/teacher/AdminDashboard.vue +++ b/src/views/teacher/AdminDashboard.vue @@ -151,6 +151,14 @@ const activeSubNavItem = ref(''); // 子菜单激活状态 const examMenuExpanded = ref(false); // 考试管理菜单展开状态 const studentMenuExpanded = ref(false); // 学员中心菜单展开状态 const showTopImage = ref(true); // 控制顶部图片显示/隐藏 + +// 需要隐藏顶部图片的路由路径数组 +const hideTopImageRoutes = [ + 'teacher/chapter-editor-teacher', + 'teacher/course-editor' + // 可以在这里添加更多需要隐藏顶部图片的路由 +]; + const route = useRoute(); const router = useRouter(); const isAiHovered = ref(false); @@ -654,13 +662,29 @@ onMounted(() => { } else { document.documentElement.style.setProperty('--top-height', '0px'); } + updateTopImageVisibility(); }); // 使用watch监听路由变化 watch(route, () => { updateActiveNavItem(); + updateTopImageVisibility(); }); +// 更新顶部图片显示状态 +const updateTopImageVisibility = () => { + const currentPath = route.path; + console.log('检查路径是否需要隐藏顶部图片:', currentPath); + + // 检查当前路径是否包含需要隐藏顶部图片的路由 + const shouldHideTopImage = hideTopImageRoutes.some(routePath => + currentPath.includes(routePath) + ); + + showTopImage.value = !shouldHideTopImage; + console.log('顶部图片显示状态:', showTopImage.value); +}; + // 更新激活的导航项 const updateActiveNavItem = () => { const path = route.path; @@ -704,7 +728,7 @@ const updateActiveNavItem = () => {