Przeglądaj źródła

生词、注释等字号根据全文设置改变 以及预览

natasha 4 dni temu
rodzic
commit
7a094644c5

+ 14 - 2
src/views/book/courseware/create/components/question/article/Article.vue

@@ -79,10 +79,22 @@
           key="new_word"
           :data-new-word="data.new_word_list"
           @sureNewWords="sureNewWords"
+          :unified-attrib="data.unified_attrib ? data.unified_attrib : null"
         />
 
-        <Notes v-if="editWordIndex === 1" key="notes" :data-notes="data.notes_list" @sureNotes="sureNotes" />
-        <NewWord v-if="editWordIndex === 2" :data-new-word="data.other_word_list" @sureNewWords="sureOtherNewWords" />
+        <Notes
+          v-if="editWordIndex === 1"
+          key="notes"
+          :data-notes="data.notes_list"
+          @sureNotes="sureNotes"
+          :unified-attrib="data.unified_attrib ? data.unified_attrib : null"
+        />
+        <NewWord
+          v-if="editWordIndex === 2"
+          :data-new-word="data.other_word_list"
+          @sureNewWords="sureOtherNewWords"
+          :unified-attrib="data.unified_attrib ? data.unified_attrib : null"
+        />
       </template>
       <!-- </el-dialog> -->
       <!-- 添加图片 -->

+ 13 - 1
src/views/book/courseware/create/components/question/article/NewWord.vue

@@ -8,6 +8,8 @@
       :placeholder="'输入标题'"
       toolbar="fontselect fontsizeselect forecolor backcolor | underline | bold italic strikethrough alignleft aligncenter alignright"
       class="title-box"
+      :font-size="unifiedAttrib?.font_size"
+      :font-family="unifiedAttrib?.font"
     />
     <div class="option-list">
       <div class="table-node">
@@ -111,6 +113,8 @@
             v-model="item.cixing"
             :inline="true"
             toolbar="fontselect fontsizeselect forecolor backcolor | underline | bold italic strikethrough alignleft aligncenter alignright"
+            :font-size="unifiedAttrib?.font_size"
+            :font-family="unifiedAttrib?.font"
           />
         </div>
         <div class="table-item" style="width: 200px">
@@ -129,6 +133,8 @@
             :inline="true"
             :placeholder="'多个释义用;隔开'"
             toolbar="fontselect fontsizeselect forecolor backcolor | underline | bold italic strikethrough alignleft aligncenter alignright"
+            :font-size="unifiedAttrib?.font_size"
+            :font-family="unifiedAttrib?.font"
           />
         </div>
         <div class="table-item" style="width: 200px">
@@ -137,6 +143,8 @@
             v-model="item.collocation"
             :inline="true"
             toolbar="fontselect fontsizeselect forecolor backcolor | underline | bold italic strikethrough alignleft aligncenter alignright"
+            :font-size="unifiedAttrib?.font_size"
+            :font-family="unifiedAttrib?.font"
           />
         </div>
         <div class="table-item" style="width: 300px">
@@ -146,6 +154,8 @@
             :inline="true"
             :placeholder="'多条例句用回车'"
             toolbar="fontselect fontsizeselect forecolor backcolor | underline | bold italic strikethrough alignleft aligncenter alignright"
+            :font-size="unifiedAttrib?.font_size"
+            :font-family="unifiedAttrib?.font"
           />
         </div>
         <div class="table-item" style="width: 100px">
@@ -298,6 +308,7 @@
 </template>
 
 <script>
+import ModuleMixin from '../../common/ModuleMixin';
 import SoundRecord from '@/views/book/courseware/create/components/question/fill/components/SoundRecord.vue';
 import UploadAudio from '@/views/book/courseware/create/components/question/fill/components/UploadAudio.vue';
 import SelectUpload from '@/views/book/courseware/create/components/common/SelectUpload.vue';
@@ -326,7 +337,8 @@ export default {
     UploadPicture,
     CheckSubtitles,
   },
-  props: ['dataNewWord'],
+  props: ['dataNewWord', 'unifiedAttrib'],
+  mixins: [ModuleMixin],
   data() {
     return {
       data: this.dataNewWord,

+ 13 - 5
src/views/book/courseware/create/components/question/article/Notes.vue

@@ -8,6 +8,8 @@
       :placeholder="'输入标题'"
       toolbar="fontselect fontsizeselect forecolor backcolor | underline | bold italic strikethrough alignleft aligncenter alignright"
       class="title-box"
+      :font-size="unifiedAttrib?.font_size"
+      :font-family="unifiedAttrib?.font"
     />
     <el-table :data="data.option" border style="width: 100%">
       <el-table-column fixed prop="number" label="序号" width="70">
@@ -22,8 +24,8 @@
             v-model="scope.row.con"
             :inline="true"
             :item-index="scope.$index"
-            :font-size="data?.unified_attrib?.font_size"
-            :font-family="data?.unified_attrib?.font"
+            :font-size="unifiedAttrib?.font_size"
+            :font-family="unifiedAttrib?.font"
             toolbar="fontselect fontsizeselect forecolor backcolor | underline | bold italic strikethrough alignleft aligncenter alignright"
             @handleRichTextBlur="handleBlurCon"
           />
@@ -35,8 +37,8 @@
             ref="richText"
             v-model="scope.row.pinyin"
             :inline="true"
-            :font-size="data?.unified_attrib?.font_size"
-            :font-family="data?.unified_attrib?.font"
+            :font-size="unifiedAttrib?.pinyin_size"
+            :font-family="'League'"
             toolbar="fontselect fontsizeselect forecolor backcolor | underline | bold italic strikethrough alignleft aligncenter alignright"
           />
         </template>
@@ -48,6 +50,8 @@
             v-model="scope.row.interpret"
             :inline="true"
             toolbar="fontselect fontsizeselect forecolor backcolor | underline | bold italic strikethrough alignleft aligncenter alignright"
+            :font-size="unifiedAttrib?.font_size"
+            :font-family="unifiedAttrib?.font"
           />
         </template>
       </el-table-column>
@@ -58,6 +62,8 @@
             v-model="scope.row.note"
             :inline="true"
             toolbar="fontselect fontsizeselect forecolor backcolor | underline | bold italic strikethrough alignleft aligncenter alignright"
+            :font-size="unifiedAttrib?.font_size"
+            :font-family="unifiedAttrib?.font"
           />
         </template>
       </el-table-column>
@@ -110,6 +116,7 @@
 </template>
 
 <script>
+import ModuleMixin from '../../common/ModuleMixin';
 import RichText from '@/components/RichText.vue';
 import UploadPicture from '../new_word/components/UploadPicture.vue';
 import { pinyinPositionLists } from '@/views/book/courseware/data/notes';
@@ -120,7 +127,8 @@ export default {
     RichText,
     UploadPicture,
   },
-  props: ['dataNotes'],
+  props: ['dataNotes', 'unifiedAttrib'],
+  mixins: [ModuleMixin],
   data() {
     return {
       data: this.dataNotes,

+ 14 - 2
src/views/book/courseware/create/components/question/dialogue_article/Article.vue

@@ -306,10 +306,22 @@
           key="new_word"
           :data-new-word="data.new_word_list"
           @sureNewWords="sureNewWords"
+          :unified-attrib="data.unified_attrib ? data.unified_attrib : null"
         />
 
-        <Notes v-if="editWordIndex === 1" key="notes" :data-notes="data.notes_list" @sureNotes="sureNotes" />
-        <NewWord v-if="editWordIndex === 2" :data-new-word="data.other_word_list" @sureNewWords="sureOtherNewWords" />
+        <Notes
+          v-if="editWordIndex === 1"
+          key="notes"
+          :data-notes="data.notes_list"
+          @sureNotes="sureNotes"
+          :unified-attrib="data.unified_attrib ? data.unified_attrib : null"
+        />
+        <NewWord
+          v-if="editWordIndex === 2"
+          :data-new-word="data.other_word_list"
+          @sureNewWords="sureOtherNewWords"
+          :unified-attrib="data.unified_attrib ? data.unified_attrib : null"
+        />
       </template>
       <!-- </el-dialog> -->
       <CheckSubtitles

+ 6 - 2
src/views/book/courseware/create/components/question/notes/Notes.vue

@@ -27,6 +27,7 @@
               :item-index="scope.$index"
               :font-size="data?.unified_attrib?.font_size"
               :font-family="data?.unified_attrib?.font"
+              :key="'richtext-1-' + scope.$index"
               toolbar="fontselect fontsizeselect forecolor backcolor | underline | bold italic strikethrough alignleft aligncenter alignright"
               @handleRichTextBlur="handleBlurCon"
             />
@@ -38,8 +39,9 @@
               ref="richText"
               v-model="scope.row.pinyin"
               :inline="true"
-              :font-size="data?.unified_attrib?.font_size"
-              :font-family="data?.unified_attrib?.font"
+              :font-size="data?.unified_attrib?.pinyin_size"
+              :font-family="'League'"
+              :key="'richtext-2-' + scope.$index"
               toolbar="fontselect fontsizeselect forecolor backcolor | underline | bold italic strikethrough alignleft aligncenter alignright"
             />
           </template>
@@ -52,6 +54,7 @@
               :inline="true"
               :font-size="data?.unified_attrib?.font_size"
               :font-family="data?.unified_attrib?.font"
+              :key="'richtext-3-' + scope.$index"
               toolbar="fontselect fontsizeselect forecolor backcolor | underline | bold italic strikethrough alignleft aligncenter alignright"
             />
           </template>
@@ -64,6 +67,7 @@
               :inline="true"
               :font-size="data?.unified_attrib?.font_size"
               :font-family="data?.unified_attrib?.font"
+              :key="'richtext-4-' + scope.$index"
               toolbar="fontselect fontsizeselect forecolor backcolor | underline | bold italic strikethrough alignleft aligncenter alignright"
             />
           </template>

+ 79 - 5
src/views/book/courseware/preview/components/new_word/NewWordPreview.vue

@@ -43,7 +43,7 @@
           </div>
 
           <div class="NPC-top-right">
-            <el-popover placement="right-start" width="60" trigger="hover">
+            <el-popover placement="right-start" width="60" trigger="click">
               <ul class="show-obj-list">
                 <li @click="handleShow('pinyin')">
                   <span>拼音</span
@@ -453,6 +453,12 @@
                               <p
                                 class="NPC-word-tab-common NPC-word-tab-cixing"
                                 :class="[/[\u4E00-\u9FA5\uF900-\uFA2D]/.test(sItem.cixing) ? 'hasCn' : '']"
+                                :style="{
+                                  fontSize:
+                                    data.unified_attrib && data.unified_attrib.font_size
+                                      ? data.unified_attrib.font_size
+                                      : '',
+                                }"
                                 v-html="convertText(sanitizeHTML(sItem.cixing))"
                                 v-if="showObj.cixing"
                               ></p>
@@ -534,6 +540,12 @@
                                 class="NPC-word-tab-common NPC-word-tab-cixing"
                                 :class="[/[\u4E00-\u9FA5\uF900-\uFA2D]/.test(sItem.cixing) ? 'hasCn' : '']"
                                 v-html="convertText(sanitizeHTML(sItem.cixing))"
+                                :style="{
+                                  fontSize:
+                                    data.unified_attrib && data.unified_attrib.font_size
+                                      ? data.unified_attrib.font_size
+                                      : '',
+                                }"
                               ></p>
 
                               <span
@@ -555,6 +567,12 @@
                           <p
                             class="NPC-word-tab-common NPC-word-tab-def"
                             v-html="convertText(sanitizeHTML(sItem.def_str))"
+                            :style="{
+                              fontSize:
+                                data.unified_attrib && data.unified_attrib.font_size
+                                  ? data.unified_attrib.font_size
+                                  : '',
+                            }"
                           ></p>
                           <span
                             v-if="
@@ -571,7 +589,15 @@
                         <div v-if="sItem.collocation && showObj.collocation">
                           <span class="collocation"
                             ><span>{{ convertText('搭配:') }}</span
-                            ><b v-html="convertText(sanitizeHTML(sItem.collocation))"></b
+                            ><b
+                              v-html="convertText(sanitizeHTML(sItem.collocation))"
+                              :style="{
+                                fontSize:
+                                  data.unified_attrib && data.unified_attrib.font_size
+                                    ? data.unified_attrib.font_size
+                                    : '',
+                              }"
+                            ></b
                           ></span>
                           <span v-if="showLang" class="">
                             {{
@@ -587,7 +613,15 @@
                           <span class="collocation"
                             ><span>{{ convertText('例句:') }}</span>
                             <div>
-                              <b v-html="convertText(sanitizeHTML(sItem.liju_list))"></b>
+                              <b
+                                v-html="convertText(sanitizeHTML(sItem.liju_list))"
+                                :style="{
+                                  fontSize:
+                                    data.unified_attrib && data.unified_attrib.font_size
+                                      ? data.unified_attrib.font_size
+                                      : '',
+                                }"
+                              ></b>
                             </div>
                           </span>
                           <span v-if="showLang" class="">
@@ -773,6 +807,12 @@
                           <p
                             class="NPC-word-tab-common NPC-word-tab-cixing"
                             :class="[/[\u4E00-\u9FA5\uF900-\uFA2D]/.test(sItem.cixing) ? 'hasCn' : '']"
+                            :style="{
+                              fontSize:
+                                data.unified_attrib && data.unified_attrib.font_size
+                                  ? data.unified_attrib.font_size
+                                  : '',
+                            }"
                             v-html="convertText(sanitizeHTML(sItem.cixing))"
                           ></p>
                           <span
@@ -791,6 +831,12 @@
                           <p
                             class="NPC-word-tab-common NPC-word-tab-def"
                             v-html="convertText(sanitizeHTML(sItem.def_str))"
+                            :style="{
+                              fontSize:
+                                data.unified_attrib && data.unified_attrib.font_size
+                                  ? data.unified_attrib.font_size
+                                  : '',
+                            }"
                           ></p>
                           <span
                             v-if="
@@ -876,6 +922,12 @@
                           <p
                             class="NPC-word-tab-common NPC-word-tab-cixing"
                             :class="[/[\u4E00-\u9FA5\uF900-\uFA2D]/.test(sItem.cixing) ? 'hasCn' : '']"
+                            :style="{
+                              fontSize:
+                                data.unified_attrib && data.unified_attrib.font_size
+                                  ? data.unified_attrib.font_size
+                                  : '',
+                            }"
                             v-html="convertText(sanitizeHTML(sItem.cixing))"
                           ></p>
 
@@ -895,6 +947,12 @@
                           <p
                             class="NPC-word-tab-common NPC-word-tab-def"
                             v-html="convertText(sanitizeHTML(sItem.def_str))"
+                            :style="{
+                              fontSize:
+                                data.unified_attrib && data.unified_attrib.font_size
+                                  ? data.unified_attrib.font_size
+                                  : '',
+                            }"
                           ></p>
                           <span
                             v-if="
@@ -935,7 +993,15 @@
                       >
                         <span class="collocation"
                           ><span>{{ convertText('搭配:') }}</span
-                          ><b v-html="convertText(sanitizeHTML(sItem.collocation))"></b
+                          ><b
+                            v-html="convertText(sanitizeHTML(sItem.collocation))"
+                            :style="{
+                              fontSize:
+                                data.unified_attrib && data.unified_attrib.font_size
+                                  ? data.unified_attrib.font_size
+                                  : '',
+                            }"
+                          ></b
                         ></span>
                         <span v-if="showLang" class="">
                           {{
@@ -951,7 +1017,15 @@
                         <span class="collocation"
                           ><span>{{ convertText('例句:') }}</span>
                           <div>
-                            <b v-html="convertText(sanitizeHTML(sItem.liju_list))"></b>
+                            <b
+                              v-html="convertText(sanitizeHTML(sItem.liju_list))"
+                              :style="{
+                                fontSize:
+                                  data.unified_attrib && data.unified_attrib.font_size
+                                    ? data.unified_attrib.font_size
+                                    : '',
+                              }"
+                            ></b>
                           </div>
                         </span>
                         <span v-if="showLang" class="">

+ 16 - 3
src/views/book/courseware/preview/components/notes/NotesPreview.vue

@@ -133,9 +133,22 @@
                   </span>
                 </div>
               </div>
-              <div class="NPC-notes-trans" v-html="convertText(sanitizeHTML(item.interpret))"></div>
-
-              <div v-if="item.note" class="NPC-notes-note" v-html="convertText(sanitizeHTML(item.note))"></div>
+              <div
+                class="NPC-notes-trans"
+                :style="{
+                  fontSize: data.unified_attrib && data.unified_attrib.font_size ? data.unified_attrib.font_size : '',
+                }"
+                v-html="convertText(sanitizeHTML(item.interpret))"
+              ></div>
+
+              <div
+                v-if="item.note"
+                class="NPC-notes-note"
+                :style="{
+                  fontSize: data.unified_attrib && data.unified_attrib.font_size ? data.unified_attrib.font_size : '',
+                }"
+                v-html="convertText(sanitizeHTML(item.note))"
+              ></div>
               <div v-if="item.file_list[0]" class="NPC-notes-note-img">
                 <el-image
                   :src="item.file_list[0].file_url"