feat(course): 添加外部链接组件及预览模式支持

- 新增 LinkComp 组件用于处理外部链接资源
- 在 createCourse.vue 中注册并使用 LinkComp 组件
- 实现添加外部链接功能,设置 resType 为 52
- EditorComp 和 LinkComp 支持 isPreview 禁用编辑状态
- useCourseData.js 初始化 resType 默认值改为 0
This commit is contained in:
陈昱达
2025-11-24 18:01:59 +08:00
parent 1feced6ed8
commit 6ac50b1fe9
4 changed files with 92 additions and 5 deletions

View File

@@ -12,8 +12,9 @@ import VideoComp from "@/components/CreatedCourse/preview/VideoComp.vue";
import AudioComp from "@/components/CreatedCourse/preview/AudioComp.vue";
import EditorComp from "@/components/CreatedCourse/preview/EditorComp.vue";
import DocComp from "@/components/CreatedCourse/preview/DocComp.vue";
import LinkComp from "@/components/CreatedCourse/preview/LinkComp.vue";
import { getType } from "@/hooks/useCreateCourseMaps";
const mapComponents = [VideoComp, AudioComp, EditorComp, DocComp];
const mapComponents = [VideoComp, AudioComp, EditorComp, DocComp, LinkComp];
// 使用课程数据hook
const { courseMetadata, courseList, courseActionButtons, addChapter } =
@@ -46,7 +47,9 @@ const courseOperations = {
showSettingDialog.value = true;
},
addExternalLink: () => {
console.log("添加外部链接功能调用");
courseMetadata.resType = 52;
chooseItemData.value.resType = 52;
showSettingDialog.value = true;
},
addScorm: () => {
console.log("添加SCORM功能调用");