Quellcode durchsuchen

语音矩阵 拼音+英文 问题修复

dusenyao vor 3 Jahren
Ursprung
Commit
d8cca25843
2 geänderte Dateien mit 12 neuen und 13 gelöschten Zeilen
  1. 1 1
      package.json
  2. 11 12
      src/components/Adult/preview/VoiceMatrix.vue

+ 1 - 1
package.json

@@ -16,7 +16,7 @@
     "dependencies": {
         "@tinymce/tinymce-vue": "^3.2.2",
         "awe-dnd": "^0.3.4",
-        "axios": "0.18.1",
+        "axios": "^0.23.0",
         "core-js": "3.6.5",
         "element-ui": "^2.13.2",
         "he-tree-vue": "^2.0.10",

+ 11 - 12
src/components/Adult/preview/VoiceMatrix.vue

@@ -396,12 +396,7 @@ export default {
       this.selectedLine = { type: "", index: -1 };
       this.selectCell = { row, column };
       // 设置录音文件名
-      let { type, text, sentence_data } = this.curQue.voiceMatrix.matrix[row][
-        column
-      ];
-      this.fileName = `${type === "text" ? text : ""}${
-        type === "SentenceSegwordChs" ? sentence_data.sentence : ""
-      }`;
+      this.setRecordingFileName(row, column);
       if (!this.hasSelectedCell) this.handleParentPlay();
     },
 
@@ -413,12 +408,16 @@ export default {
         this.curQue.voiceMatrix.matrix[row][column].lrc_data
       );
       // 设置录音文件名
-      let { type, text, sentence_data } = this.curQue.voiceMatrix.matrix[row][
+      this.setRecordingFileName(row, column);
+    },
+
+    setRecordingFileName(row, column) {
+      let { type, text, sentence_data, pinyin_english_data } = this.curQue.voiceMatrix.matrix[row][
         column
       ];
-      this.fileName = `${type === "text" ? text : ""}${
-        type === "SentenceSegwordChs" ? sentence_data.sentence : ""
-      }`;
+      if (type === 'text') this.fileName = text;
+      if (type === 'SentenceSegwordChs') this.fileName = sentence_data.sentence;
+      if (type === 'PinyinEnglish') this.fileName = pinyin_english_data.pinyin;
     },
 
     checkboxMouseenter(isSelected, type) {
@@ -460,7 +459,7 @@ export default {
       if (type.length > 0 && index >= 0 && type === "row") {
         this.curQue.voiceMatrix.matrix[index].forEach(item => {
           if (
-            item.type === "SentenceSegwordChs" ||
+            item.type === "SentenceSegwordChs" || item.type === 'PinyinEnglish' ||
             (item.type === "text" && item.text.length > 0)
           ) {
             this.lrcArray.push(item.lrc_data);
@@ -474,7 +473,7 @@ export default {
         this.curQue.voiceMatrix.matrix.forEach(item => {
           let data = item[index];
           if (
-            data.type === "SentenceSegwordChs" ||
+            data.type === "SentenceSegwordChs" || data.type === 'PinyinEnglish' ||
             (data.type === "text" && data.text.length > 0)
           ) {
             this.lrcArray.push(data.lrc_data);