Procházet zdrojové kódy

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

dsy před 1 týdnem
rodič
revize
5af7246902

+ 0 - 2
src/components/RichText.vue

@@ -65,7 +65,6 @@ export default {
     Editor,
     MathDialog,
   },
-  inject: ['getBookUnifiedAttr'],
   inheritAttrs: false,
   props: {
     inline: {
@@ -142,7 +141,6 @@ export default {
         left: 0,
       },
       id: getRandomNumber(),
-      bookUnifiedAttr: this.getBookUnifiedAttr(),
       init: {
         content_style: `
           mjx-container, mjx-container * {

+ 0 - 1
src/styles/mixin.scss

@@ -41,7 +41,6 @@
 @mixin preview-base {
   display: grid;
   gap: 6px;
-  padding: $border-component-spacing;
 
   :deep .rich-text {
     @include rich-text;

+ 0 - 1
src/styles/variables.scss

@@ -30,6 +30,5 @@ $courseware-top-padding: 65px; // 教材顶部页边距
 $courseware-bottom-padding: 65px; // 教材底部页边距
 $component-spacing: 24px; // 组件间间距
 $title-content-spacing: 65px; // 标题与内容间距
-$border-component-spacing: 10px; // 组件边框与组件内容间距
 $catalogue-width: 300px; // 目录宽度
 $sidebar-width: 300px; // 工具栏宽度

+ 1 - 0
src/views/book/courseware/preview/components/article/Practicechs.vue

@@ -476,6 +476,7 @@
                 "
                 :tm-index="index"
                 :sent-index="sentIndex"
+                :attrib="attrib"
                 @getWavblob="getWavblob"
                 @handleParentPlay="handleParentPlay"
                 @sentPause="sentPause"

+ 7 - 0
src/views/book/courseware/preview/components/h5_games/H5GamesPreview.vue

@@ -37,6 +37,13 @@ export default {
       full_type: false,
     };
   },
+  watch: {
+    'data.file_list.length': {
+      handler() {
+        this.initData();
+      },
+    },
+  },
   created() {
     this.initData();
   },

+ 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) {

+ 6 - 2
src/views/book/courseware/preview/components/new_word/components/writeTableZoom.vue

@@ -142,7 +142,7 @@
             class="definition-box"
             :style="{
               flex: '1',
-              marginTop: data.mp3_list ? '104px' : '36px',
+              marginTop: data.mp3_list || data.bg || data.ed ? '104px' : '36px',
             }"
           >
             <div v-if="data.cixing">
@@ -160,7 +160,11 @@
           class="definition-box"
           :style="{
             width:
-              !(data.collocation || data.liju_list) && data.new_word.length < 4 ? data.hz_info.length * 98 + 'px' : '',
+              !(data.collocation || data.liju_list) && data.new_word.length < 4
+                ? data.new_word.length > 2
+                  ? data.hz_info.length * 150 + 'px'
+                  : '290px'
+                : '',
             margin: !(data.collocation || data.liju_list) && data.new_word.length < 4 ? '16px auto 0 auto' : '',
           }"
         >

+ 18 - 7
src/web_preview/index.vue

@@ -250,7 +250,7 @@ export default {
     ];
 
     return {
-      book_id: this.$route.query.book_id || '',
+      projectId: this.$route.query.book_id || '',
       select_node: this.id,
       courseware_info: {
         book_name: '',
@@ -364,14 +364,25 @@ export default {
   },
   methods: {
     getBookBaseInfo() {
-      GetBookBaseInfo({ id: this.book_id }).then(({ book_info }) => {
+      GetBookBaseInfo({ id: this.projectId }).then(({ book_info }) => {
         this.courseware_info = { ...this.courseware_info, ...book_info, book_name: book_info.name };
+        if (book_info.cover_image_file_id) {
+          this.project.cover_image_file_url = book_info.cover_image_file_url;
+        }
+        if (book_info.editor) {
+          this.project.editor = book_info.editor;
+        }
+        if (book_info.cover_image_file_url) {
+          this.project.cover_image_file_url = book_info.cover_image_file_url;
+        }
       });
     },
 
     getProjectInfo() {
-      GetProjectInfo({ id: this.book_id }).then(({ project_info }) => {
-        this.project = project_info;
+      GetProjectInfo({ id: this.projectId }).then(({ project_info }) => {
+        if (project_info.cover_image_file_url) {
+          this.project = project_info;
+        }
       });
     },
 
@@ -422,7 +433,7 @@ export default {
      */
     getBookChapterStructExpandList() {
       ChapterGetBookChapterStructExpandList({
-        book_id: this.book_id,
+        book_id: this.projectId,
         node_deep_mode: 0,
         is_contain_producer: 'true',
         is_contain_auditor: 'true',
@@ -432,7 +443,7 @@ export default {
     },
 
     getBookUnifiedAttr() {
-      GetBookUnifiedAttrib({ book_id: this.book_id }).then(({ content }) => {
+      GetBookUnifiedAttrib({ book_id: this.projectId }).then(({ content }) => {
         if (content) {
           this.unified_attrib = JSON.parse(content);
         }
@@ -1115,7 +1126,7 @@ $total-width: $courseware-width + $courseware-left-margin + $courseware-right-ma
   }
 }
 
-:deep .audio-wrapper .audio-middle {
+:deep .scroll-container .audio-wrapper .audio-middle {
   width: 210px !important;
   padding: 6px 8px !important;
   border: none;