From 607b0896bd3035313f5bbb6d43f214b237389b4f Mon Sep 17 00:00:00 2001 From: zhonghua Date: Wed, 25 Mar 2026 09:40:02 +0800 Subject: [PATCH] =?UTF-8?q?feat(course):=20=E5=AF=BC=E5=85=A5=E8=AF=BE/?= =?UTF-8?q?=E9=9B=86=E4=BD=93=E8=AF=BE/=E9=A2=86=E5=9F=9F=E8=AF=BE?= =?UTF-8?q?=E6=A0=B8=E5=BF=83=E8=B5=84=E6=BA=90=E6=94=B9=E4=B8=BA=E5=8F=AF?= =?UTF-8?q?=E9=80=89=EF=BC=8C=E5=8F=96=E6=B6=88=E5=BF=85=E5=A1=AB=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Made-with: Cursor --- .../course-edit/Step4IntroLesson.vue | 2 +- .../course-edit/Step5CollectiveLesson.vue | 2 +- .../course-edit/Step6DomainLessons.vue | 2 +- .../components/course/LessonConfigPanel.vue | 46 ++----------------- 4 files changed, 8 insertions(+), 44 deletions(-) diff --git a/reading-platform-frontend/src/components/course-edit/Step4IntroLesson.vue b/reading-platform-frontend/src/components/course-edit/Step4IntroLesson.vue index 09dd546..c2a8a3f 100644 --- a/reading-platform-frontend/src/components/course-edit/Step4IntroLesson.vue +++ b/reading-platform-frontend/src/components/course-edit/Step4IntroLesson.vue @@ -14,7 +14,7 @@ diff --git a/reading-platform-frontend/src/components/course-edit/Step5CollectiveLesson.vue b/reading-platform-frontend/src/components/course-edit/Step5CollectiveLesson.vue index 484a7fd..f3a0406 100644 --- a/reading-platform-frontend/src/components/course-edit/Step5CollectiveLesson.vue +++ b/reading-platform-frontend/src/components/course-edit/Step5CollectiveLesson.vue @@ -14,7 +14,7 @@ diff --git a/reading-platform-frontend/src/components/course-edit/Step6DomainLessons.vue b/reading-platform-frontend/src/components/course-edit/Step6DomainLessons.vue index 22ede33..51461db 100644 --- a/reading-platform-frontend/src/components/course-edit/Step6DomainLessons.vue +++ b/reading-platform-frontend/src/components/course-edit/Step6DomainLessons.vue @@ -14,7 +14,7 @@ diff --git a/reading-platform-frontend/src/components/course/LessonConfigPanel.vue b/reading-platform-frontend/src/components/course/LessonConfigPanel.vue index b606050..02ca34b 100644 --- a/reading-platform-frontend/src/components/course/LessonConfigPanel.vue +++ b/reading-platform-frontend/src/components/course/LessonConfigPanel.vue @@ -46,18 +46,10 @@ -
至少上传一个(动画/课件/电子绘本)
- +
按需上传(动画/课件/电子绘本,可选)
+
@@ -93,7 +85,7 @@ - +
@@ -228,8 +220,6 @@ export interface LessonData { useTemplate: boolean; steps: StepData[]; isNew?: boolean; - /** 仅用于表单校验,不持久化 */ - resourceCheck?: string; } interface Props { @@ -276,7 +266,6 @@ const defaultLessonData: LessonData = { assessmentData: '', useTemplate: false, steps: [], - resourceCheck: '', }; const lessonData = reactive({ @@ -332,19 +321,6 @@ const formRules = computed(() => { }, ], }; - if (props.showResources) { - rules.resourceCheck = [ - { - validator: (_: unknown, _val: string) => { - const has = lessonData.videoPath || lessonData.pptPath || lessonData.pdfPath; - if (!has) { - return Promise.reject(new Error('请至少上传一个核心资源(动画/课件/电子绘本)')); - } - return Promise.resolve(); - }, - }, - ]; - } if (extensionRequired.value) { rules.extension = [ { required: true, whitespace: true, message: '请输入教学延伸活动建议' }, @@ -353,29 +329,17 @@ const formRules = computed(() => { return rules; }); -// 同步 resourceCheck 用于校验触发 -watch( - () => [lessonData.videoPath, lessonData.pptPath, lessonData.pdfPath], - () => { - lessonData.resourceCheck = lessonData.videoPath || lessonData.pptPath || lessonData.pdfPath || ''; - }, - { immediate: true } -); - // 监听外部值变化 watch( () => props.modelValue, (newVal) => { Object.assign(lessonData, defaultLessonData, newVal); - lessonData.resourceCheck = lessonData.videoPath || lessonData.pptPath || lessonData.pdfPath || ''; }, { deep: true } ); -// 处理变化(排除校验用字段,不传给父组件) const handleChange = () => { - const { resourceCheck, ...toEmit } = lessonData; - emit('update:modelValue', toEmit as LessonData); + emit('update:modelValue', { ...lessonData } as LessonData); emit('change'); };