natasha 6 дней назад
Родитель
Сommit
b9361665df

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

@@ -21,6 +21,9 @@
         <div class="table-th" style="width: 110px">
           <label>生词/短语</label>
         </div>
+        <div class="table-th" style="width: 110px">
+          <label>繁体</label>
+        </div>
         <div class="table-th" style="width: 200px">
           <label>读音</label>
         </div>
@@ -63,6 +66,9 @@
         <div class="table-item" style="width: 110px">
           <el-input v-model="item.new_word" @blur="handleBlurCon(item)" />
         </div>
+        <div class="table-item" style="width: 110px">
+          <el-input v-model="item.word_traditional" />
+        </div>
         <div class="table-item" style="width: 200px">
           <template v-if="data.lrc_arr.length > 0 && data.lrc_arr[i]">
             <span class="adult-book-lable">字幕时间:</span>
@@ -206,6 +212,7 @@
         <div class="table-item" style="width: 110px">
           <el-input v-model="data.col_width[0].value" />
         </div>
+        <div class="table-item" style="width: 110px"></div>
         <div class="table-item" style="width: 200px"></div>
         <div class="table-item" style="width: 110px">
           <el-input v-model="data.col_width[1].value" />
@@ -409,6 +416,7 @@ export default {
       return {
         number: '',
         new_word: '',
+        word_traditional: '', // 繁体
         cixing: '', // 词性
         definition_list: '', // 释义
         pinyin: '',

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

@@ -163,6 +163,9 @@
           <div class="table-th" style="width: 110px">
             <label>生词/短语</label>
           </div>
+          <div class="table-th" style="width: 110px">
+            <label>繁体</label>
+          </div>
           <div class="table-th" style="width: 200px">
             <label>读音</label>
           </div>
@@ -205,6 +208,9 @@
           <div class="table-item" style="width: 110px">
             <el-input v-model="item.new_word" @blur="handleBlurCon(item)" />
           </div>
+          <div class="table-item" style="width: 110px">
+            <el-input v-model="item.word_traditional" />
+          </div>
           <div class="table-item" style="width: 200px">
             <template v-if="data.lrc_arr.length > 0 && data.lrc_arr[i]">
               <span class="adult-book-lable">字幕时间:</span>
@@ -347,6 +353,7 @@
           <div class="table-item" style="width: 110px">
             <el-input v-model="data.col_width[0].value" />
           </div>
+          <div class="table-item" style="width: 110px"></div>
           <div class="table-item" style="width: 200px"></div>
           <div class="table-item" style="width: 110px">
             <el-input v-model="data.col_width[1].value" />

+ 1 - 0
src/views/book/courseware/data/newWord.js

@@ -60,6 +60,7 @@ export function getOption() {
   return {
     number: '1',
     new_word: '',
+    word_traditional: '', // 繁体
     cixing: '', // 词性
     definition_list: '', // 释义
     pinyin: '',

+ 1 - 0
src/views/book/courseware/preview/components/article/components/WordPhraseDetail.vue

@@ -80,6 +80,7 @@
                 <AudioRed :mp3="data.audio_file_url" :attrib="attrib" :theme-color="themeColor" :bg="bg" :ed="ed" />
               </template>
             </div>
+            <p class="jieshu" style="font-family: '楷体'" v-html="data.word_traditional"></p>
             <p
               v-if="data.definition_list.length > 0"
               class="jieshu"

+ 172 - 6
src/views/book/courseware/preview/components/new_word/NewWordPreview.vue

@@ -121,6 +121,36 @@
                     <svg-icon size="16" icon-class="eye-invisible" />
                   </i>
                 </li>
+                <li v-if="isHasTraditional" @click="handleShow('traditional')">
+                  <span>繁体</span
+                  ><i
+                    v-if="showObj.traditional"
+                    slot="suffix"
+                    class="el-icon-view show-icon"
+                    size="16"
+                    :style="{
+                      color:
+                        data.unified_attrib && data.unified_attrib.topic_color
+                          ? data.unified_attrib.topic_color
+                          : '#de4444',
+                      marginLeft: '5px',
+                    }"
+                  ></i>
+                  <i
+                    v-else
+                    slot="suffix"
+                    class="show-icon"
+                    :style="{
+                      color:
+                        data.unified_attrib && data.unified_attrib.topic_color
+                          ? data.unified_attrib.topic_color
+                          : '#de4444',
+                      marginLeft: '5px',
+                    }"
+                  >
+                    <svg-icon size="16" icon-class="eye-invisible" />
+                  </i>
+                </li>
                 <li v-if="colHasContent[2]" @click="handleShow('cixing')">
                   <span>词性</span
                   ><i
@@ -526,6 +556,25 @@
                               >
                               </span>
                             </div>
+                            <span
+                              v-if="showObj.traditional && isHasTraditional"
+                              :style="{
+                                width: data.col_width[0].value + 'px',
+                                flex: !data.col_width[0].value || data.col_width[0].value === '0' ? '1' : '',
+                              }"
+                            >
+                              <p
+                                class="NPC-word-tab-common NPC-word-tab-word"
+                                :style="{
+                                  fontSize:
+                                    data.unified_attrib && data.unified_attrib.font_size
+                                      ? data.unified_attrib.font_size
+                                      : '',
+                                  fontFamily: '楷体',
+                                }"
+                                v-html="sItem.word_traditional"
+                              ></p>
+                            </span>
                             <span>
                               <p
                                 v-if="showObj.cixing"
@@ -600,6 +649,25 @@
                               </span>
                             </span>
                             <span
+                              v-if="showObj.traditional && isHasTraditional"
+                              :style="{
+                                width: data.col_width[0].value + 'px',
+                                flex: !data.col_width[0].value || data.col_width[0].value === '0' ? '1' : '',
+                              }"
+                            >
+                              <p
+                                class="NPC-word-tab-common NPC-word-tab-word"
+                                :style="{
+                                  fontSize:
+                                    data.unified_attrib && data.unified_attrib.font_size
+                                      ? data.unified_attrib.font_size
+                                      : '',
+                                  fontFamily: '楷体',
+                                }"
+                                v-html="convertText(sanitizeHTML(sItem.word_traditional))"
+                              ></p>
+                            </span>
+                            <span
                               v-if="data.property.pinyin_position == 'back' && showObj.pinyin"
                               class="NPC-word-tab-common NPC-word-tab-pinyin"
                               :style="{
@@ -1024,6 +1092,25 @@
                           </span>
                         </div>
                         <span
+                          v-if="showObj.traditional && isHasTraditional"
+                          :style="{
+                            width: data.col_width[0].value + 'px',
+                            flex: !data.col_width[0].value || data.col_width[0].value === '0' ? '1' : '',
+                          }"
+                        >
+                          <p
+                            class="NPC-word-tab-common NPC-word-tab-word"
+                            :style="{
+                              fontSize:
+                                data.unified_attrib && data.unified_attrib.font_size
+                                  ? data.unified_attrib.font_size
+                                  : '',
+                              fontFamily: '楷体',
+                            }"
+                            v-html="sItem.word_traditional"
+                          ></p>
+                        </span>
+                        <span
                           v-if="showObj.cixing && colHasContent[2]"
                           :style="{
                             width: data.col_width[2].value + 'px',
@@ -1145,6 +1232,25 @@
                           </span>
                         </span>
                         <span
+                          v-if="showObj.traditional && isHasTraditional"
+                          :style="{
+                            width: data.col_width[0].value + 'px',
+                            flex: !data.col_width[0].value || data.col_width[0].value === '0' ? '1' : '',
+                          }"
+                        >
+                          <p
+                            class="NPC-word-tab-common NPC-word-tab-word"
+                            :style="{
+                              fontSize:
+                                data.unified_attrib && data.unified_attrib.font_size
+                                  ? data.unified_attrib.font_size
+                                  : '',
+                              fontFamily: '楷体',
+                            }"
+                            v-html="sItem.word_traditional"
+                          ></p>
+                        </span>
+                        <span
                           v-if="data.property.pinyin_position == 'back' && showObj.pinyin && colHasContent[0]"
                           class="NPC-word-tab-common NPC-word-tab-pinyin"
                           :style="{
@@ -1696,7 +1802,13 @@
                             ? item.hz_info.length * 86 + 'px'
                             : '', -->
                     <div
-                      v-if="item.collocation || item.liju_list || item.definition_list || item.cixing"
+                      v-if="
+                        item.collocation ||
+                        item.liju_list ||
+                        item.definition_list ||
+                        item.cixing ||
+                        item.word_traditional
+                      "
                       class="definition_list-box"
                       :style="{
                         width: !(item.collocation || item.liju_list) && item.new_word.length < 4 ? '160px' : '',
@@ -1704,6 +1816,9 @@
                           !(item.collocation || item.liju_list) && item.new_word.length < 4 ? '16px auto 0 auto' : '',
                       }"
                     >
+                      <div v-if="item.word_traditional">
+                        <p style="font-family: '楷体'" v-html="item.word_traditional"></p>
+                      </div>
                       <template v-if="!(item.collocation || item.liju_list) || item.new_word.length >= 4">
                         <div v-if="item.cixing">
                           <p v-html="convertText(sanitizeHTML(item.cixing))"></p>
@@ -1896,6 +2011,7 @@ export default {
         shiyi: true,
         collocation: true,
         liju: true,
+        traditional: true,
       },
       colHasContent: [],
       sentIndex: 0,
@@ -1916,6 +2032,7 @@ export default {
       assessmentMode: false, // 是否开启录音评分模式
       isShowScoreBtn: false, // 是否显示评分按钮
       isRecording: false, // 整体录音是否在开启中
+      isHasTraditional: false, // 繁体列是否含有内容
     };
   },
   computed: {
@@ -1981,6 +2098,10 @@ export default {
                 }
               });
               this.rowWidth += 180;
+              if (this.isHasTraditional) {
+                // 如果有繁体列并且有内容
+                this.rowWidth += Number(this.data.col_width[0].value);
+              }
               if (this.rowWidth < this.width - 2) {
                 this.rowWidth = this.width - 2;
               }
@@ -2033,7 +2154,10 @@ export default {
             }
           });
           this.rowWidth += 180;
-
+          if (this.isHasTraditional) {
+            // 如果有繁体列并且有内容
+            this.rowWidth += Number(this.data.col_width[0].value);
+          }
           this.rowWidth += 138; // 加上评分分数的宽度
           if (this.rowWidth < this.width - 2) {
             this.rowWidth = this.width - 2;
@@ -2065,7 +2189,10 @@ export default {
             }
           });
           this.rowWidth += 180;
-
+          if (this.isHasTraditional) {
+            // 如果有繁体列并且有内容
+            this.rowWidth += Number(this.data.col_width[0].value);
+          }
           // 有评分按钮
           this.rowWidth += 50;
           if (this.isHasScore) {
@@ -2095,6 +2222,10 @@ export default {
             }
           });
           this.rowWidth += 180;
+          if (this.isHasTraditional) {
+            // 如果有繁体列并且有内容
+            this.rowWidth += Number(this.data.col_width[0].value);
+          }
           if (this.rowWidth < this.width - 2) {
             this.rowWidth = this.width - 2;
           }
@@ -2125,6 +2256,10 @@ export default {
             }
           });
           this.rowWidth += 180;
+          if (this.isHasTraditional) {
+            // 如果有繁体列并且有内容
+            this.rowWidth += Number(this.data.col_width[0].value);
+          }
           // 有评分按钮
           this.rowWidth += 50;
           if (this.isHasScore) {
@@ -2154,6 +2289,10 @@ export default {
             }
           });
           this.rowWidth += 180;
+          if (this.isHasTraditional) {
+            // 如果有繁体列并且有内容
+            this.rowWidth += Number(this.data.col_width[0].value);
+          }
           if (this.rowWidth < this.width - 2) {
             this.rowWidth = this.width - 2;
           }
@@ -2184,6 +2323,10 @@ export default {
           }
         });
         this.rowWidth += 180;
+        if (this.isHasTraditional) {
+          // 如果有繁体列并且有内容
+          this.rowWidth += Number(this.data.col_width[0].value);
+        }
         if (this.rowWidth < this.width - 2) {
           this.rowWidth = this.width - 2;
         }
@@ -2211,6 +2354,22 @@ export default {
         }
       });
       this.rowWidth += 180;
+      if (this.isHasTraditional) {
+        // 如果有繁体列并且有内容
+        this.rowWidth += Number(this.data.col_width[0].value);
+      }
+      if (this.assessmentMode) {
+        // 语音评分模式下
+        if (this.isShowScoreBtn) {
+          // 有评分按钮
+          this.rowWidth += 50;
+        }
+        if (this.isHasScore) {
+          // 有评分
+          this.rowWidth += 88;
+        }
+      }
+
       // 如果有宽度为0且有内容的列,则行宽最小为撑满
       if (this.rowWidth < this.width - 2) {
         this.rowWidth = this.width - 2;
@@ -2283,6 +2442,7 @@ export default {
       this.isHasScore = false;
       this.isShowScoreBtn = false;
       this.assessmentMode = false;
+      this.isHasTraditional = false;
       this.showObj = {
         pinyin: true,
         newWord: true,
@@ -2290,6 +2450,7 @@ export default {
         shiyi: true,
         collocation: true,
         liju: true,
+        traditional: true,
       };
       if (this.data.addCol) {
         this.data.addCol.forEach((item) => {
@@ -2303,6 +2464,10 @@ export default {
       let def_str_col = this.data.new_word_list.reduce((acc, itemss) => `${acc + itemss.definition_list}`, '');
       let collocation_col = this.data.new_word_list.reduce((acc, itemss) => `${acc + itemss.collocation}`, '');
       let liju_list_col = this.data.new_word_list.reduce((acc, itemss) => `${acc + itemss.liju_list}`, '');
+      let traditional_col = this.data.new_word_list.reduce(
+        (acc, itemss) => `${acc + (itemss.word_traditional ? itemss.word_traditional : '')}`,
+        '',
+      );
       this.colHasContent = [
         Boolean(pinyin_col),
         Boolean(new_word_col),
@@ -2311,6 +2476,7 @@ export default {
         Boolean(collocation_col),
         Boolean(liju_list_col),
       ];
+      this.isHasTraditional = Boolean(traditional_col);
       if (this.data.addCol) {
         this.data.addCol.forEach((item) => {
           let str_col = this.data.new_word_list.reduce((acc, itemss) => `${acc + itemss[item.key]}`, '');
@@ -2416,7 +2582,7 @@ export default {
           this.$set(this.multilingualTextList, item.type, chunkedArr);
         });
       }
-      // console.log(this.data);
+      console.log(this.data);
     },
     handleChangeTab() {
       this.wordShow = !this.wordShow;
@@ -3282,8 +3448,8 @@ export default {
           text-align: center;
 
           :deep .strockplayInner {
-            width: 40px;
-            height: 40px;
+            width: 42px;
+            height: 42px;
 
             .eep-strock-play-box,
             .playStorkes-btn {

+ 1 - 0
src/views/book/courseware/preview/components/new_word/components/WordPhraseDetail.vue

@@ -92,6 +92,7 @@
                 <AudioRed :mp3="data.audio_file_url" :attrib="attrib" :theme-color="themeColor" :bg="bg" :ed="ed" />
               </template>
             </div>
+            <p class="jieshu" style="font-family: '楷体'" v-html="data.word_traditional"></p>
             <p class="jieshu" v-html="convertText(sanitizeHTML(data.definition_list))"></p>
           </div>
         </div>

+ 6 - 3
src/views/book/courseware/preview/components/new_word/components/writeTableZoom.vue

@@ -163,7 +163,7 @@
           </div>
         </div>
         <div
-          v-if="data.collocation || data.liju_list || data.definition_list || data.cixing"
+          v-if="data.collocation || data.liju_list || data.definition_list || data.cixing || data.word_traditional"
           class="definition-box"
           :style="{
             width:
@@ -175,6 +175,9 @@
             margin: !(data.collocation || data.liju_list) && data.new_word.length < 4 ? '16px auto 0 auto' : '',
           }"
         >
+          <div v-if="data.word_traditional">
+            <p style="font-family: '楷体'" v-html="data.word_traditional"></p>
+          </div>
           <template v-if="!(data.collocation || data.liju_list) || data.new_word.length >= 4">
             <div v-if="data.cixing">
               <p v-html="convertText(sanitizeHTML(data.cixing))"></p>
@@ -531,8 +534,8 @@ export default {
 
           :deep .strockplayInner {
             box-sizing: border-box;
-            width: 98px;
-            height: 98px;
+            width: 100px;
+            height: 100px;
           }
 
           p {