@@ -67,9 +53,7 @@ const updateFormValue = (field, value) => {
:key="localDialogVideoForm.filePath"
>
您的浏览器不支持video
diff --git a/src/views/courselibrary/components/createCourse.vue b/src/views/courselibrary/components/createCourse.vue
index f89ab7f8..6acf41c9 100644
--- a/src/views/courselibrary/components/createCourse.vue
+++ b/src/views/courselibrary/components/createCourse.vue
@@ -11,8 +11,9 @@ import chooseFileList from "@/components/CreatedCourse/chooseFileList.vue";
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 { getType } from "@/hooks/useCreateCourseMaps";
-const mapComponents = [VideoComp, AudioComp, EditorComp];
+const mapComponents = [VideoComp, AudioComp, EditorComp, DocComp];
// 使用课程数据hook
const { courseMetadata, courseList, courseActionButtons, addChapter } =
@@ -20,6 +21,8 @@ const { courseMetadata, courseList, courseActionButtons, addChapter } =
const isPreview = ref(false);
const chooseItemData = ref({});
const showSettingDialog = ref(false);
+const isNext = ref(true);
+const showTablePreview = ref(false);
// 定义表格列
const showDialog = ref(false);
// 课程操作映射
@@ -32,7 +35,11 @@ const courseOperations = {
courseMetadata.resType = 20;
showDialog.value = true;
},
- addDocument: () => {},
+ addDocument: () => {
+ courseMetadata.resType = 40;
+ showDialog.value = true;
+ isNext.value = false;
+ },
addImageText: () => {
courseMetadata.resType = 41;
chooseItemData.value.resType = 41;
@@ -67,6 +74,10 @@ const executeCourseOperation = (operationName, data) => {
};
const chooseItem = (data) => {
chooseItemData.value = data;
+ if (!isNext.value) {
+ saveContent();
+ return;
+ }
showSettingDialog.value = true;
};
// 保存
@@ -166,6 +177,7 @@ const previewRow = (data) => {
v-if="showDialog"
@chooseItem="chooseItem"
:resType="courseMetadata.resType"
+ :showTablePreview="showTablePreview"
>
@@ -175,9 +187,10 @@ const previewRow = (data) => {
:title="isPreview ? '预览' : getType(chooseItemData.resType)"
>
- {{ chooseItemData.resType }}, {{ item }}
{
return h(
"span",
{
- style: { display: "flex", justifyContent: "center", gap: "12px" },
+ style: { display: "flex", justifyContent: "flex-end", gap: "12px" },
},
[
// 设置
@@ -239,6 +239,9 @@ const renderActionColumn = () => {
{
href: "javascript:void(0)",
onClick: () => handleSetting(index, record),
+ style: {
+ display: [40].includes(record.resType) ? "none" : "",
+ },
},
[
createVNode(SettingOutlined, {