Ver código fonte

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

dsy 1 semana atrás
pai
commit
4a7e487d1e

+ 16 - 0
src/styles/index.scss

@@ -76,6 +76,22 @@ ul {
   }
 }
 
+.rich-text {
+  ul,
+  ol {
+    padding-left: 40px;
+    margin: 1em 0;
+  }
+
+  ul li {
+    list-style: disc;
+  }
+
+  ol li {
+    list-style: decimal;
+  }
+}
+
 .card {
   padding: 2em;
 }

+ 18 - 2
src/views/book/courseware/preview/components/dialogue_article/PhraseModelChs.vue

@@ -210,6 +210,10 @@
                               >
                               <span
                                 class="NNPE-chs"
+                                :class="[
+                                  newWordList.indexOf(item.wordsList[pIndex + 1].chs) > -1 ? 'newActive' : '',
+                                  item.wordsList[pIndex + 1].words ? 'newActive' : '',
+                                ]"
                                 style="text-align: left"
                                 :style="{
                                   fontFamily: item.wordsList[pIndex + 1].config.fontFamily,
@@ -217,7 +221,6 @@
                                   borderBottom:
                                     item.wordsList[pIndex + 1].config.border === 'dotted' ? '1px dotted' : '',
                                   fontWeight: item.wordsList[pIndex + 1].config.fontWeight,
-                                  color: item.wordsList[pIndex + 1].config.color,
                                   height:
                                     attrib && attrib.font_size
                                       ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
@@ -227,6 +230,12 @@
                                     attrib && attrib.font_size
                                       ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
                                       : '28px',
+                                  color:
+                                    newWordList.indexOf(pItem.chs) > -1 || pItem.words
+                                      ? attrib
+                                        ? attrib.topic_color
+                                        : item.wordsList[pIndex + 1].config.color
+                                      : item.wordsList[pIndex + 1].config.color,
                                 }"
                                 @click.stop="
                                   viewNotes(
@@ -304,6 +313,8 @@
                                   curTime <= item.timeList[pItem.sentIndex].ed
                                     ? 'wordActive'
                                     : '',
+                                  newWordList.indexOf(item.wordsList[pIndex + 2].chs) > -1 ? 'newActive' : '',
+                                  item.wordsList[pIndex + 2].words ? 'newActive' : '',
                                 ]"
                                 :style="{
                                   fontFamily: item.wordsList[pIndex + 2].config.fontFamily,
@@ -311,7 +322,6 @@
                                   borderBottom:
                                     item.wordsList[pIndex + 2].config.border === 'dotted' ? '1px dotted' : '',
                                   fontWeight: item.wordsList[pIndex + 2].config.fontWeight,
-                                  color: item.wordsList[pIndex + 2].config.color,
                                   height:
                                     attrib && attrib.font_size
                                       ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
@@ -321,6 +331,12 @@
                                     attrib && attrib.font_size
                                       ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
                                       : '28px',
+                                  color:
+                                    newWordList.indexOf(pItem.chs) > -1 || pItem.words
+                                      ? attrib
+                                        ? attrib.topic_color
+                                        : item.wordsList[pIndex + 2].config.color
+                                      : item.wordsList[pIndex + 2].config.color,
                                 }"
                                 @click.stop="
                                   viewNotes(

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

@@ -212,7 +212,7 @@
                     </p>
                   </template>
                 </div>
-                <span v-if="showLang" class="multilingual">
+                <span v-if="showLang" class="multilingual" :style="[tdStyle, computedRichStyle(col.content)]">
                   {{
                     multilingualTextList[getLang()] &&
                     multilingualTextList[getLang()][i] &&
@@ -308,22 +308,20 @@ export default {
       this.data.col_width.forEach((item) => {
         this.table_width += Number(item.value);
       });
-      if (this.showLang) {
-        this.data.multilingual.forEach((item) => {
-          let trans_arr = item.translation.split('\n');
-          let chunkSize = this.data.property.column_count;
-          let chunkedArr = trans_arr.reduce((acc, curr, index) => {
-            // 当索引是chunkSize的倍数时,开始一个新的子数组
-            if (index % chunkSize === 0) {
-              acc.push([curr]); // 开始新的子数组并添加当前元素
-            } else {
-              acc[acc.length - 1].push(curr); // 将当前元素添加到最后一个子数组中
-            }
-            return acc;
-          }, []);
-          this.$set(this.multilingualTextList, item.type, chunkedArr);
-        });
-      }
+      this.data.multilingual.forEach((item) => {
+        let trans_arr = item.translation.split('\n');
+        let chunkSize = this.data.property.column_count;
+        let chunkedArr = trans_arr.reduce((acc, curr, index) => {
+          // 当索引是chunkSize的倍数时,开始一个新的子数组
+          if (index % chunkSize === 0) {
+            acc.push([curr]); // 开始新的子数组并添加当前元素
+          } else {
+            acc[acc.length - 1].push(curr); // 将当前元素添加到最后一个子数组中
+          }
+          return acc;
+        }, []);
+        this.$set(this.multilingualTextList, item.type, chunkedArr);
+      });
       if (!this.isJudgingRightWrong) {
         this.answer.answer_list = this.data.answer_list;
       }
@@ -450,6 +448,7 @@ $border-color: #e6e6e6;
       align-items: end;
 
       p {
+        flex-grow: 1; // 为了常规模式时设置居中显示撑满整个单元格
         max-width: 100%;
         margin: 0;
       }
@@ -532,6 +531,7 @@ $border-color: #e6e6e6;
     }
 
     .multilingual {
+      display: block;
       word-break: break-word;
     }