Browse Source

表格拼音

natasha 1 month ago
parent
commit
c94fc97f8a

+ 1 - 0
src/views/book/components/MultilingualFill.vue

@@ -262,6 +262,7 @@ export default {
     .content {
       display: flex;
       column-gap: 8px;
+      word-break: break-word;
 
       .original-text {
         width: 100%;

+ 17 - 2
src/views/book/courseware/create/components/question/dialogue_article/Article.vue

@@ -737,10 +737,25 @@ export default {
     },
     handleMultilingual() {
       this.multilingualText = '';
+      let flag = false;
       this.data.detail.forEach((item) => {
-        this.multilingualText += item.para ? '<p>' + item.para + '<p>' : '<p>&nbsp;</p>';
+        // this.multilingualText += item.para ? '<p>' + item.para + '<p>' : '<p>&nbsp;</p>';
+        if (item.para) {
+          if (item.sentences && item.sentences.length > 0) {
+            flag = true;
+          }
+          item.sentences.forEach((items) => {
+            this.multilingualText += '<p>' + items + '<p>';
+          });
+        } else {
+          this.multilingualText += '<p>&nbsp;</p>';
+        }
       });
-      this.multilingualVisible = true;
+      if (flag) {
+        this.multilingualVisible = true;
+      } else {
+        this.$message.warning('请先生成分词');
+      }
     },
   },
 };

+ 10 - 2
src/views/book/courseware/create/components/question/table/Table.vue

@@ -206,7 +206,11 @@ export default {
             text += `${items.content.replace(/<[^>]+>/g, '')}\n`;
           });
         });
-        if (isEnable(val) && text) {
+        if (!isEnable(val)) {
+          this.data.paragraph_list = [];
+          return;
+        }
+        if (isEnable(val) && text && this.data.paragraph_list.length <= 0) {
           this.data.paragraph_list_parameter.text = text;
           this.data.paragraph_list_parameter.is_first_sentence_first_hz_pinyin_first_char_upper_case =
             this.data.property.is_first_sentence_first_hz_pinyin_first_char_upper_case;
@@ -223,7 +227,11 @@ export default {
             text += `${items.content.replace(/<[^>]+>/g, '')}\n`;
           });
         });
-        if (text && isEnable(this.data.property.view_pinyin)) {
+        if (!isEnable(this.data.property.view_pinyin)) {
+          this.data.paragraph_list = [];
+          return;
+        }
+        if (text && isEnable(this.data.property.view_pinyin) && this.data.paragraph_list.length <= 0) {
           this.data.paragraph_list_parameter.text = text;
           this.data.paragraph_list_parameter.is_first_sentence_first_hz_pinyin_first_char_upper_case = val;
           this.createParsedTextInfoPinyin(text);

+ 1 - 1
src/views/book/courseware/data/dialogueArticle.js

@@ -96,7 +96,7 @@ export function getArticleProperty() {
     role_img_type: 'word',
     role_list: [getRole(0), getRole(1)],
     
-    multilingual_position: multilingualList[1].value,
+    multilingual_position: multilingualList[0].value,
   };
 }