1
0

2 Commity a6681773af ... edaebfecb9

Autor SHA1 Správa Dátum
  dsy edaebfecb9 提交 3 týždňov pred
  dsy 5af7246902 修改课文分词保存分词结果 3 týždňov pred

+ 8 - 0
src/api/article.js

@@ -29,3 +29,11 @@ export function analysSubmit(data) {
 export function fileToBase64Text(data) {
   return http.post(`/FileServer/SI?MethodName=file_store_manager-GetFileByteBase64Text`, data, {}, true);
 }
+
+// 检索课件单词的例句列表
+export function getCoursewareWordExampleSentenceList(data) {
+  return http.post(
+    `${process.env.VUE_APP_EepServer}?MethodName=book_content_manager-GetCoursewareWordExampleSentenceList_Sort`,
+    data,
+  );
+}

+ 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 - 1
src/views/book/courseware/preview/CoursewarePreview.vue

@@ -406,7 +406,7 @@ export default {
   row-gap: $component-spacing;
   width: 100%;
   height: 100%;
-  min-height: calc(100vh - 106px);
+  min-height: calc(100vh - 226px);
   padding-top: $courseware-top-padding;
   padding-bottom: $courseware-bottom-padding;
   margin: 15px 0;

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

@@ -480,6 +480,7 @@
                 @handleParentPlay="handleParentPlay"
                 @sentPause="sentPause"
                 @handleWav="handleWav"
+                :attrib="attrib"
               />
               <div v-if="curQue.mp3_list && curQue.mp3_list.length > 0" class="compare-box">
                 <Audio-compare

+ 91 - 30
src/views/book/courseware/preview/components/article/components/WordPhraseDetail.vue

@@ -145,11 +145,67 @@
                 </div>
               </div> -->
             </div>
+            <div :class="['liju', lijuPatternIndex == 1 ? 'KWIC_liju' : '']">
+              <div v-if="lijuPatternIndex == 1" class="sort_dv">
+                <!-- <span :class="['sort', sortIndex == 0 ? 'sele' : '']" @click="sortEvent(0, 'sentence_list_sort_left')">
+                  <img src="../../../../assets/NPC/analys-right.png" alt="" />
+                </span>
+                <span :class="['sort', sortIndex == 1 ? 'sele' : '']" @click="sortEvent(1, 'sentence_list_sort_mid')">
+                  <img src="../../../../assets/NPC/analys-center.png" alt="" />
+                </span>
+                <span :class="['sort', sortIndex == 2 ? 'sele' : '']" @click="sortEvent(2, 'sentence_list_sort_right')">
+                  <img src="../../../../assets/NPC/analys-left.png" alt="" />
+                </span>
+                <span class="down" @click="downloadImage">
+                  <img src="../../../../assets/NPC/download.png" alt="" />
+                </span> -->
+              </div>
+              <div class="liju_main">
+                <div v-for="(item, i) in CurrentList" :key="i">
+                  <div class="number">{{ i + 1 }}.</div>
+                  <div>
+                    <template v-if="lijuPatternIndex == 1">
+                      <el-tooltip effect="dark" placement="bottom">
+                        <div slot="content">
+                          {{ item.source_courseware_name_path }}
+                        </div>
+                        <p class="p1">
+                          {{ item.show_source_courseware_name_path }}
+                        </p>
+                      </el-tooltip>
+                      <div class="p2">
+                        <div v-for="(txt, indexs) in item.resArr" :key="indexs">
+                          <span v-for="(txts, indexs) in txt" :key="indexs" v-html="txts"></span>
+                        </div>
+                      </div>
+                      <!-- <p class="p2" v-html="item.resArr"></p> -->
+                    </template>
+                    <template v-else>
+                      <p v-html="item.res"></p>
+                      <p class="p2">
+                        {{ item.source_courseware_name_path }}
+                      </p>
+                    </template>
+                  </div>
+                </div>
+                <p
+                  v-if="CurrentList.length === 0"
+                  :style="{
+                    textAlign: 'center',
+                    fontSize: baseSizePhone - 2 + 'px',
+                    margin: '0',
+                    padding: ' 16px 0 0 24px',
+                  }"
+                >
+                  暂无例句
+                </p>
+              </div>
+            </div>
           </div>
-          <!-- <div v-if="list1 && list1.length > 0" v-loading="loading1">
+          <div v-if="list1 && list1.length > 0" v-loading="loading1">
             <div class="topTitle">
               <span>本课例句({{ list1.length }})</span>
-              <span @click="handleChangeTab('wordShow')"
+              <!-- <span @click="handleChangeTab('wordShow')"
                 >{{ wordShow ? "收起" : "展开" }}
                 <img
                   v-if="wordShow"
@@ -157,7 +213,7 @@
                   alt=""
                 />
                 <img v-else src="../../../../assets/NPC/up-black.png" alt="" />
-              </span>
+              </span> -->
             </div>
             <el-collapse-transition>
               <div class="liju" v-show="wordShow">
@@ -176,7 +232,7 @@
           <div v-if="list2 && list2.length > 0" v-loading="loading2">
             <div class="topTitle">
               <span>本书例句({{ list2.length }})</span>
-              <span @click="handleChangeTab('wordShow2')"
+              <!-- <span @click="handleChangeTab('wordShow2')"
                 >{{ wordShow2 ? "收起" : "展开" }}
                 <img
                   v-if="wordShow2"
@@ -184,7 +240,7 @@
                   alt=""
                 />
                 <img v-else src="../../../../assets/NPC/up-black.png" alt="" />
-              </span>
+              </span> -->
             </div>
             <el-collapse-transition>
               <div class="liju" v-show="wordShow2">
@@ -203,14 +259,14 @@
           <div v-if="list3 && list3.length > 0" v-loading="loading3">
             <div class="topTitle">
               <span>本套教材例句({{ list3.length }})</span>
-              <span @click="handleChangeTab('wordShow3')"
+              <!-- <span @click="handleChangeTab('wordShow3')"
                 >{{ wordShow3 ? "收起" : "展开" }}
                 <img
                   v-if="wordShow3"
                   src="../../../../assets/NPC/down-black.png"
                 />
                 <img v-else src="../../../../assets/NPC/up-black.png" alt="" />
-              </span>
+              </span> -->
             </div>
             <el-collapse-transition>
               <div class="liju" v-if="wordShow3">
@@ -225,7 +281,7 @@
                 </div>
               </div>
             </el-collapse-transition>
-          </div> -->
+          </div>
         </div>
       </div>
     </div>
@@ -236,7 +292,8 @@
 <script>
 import Strockplayredline from './Strockplayredline.vue';
 import Audio from './AudioRed.vue';
-import { GetBookWebSIContent, GetStaticResources } from '@/api/app';
+import { GetStaticResources } from '@/api/app';
+import { getCoursewareWordExampleSentenceList } from '@/api/article';
 
 export default {
   // import引入的组件需要注入到对象中才能使用
@@ -419,20 +476,19 @@ export default {
       this.loading1 = true;
       this.loading2 = true;
       this.loading3 = true;
-      let Mname = 'book-courseware_manager-GetCoursewareWordExampleSentenceList_Sort';
+      let currentTreeID = this.$route.params.id;
       // 获取本课的 本教材的 本套的 的例句
-      GetBookWebSIContent(Mname, {
-        courseware_id: this.currentTreeID, // 课件id
+      getCoursewareWordExampleSentenceList({
+        courseware_id: currentTreeID, // 课件id
         word: this.data.new_word, // 生词
         search_scope: 0, // 检索范围0 本课件  1本教材 2本套
-        is_contain_word_variants: false,
+        is_contain_word_variants: 'false',
         is_filter_repetitive_sentence: 'true',
-        book_publish_status: 1,
+        book_publish_status: -1,
         sort_mode: 'ASCENT',
         compare_mode: 'SOURCE',
         book_id_list: [],
-        is_contain_word_variants: false,
-        is_contain_stat_data: false,
+        is_contain_stat_data: 'false',
         sentence_fc_length_min: -1,
         sentence_fc_length_max: -1,
       })
@@ -472,18 +528,17 @@ export default {
             //   this.list1.sentence_list_sort_right
             // );
           }
-          GetBookWebSIContent(Mname, {
-            courseware_id: this.currentTreeID, // 课件id
+          getCoursewareWordExampleSentenceList({
+            courseware_id: currentTreeID, // 课件id
             word: this.data.new_word, // 生词
             search_scope: 1, // 检索范围0 本课件  1本教材 2本套
-            is_contain_word_variants: false,
+            is_contain_word_variants: 'false',
             is_filter_repetitive_sentence: 'true',
-            book_publish_status: 1,
+            book_publish_status: -1,
             sort_mode: 'ASCENT',
             compare_mode: 'SOURCE',
             book_id_list: [],
-            is_contain_word_variants: false,
-            is_contain_stat_data: false,
+            is_contain_stat_data: 'false',
             sentence_fc_length_min: -1,
             sentence_fc_length_max: -1,
           })
@@ -515,19 +570,17 @@ export default {
                 //   this.list2.sentence_list_sort_right
                 // );
               }
-
-              GetBookWebSIContent(Mname, {
-                courseware_id: this.currentTreeID, // 课件id
+              getCoursewareWordExampleSentenceList({
+                courseware_id: currentTreeID, // 课件id
                 word: this.data.new_word, // 生词
                 search_scope: 2, // 检索范围0 本课件  1本教材 2本套
-                is_contain_word_variants: false,
+                is_contain_word_variants: 'false',
                 is_filter_repetitive_sentence: 'true',
-                book_publish_status: 1,
+                book_publish_status: -1,
                 sort_mode: 'ASCENT',
                 compare_mode: 'SOURCE',
                 book_id_list: [],
-                is_contain_word_variants: false,
-                is_contain_stat_data: false,
+                is_contain_stat_data: 'false',
                 sentence_fc_length_min: -1,
                 sentence_fc_length_max: -1,
               })
@@ -559,7 +612,15 @@ export default {
                     //   this.list3.sentence_list_sort_right
                     // );
                   }
-                  this.CurrentList = JSON.parse(JSON.stringify(this.allList.sentence_list));
+                  this.CurrentList = JSON.parse(
+                    JSON.stringify(
+                      this.list1.sentence_list.length !== 0
+                        ? this.list1.sentence_list
+                        : this.list2.sentence_list.length !== 0
+                          ? this.list2.sentence_list
+                          : this.list3.sentence_list,
+                    ),
+                  );
                   this.loading3 = false;
                 })
                 .catch((err) => {

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

@@ -463,7 +463,6 @@ export default {
         // _this.mp3Url = _this.word.detail.mp3_list[0].id;
       }
       this.word.detail.mp3Url = this.mp3Url;
-      console.log(this.word.detail);
       if (_this.word.detail.definition_list && _this.word.detail.definition_list.length > 0) {
         // _this.word.detail.definition_list.forEach((item) => {
         if (/^[\u4E00-\u9FA5]+$/.test(_this.word.detail.definition_list)) {

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

+ 82 - 22
src/views/book/courseware/preview/components/new_word/components/WordPhraseDetail.vue

@@ -154,6 +154,62 @@
                 </div>
               </div> -->
             </div>
+            <div :class="['liju', lijuPatternIndex == 1 ? 'KWIC_liju' : '']">
+              <div v-if="lijuPatternIndex == 1" class="sort_dv">
+                <!-- <span :class="['sort', sortIndex == 0 ? 'sele' : '']" @click="sortEvent(0, 'sentence_list_sort_left')">
+                  <img src="../../../../assets/NPC/analys-right.png" alt="" />
+                </span>
+                <span :class="['sort', sortIndex == 1 ? 'sele' : '']" @click="sortEvent(1, 'sentence_list_sort_mid')">
+                  <img src="../../../../assets/NPC/analys-center.png" alt="" />
+                </span>
+                <span :class="['sort', sortIndex == 2 ? 'sele' : '']" @click="sortEvent(2, 'sentence_list_sort_right')">
+                  <img src="../../../../assets/NPC/analys-left.png" alt="" />
+                </span>
+                <span class="down" @click="downloadImage">
+                  <img src="../../../../assets/NPC/download.png" alt="" />
+                </span> -->
+              </div>
+              <div class="liju_main">
+                <div v-for="(item, i) in CurrentList" :key="i">
+                  <div class="number">{{ i + 1 }}.</div>
+                  <div>
+                    <template v-if="lijuPatternIndex == 1">
+                      <el-tooltip effect="dark" placement="bottom">
+                        <div slot="content">
+                          {{ item.source_courseware_name_path }}
+                        </div>
+                        <p class="p1">
+                          {{ item.show_source_courseware_name_path }}
+                        </p>
+                      </el-tooltip>
+                      <div class="p2">
+                        <div v-for="(txt, indexs) in item.resArr" :key="indexs">
+                          <span v-for="(txts, indexs) in txt" :key="indexs" v-html="txts"></span>
+                        </div>
+                      </div>
+                      <!-- <p class="p2" v-html="item.resArr"></p> -->
+                    </template>
+                    <template v-else>
+                      <p v-html="item.res"></p>
+                      <p class="p2">
+                        {{ item.source_courseware_name_path }}
+                      </p>
+                    </template>
+                  </div>
+                </div>
+                <p
+                  v-if="CurrentList.length === 0"
+                  :style="{
+                    textAlign: 'center',
+                    fontSize: baseSizePhone - 2 + 'px',
+                    margin: '0',
+                    padding: ' 16px 0 0 24px',
+                  }"
+                >
+                  暂无例句
+                </p>
+              </div>
+            </div>
           </div>
         </div>
       </div>
@@ -165,7 +221,7 @@
 <script>
 import Strockplayredline from './Strockplayredline.vue';
 import Audio from '../../voice_matrix/components/AudioRed.vue';
-import { GetBookWebSIContent } from '@/api/app';
+import { getCoursewareWordExampleSentenceList } from '@/api/article';
 
 export default {
   // import引入的组件需要注入到对象中才能使用
@@ -316,20 +372,19 @@ export default {
       this.loading1 = true;
       this.loading2 = true;
       this.loading3 = true;
-      let Mname = 'book-courseware_manager-GetCoursewareWordExampleSentenceList_Sort';
+      let currentTreeID = this.$route.params.id;
       // 获取本课的 本教材的 本套的 的例句
-      GetBookWebSIContent(Mname, {
-        courseware_id: this.currentTreeID, // 课件id
+      getCoursewareWordExampleSentenceList({
+        courseware_id: currentTreeID, // 课件id
         word: this.data.new_word, // 生词
         search_scope: 0, // 检索范围0 本课件  1本教材 2本套
-        is_contain_word_variants: false,
+        is_contain_word_variants: 'false',
         is_filter_repetitive_sentence: 'true',
-        book_publish_status: 1,
+        book_publish_status: -1,
         sort_mode: 'ASCENT',
         compare_mode: 'SOURCE',
         book_id_list: [],
-        is_contain_word_variants: false,
-        is_contain_stat_data: false,
+        is_contain_stat_data: 'false',
         sentence_fc_length_min: -1,
         sentence_fc_length_max: -1,
       })
@@ -369,18 +424,17 @@ export default {
             //   this.list1.sentence_list_sort_right
             // );
           }
-          GetBookWebSIContent(Mname, {
-            courseware_id: this.currentTreeID, // 课件id
+          getCoursewareWordExampleSentenceList({
+            courseware_id: currentTreeID, // 课件id
             word: this.data.new_word, // 生词
             search_scope: 1, // 检索范围0 本课件  1本教材 2本套
-            is_contain_word_variants: false,
+            is_contain_word_variants: 'false',
             is_filter_repetitive_sentence: 'true',
-            book_publish_status: 1,
+            book_publish_status: -1,
             sort_mode: 'ASCENT',
             compare_mode: 'SOURCE',
             book_id_list: [],
-            is_contain_word_variants: false,
-            is_contain_stat_data: false,
+            is_contain_stat_data: 'false',
             sentence_fc_length_min: -1,
             sentence_fc_length_max: -1,
           })
@@ -412,19 +466,17 @@ export default {
                 //   this.list2.sentence_list_sort_right
                 // );
               }
-
-              GetBookWebSIContent(Mname, {
-                courseware_id: this.currentTreeID, // 课件id
+              getCoursewareWordExampleSentenceList({
+                courseware_id: currentTreeID, // 课件id
                 word: this.data.new_word, // 生词
                 search_scope: 2, // 检索范围0 本课件  1本教材 2本套
-                is_contain_word_variants: false,
+                is_contain_word_variants: 'false',
                 is_filter_repetitive_sentence: 'true',
-                book_publish_status: 1,
+                book_publish_status: -1,
                 sort_mode: 'ASCENT',
                 compare_mode: 'SOURCE',
                 book_id_list: [],
-                is_contain_word_variants: false,
-                is_contain_stat_data: false,
+                is_contain_stat_data: 'false',
                 sentence_fc_length_min: -1,
                 sentence_fc_length_max: -1,
               })
@@ -456,7 +508,15 @@ export default {
                     //   this.list3.sentence_list_sort_right
                     // );
                   }
-                  this.CurrentList = JSON.parse(JSON.stringify(this.allList.sentence_list));
+                  this.CurrentList = JSON.parse(
+                    JSON.stringify(
+                      this.list1.sentence_list.length !== 0
+                        ? this.list1.sentence_list
+                        : this.list2.sentence_list.length !== 0
+                          ? this.list2.sentence_list
+                          : this.list3.sentence_list,
+                    ),
+                  );
                   this.loading3 = false;
                 })
                 .catch((err) => {

+ 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' : '',
           }"
         >

+ 19 - 8
src/web_preview/index.vue

@@ -100,7 +100,7 @@
         </aside>
       </div>
 
-      <div class="back-top" @click="backTop">
+      <div v-if="!sidebarShow" class="back-top" @click="backTop">
         <img :src="require(`@/assets/icon/back-top.png`)" alt="返回顶部" />
       </div>
 
@@ -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;