瀏覽代碼

文件id file_id_list

natasha 2 天之前
父節點
當前提交
f539645851

+ 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() {

+ 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: [
       ], // 思维导图数据