Преглед на файлове

富文本根据全文设置初始化字体和字号

natasha преди 6 дни
родител
ревизия
7472d87729

+ 6 - 0
src/views/book/courseware/create/components/question/article/NewWord.vue

@@ -2,6 +2,7 @@
   <div>
     <label>标题:</label>
     <RichText
+      v-if="property.isGetContent"
       ref="richText"
       v-model="data.title_con"
       :inline="true"
@@ -113,6 +114,7 @@
         </div>
         <div class="table-item" style="width: 110px">
           <RichText
+            v-if="property.isGetContent"
             ref="richText"
             v-model="item.cixing"
             :inline="true"
@@ -132,6 +134,7 @@
         </div>
         <div class="table-item" style="width: 200px">
           <RichText
+            v-if="property.isGetContent"
             ref="richText"
             v-model="item.definition_list"
             :inline="true"
@@ -143,6 +146,7 @@
         </div>
         <div class="table-item" style="width: 200px">
           <RichText
+            v-if="property.isGetContent"
             ref="richText"
             v-model="item.collocation"
             :inline="true"
@@ -153,6 +157,7 @@
         </div>
         <div class="table-item" style="width: 300px">
           <RichText
+            v-if="property.isGetContent"
             ref="richText"
             v-model="item.liju_list"
             :inline="true"
@@ -170,6 +175,7 @@
         </div>
         <div class="table-item" style="width: 200px" v-for="(itemN, indexN) in data.addCol" :key="indexN">
           <RichText
+            v-if="property.isGetContent"
             ref="richText"
             v-model="item[itemN.key]"
             :inline="true"

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

@@ -2,6 +2,7 @@
   <div>
     <label>标题:</label>
     <RichText
+      v-if="property.isGetContent"
       ref="richText"
       v-model="data.title_con"
       :inline="true"
@@ -20,6 +21,7 @@
       <el-table-column fixed prop="con" label="内容" width="200">
         <template slot-scope="scope">
           <RichText
+            v-if="property.isGetContent"
             ref="richText"
             v-model="scope.row.con"
             :inline="true"
@@ -34,6 +36,7 @@
       <el-table-column v-if="isEnable(data.property.view_pinyin)" prop="con" label="拼音" width="150">
         <template slot-scope="scope">
           <RichText
+            v-if="property.isGetContent"
             ref="richText"
             v-model="scope.row.pinyin"
             :inline="true"
@@ -46,6 +49,7 @@
       <el-table-column prop="interpret" label="翻译" width="200">
         <template slot-scope="scope">
           <RichText
+            v-if="property.isGetContent"
             ref="richText"
             v-model="scope.row.interpret"
             :inline="true"
@@ -58,6 +62,7 @@
       <el-table-column prop="note" label="注释" width="200">
         <template slot-scope="scope">
           <RichText
+            v-if="property.isGetContent"
             ref="richText"
             v-model="scope.row.note"
             :inline="true"

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

@@ -277,6 +277,7 @@
               @blur="onBlur(remark, 'chs')"
             /> -->
             <RichText
+              v-if="property.isGetContent"
               ref="richText"
               v-model="remark.chs"
               toolbar="fontselect fontsizeselect forecolor backcolor | underline | bold italic strikethrough alignleft aligncenter alignright"
@@ -302,6 +303,7 @@
               show-word-limit
             ></el-input> -->
             <RichText
+              v-if="property.isGetContent"
               ref="richText"
               v-model="remark.en"
               toolbar="fontselect fontsizeselect forecolor backcolor | underline | bold italic strikethrough alignleft aligncenter alignright"

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

@@ -257,6 +257,7 @@
           </div>
           <div class="table-item" style="width: 110px">
             <RichText
+              v-if="property.isGetContent"
               ref="richText"
               v-model="item.cixing"
               :inline="true"
@@ -276,6 +277,7 @@
           </div>
           <div class="table-item" style="width: 200px">
             <RichText
+              v-if="property.isGetContent"
               ref="richText"
               v-model="item.definition_list"
               :inline="true"
@@ -287,6 +289,7 @@
           </div>
           <div class="table-item" style="width: 200px">
             <RichText
+              v-if="property.isGetContent"
               ref="richText"
               v-model="item.collocation"
               :inline="true"
@@ -297,6 +300,7 @@
           </div>
           <div class="table-item" style="width: 300px">
             <RichText
+              v-if="property.isGetContent"
               ref="richText"
               v-model="item.liju_list"
               :font-size="data?.unified_attrib?.font_size"
@@ -314,6 +318,7 @@
           </div>
           <div class="table-item" style="width: 200px" v-for="(itemN, indexN) in data.addCol" :key="indexN">
             <RichText
+              v-if="property.isGetContent"
               ref="richText"
               v-model="item[itemN.key]"
               :inline="true"

+ 4 - 0
src/views/book/courseware/create/components/question/notes/Notes.vue

@@ -21,6 +21,7 @@
         <el-table-column fixed prop="con" label="内容" width="200">
           <template slot-scope="scope">
             <RichText
+              v-if="property.isGetContent"
               ref="richText"
               v-model="scope.row.con"
               :inline="true"
@@ -36,6 +37,7 @@
         <el-table-column v-if="isEnable(data.property.view_pinyin)" prop="con" label="拼音" width="150">
           <template slot-scope="scope">
             <RichText
+              v-if="property.isGetContent"
               ref="richText"
               v-model="scope.row.pinyin"
               :inline="true"
@@ -49,6 +51,7 @@
         <el-table-column prop="interpret" label="翻译" width="200">
           <template slot-scope="scope">
             <RichText
+              v-if="property.isGetContent"
               ref="richText"
               v-model="scope.row.interpret"
               :inline="true"
@@ -62,6 +65,7 @@
         <el-table-column prop="note" label="注释" width="200">
           <template slot-scope="scope">
             <RichText
+              v-if="property.isGetContent"
               ref="richText"
               v-model="scope.row.note"
               :inline="true"

+ 3 - 3
src/views/book/courseware/create/components/question/table/Table.vue

@@ -1,7 +1,7 @@
 <template>
   <ModuleBase ref="base" :type="data.type">
     <template #content>
-      <div class="fun-type">
+      <!-- <div class="fun-type">
         <a
           v-for="{ value, label } in tableTypeList"
           :key="value"
@@ -9,7 +9,7 @@
           @click="data.mode = value"
           >{{ label }}</a
         >
-      </div>
+      </div> -->
       <template v-if="data.mode === 'short'">
         <div class="table-rich-toolbar">
           <el-select v-model="data.styles.fontFamily" placeholder="请选择" style="width: 130px">
@@ -65,7 +65,7 @@
           <div v-for="li in item" :key="li.mark" class="table-item">
             <!-- eslint-disable max-len -->
             <RichText
-              v-if="data.mode === 'normal'"
+              v-if="property.isGetContent"
               ref="richText"
               v-model="li.content"
               :font-size="data?.unified_attrib?.font_size"

+ 1 - 1
src/views/book/courseware/data/table.js

@@ -79,7 +79,7 @@ export function getTableData() {
     option_list: Array.from({ length: 2 }, () => Array.from({ length: 3 }, getOption)),
     record_list: [],
     answer_lists: Array.from({ length: 2 }, () => Array.from({ length: 3 }, getAnswerOption)),
-    mode: tableTypeList[0].value,
+    mode: tableTypeList[1].value,
     vocabulary: '', // 用于选词的词汇
     word_list: [], // 选词列表
     styles: {

+ 8 - 0
src/views/book/courseware/preview/components/new_word/NewWordPreview.vue

@@ -448,6 +448,8 @@
                                     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 : '',
                                 }"
                                 v-if="showObj.newWord"
                                 class="NPC-word-tab-common NPC-word-tab-word"
@@ -534,6 +536,8 @@
                                     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 : '',
                                 }"
                                 v-html="convertText(sanitizeHTML(sItem.new_word))"
                               ></p>
@@ -829,6 +833,8 @@
                                 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 : '',
                             }"
                             v-if="showObj.newWord && colHasContent[1]"
                             class="NPC-word-tab-common NPC-word-tab-word"
@@ -964,6 +970,8 @@
                                 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 : '',
                             }"
                             v-html="convertText(sanitizeHTML(sItem.new_word))"
                           ></p>