Przeglądaj źródła

图片文本融合、表格主题色

natasha 2 tygodni temu
rodzic
commit
61c1a90c5c

+ 1 - 0
src/views/book/courseware/preview/components/image_text/ImageTextPreview.vue

@@ -108,6 +108,7 @@
         :mp3Url="mp3_url"
         :multilingualTextList="showLang && multilingualTextList[getLang()] ? multilingualTextList[getLang()] : []"
         :property="data.property"
+        :attrib="data.unified_attrib"
       ></magazine-sentence>
     </el-dialog>
   </div>

+ 20 - 1
src/views/book/courseware/preview/components/image_text/components/MagazineSentence.vue

@@ -261,7 +261,7 @@
 export default {
   //import引入的组件需要注入到对象中才能使用
   components: {},
-  props: ['fontSize', 'sentenceTheme', 'data', 'activeIndex', 'mp3Url', 'multilingualTextList', 'property'],
+  props: ['fontSize', 'sentenceTheme', 'data', 'activeIndex', 'mp3Url', 'multilingualTextList', 'property', 'attrib'],
   data() {
     //这里存放数据
     return {
@@ -435,6 +435,25 @@ export default {
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
+    if (this.attrib) {
+      this.themeList[0] = {
+        type: 'white',
+        bg: '#E5E6EB',
+        playBtnBg: this.attrib.topic_color, // 播放按钮背景色
+        rightBtnColor: 'rgba(0, 0, 0, 0.96)', // 右侧按钮颜色
+        contentBg: '#F7F8FA',
+        sentenceColor: 'rgba(0, 0, 0, 0.96)',
+        sentenceActiveColor: this.attrib.topic_color,
+        bottomBg: '#F2F3F5',
+        bottomBarActiveBtnBg: '#FFFFFF',
+        bottomBarColor: '#4E5969',
+        bottomBarActive: this.attrib.topic_color,
+        bottomBarBorder: '#E5E6EB',
+        themeBg: '#FFFFFF',
+        themeActiveBorder: '#E5E6EB',
+        boxBorder: this.attrib.topic_color, // 选中时高亮的外圈边框
+      };
+    }
     this.handleData();
   },
   //生命周期 - 挂载完成(可以访问DOM元素)

+ 12 - 1
src/views/book/courseware/preview/components/table/TablePreview.vue

@@ -112,6 +112,7 @@
                             :answer-record-list="data.audio_answer_list"
                             :task-model="isJudgingRightWrong ? 'ANSWER' : ''"
                             @handleWav="handleMiniWav($event, item)"
+                            :attrib="data.unified_attrib"
                           />
                         </template>
                         <span v-if="data.property.pinyin_position === 'bottom'" class="pinyin">&nbsp;</span>
@@ -131,7 +132,16 @@
                   </template>
                   <template v-else>
                     <p v-for="(item, index) in col.model_essay" :key="index" :style="[tdStyle]">
-                      <span v-if="item.type === 'text'" :key="index" v-html="sanitizeHTML(item.value)"></span>
+                      <span
+                        v-if="item.type === 'text'"
+                        :key="index"
+                        v-html="sanitizeHTML(item.value)"
+                        :style="{
+                          fontSize:
+                            data.unified_attrib && data.unified_attrib.font_size ? data.unified_attrib.font_size : '',
+                          fontFamily: data.unified_attrib && data.unified_attrib.font ? data.unified_attrib.font : '',
+                        }"
+                      ></span>
                       <template v-if="item.type === 'input'">
                         <template v-if="data.property.fill_type === fillTypeList[0].value">
                           <el-input
@@ -186,6 +196,7 @@
                             :answer-record-list="data.audio_answer_list"
                             :task-model="isJudgingRightWrong ? 'ANSWER' : ''"
                             @handleWav="handleMiniWav($event, item)"
+                            :attrib="data.unified_attrib"
                           />
                         </template>
                         <span