Sfoglia il codice sorgente

Merge branch 'master' of http://60.205.254.193:3000/GCLS/eep_page

dsy 1 mese fa
parent
commit
c3973677c8

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

@@ -75,7 +75,7 @@
               v-model="articleAttrib.font_size"
               placeholder="请选择"
               style="width: 130px"
-              @change="data.unified_attrib.font_size = articleAttrib.font_size"
+              @change="handleChangeStyles('fontSize')"
             >
               <el-option
                 v-for="(value, index) in 16"
@@ -554,7 +554,7 @@ export default {
   created() {},
   methods: {
     // 全局样式变化
-    handleChangeStyles() {
+    handleChangeStyles(type) {
       if (this.articleAttrib.font !== this.data.other_attrib.oldFont) {
         this.data.other_attrib.oldFont = this.articleAttrib.font;
         this.data.detail.forEach((item) => {
@@ -582,6 +582,10 @@ export default {
             this.articleAttrib.align === 'RIGHT' ? 'right' : this.articleAttrib.align === 'MIDDLE' ? 'center' : 'left';
         });
       }
+      if (type === 'fontSize') {
+        this.data.unified_attrib.font_size = this.articleAttrib.font_size;
+        this.data.unified_attrib.font = this.articleAttrib.font;
+      }
     },
     // 解析输入内容
     handleChangeContent() {

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

@@ -155,7 +155,7 @@
             :inline="true"
             toolbar="fontselect fontsizeselect forecolor backcolor | underline | bold italic strikethrough alignleft aligncenter alignright"
             :font-size="unifiedAttrib?.font_size"
-            :font-family="unifiedAttrib?.font"
+            :font-family="'楷体'"
             :font-color="unifiedAttrib?.text_color"
           />
         </div>
@@ -168,7 +168,7 @@
             :placeholder="'多条例句用回车'"
             toolbar="fontselect fontsizeselect forecolor backcolor | underline | bold italic strikethrough alignleft aligncenter alignright"
             :font-size="unifiedAttrib?.font_size"
-            :font-family="unifiedAttrib?.font"
+            :font-family="'楷体'"
             :font-color="unifiedAttrib?.text_color"
           />
         </div>

+ 4 - 1
src/views/book/courseware/create/components/question/dialogue_article/Article.vue

@@ -16,7 +16,10 @@
             v-model="articleAttrib.font_size"
             placeholder="请选择"
             style="width: 130px"
-            @change="data.unified_attrib.font_size = articleAttrib.font_size"
+            @change="
+              data.unified_attrib.font_size = articleAttrib.font_size;
+              data.unified_attrib.font = articleAttrib.font;
+            "
           >
             <el-option
               v-for="(value, index) in 16"

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

@@ -296,7 +296,7 @@
               v-model="item.collocation"
               :inline="true"
               :font-size="data?.unified_attrib?.font_size"
-              :font-family="data?.unified_attrib?.font"
+              :font-family="'楷体'"
               :font-color="data?.unified_attrib?.text_color"
               toolbar="fontselect fontsizeselect forecolor backcolor | underline | bold italic strikethrough alignleft aligncenter alignright"
             />
@@ -307,7 +307,7 @@
               ref="richText"
               v-model="item.liju_list"
               :font-size="data?.unified_attrib?.font_size"
-              :font-family="data?.unified_attrib?.font"
+              :font-family="'楷体'"
               :font-color="data?.unified_attrib?.text_color"
               :inline="true"
               :placeholder="'多条例句用回车'"

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

@@ -456,10 +456,13 @@ export default {
     'data.unified_attrib': {
       handler(val) {
         if (val) {
-          this.data.styles.fontFamily = this.data?.unified_attrib?.font || '楷体,微软雅黑';
-          this.data.styles.fontSize = this.data?.unified_attrib?.font_size || '12pt';
-          this.data.styles.fontColor = this.data?.unified_attrib?.text_color || '#1d2129';
-          this.data.styles.textAlign = this.data?.unified_attrib?.align || '';
+          this.attrib = JSON.parse(JSON.stringify(val));
+          if (this.property.isSilentPropertyWatch && !this.data.styles.fontFamily) {
+            this.data.styles.fontFamily = this.attrib.font ? this.attrib.font : '楷体,微软雅黑';
+            this.data.styles.fontSize = this.attrib.font_size ? this.attrib.font_size : '12pt';
+            this.data.styles.fontColor = this.attrib.text_color ? this.attrib.text_color : '#1d2129';
+            this.data.styles.textAlign = this.attrib.align ? this.attrib.align : '';
+          }
         }
       },
       deep: true,
@@ -833,13 +836,14 @@ export default {
     async saveOptionWord(saveArr, rowIndex, colIndex) {
       const option = this.data.option_list[rowIndex]?.[colIndex];
       if (!option) return;
-      const { parsed_text } = await this.createParsedTextInfoPinyin(
+      const { parsed_text, rich_text } = await this.createParsedTextInfoPinyin(
         option.content,
         rowIndex,
         colIndex,
         'option_list',
         saveArr,
-      ).then(({ rich_text }) => {
+      );
+      if (rich_text) {
         let list = rich_text.text_list;
         list.forEach((item) => {
           let inputIndex = 0;
@@ -866,7 +870,7 @@ export default {
           }
         });
         this.$set(this.data.option_list[rowIndex][colIndex], 'rich_text_list', list);
-      });
+      }
       this.$set(this.optionWordDataMap, option.mark, buildWordProofreadData(parsed_text?.paragraph_list || []));
       this.$set(this.optionWordDataSourceMap, option.mark, option.content || '');
     },

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

@@ -93,9 +93,9 @@ export function getTableData() {
     vocabulary: '', // 用于选词的词汇
     word_list: [], // 选词列表
     styles: {
-      fontFamily: 'Arial',
-      fontSize: '12pt',
-      fontColor: '#1d2129',
+      fontFamily: '',
+      fontSize: '',
+      fontColor: '',
       bgColor: '',
       isUnderline: false,
       isBold: false,

+ 7 - 10
src/views/book/courseware/preview/components/new_word/NewWordPreview.vue

@@ -449,7 +449,7 @@
                                 v-html="sItem.pinyin"
                               >
                               </span>
-
+                              <!-- fontFamily: data.unified_attrib && data.unified_attrib.font ? data.unified_attrib.font : '', -->
                               <span
                                 v-if="showObj.newWord"
                                 :style="{
@@ -457,8 +457,7 @@
                                     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 : '',
+                                  fontFamily: '楷体',
                                 }"
                                 class="NPC-word-tab-common NPC-word-tab-word"
                                 v-html="convertText(sanitizeHTML(sItem.new_word))"
@@ -544,8 +543,7 @@
                                     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 : '',
+                                  fontFamily: '楷体',
                                 }"
                                 v-html="convertText(sanitizeHTML(sItem.new_word))"
                               ></p>
@@ -845,8 +843,7 @@
                                 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 : '',
+                              fontFamily: '楷体',
                             }"
                             class="NPC-word-tab-common NPC-word-tab-word"
                             v-html="convertText(sanitizeHTML(sItem.new_word))"
@@ -981,8 +978,7 @@
                                 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 : '',
+                              fontFamily: '楷体',
                             }"
                             v-html="convertText(sanitizeHTML(sItem.new_word))"
                           ></p>
@@ -2315,7 +2311,8 @@ export default {
       font-family: 'robot', '楷体', 'alabo';
       font-size: 16px;
       font-weight: 400;
-      line-height: 24px;
+
+      // line-height: 24px;
       color: rgba(0, 0, 0, 65%);
     }
   }

+ 15 - 3
src/views/book/courseware/preview/components/table/TablePreview.vue

@@ -62,6 +62,7 @@
                           :class="[
                             index === 0 ? 'pinyin-text-left' : '',
                             item.type === 'audio' ? 'pinyin-text-audio' : '',
+                            item.type === 'newline' ? 'pinyin-text-br' : '',
                           ]"
                         >
                           <!-- 文字块:包含 word_list -->
@@ -88,7 +89,9 @@
                                   }"
                                 >
                                   <span class="pinyin" :style="getPinyinStyle(word)">
-                                    {{ word.pinyin.trim() ? word.pinyin : '&nbsp;' }}</span
+                                    {{
+                                      word.pinyin.trim() && word.showPinyin !== 'false' ? word.pinyin : '&nbsp;'
+                                    }}</span
                                   >
                                   <span class="py-char" :style="getCharStyle(word, item)">{{
                                     convertText(word.text)
@@ -240,6 +243,7 @@
                           :class="[
                             index === 0 ? 'pinyin-text-left' : '',
                             item.type === 'audio' ? 'pinyin-text-audio' : '',
+                            item.type === 'newline' ? 'pinyin-text-br' : '',
                           ]"
                         >
                           <!-- 文字块:包含 word_list -->
@@ -575,6 +579,7 @@
                             :class="[
                               index === 0 ? 'pinyin-text-left' : '',
                               item.type === 'audio' ? 'pinyin-text-audio' : '',
+                              item.type === 'newline' ? 'pinyin-text-br' : '',
                             ]"
                           >
                             <!-- 文字块:包含 word_list -->
@@ -601,7 +606,7 @@
                                     }"
                                   >
                                     <span class="pinyin" :style="getPinyinStyle(word)">{{
-                                      word.pinyin.trim() ? word.pinyin : '&nbsp;'
+                                      word.pinyin.trim() && word.showPinyin !== 'false' ? word.pinyin : '&nbsp;'
                                     }}</span>
                                     <span class="py-char" :style="getCharStyle(word, item)">{{
                                       convertText(word.text)
@@ -682,6 +687,7 @@
                             :class="[
                               index === 0 ? 'pinyin-text-left' : '',
                               item.type === 'audio' ? 'pinyin-text-audio' : '',
+                              item.type === 'newline' ? 'pinyin-text-br' : '',
                             ]"
                           >
                             <!-- 文字块:包含 word_list -->
@@ -1797,7 +1803,8 @@ $border-color: #e6e6e6;
     .pinyin-text {
       display: flex;
       flex-direction: column;
-      padding: 0 1px;
+
+      // padding: 0 1px;
       font-size: 16px;
 
       span {
@@ -1868,6 +1875,11 @@ $border-color: #e6e6e6;
       .pinyin-text-audio {
         width: 100%;
       }
+
+      .pinyin-text-br {
+        width: 100%;
+        font-size: 0;
+      }
     }
 
     :deep .el-input--small .el-input__inner {