From 17dc815030c8b7d1c2909ae87409b6f6e46720e3 Mon Sep 17 00:00:00 2001 From: zhonghua Date: Wed, 18 Mar 2026 16:19:22 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=AF=BE=E7=A8=8B=E5=8C=85):=20=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E6=A0=A1=E9=AA=8C=E5=A2=9E=E5=BC=BA=20-=20=E6=95=99?= =?UTF-8?q?=E5=AD=A6=E7=8E=AF=E8=8A=82=E5=BF=85=E5=A1=AB=E6=A0=87=E8=AF=86?= =?UTF-8?q?=E4=B8=8E=E6=A0=A1=E9=AA=8C=E3=80=81=E6=A0=B8=E5=BF=83=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E5=BF=85=E5=A1=AB=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Made-with: Cursor --- .../course-edit/Step4IntroLesson.vue | 6 +++ .../course-edit/Step5CollectiveLesson.vue | 10 ++++ .../course-edit/Step6DomainLessons.vue | 10 ++++ .../components/course/LessonConfigPanel.vue | 7 ++- .../components/course/LessonStepsEditor.vue | 50 ++++++++++++++++--- 5 files changed, 74 insertions(+), 9 deletions(-) diff --git a/reading-platform-frontend/src/components/course-edit/Step4IntroLesson.vue b/reading-platform-frontend/src/components/course-edit/Step4IntroLesson.vue index d856138..1597d66 100644 --- a/reading-platform-frontend/src/components/course-edit/Step4IntroLesson.vue +++ b/reading-platform-frontend/src/components/course-edit/Step4IntroLesson.vue @@ -174,6 +174,12 @@ const validate = () => { const steps = lessonData.value.steps || []; if (steps.length < 1) { errors.push('请至少添加一个教学环节'); + } else { + steps.forEach((step, i) => { + if (!step.name?.trim()) errors.push(`第${i + 1}个环节:请填写环节名称`); + if (!step.content?.trim()) errors.push(`第${i + 1}个环节:请填写环节内容`); + if (!step.objective?.trim()) errors.push(`第${i + 1}个环节:请填写教学目标`); + }); } return { valid: errors.length === 0, errors }; diff --git a/reading-platform-frontend/src/components/course-edit/Step5CollectiveLesson.vue b/reading-platform-frontend/src/components/course-edit/Step5CollectiveLesson.vue index 886a44f..cf70cb4 100644 --- a/reading-platform-frontend/src/components/course-edit/Step5CollectiveLesson.vue +++ b/reading-platform-frontend/src/components/course-edit/Step5CollectiveLesson.vue @@ -175,6 +175,16 @@ const validate = () => { if (duration != null && (duration < 15 || duration > 45)) { errors.push('集体课时长需在 15-45 分钟之间'); } + const steps = lessonData.value.steps || []; + if (steps.length < 1) { + errors.push('请至少添加一个教学环节'); + } else { + steps.forEach((step, i) => { + if (!step.name?.trim()) errors.push(`第${i + 1}个环节:请填写环节名称`); + if (!step.content?.trim()) errors.push(`第${i + 1}个环节:请填写环节内容`); + if (!step.objective?.trim()) errors.push(`第${i + 1}个环节:请填写教学目标`); + }); + } return { valid: errors.length === 0, errors }; }; diff --git a/reading-platform-frontend/src/components/course-edit/Step6DomainLessons.vue b/reading-platform-frontend/src/components/course-edit/Step6DomainLessons.vue index e599a5b..9819f1a 100644 --- a/reading-platform-frontend/src/components/course-edit/Step6DomainLessons.vue +++ b/reading-platform-frontend/src/components/course-edit/Step6DomainLessons.vue @@ -267,6 +267,16 @@ const validate = () => { if (duration != null && (duration < 15 || duration > 45)) { errors.push(`${domain.name}:时长需在 15-45 分钟之间`); } + const steps = domain.lessonData.steps || []; + if (steps.length < 1) { + errors.push(`${domain.name}:请至少添加一个教学环节`); + } else { + steps.forEach((step, i) => { + if (!step.name?.trim()) errors.push(`${domain.name}:第${i + 1}个环节请填写环节名称`); + if (!step.content?.trim()) errors.push(`${domain.name}:第${i + 1}个环节请填写环节内容`); + if (!step.objective?.trim()) errors.push(`${domain.name}:第${i + 1}个环节请填写教学目标`); + }); + } } }); diff --git a/reading-platform-frontend/src/components/course/LessonConfigPanel.vue b/reading-platform-frontend/src/components/course/LessonConfigPanel.vue index ed6e980..3d0f0fb 100644 --- a/reading-platform-frontend/src/components/course/LessonConfigPanel.vue +++ b/reading-platform-frontend/src/components/course/LessonConfigPanel.vue @@ -33,8 +33,11 @@ - - + + + diff --git a/reading-platform-frontend/src/components/course/LessonStepsEditor.vue b/reading-platform-frontend/src/components/course/LessonStepsEditor.vue index 61adfa0..391e15c 100644 --- a/reading-platform-frontend/src/components/course/LessonStepsEditor.vue +++ b/reading-platform-frontend/src/components/course/LessonStepsEditor.vue @@ -19,12 +19,15 @@ >
{{ index + 1 }} - +
+ 环节名称 + +
+ 环节内容
+ 教学目标