Просмотр исходного кода

带拼音分词间间距为6px

natasha 3 недель назад
Родитель
Сommit
fd17e5a994

+ 3 - 3
src/views/book/courseware/preview/components/article/Practicechs.vue

@@ -1840,9 +1840,9 @@ export default {
             }
           }
 
-          // &.padding {
-          //   padding-right: 6px;
-          // }
+          &.padding {
+            padding: 0 3px;
+          }
         }
       }
 

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

@@ -1687,9 +1687,9 @@ export default {
             }
           }
 
-          // &.padding {
-          //   padding-right: 6px;
-          // }
+          &.padding {
+            padding: 0 3px;
+          }
         }
       }
 

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

@@ -78,6 +78,14 @@
                               v-for="(word, wIndex) in item.word_list"
                               :key="wIndex"
                               class="pinyin-text"
+                              :class="[
+                                word.text.trim() && chsFhList.indexOf(word.text) === -1 ? 'pinyin-text-padding' : '',
+                                item.word_list[wIndex + 1] &&
+                                item.word_list[wIndex + 1].text.trim() &&
+                                chsFhList.indexOf(item.word_list[wIndex + 1].text.trim()) > -1
+                                  ? 'pinyin-text-padding-left'
+                                  : '',
+                              ]"
                               :style="item.styleObj"
                             >
                               <span v-if="word.type === 'text'">
@@ -595,6 +603,14 @@
                                 v-for="(word, wIndex) in item.word_list"
                                 :key="wIndex"
                                 class="pinyin-text"
+                                :class="[
+                                  word.text.trim() && chsFhList.indexOf(word.text) === -1 ? 'pinyin-text-padding' : '',
+                                  item.word_list[wIndex + 1] &&
+                                  item.word_list[wIndex + 1].text.trim() &&
+                                  chsFhList.indexOf(item.word_list[wIndex + 1].text.trim()) > -1
+                                    ? 'pinyin-text-padding-left'
+                                    : '',
+                                ]"
                                 :style="item.styleObj"
                               >
                                 <span v-if="word.type === 'text'">
@@ -924,6 +940,7 @@ export default {
       writeMark: '',
       isHasInput: false,
       statusList: ['normal', 'tick', 'cross'],
+      chsFhList: [',', '。', '”', ':', '》', '?', '!', ';', '#', '、', '’', ')', '〕', '〕〕', '〉'],
     };
   },
   computed: {
@@ -1825,6 +1842,14 @@ $border-color: #e6e6e6;
           // text-align: left;
         }
       }
+
+      &-padding {
+        padding: 0 3px;
+      }
+
+      &-padding-left {
+        padding: 0 0 0 3px;
+      }
     }
 
     .cell-wrap-content {