natasha 2 днів тому
батько
коміт
1cd0e03a38
19 змінених файлів з 68 додано та 12 видалено
  1. 2 0
      src/views/book/courseware/create/components/base/character_base/CharacterBase.vue
  2. 11 7
      src/views/book/courseware/create/components/base/common/SelectResource.vue
  3. 2 0
      src/views/book/courseware/create/components/base/upload_preview/UploadPreview.vue
  4. 3 0
      src/views/book/courseware/create/components/question/article/Article.vue
  5. 1 0
      src/views/book/courseware/create/components/question/drawing/Drawing.vue
  6. 4 0
      src/views/book/courseware/create/components/question/image_text/ImageText.vue
  7. 12 0
      src/views/book/courseware/create/components/question/new_word/NewWord.vue
  8. 8 0
      src/views/book/courseware/create/components/question/other_word/OtherWord.vue
  9. 4 0
      src/views/book/courseware/create/components/question/pinyin_base/PinyinBase.vue
  10. 2 0
      src/views/book/courseware/create/components/question/video_interaction/VideoInteraction.vue
  11. 1 0
      src/views/book/courseware/data/article.js
  12. 1 0
      src/views/book/courseware/data/characterBase.js
  13. 1 0
      src/views/book/courseware/data/drawing.js
  14. 1 0
      src/views/book/courseware/data/imageText.js
  15. 1 0
      src/views/book/courseware/data/newWord.js
  16. 1 0
      src/views/book/courseware/data/otherWord.js
  17. 1 0
      src/views/book/courseware/data/pinyinBase.js
  18. 2 1
      src/views/book/courseware/data/videoInteraction.js
  19. 10 4
      src/views/personal_workbench/project/ProductionResourceManage.vue

+ 2 - 0
src/views/book/courseware/create/components/base/character_base/CharacterBase.vue

@@ -168,9 +168,11 @@ export default {
     },
     uploads(file_id) {
       this.data.audio_file_id = file_id;
+      this.data.file_id_list = [file_id];
     },
     deleteFiles() {
       this.data.audio_file_id = '';
+      this.data.file_id_list = [];
     },
     // 自动生成音频
     handleMatic() {

+ 11 - 7
src/views/book/courseware/create/components/base/common/SelectResource.vue

@@ -69,9 +69,7 @@
               <p class="name">
                 {{ item.name
                 }}<SvgIcon
-                  v-show="
-                    item.file_id && (type_index === 5 || type_index === 3 || type_index === 2 || type_index === 1)
-                  "
+                  v-show="item.file_id && type_index !== 0"
                   icon-class="uploadPreview"
                   size="16"
                   @click="viewDialog(item)"
@@ -295,10 +293,16 @@ export default {
     viewDialog(file) {
       this.newpath = '';
       if (this.type_index === 3) {
-        H5StartupFile({ file_id: file.file_id, index_file_name: 'index.html' }).then((res) => {
-          this.newpath = res.file_url;
-          this.visible_flag = true;
-        });
+        const suffix = file.name.slice(file.name.lastIndexOf('.') + 1, file.name.length).toLowerCase();
+        if (suffix === 'html') {
+          this.newpath = file.file_url;
+          this.visible = true;
+        } else {
+          H5StartupFile({ file_id: file.file_id, index_file_name: 'index.html' }).then((res) => {
+            this.newpath = res.file_url;
+            this.visible = true;
+          });
+        }
       } else {
         GetFileURLMap({ file_id_list: [file.file_id] }).then(({ url_map }) => {
           this.newpath = `${this.file_preview_url}onlinePreview?url=${Base64.encode(url_map[file.file_id])}`;

+ 2 - 0
src/views/book/courseware/create/components/base/upload_preview/UploadPreview.vue

@@ -14,6 +14,8 @@
         :accept-file-type="acceptFileType"
         :upload-tip="uploadTip"
         :icon-class="iconClass"
+        :can-edit-name="true"
+        :file-info="data.file_info"
         :limit="100"
         @updateFileList="updateFileList"
       />

+ 3 - 0
src/views/book/courseware/create/components/question/article/Article.vue

@@ -107,6 +107,7 @@ export default {
       editWordIndex: 0,
     };
   },
+  watch: {},
   created() {},
   methods: {
     // 解析输入内容
@@ -234,10 +235,12 @@ export default {
             file_id,
           },
         ];
+        this.data.file_id_list = [file_id];
       }
     },
     removeFile() {
       this.data.mp3_list = [];
+      this.data.file_id_list = [];
     },
     // 校对文章
     checkArticle() {

+ 1 - 0
src/views/book/courseware/create/components/question/drawing/Drawing.vue

@@ -80,6 +80,7 @@ export default {
       this.data.image_list = file_list;
       this.data.image_id_list = file_id_list;
       this.data.image_info_list = file_info_list;
+      this.data.file_id_list = file_id_list;
     },
 
     handleData() {

+ 4 - 0
src/views/book/courseware/create/components/question/image_text/ImageText.vue

@@ -232,6 +232,8 @@ export default {
       this.data.image_list = file_list;
       this.data.image_id_list = file_id_list;
       this.data.image_info_list = file_info_list;
+      this.data.file_id_list =
+        this.data.mp3_list.length > 0 ? file_id_list.push(this.data.mp3_list[0].file_id) : file_id_list;
     },
     uploadAudioSuccess(fileList) {
       if (fileList.length > 0) {
@@ -245,9 +247,11 @@ export default {
             file_id,
           },
         ];
+        this.data.file_id_list.push(file_id);
       }
     },
     removeFile() {
+      this.data.file_id_list = this.data.file_id_list.filter((item) => item !== this.data.mp3_list[0].file_id);
       this.data.mp3_list = [];
     },
     startSelection(event) {

+ 12 - 0
src/views/book/courseware/create/components/question/new_word/NewWord.vue

@@ -221,6 +221,7 @@ export default {
           file_id,
         };
         this.parseLrcFile();
+        this.data.file_id_list.push(file_id);
       }
     },
     uploadAudioSuccess(fileList) {
@@ -233,6 +234,7 @@ export default {
           url: file_id,
           file_id,
         };
+        this.data.file_id_list.push(file_id);
       }
     },
     /**
@@ -241,6 +243,7 @@ export default {
      */
     removeFile(type) {
       if (type === 'audio') {
+        this.data.file_id_list = this.data.file_id_list.filter((item) => item !== this.data.audio_data.file_id);
         this.data.audio_data = {
           name: '',
           media_duration: 0,
@@ -249,6 +252,7 @@ export default {
           file_id: '',
         };
       } else if (type === 'lrc') {
+        this.data.file_id_list = this.data.file_id_list.filter((item) => item !== this.data.lrc_data.file_id);
         this.data.lrc_data = {
           name: '',
           url: '',
@@ -260,15 +264,19 @@ export default {
     },
     uploads(file_id, index) {
       this.data.new_word_list[index].mp3_list = file_id;
+      this.data.file_id_list.push(file_id);
     },
     deleteFiles(file_id, index) {
       this.data.new_word_list[index].mp3_list = '';
+      this.data.file_id_list = this.data.file_id_list.filter((item) => item !== file_id);
     },
     uploadPic(file_id, index) {
       this.data.new_word_list[index].file_list[0] = file_id;
+      this.data.file_id_list.push(file_id);
     },
     deletePic(file_id, index) {
       this.data.new_word_list[index].file_list[0] = '';
+      this.data.file_id_list = this.data.file_id_list.filter((item) => item !== file_id);
     },
     // 自动生成音频
     handleMatic(index) {
@@ -278,12 +286,16 @@ export default {
         .then(({ status, file_id }) => {
           if (status === 1) {
             this.data.new_word_list[index].mp3_list = file_id;
+            this.data.file_id_list.push(file_id);
           }
         })
         .catch(() => {});
     },
     // 删除行
     handleDelete(index) {
+      this.data.file_id_list = this.data.file_id_list.filter(
+        (item) => item !== this.data.new_word_list[index].mp3_list,
+      );
       this.data.new_word_list.splice(index, 1);
     },
     // 上移下移

+ 8 - 0
src/views/book/courseware/create/components/question/other_word/OtherWord.vue

@@ -194,6 +194,7 @@ export default {
           file_id,
         };
         this.parseLrcFile();
+        this.data.file_id_list.push(file_id);
       }
     },
     uploadAudioSuccess(fileList) {
@@ -206,6 +207,7 @@ export default {
           url: file_id,
           file_id,
         };
+        this.data.file_id_list.push(file_id);
       }
     },
     /**
@@ -214,6 +216,7 @@ export default {
      */
     removeFile(type) {
       if (type === 'audio') {
+        this.data.file_id_list = this.data.file_id_list.filter((item) => item !== this.data.audio_data.file_id);
         this.data.audio_data = {
           name: '',
           media_duration: 0,
@@ -222,6 +225,7 @@ export default {
           file_id: '',
         };
       } else if (type === 'lrc') {
+        this.data.file_id_list = this.data.file_id_list.filter((item) => item !== this.data.lrc_data.file_id);
         this.data.lrc_data = {
           name: '',
           url: '',
@@ -232,9 +236,11 @@ export default {
     },
     uploads(file_id, index) {
       this.data.option[index].mp3_list = file_id;
+      this.data.file_id_list.push(file_id);
     },
     deleteFiles(file_id, index) {
       this.data.option[index].mp3_list = '';
+      this.data.file_id_list = this.data.file_id_list.filter((item) => item !== file_id);
     },
     // 自动生成音频
     handleMatic(index) {
@@ -244,12 +250,14 @@ export default {
         .then(({ status, file_id }) => {
           if (status === 1) {
             this.data.option[index].mp3_list = file_id;
+            this.data.file_id_list.push(file_id);
           }
         })
         .catch(() => {});
     },
     // 删除行
     handleDelete(index) {
+      this.data.file_id_list = this.data.file_id_list.filter((item) => item !== this.data.option[index].mp3_list);
       this.data.option.splice(index, 1);
     },
     // 上移下移

+ 4 - 0
src/views/book/courseware/create/components/question/pinyin_base/PinyinBase.vue

@@ -119,9 +119,11 @@ export default {
   methods: {
     uploads(file_id) {
       this.data.audio_file_id = file_id;
+      this.data.file_id_list = [file_id];
     },
     deleteFiles() {
       this.data.audio_file_id = '';
+      this.data.file_id_list = [];
     },
     // 自动生成音频
     handleMatically() {
@@ -144,6 +146,7 @@ export default {
         .then((res) => {
           if (res.status === 1) {
             this.data.audio_file_id = res.file_id;
+            this.data.file_id_list = [res.file_id];
           }
         })
         .catch(() => {});
@@ -261,6 +264,7 @@ export default {
     changePinyin(item) {
       if (this.data.property.audio_generation_method === 'auto') {
         item.audio_file_id = '';
+        this.data.file_id_list = [];
       }
     },
     // 识别文本

+ 2 - 0
src/views/book/courseware/create/components/question/video_interaction/VideoInteraction.vue

@@ -106,6 +106,7 @@ export default {
     updateFileList({ file_list, file_id_list, file_info_list }) {
       this.data.video_list = file_list;
       this.data.video_id_list = file_id_list;
+      this.data.file_id_list = this.data.files_id_list.concat(file_id_list);
       this.data.video_info_list = file_info_list;
       if (file_list.length === 0) {
         this.data.file_info_list = [];
@@ -133,6 +134,7 @@ export default {
     updateFileLists({ file_list, file_id_list }) {
       this.file_list = file_list;
       this.file_id_list = file_id_list;
+      this.data.file_id_list = this.data.video_id_list.concat(file_id_list);
       if (file_list.length > 0 && file_list[0].file_id) {
         let obj = file_list[0];
         obj.currentTime = this.currentTime;

+ 1 - 0
src/views/book/courseware/data/article.js

@@ -60,6 +60,7 @@ export function getArticleData() {
     property: getArticleProperty(),
     content: '', // 课文内容
     mp3_list: [], // 音频列表
+    file_id_list: [], // 文件 id
     detail: [], // 分段分句分词详情
     word_time: [], // 字幕时间
     new_word_list: [], // 生词列表

+ 1 - 0
src/views/book/courseware/data/characterBase.js

@@ -101,6 +101,7 @@ export function getCharacterBaseData() {
     pinyin: '',
     definition: '',
     audio_file_id: '',
+    file_id_list: [],
     hz_strokes_list: [],
     mark: getRandomNumber(),
     record_list: [],

+ 1 - 0
src/views/book/courseware/data/drawing.js

@@ -29,6 +29,7 @@ export function getDrawingData() {
     image_id_list: [], // 文件 id
     image_width: 500, // 图片宽度px
     image_height: 500, // 图片高度px
+    file_id_list: [],
     mind_map: {
       node_list: [
       ], // 思维导图数据

+ 1 - 0
src/views/book/courseware/data/imageText.js

@@ -35,6 +35,7 @@ export function getImageTextData() {
     image_height: 500, // 图片高度px
     text_list: [], // 文字框列表
     input_list: [], // 输入框列表
+    file_id_list: [], // 文件 id
     mind_map: {
       node_list: [
       ], // 思维导图数据

+ 1 - 0
src/views/book/courseware/data/newWord.js

@@ -97,6 +97,7 @@ export function getNewWordData() {
       url: '',
       file_id: '',
     },
+    file_id_list: [], // 文件 id
     mind_map: {
       node_list: [
         { name: '生词组件' }

+ 1 - 0
src/views/book/courseware/data/otherWord.js

@@ -78,6 +78,7 @@ export function getOtherWordData() {
       url: '',
       file_id: '',
     },
+    file_id_list: [], // 文件 id
     mind_map: {
       node_list: [
         { name: '其他词汇' }

+ 1 - 0
src/views/book/courseware/data/pinyinBase.js

@@ -85,6 +85,7 @@ export function getPinyinBaseData() {
     content_view: [],
     content_hz: '',
     audio_file_id: '',
+    file_id_list: [], // 文件 id
     mark: getRandomNumber(),
     record_list: [],
     mind_map: {

+ 2 - 1
src/views/book/courseware/data/videoInteraction.js

@@ -27,7 +27,8 @@ export function getVideoInteractionData() {
     video_id_list: [], // 视频文件 id
     file_list: [], // 文件列表
     file_info_list: [],
-    file_id_list: [], // 文件 id
+    file_id_list: [], // 总文件 id
+    files_id_list: [], // 上传文件 id
     mind_map: {
       node_list: [
       ], // 思维导图数据

+ 10 - 4
src/views/personal_workbench/project/ProductionResourceManage.vue

@@ -325,7 +325,7 @@ export default {
       file_id_list: [],
       file_list: [],
       loading: false,
-      acceptFileTypeList: ['.jpg,.png,.jpeg', '.mp3', '.mp4', '.zip', '.fbx,.obj,.gltf,.glb', '.txt'],
+      acceptFileTypeList: ['.jpg,.png,.jpeg', '.mp3', '.mp4', '.zip,.html', '.fbx,.obj,.gltf,.glb', '.txt'],
       limit: 10,
       uploadTip: '',
       boxLoading: false,
@@ -649,10 +649,16 @@ export default {
     viewDialog(file) {
       this.newpath = '';
       if (this.type_index === 3) {
-        H5StartupFile({ file_id: file.file_id, index_file_name: 'index.html' }).then((res) => {
-          this.newpath = res.file_url;
+        const suffix = file.name.slice(file.name.lastIndexOf('.') + 1, file.name.length).toLowerCase();
+        if (suffix === 'html') {
+          this.newpath = file.file_url;
           this.visible = true;
-        });
+        } else {
+          H5StartupFile({ file_id: file.file_id, index_file_name: 'index.html' }).then((res) => {
+            this.newpath = res.file_url;
+            this.visible = true;
+          });
+        }
       } else if (this.type_index === 4) {
         this.visible3D = true;
         this.loadModel(file.file_id);