From 80246c9dec2958b5e03d535e50f534724512c9fd Mon Sep 17 00:00:00 2001 From: zhonghua Date: Mon, 23 Mar 2026 14:09:03 +0800 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20=E6=A0=A1=E5=9B=AD=E7=AB=AF?= =?UTF-8?q?=E6=8E=92=E8=AF=BE=E3=80=81=E6=95=99=E5=B8=88=E7=AB=AF=E9=A2=84?= =?UTF-8?q?=E7=BA=A6=E6=8E=92=E8=AF=BE=E6=B7=BB=E5=8A=A0=E5=A5=97=E9=A4=90?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 多套餐时步骤1展示套餐选择器,支持切换套餐后加载对应课程包 - 单套餐时保持原行为,自动选中并展示课程包 - 管理端数据模型已支持一租户多套餐、一套餐多课程 Made-with: Cursor --- .../components/CreateScheduleModal.scss | 20 ++++++ .../components/CreateScheduleModal.vue | 52 ++++++++++++++ .../components/TeacherCreateScheduleModal.vue | 72 +++++++++++++++++++ 3 files changed, 144 insertions(+) diff --git a/reading-platform-frontend/src/views/school/schedule/components/CreateScheduleModal.scss b/reading-platform-frontend/src/views/school/schedule/components/CreateScheduleModal.scss index 2b218f9..bb63e4c 100644 --- a/reading-platform-frontend/src/views/school/schedule/components/CreateScheduleModal.scss +++ b/reading-platform-frontend/src/views/school/schedule/components/CreateScheduleModal.scss @@ -25,6 +25,26 @@ } } +.collection-selector { + margin-bottom: 20px; + padding: 16px; + background: #FAFAFA; + border-radius: 8px; + + .selector-label { + font-size: 14px; + font-weight: 500; + color: #333; + margin-bottom: 12px; + } + + .collection-radio-group { + display: flex; + flex-wrap: wrap; + gap: 8px; + } +} + .collection-option { .collection-name { font-weight: 500; diff --git a/reading-platform-frontend/src/views/school/schedule/components/CreateScheduleModal.vue b/reading-platform-frontend/src/views/school/schedule/components/CreateScheduleModal.vue index 401a885..abe5638 100644 --- a/reading-platform-frontend/src/views/school/schedule/components/CreateScheduleModal.vue +++ b/reading-platform-frontend/src/views/school/schedule/components/CreateScheduleModal.vue @@ -50,8 +50,22 @@

选择课程包

+ +
+
选择课程套餐
+ + + {{ col.name }} + + +
+
选择课程包
{ classTeacherMap.value = {}; }; +<<<<<<< HEAD // 加载课程套餐列表(租户可拥有多个套餐) +======= +// 加载课程套餐列表;多套餐时展示选择器,单套餐时自动选中并加载课程包 +>>>>>>> d300fa4 (feat: 校园端排课、教师端预约排课添加套餐选择) const loadCollections = async () => { loadingPackages.value = true; try { collections.value = await getCourseCollections(); +<<<<<<< HEAD // 若仅有一个套餐,自动选中并加载其课程包,提升体验 if (collections.value.length === 1) { await selectCollection(collections.value[0]); +======= + if (collections.value.length > 0) { + const first = collections.value[0]; + formData.collectionId = first.id as number; + await loadPackagesForCollection(first.id); + if (!first.packages || first.packages.length === 0) { + message.warning(collections.value.length > 1 ? '该套餐暂无课程包' : '暂无课程包'); + } +>>>>>>> d300fa4 (feat: 校园端排课、教师端预约排课添加套餐选择) } } catch (error) { console.error('❌ 加载课程套餐失败:', error); @@ -445,13 +473,27 @@ const loadCollections = async () => { } }; +<<<<<<< HEAD // 选择套餐,并加载该套餐下的课程包 const selectCollection = async (coll: CourseCollection) => { formData.collectionId = coll.id as number; +======= +// 加载指定套餐下的课程包 +const loadPackagesForCollection = async (collectionId: number | string) => { + const col = collections.value.find(c => c.id === collectionId); + if (!col) return; + const packages = await getCourseCollectionPackages(collectionId); + (col as any).packages = packages; +}; + +// 切换套餐时重新加载课程包并清空已选课程包 +const onCollectionChange = async () => { +>>>>>>> d300fa4 (feat: 校园端排课、教师端预约排课添加套餐选择) formData.packageId = undefined; formData.courseId = undefined; scheduleRefData.value = []; lessonTypes.value = []; +<<<<<<< HEAD if (!coll.id) return; loadingPackages.value = true; @@ -466,6 +508,16 @@ const selectCollection = async (coll: CourseCollection) => { message.error('加载课程包失败'); } finally { loadingPackages.value = false; +======= + const colId = formData.collectionId; + if (colId) { + loadingPackages.value = true; + try { + await loadPackagesForCollection(colId); + } finally { + loadingPackages.value = false; + } +>>>>>>> d300fa4 (feat: 校园端排课、教师端预约排课添加套餐选择) } }; diff --git a/reading-platform-frontend/src/views/teacher/schedule/components/TeacherCreateScheduleModal.vue b/reading-platform-frontend/src/views/teacher/schedule/components/TeacherCreateScheduleModal.vue index 830788b..8525fb4 100644 --- a/reading-platform-frontend/src/views/teacher/schedule/components/TeacherCreateScheduleModal.vue +++ b/reading-platform-frontend/src/views/teacher/schedule/components/TeacherCreateScheduleModal.vue @@ -50,8 +50,22 @@

选择课程包

+ +
+
选择课程套餐
+ + + {{ col.name }} + + +
+
选择课程包
{ lessonTypes.value = []; }; +<<<<<<< HEAD // 加载课程套餐列表(租户可拥有多个套餐) +======= +// 加载课程套餐列表;多套餐时展示选择器,单套餐时自动选中并加载课程包 +>>>>>>> d300fa4 (feat: 校园端排课、教师端预约排课添加套餐选择) const loadCollections = async () => { loadingPackages.value = true; try { collections.value = await getCourseCollections(); +<<<<<<< HEAD // 若仅有一个套餐,自动选中并加载其课程包,提升体验 if (collections.value.length === 1) { await selectCollection(collections.value[0]); +======= + if (collections.value.length > 0) { + const first = collections.value[0]; + formData.collectionId = first.id as number; + await loadPackagesForCollection(first.id); + if (!first.packages || first.packages.length === 0) { + message.warning(collections.value.length > 1 ? '该套餐暂无课程包' : '暂无课程包'); + } +>>>>>>> d300fa4 (feat: 校园端排课、教师端预约排课添加套餐选择) } } catch (error) { console.error('加载课程套餐失败:', error); @@ -400,13 +428,27 @@ const loadCollections = async () => { } }; +<<<<<<< HEAD // 选择套餐,并加载该套餐下的课程包 const selectCollection = async (coll: CourseCollection) => { formData.collectionId = coll.id as number; +======= +// 加载指定套餐下的课程包 +const loadPackagesForCollection = async (collectionId: number | string) => { + const col = collections.value.find(c => c.id === collectionId); + if (!col) return; + const packages = await getCourseCollectionPackages(collectionId); + (col as any).packages = packages; +}; + +// 切换套餐时重新加载课程包并清空已选课程包 +const onCollectionChange = async () => { +>>>>>>> d300fa4 (feat: 校园端排课、教师端预约排课添加套餐选择) formData.packageId = undefined; formData.courseId = undefined; scheduleRefData.value = []; lessonTypes.value = []; +<<<<<<< HEAD if (!coll.id) return; loadingPackages.value = true; @@ -421,6 +463,16 @@ const selectCollection = async (coll: CourseCollection) => { message.error('加载课程包失败'); } finally { loadingPackages.value = false; +======= + const colId = formData.collectionId; + if (colId) { + loadingPackages.value = true; + try { + await loadPackagesForCollection(colId); + } finally { + loadingPackages.value = false; + } +>>>>>>> d300fa4 (feat: 校园端排课、教师端预约排课添加套餐选择) } }; @@ -642,6 +694,26 @@ defineExpose({ open, openWithPreset }); } } +.collection-selector { + margin-bottom: 20px; + padding: 16px; + background: #FAFAFA; + border-radius: 8px; + + .selector-label { + font-size: 14px; + font-weight: 500; + color: #333; + margin-bottom: 12px; + } + + .collection-radio-group { + display: flex; + flex-wrap: wrap; + gap: 8px; + } +} + .collection-option { .collection-name { font-weight: 500; } .collection-info { font-size: 12px; color: #999; } From 275b0da7a0bd9f3f35c59597fd666d0a208b8e46 Mon Sep 17 00:00:00 2001 From: zhonghua Date: Mon, 23 Mar 2026 14:18:49 +0800 Subject: [PATCH 2/4] =?UTF-8?q?style:=20=E6=88=91=E7=9A=84=E8=AF=BE?= =?UTF-8?q?=E8=A1=A8=E8=AF=BE=E7=A8=8B=E4=BF=A1=E6=81=AF=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E8=89=B2=E7=BB=9F=E4=B8=80=E4=B8=BA=E6=A9=99=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Made-with: Cursor --- .../views/teacher/schedule/ScheduleView.vue | 6 +++--- .../components/TeacherCreateScheduleModal.vue | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/reading-platform-frontend/src/views/teacher/schedule/ScheduleView.vue b/reading-platform-frontend/src/views/teacher/schedule/ScheduleView.vue index 5c0ec7a..45a0a63 100644 --- a/reading-platform-frontend/src/views/teacher/schedule/ScheduleView.vue +++ b/reading-platform-frontend/src/views/teacher/schedule/ScheduleView.vue @@ -94,7 +94,7 @@
学校排课 - 自主预约 + 自主预约
@@ -136,7 +136,7 @@ 学校排课 - 自主预约 + 自主预约 @@ -480,7 +480,7 @@ onMounted(() => { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); cursor: pointer; transition: all 0.3s; - border-left: 3px solid #722ed1; + border-left: 3px solid #FF8C42; &:hover { box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15); diff --git a/reading-platform-frontend/src/views/teacher/schedule/components/TeacherCreateScheduleModal.vue b/reading-platform-frontend/src/views/teacher/schedule/components/TeacherCreateScheduleModal.vue index 8525fb4..bd6cfe5 100644 --- a/reading-platform-frontend/src/views/teacher/schedule/components/TeacherCreateScheduleModal.vue +++ b/reading-platform-frontend/src/views/teacher/schedule/components/TeacherCreateScheduleModal.vue @@ -723,7 +723,7 @@ defineExpose({ open, openWithPreset }); .collections-grid { .collection-card { - .package-count { color: #722ed1; } + .package-count { color: #FF8C42; } } } @@ -743,19 +743,19 @@ defineExpose({ open, openWithPreset }); &:hover { border-color: #BDBDBD; } &.active { - border-color: #722ed1; - background: #f9f0ff; + border-color: #FF8C42; + background: #FFF0E6; } .package-name { font-weight: 500; color: #2D3436; margin-bottom: 4px; } .package-grade { font-size: 12px; color: #999; margin-bottom: 2px; } - .package-count { font-size: 11px; color: #722ed1; } + .package-count { font-size: 11px; color: #FF8C42; } } .schedule-ref-card { margin-top: 24px; padding: 16px; - background: #f9f0ff; + background: #FFF8F0; border-radius: 8px; .ref-header { @@ -765,7 +765,7 @@ defineExpose({ open, openWithPreset }); margin-bottom: 12px; .ref-icon { - color: #722ed1; + color: #FF8C42; } .ref-title { @@ -829,8 +829,8 @@ defineExpose({ open, openWithPreset }); &:hover { border-color: #BDBDBD; } &.active { - border-color: #722ed1; - background: #f9f0ff; + border-color: #FF8C42; + background: #FFF0E6; } .class-name { font-weight: 500; color: #2D3436; margin-bottom: 4px; } @@ -851,7 +851,7 @@ defineExpose({ open, openWithPreset }); div { margin-bottom: 4px; } div:last-child { margin-bottom: 0; } - strong { color: #722ed1; } + strong { color: #FF8C42; } } .modal-footer { From da415703cf12f0aded3e48d3b9a40f8702c578e8 Mon Sep 17 00:00:00 2001 From: zhonghua Date: Mon, 23 Mar 2026 14:31:48 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=E6=8E=92=E8=AF=BE=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E9=87=8D=E5=A4=8D=E5=A5=97=E9=A4=90=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E6=AD=A5=E9=AA=A4=EF=BC=8C=E7=BB=9F=E4=B8=80=E6=95=99?= =?UTF-8?q?=E5=B8=88=E7=AB=AF=E4=B8=8E=E5=AD=A6=E6=A0=A1=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 合并步骤1与步骤2,直接在选择课程包中展示套餐选择器 - 教师端、学校端均由5步改为4步流程 - 修复ID类型比较问题,使用宽松相等避免选中高亮异常 Made-with: Cursor --- .../components/CreateScheduleModal.vue | 232 ++++++------------ .../components/TeacherCreateScheduleModal.vue | 127 ++++------ 2 files changed, 112 insertions(+), 247 deletions(-) diff --git a/reading-platform-frontend/src/views/school/schedule/components/CreateScheduleModal.vue b/reading-platform-frontend/src/views/school/schedule/components/CreateScheduleModal.vue index abe5638..be49265 100644 --- a/reading-platform-frontend/src/views/school/schedule/components/CreateScheduleModal.vue +++ b/reading-platform-frontend/src/views/school/schedule/components/CreateScheduleModal.vue @@ -1,15 +1,7 @@