Parcourir la source

对话课文保留英文中间的空白分词

natasha il y a 1 mois
Parent
commit
ee93ee3701

+ 8 - 0
src/views/book/courseware/preview/components/dialogue_article/NormalModelChs.vue

@@ -281,6 +281,7 @@
                                           attrib && attrib.font_size
                                             ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
                                             : '28px',
+                                        whiteSpace: pItem.chs[wIndex].trim() === '' ? 'pre' : '', // 保留空白分词
                                       }"
                                       @click.stop="
                                         viewNotes(
@@ -354,6 +355,7 @@
                                           attrib && attrib.font_size
                                             ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
                                             : '28px',
+                                        whiteSpace: pItem.chs[wIndex].trim() === '' ? 'pre' : '', // 保留空白分词
                                       }"
                                       @click.stop="
                                         viewNotes(
@@ -486,6 +488,7 @@
                                       attrib && attrib.font_size
                                         ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
                                         : '28px',
+                                    whiteSpace: item.wordsList[pIndex + 1].chs.trim() === '' ? 'pre' : '', // 保留空白分词
                                   }"
                                   @click.stop="
                                     viewNotes(
@@ -546,6 +549,7 @@
                                       attrib && attrib.font_size
                                         ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
                                         : '28px',
+                                    whiteSpace: item.wordsList[pIndex + 1].chs.trim() === '' ? 'pre' : '', // 保留空白分词
                                   }"
                                   @click.stop="
                                     viewNotes(
@@ -688,6 +692,7 @@
                                       attrib && attrib.font_size
                                         ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
                                         : '28px',
+                                    whiteSpace: item.wordsList[pIndex + 2].chs.trim() === '' ? 'pre' : '', // 保留空白分词
                                   }"
                                   @click.stop="
                                     viewNotes(
@@ -748,6 +753,7 @@
                                       attrib && attrib.font_size
                                         ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
                                         : '28px',
+                                    whiteSpace: item.wordsList[pIndex + 2].chs.trim() === '' ? 'pre' : '', // 保留空白分词
                                   }"
                                   @click.stop="
                                     viewNotes(
@@ -895,6 +901,7 @@
                                         attrib && attrib.font_size
                                           ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
                                           : '28px',
+                                      whiteSpace: pItem.chs[wIndex].trim() === '' ? 'pre' : '', // 保留空白分词
                                     }"
                                     @click.stop="
                                       viewNotes(
@@ -966,6 +973,7 @@
                                         attrib && attrib.font_size
                                           ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
                                           : '28px',
+                                      whiteSpace: pItem.chs[wIndex].trim() === '' ? 'pre' : '', // 保留空白分词
                                     }"
                                     @click.stop="
                                       viewNotes(

+ 8 - 0
src/views/book/courseware/preview/components/dialogue_article/PhraseModelChs.vue

@@ -246,6 +246,7 @@
                                         : pItem.matchNotesObj.con && pItem.matchNotesObj.notesColor
                                           ? pItem.matchNotesObj.notesColor
                                           : pItem.config.color,
+                                    whiteSpace: pItem.chs.trim() === '' ? 'pre' : '', // 保留空白分词
                                   }"
                                   @click.stop="viewNotes($event, pItem.words ? pItem.words : pItem.chs, pItem)"
                                   >{{ convertText(pItem.chs) }}</span
@@ -280,6 +281,7 @@
                                         : pItem.matchNotesObj.con && pItem.matchNotesObj.notesColor
                                           ? pItem.matchNotesObj.notesColor
                                           : pItem.config.color,
+                                    whiteSpace: pItem.chs.trim() === '' ? 'pre' : '', // 保留空白分词
                                   }"
                                   @click.stop="viewNotes($event, pItem.words ? pItem.words : pItem.chs, pItem)"
                                   >{{ convertText(pItem.chs) }}</span
@@ -372,6 +374,7 @@
                                             item.wordsList[pIndex + 1].matchNotesObj.notesColor
                                           ? item.wordsList[pIndex + 1].matchNotesObj.notesColor
                                           : item.wordsList[pIndex + 1].config.color,
+                                    whiteSpace: item.wordsList[pIndex + 1].chs.trim() === '' ? 'pre' : '', // 保留空白分词
                                   }"
                                   @click.stop="
                                     viewNotes(
@@ -418,6 +421,7 @@
                                             item.wordsList[pIndex + 1].matchNotesObj.notesColor
                                           ? item.wordsList[pIndex + 1].matchNotesObj.notesColor
                                           : item.wordsList[pIndex + 1].config.color,
+                                    whiteSpace: item.wordsList[pIndex + 1].chs.trim() === '' ? 'pre' : '', // 保留空白分词
                                   }"
                                   @click.stop="
                                     viewNotes(
@@ -539,6 +543,7 @@
                                             item.wordsList[pIndex + 2].matchNotesObj.notesColor
                                           ? item.wordsList[pIndex + 2].matchNotesObj.notesColor
                                           : item.wordsList[pIndex + 2].config.color,
+                                    whiteSpace: item.wordsList[pIndex + 2].chs.trim() === '' ? 'pre' : '', // 保留空白分词
                                   }"
                                   @click.stop="
                                     viewNotes(
@@ -592,6 +597,7 @@
                                             item.wordsList[pIndex + 2].matchNotesObj.notesColor
                                           ? item.wordsList[pIndex + 2].matchNotesObj.notesColor
                                           : item.wordsList[pIndex + 2].config.color,
+                                    whiteSpace: item.wordsList[pIndex + 2].chs.trim() === '' ? 'pre' : '', // 保留空白分词
                                   }"
                                   @click.stop="
                                     viewNotes(
@@ -694,6 +700,7 @@
                                       : pItem.matchNotesObj.con && pItem.matchNotesObj.notesColor
                                         ? pItem.matchNotesObj.notesColor
                                         : pItem.config.color,
+                                  whiteSpace: pItem.chs.trim() === '' ? 'pre' : '', // 保留空白分词
                                 }"
                                 @click.stop="viewNotes($event, pItem.words ? pItem.words : pItem.chs, pItem)"
                                 >{{ convertText(pItem.chs) }}</span
@@ -730,6 +737,7 @@
                                       : pItem.matchNotesObj.con && pItem.matchNotesObj.notesColor
                                         ? pItem.matchNotesObj.notesColor
                                         : pItem.config.color,
+                                  whiteSpace: pItem.chs.trim() === '' ? 'pre' : '', // 保留空白分词
                                 }"
                                 @click.stop="viewNotes($event, pItem.words ? pItem.words : pItem.chs, pItem)"
                                 >{{ convertText(pItem.chs) }}</span

+ 4 - 0
src/views/book/courseware/preview/components/dialogue_article/Practicechs.vue

@@ -278,6 +278,7 @@
                                         attrib
                                           ? attrib.topic_color
                                           : pItem.config.color,
+                                      whiteSpace: pItem.chs[wIndex].trim() === '' ? 'pre' : '', // 保留空白分词
                                     }"
                                     >{{
                                       NumberList.indexOf(pItem.pinyin) == -1 ? convertText(pItem.chs[wIndex]) : ''
@@ -368,6 +369,7 @@
                                       attrib
                                         ? attrib.topic_color
                                         : item.sentArr[pIndex + 1].config.color,
+                                    whiteSpace: item.sentArr[pIndex + 1].chs.trim() === '' ? 'pre' : '', // 保留空白分词
                                   }"
                                 >
                                   {{
@@ -471,6 +473,7 @@
                                       attrib
                                         ? attrib.topic_color
                                         : item.sentArr[pIndex + 2].config.color,
+                                    whiteSpace: item.sentArr[pIndex + 2].chs.trim() === '' ? 'pre' : '', // 保留空白分词
                                   }"
                                 >
                                   {{
@@ -577,6 +580,7 @@
                                       attrib
                                         ? attrib.topic_color
                                         : pItem.config.color,
+                                    whiteSpace: pItem.chs[wIndex].trim() === '' ? 'pre' : '', // 保留空白分词
                                   }"
                                   >{{
                                     NumberList.indexOf(pItem.chs[wIndex]) == -1 ? convertText(pItem.chs[wIndex]) : ''

+ 4 - 0
src/views/book/courseware/preview/components/dialogue_article/WordModelChs.vue

@@ -213,6 +213,7 @@
                                     attrib
                                       ? attrib.topic_color
                                       : '',
+                                  whiteSpace: pItem.chs.trim() === '' ? 'pre' : '', // 保留空白分词
                                 }"
                                 >{{ NumberList.indexOf(pItem.pinyin) == -1 ? convertText(pItem.chs) : '' }}</span
                               >
@@ -267,6 +268,7 @@
                                     attrib && attrib.font_size
                                       ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
                                       : '28px',
+                                  whiteSpace: item.wordsList[pIndex + 1].chs.trim() === '' ? 'pre' : '', // 保留空白分词
                                 }"
                                 >{{
                                   NumberList.indexOf(item.wordsList[pIndex + 1].pinyin) == -1
@@ -343,6 +345,7 @@
                                     attrib && attrib.font_size
                                       ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
                                       : '28px',
+                                  whiteSpace: item.wordsList[pIndex + 2].chs.trim() === '' ? 'pre' : '', // 保留空白分词
                                 }"
                                 >{{
                                   NumberList.indexOf(item.wordsList[pIndex + 2].pinyin) == -1
@@ -416,6 +419,7 @@
                                   attrib
                                     ? attrib.topic_color
                                     : '',
+                                whiteSpace: pItem.chs.trim() === '' ? 'pre' : '', // 保留空白分词
                               }"
                               @click="showWordDetail($event, pItem)"
                               >{{ NumberList.indexOf(pItem.pinyin) == -1 ? convertText(pItem.chs) : '' }}</span