Selaa lähdekoodia

校对文章句首拼音

natasha 3 päivää sitten
vanhempi
commit
0c93bbd9f1

+ 8 - 7
src/views/book/courseware/create/components/question/article/Article.vue

@@ -125,7 +125,7 @@
               :key="windex + '-' + wIndex"
               class="text-item"
               :style="{
-                textAlign: windex === 0 && wIndex === 0 ? 'left' : '',
+                textAlign: wIndex === 0 ? 'left' : '',
               }"
             >
               <span
@@ -134,11 +134,9 @@
                   fontSize: articleAttrib.pinyin_size,
                 }"
                 v-if="isEnable(data.property.view_pinyin)"
-                @click="selectItem(wItem)"
+                @click="selectItem(wItem, wIndex)"
                 >{{
-                  windex === 0 &&
-                  wIndex === 0 &&
-                  data.property.is_first_sentence_first_hz_pinyin_first_char_upper_case === 'true'
+                  wIndex === 0 && data.property.is_first_sentence_first_hz_pinyin_first_char_upper_case === 'true'
                     ? wItem.pinyin_up
                     : wItem.pinyin
                 }}</span
@@ -177,7 +175,7 @@
           <div class="content">
             <div class="words-box">
               <span class="pinyin">
-                {{ itemActive.pinyin }}
+                {{ itemActiveIndex === 0 ? itemActive.pinyin_up : itemActive.pinyin }}
               </span>
               <span class="words">
                 {{ itemActive.chs }}
@@ -396,6 +394,7 @@ export default {
       visible: false,
       subtitleList: [],
       itemActive: null,
+      itemActiveIndex: null,
       dialogFlag: false,
       checkPinyinInput: '',
       oldInput: '',
@@ -1122,8 +1121,9 @@ export default {
         });
       }
     },
-    selectItem(item) {
+    selectItem(item, index) {
       this.itemActive = item;
+      this.itemActiveIndex = index;
       this.pinyinList = [];
       toolGetWordPinyinCorrectionList({
         word: item.chs,
@@ -1193,6 +1193,7 @@ export default {
             this.checkPinyinInput = str.trim();
 
             this.itemActive.pinyin = this.checkPinyinInput.replace(/\s+/g, '');
+            this.itemActive.pinyin_up = this.checkPinyinInput.replace(/\s+/g, '');
             this.$message.success('保存成功');
             // this.itemActive = null;
             this.checkPinyinInput = '';

+ 8 - 5
src/views/book/courseware/create/components/question/dialogue_article/Article.vue

@@ -135,7 +135,7 @@
                       :key="windex + '-' + wIndex"
                       class="text-item"
                       :style="{
-                        textAlign: windex === 0 && wIndex === 0 ? 'left' : '',
+                        textAlign: wIndex === 0 ? 'left' : '',
                       }"
                     >
                       <span
@@ -144,9 +144,8 @@
                         :style="{
                           fontSize: articleAttrib.pinyin_size,
                         }"
-                        @click="selectItem(wItem)"
+                        @click="selectItem(wItem, wIndex)"
                         >{{
-                          windex === 0 &&
                           wIndex === 0 &&
                           data.property.is_first_sentence_first_hz_pinyin_first_char_upper_case === 'true'
                             ? wItem.pinyin_up
@@ -289,7 +288,7 @@
           <div class="contents">
             <div class="words-box">
               <span class="pinyin">
-                {{ itemActive.pinyin }}
+                {{ itemActiveIndex === 0 ? itemActive.pinyin_up : itemActive.pinyin }}
               </span>
               <span class="words">
                 {{ itemActive.chs }}
@@ -592,6 +591,8 @@ export default {
       visible: false,
       subtitleList: [],
       itemActive: null,
+      itemActiveIndex: null,
+
       dialogFlag: false,
       checkPinyinInput: '',
       oldInput: '',
@@ -1573,8 +1574,9 @@ export default {
         });
       }
     },
-    selectItem(item) {
+    selectItem(item, index) {
       this.itemActive = item;
+      this.itemActiveIndex = index;
       this.pinyinList = [];
       toolGetWordPinyinCorrectionList({
         word: item.chs,
@@ -1644,6 +1646,7 @@ export default {
             this.checkPinyinInput = str.trim();
 
             this.itemActive.pinyin = this.checkPinyinInput.replace(/\s+/g, '');
+            this.itemActive.pinyin_up = this.checkPinyinInput.replace(/\s+/g, '');
             this.$message.success('保存成功');
             // this.itemActive = null;
             this.checkPinyinInput = '';