Ver Fonte

修改问题

dsy há 1 dia atrás
pai
commit
b68eea2cdd

+ 4 - 3
src/views/book/courseware/preview/components/article/index.vue

@@ -506,9 +506,10 @@ export default {
         });
       }
       if (this.data.mp3_list && this.data.mp3_list.length > 0) {
-        GetFileURLMap({ file_id_list: [this.data.mp3_list[0].file_id] }).then(({ url_map }) => {
-          this.data.mp3_list[0].url = url_map[this.data.mp3_list[0].file_id];
-        });
+        this.data.mp3_list[0].url = this.data.mp3_list[0].temporary_url;
+        // GetFileURLMap({ file_id_list: [this.data.mp3_list[0].file_id] }).then(({ url_map }) => {
+        //   this.data.mp3_list[0].url = url_map[this.data.mp3_list[0].file_id];
+        // });
       }
       this.NNPENewWordList = (
         this.data.new_word_list_other_component_input ? this.data.new_word_list_other_component_input : []

+ 1 - 1
src/views/book/courseware/preview/components/character/CharacterPreview.vue

@@ -178,7 +178,7 @@
               <div class="words-left" :style="{}">
                 <AudioPlay
                   v-if="isEnable(data.property.is_enable_voice)"
-                  :file-id="item.audio_file_id"
+                  :file-id="item.audio_file_id ? item.audio_file_id.file_url : ''"
                   :theme-color="
                     data.unified_attrib && data.unified_attrib.topic_color ? data.unified_attrib.topic_color : ''
                   "

+ 7 - 3
src/views/book/courseware/preview/components/character_base/components/AudioPlay.vue

@@ -100,9 +100,13 @@ export default {
     fileId: {
       handler(val) {
         if (!val) return;
-        GetFileURLMap({ file_id_list: [val] }).then(({ url_map }) => {
-          this.url = url_map[val];
-        });
+        if (val.indexOf('http') > -1) {
+          this.url = val;
+        } else {
+          GetFileURLMap({ file_id_list: [val] }).then(({ url_map }) => {
+            this.url = url_map[val];
+          });
+        }
       },
       immediate: true,
     },

+ 4 - 3
src/views/book/courseware/preview/components/dialogue_article/index.vue

@@ -501,9 +501,10 @@ export default {
       let userAnswer = JSON.parse(JSON.stringify(this.userAnswer));
       this.$set(this.data, 'Bookanswer', userAnswer);
       if (this.data.mp3_list && this.data.mp3_list.length > 0) {
-        GetFileURLMap({ file_id_list: [this.data.mp3_list[0].file_id] }).then(({ url_map }) => {
-          this.data.mp3_list[0].url = url_map[this.data.mp3_list[0].file_id];
-        });
+        this.data.mp3_list[0].url = this.data.mp3_list[0].temporary_url;
+        // GetFileURLMap({ file_id_list: [this.data.mp3_list[0].file_id] }).then(({ url_map }) => {
+        //   this.data.mp3_list[0].url = url_map[this.data.mp3_list[0].file_id];
+        // });
       }
       this.NNPENewWordList = (
         this.data.new_word_list_other_component_input ? this.data.new_word_list_other_component_input : []

+ 4 - 3
src/views/book/courseware/preview/components/drawing/DrawingPreview.vue

@@ -163,9 +163,10 @@ export default {
       }
 
       this.data.image_list.forEach((item) => {
-        GetFileURLMap({ file_id_list: [item.file_id] }).then(({ url_map }) => {
-          this.image_url = url_map[item.file_id];
-        });
+        this.image_url = item.file_url;
+        // GetFileURLMap({ file_id_list: [item.file_id] }).then(({ url_map }) => {
+        //   this.image_url = url_map[item.file_id];
+        // });
       });
     },
     // 保存图片

+ 9 - 2
src/views/book/courseware/preview/components/fill/FillPreview.vue

@@ -270,10 +270,17 @@ export default {
       const isRow = this.data.property.arrange_type === arrangeTypeList[0].value;
       const isFront = this.data.property.audio_position === audioPositionList[0].value;
       const isEnableVoice = this.data.property.is_enable_voice_answer === 'true';
+      const isHasAudio = this.data.audio_file_id.length > 0;
       let _list = [
         { name: 'audio', value: '24px' },
         { name: 'fill', value: '1fr' },
       ];
+
+      if (!isHasAudio) {
+        _list[0].value = '0px';
+      }
+      console.log(_list);
+
       if (!isFront) {
         _list = _list.reverse();
       }
@@ -292,8 +299,8 @@ export default {
 
       let style = {
         'grid-auto-flow': isRow ? 'column' : 'row',
-        'column-gap': isRow ? '16px' : undefined,
-        'row-gap': isRow ? undefined : '8px',
+        'column-gap': isRow && isHasAudio ? '16px' : undefined,
+        'row-gap': isRow && !isHasAudio ? undefined : '8px',
         'grid-template-areas': gridArea,
         'grid-template-rows': gridTemplateRows,
         'grid-template-columns': gridTemplateColumns,

+ 8 - 6
src/views/book/courseware/preview/components/image_text/ImageTextPreview.vue

@@ -178,14 +178,16 @@ export default {
       }
 
       this.data.image_list.forEach((item) => {
-        GetFileURLMap({ file_id_list: [item.file_id] }).then(({ url_map }) => {
-          this.image_url = url_map[item.file_id];
-        });
+        this.image_url = item.file_url;
+        // GetFileURLMap({ file_id_list: [item.file_id] }).then(({ url_map }) => {
+        //   this.image_url = url_map[item.file_id];
+        // });
       });
       this.data.mp3_list.forEach((item) => {
-        GetFileURLMap({ file_id_list: [item.file_id] }).then(({ url_map }) => {
-          this.mp3_url = url_map[item.file_id];
-        });
+        this.mp3_url = item.temporary_url;
+        // GetFileURLMap({ file_id_list: [item.file_id] }).then(({ url_map }) => {
+        //   this.mp3_url = url_map[item.file_id];
+        // });
       });
     },
     /**

+ 16 - 12
src/views/book/courseware/preview/components/new_word/NewWordPreview.vue

@@ -1,7 +1,10 @@
 <!-- eslint-disable vue/no-v-html -->
 <template>
   <div ref="previewContainer" class="newWord-preview" :style="getAreaStyle()">
-    <SerialNumberPosition v-if="isEnable(data.property.sn_display_mode)" :property="data.property" />
+    <SerialNumberPosition
+      v-if="isEnable(data.property.hasOwnProperty('sn_display_mode') ? data.property.sn_display_mode : 'false')"
+      :property="data.property"
+    />
 
     <main v-if="data" ref="newWordMain" class="main">
       <div class="NPC-zhedie" :style="{ width: width }">
@@ -481,8 +484,8 @@
                                 ? '180px'
                                 : '160px',
                         }"
-                        :src="item.pic_url"
-                        :preview-src-list="[item.pic_url]"
+                        :src="item.file_list[0].file_url"
+                        :preview-src-list="[item.file_list[0].file_url]"
                         fit="contain"
                       />
                     </div>
@@ -794,7 +797,7 @@ export default {
               oldVal.new_word_list[0].new_word &&
               val.new_word_list[0].new_word !== oldVal.new_word_list[0].new_word) ||
             (val && val.new_word_list[0].new_word && !oldVal) ||
-            (val && val.hasOwn('unified_attrib') && oldVal && !oldVal.hasOwn('unified_attrib'))
+            (val && val.hasOwnProperty('unified_attrib') && oldVal && !oldVal.hasOwnProperty('unified_attrib'))
           ) {
             // this.wordShow = isEnable(this.data.property.is_word_show);
             this.initData();
@@ -934,9 +937,10 @@ export default {
       let Bookanswer = [];
       let option_list = [];
       if (this.data.audio_data.file_id) {
-        GetFileURLMap({ file_id_list: [this.data.audio_data.file_id] }).then(({ url_map }) => {
-          this.data.audio_data.url = url_map[this.data.audio_data.file_id];
-        });
+        this.data.audio_data.url = this.data.audio_data.temporary_url;
+        // GetFileURLMap({ file_id_list: [this.data.audio_data.file_id] }).then(({ url_map }) => {
+        //   this.data.audio_data.url = url_map[this.data.audio_data.file_id];
+        // });
       }
       this.data.new_word_list.forEach((item) => {
         if (item.number) {
@@ -951,11 +955,11 @@ export default {
             this.$set(item, 'mp3_list_url', url_map[item.mp3_list]);
           });
         }
-        if (item.file_list && item.file_list[0]) {
-          GetFileURLMap({ file_id_list: item.file_list }).then(({ url_map }) => {
-            this.$set(item, 'pic_url', url_map[item.file_list[0]]);
-          });
-        }
+        // if (item.file_list && item.file_list[0]) {
+        //   GetFileURLMap({ file_id_list: item.file_list }).then(({ url_map }) => {
+        //     this.$set(item, 'pic_url', url_map[item.file_list[0]]);
+        //   });
+        // }
         this.$set(item, 'show_left', true);
         this.$set(item, 'isFlipped', false);
       });

+ 7 - 3
src/views/book/courseware/preview/components/new_word/components/AudioPlay.vue

@@ -38,9 +38,13 @@ export default {
     fileId: {
       handler(val) {
         if (!val) return;
-        GetFileURLMap({ file_id_list: [val] }).then(({ url_map }) => {
-          this.url = url_map[val];
-        });
+        if (val.indexOf('http') > -1) {
+          this.url = val;
+        } else {
+          GetFileURLMap({ file_id_list: [val] }).then(({ url_map }) => {
+            this.url = url_map[val];
+          });
+        }
       },
       immediate: true,
     },

+ 17 - 9
src/views/book/courseware/preview/components/notes/NotesPreview.vue

@@ -1,7 +1,10 @@
 <!-- eslint-disable vue/no-v-html -->
 <template>
   <div class="notes-preview" :style="getAreaStyle()">
-    <SerialNumberPosition v-if="isEnable(data.property.sn_display_mode)" :property="data.property" />
+    <SerialNumberPosition
+      v-if="isEnable(data.property.hasOwnProperty('sn_display_mode') ? data.property.sn_display_mode : 'false')"
+      :property="data.property"
+    />
 
     <div class="main">
       <div class="NPC-zhedie">
@@ -39,6 +42,7 @@
                   :style="{
                     color:
                       data.unified_attrib && data.unified_attrib.topic_color ? data.unified_attrib.topic_color : '',
+                    fontSize: data.unified_attrib && data.unified_attrib.font_size ? data.unified_attrib.font_size : '',
                   }"
                   v-html="item.number"
                 ></span>
@@ -133,7 +137,11 @@
 
               <div v-if="item.note" class="NPC-notes-note" v-html="item.note"></div>
               <div v-if="item.file_list[0]" class="NPC-notes-note-img">
-                <el-image :src="item.pic_url" :preview-src-list="[item.pic_url]" fit="contain" />
+                <el-image
+                  :src="item.file_list[0].file_url"
+                  :preview-src-list="[item.file_list[0].file_url]"
+                  fit="contain"
+                />
               </div>
               <div v-if="showLang" class="NPC-notes-note">
                 {{
@@ -207,13 +215,13 @@ export default {
           this.$set(this.multilingualTextList, item.type, chunkedArr);
         });
       }
-      this.data.option.forEach((item) => {
-        if (item.file_list && item.file_list[0]) {
-          GetFileURLMap({ file_id_list: item.file_list }).then(({ url_map }) => {
-            this.$set(item, 'pic_url', url_map[item.file_list[0]]);
-          });
-        }
-      });
+      // this.data.option.forEach((item) => {
+      //   if (item.file_list && item.file_list[0]) {
+      //     GetFileURLMap({ file_id_list: item.file_list }).then(({ url_map }) => {
+      //       this.$set(item, 'pic_url', url_map[item.file_list[0]]);
+      //     });
+      //   }
+      // });
     },
   },
 };

+ 1 - 1
src/views/book/courseware/preview/components/pinyin_base/PinyinBasePreview.vue

@@ -11,7 +11,7 @@
         <div class="first-con">
           <AudioPlay
             v-if="data.audio_file_id && data.property.audio_position === 'front'"
-            :file-id="data.audio_file_id"
+            :file-id="data.file_list[0].file_url"
             :theme-color="data.unified_attrib && data.unified_attrib.topic_color ? data.unified_attrib.topic_color : ''"
           />
           <div

+ 3 - 0
src/views/book/courseware/preview/components/rich_text/RichTextPreview.vue

@@ -9,6 +9,9 @@
           :paragraph-list="data.paragraph_list"
           :pinyin-position="data.property.pinyin_position"
           :pinyin-overall-position="data.property.pinyin_overall_position"
+          :pinyin-size="data?.unified_attrib?.pinyin_size"
+          :font-size="data?.unified_attrib?.font_size"
+          :font-family="data?.unified_attrib?.font"
           :is-preview="isPreview"
         />
         <span v-else class="rich-text" @click="handleRichFillClick" v-html="sanitizeHTML(data.content)"></span>

+ 11 - 10
src/views/book/courseware/preview/components/upload_preview/UploadPreviewPreview.vue

@@ -173,16 +173,17 @@ export default {
     },
     // 预览
     viewDialog(file) {
-      this.newpath = '';
-      GetFileURLMap({ file_id_list: [file.file_id] }).then(({ url_map }) => {
-        // this.$set(
-        //   item,
-        //   'newpath',
-        //   `${this.file_preview_url}onlinePreview?url=${Base64.encode(url_map[item.file_id])}`,
-        // );
-        this.newpath = `${this.file_preview_url}onlinePreview?url=${Base64.encode(url_map[file.file_id])}`;
-        this.visible = true;
-      });
+      this.newpath = `${this.file_preview_url}onlinePreview?url=${Base64.encode(file.file_url)}`;
+      this.visible = true;
+      // GetFileURLMap({ file_id_list: [file.file_id] }).then(({ url_map }) => {
+      // this.$set(
+      //   item,
+      //   'newpath',
+      //   `${this.file_preview_url}onlinePreview?url=${Base64.encode(url_map[item.file_id])}`,
+      // );
+      // this.newpath = `${this.file_preview_url}onlinePreview?url=${Base64.encode(url_map[file.file_id])}`;
+      // this.visible = true;
+      // });
     },
   },
 };