Browse Source

课文校对拼音保存空拼音

natasha 1 month ago
parent
commit
f6fb627a24

+ 10 - 1
src/views/book/courseware/create/components/question/article/Article.vue

@@ -1252,7 +1252,15 @@ export default {
     },
     surePinyin() {
       this.oldInput = JSON.parse(JSON.stringify(this.checkPinyinInput.trim()));
-      this.handleReplaceTone(this.checkPinyinInput.trim());
+      if (this.oldInput) {
+        this.handleReplaceTone(this.checkPinyinInput.trim());
+      } else {
+        this.itemActive.pinyin = ' ';
+        this.itemActive.pinyin_up = ' ';
+        this.$message.success('保存成功');
+        // this.itemActive = null;
+        this.dialogFlag = false;
+      }
     },
     handleReplaceTone(e) {
       let _this = this;
@@ -1669,6 +1677,7 @@ export default {
   .pinyin {
     display: block;
     font-family: 'PINYIN-B';
+    white-space: pre;
   }
 
   .word {

+ 7 - 1
src/views/book/courseware/create/components/question/article/CheckWord.vue

@@ -311,7 +311,13 @@ export default {
     },
     surePinyin() {
       this.oldInput = JSON.parse(JSON.stringify(this.checkPinyinInput.trim()));
-      this.handleReplaceTone(this.checkPinyinInput.trim());
+      if (this.oldInput) {
+        this.handleReplaceTone(this.checkPinyinInput.trim());
+      } else {
+        this.ArticelData[this.itemActive.saveIndex].pinyin = ' ';
+        this.itemActive.pinyin = ' ';
+        this.savePinyin();
+      }
     },
     handleReplaceTone(e) {
       let _this = this;

+ 11 - 1
src/views/book/courseware/create/components/question/dialogue_article/Article.vue

@@ -1700,7 +1700,16 @@ export default {
     },
     surePinyin() {
       this.oldInput = JSON.parse(JSON.stringify(this.checkPinyinInput.trim()));
-      this.handleReplaceTone(this.checkPinyinInput.trim());
+
+      if (this.oldInput) {
+        this.handleReplaceTone(this.checkPinyinInput.trim());
+      } else {
+        this.itemActive.pinyin = ' ';
+        this.itemActive.pinyin_up = ' ';
+        this.$message.success('保存成功');
+        // this.itemActive = null;
+        this.dialogFlag = false;
+      }
     },
     handleReplaceTone(e) {
       let _this = this;
@@ -2052,6 +2061,7 @@ export default {
   .pinyin {
     display: block;
     font-family: 'PINYIN-B';
+    white-space: pre;
   }
 
   .word {

+ 6 - 1
src/views/book/courseware/create/components/question/image_text/CheckWord.vue

@@ -183,7 +183,12 @@ export default {
     },
     surePinyin() {
       this.oldInput = JSON.parse(JSON.stringify(this.checkPinyinInput.trim()));
-      this.handleReplaceTone(this.checkPinyinInput.trim());
+      if (this.oldInput) {
+        this.handleReplaceTone(this.checkPinyinInput.trim());
+      } else {
+        this.itemActive.pinyin = ' ';
+        this.savePinyin();
+      }
     },
     handleReplaceTone(e) {
       let _this = this;