From 27e630f20049b66567cda81c88623d737082734f Mon Sep 17 00:00:00 2001 From: Rao <1227431568@qq.com> Date: Fri, 7 Mar 2025 16:27:54 +0800 Subject: [PATCH] rht --- .../common/uploader/ResourceShower.tsx | 4 +- .../course/detail/CourseDetailDisplayArea.tsx | 18 +++++---- .../CourseContentForm/SortableLecture.tsx | 38 +++++++++++-------- 3 files changed, 37 insertions(+), 23 deletions(-) diff --git a/apps/web/src/components/common/uploader/ResourceShower.tsx b/apps/web/src/components/common/uploader/ResourceShower.tsx index 4401609..213a10b 100755 --- a/apps/web/src/components/common/uploader/ResourceShower.tsx +++ b/apps/web/src/components/common/uploader/ResourceShower.tsx @@ -7,8 +7,10 @@ import { formatFileSize, getCompressedImageUrl } from "@nice/utils"; export default function ResourcesShower({ resources = [], + isShowImage }: { resources: ResourceDto[]; + isShowImage?: boolean; }) { const { resources: dealedResources } = useMemo(() => { if (!resources) return { resources: [] }; @@ -36,7 +38,7 @@ export default function ResourcesShower({ const fileResources = dealedResources.filter((res) => !res.isImage); return (
- {imageResources.length > 0 && ( + {imageResources.length > 0 && isShowImage && ( {imageResources.map((resource) => ( diff --git a/apps/web/src/components/models/course/detail/CourseDetailDisplayArea.tsx b/apps/web/src/components/models/course/detail/CourseDetailDisplayArea.tsx index 6231436..f46e22f 100755 --- a/apps/web/src/components/models/course/detail/CourseDetailDisplayArea.tsx +++ b/apps/web/src/components/models/course/detail/CourseDetailDisplayArea.tsx @@ -14,7 +14,7 @@ import CourseDetailTitle from "./CourseDetailTitle"; export const CourseDetailDisplayArea: React.FC = () => { // 创建滚动动画效果 const { - + isLoading, canEdit, lecture, @@ -48,18 +48,22 @@ export const CourseDetailDisplayArea: React.FC = () => { )} {!lectureIsLoading && selectedLectureId && - lecture?.meta?.type === LectureType.ARTICLE && ( + (
- + {lecture?.meta?.type === LectureType.ARTICLE && ( + + )}
+ } + isShowImage = {lecture?.meta?.type === LectureType.ARTICLE} + >
diff --git a/apps/web/src/components/models/course/editor/form/CourseContentForm/SortableLecture.tsx b/apps/web/src/components/models/course/editor/form/CourseContentForm/SortableLecture.tsx index b56f2cc..2d9bfd2 100755 --- a/apps/web/src/components/models/course/editor/form/CourseContentForm/SortableLecture.tsx +++ b/apps/web/src/components/models/course/editor/form/CourseContentForm/SortableLecture.tsx @@ -175,22 +175,30 @@ export const SortableLecture: React.FC = ({ />
-
+
{lectureType === LectureType.VIDEO ? ( - - - + <> + + + + + + + + ) : (