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

修改课文分词保存分词结果

natasha 1 неделя назад
Родитель
Сommit
357e457791

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

@@ -174,6 +174,7 @@ export default {
                   this.data.detail[index].segList = list;
                   this.setWordsList(list, index);
                   if (index === result.length - 1) {
+                    this.handleSenWord();
                     this.loading = false;
                   }
                 })

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

@@ -463,6 +463,7 @@ export default {
                   let list = res.data.result.list;
                   items.segList = list;
                   this.setWordsList(list, indexs);
+                  this.handleSenWord();
                 })
                 .catch(() => {
                   this.loading = false;

+ 4 - 8
src/views/book/courseware/preview/components/new_word/NewWordPreview.vue

@@ -780,7 +780,8 @@ export default {
               oldVal &&
               oldVal.new_word_list[0].new_word &&
               val.new_word_list[0].new_word !== oldVal.new_word_list[0].new_word) ||
-            (val && val.new_word_list[0].new_word && !oldVal)
+            (val && val.new_word_list[0].new_word && !oldVal) ||
+            (val && val.hasOwnProperty('unified_attrib') && oldVal && !oldVal.hasOwnProperty('unified_attrib'))
           ) {
             // this.wordShow = isEnable(this.data.property.is_word_show);
             this.initData();
@@ -792,13 +793,8 @@ export default {
     },
   },
   mounted() {
-    this.width = `${
-      document.querySelector('.preview-main').offsetWidth -
-      200 -
-      20 -
-      (this.data.property.sn_display_mode === 'true' ? 15 : 0) -
-      (this.newData ? 16 : 0)
-    }px`;
+    let totalWidth = document.querySelector('.newWord-preview').offsetWidth;
+    this.width = `${totalWidth - (this.data.property.sn_display_mode === 'true' ? 15 : 0) - (this.newData ? 16 : 0)}px`;
   },
   methods: {
     palyAudio(url, sIndex) {