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

生词组件高度变化事件、文本分析功能、解决文章分词问题

dsy 1 месяц назад
Родитель
Сommit
9426973cc4

+ 6 - 1
src/api/article.js

@@ -22,7 +22,7 @@ export function getWordTime(data) {
 
 // 文本分析
 export function analysSubmit(data) {
-  return http.post(`/OtherSysTool/TeachingServer/TextAnalyser/Analyse`, data);
+  return http.post(`/OtherSysTool/GCLSTeachingServer/TextAnalyser/Analyse`, data, {}, false, { newAccessToken: true });
 }
 
 // 音频转为base64流
@@ -37,3 +37,8 @@ export function getCoursewareWordExampleSentenceList(data) {
     data,
   );
 }
+
+// 得到文本分析地址
+export function getSysConfig() {
+  return http.post(`${process.env.VUE_APP_EepServer}?MethodName=sys_config_manager-GetSysConfig`);
+}

+ 1 - 1
src/components/CommonPreview.vue

@@ -729,7 +729,7 @@ export default {
 
   .audit-content {
     display: flex;
-    min-width: 1400px;
+    min-width: 1810px;
     height: calc(100vh - 175px);
 
     .remark-list {

+ 17 - 0
src/views/book/courseware/preview/CoursewarePreview.vue

@@ -28,6 +28,7 @@
                   height: grid.height,
                 }"
                 @contextmenu.native.prevent="handleContextMenu($event, grid.id)"
+                @handleHeightChange="handleHeightChange"
               />
 
               <div
@@ -394,6 +395,22 @@ export default {
         item.showAnswer(isJudgingRightWrong, isShowRightAnswer, null, disabled);
       });
     },
+    /**
+     * 处理组件高度变化事件
+     * @param {string} id 组件id
+     * @param {string} newHeight 组件的新高度
+     */
+    handleHeightChange(id, newHeight) {
+      this.data.row_list.forEach((row) => {
+        row.col_list.forEach((col) => {
+          col.grid_list.forEach((grid) => {
+            if (grid.id === id) {
+              grid.height = newHeight;
+            }
+          });
+        });
+      });
+    },
   },
 };
 </script>

+ 0 - 8
src/views/book/courseware/preview/components/article/NormalModelChs.vue

@@ -137,7 +137,6 @@
                               fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                               lineHeight:
                                 attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              display: 'inline-block',
                               backgroundColor:
                                 item.timeList &&
                                 item.timeList[pItem.sentIndex] &&
@@ -270,7 +269,6 @@
                               fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                               lineHeight:
                                 attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              display: 'inline-block',
                               width: item.wordsList[pIndex + 1].chs.trim() === '' ? '6px' : '',
                               backgroundColor:
                                 isPlaying &&
@@ -395,7 +393,6 @@
                               fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                               lineHeight:
                                 attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              display: 'inline-block',
                               width: item.wordsList[pIndex + 2].chs.trim() === '' ? '6px' : '',
                               backgroundColor:
                                 isPlaying &&
@@ -529,7 +526,6 @@
                                 fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                                 lineHeight:
                                   attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                                display: 'inline-block',
                                 width: pItem.chs[wIndex].trim() === '' ? '6px' : '',
                                 color:
                                   isPlaying &&
@@ -709,7 +705,6 @@
                                 fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                                 lineHeight:
                                   attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                                display: 'inline-block',
                                 width: pItem.chs[wIndex].trim() === '' ? '6px' : '',
                               }"
                               @click.stop="
@@ -812,7 +807,6 @@
                               fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                               lineHeight:
                                 attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              display: 'inline-block',
                               width: item.sentArr[pIndex + 1].chs.trim() === '' ? '6px' : '',
                             }"
                             @click.stop="
@@ -916,7 +910,6 @@
                               fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                               lineHeight:
                                 attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              display: 'inline-block',
                               width: item.sentArr[pIndex + 2].chs.trim() === '' ? '6px' : '',
                             }"
                             @click.stop="
@@ -1028,7 +1021,6 @@
                               fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                               lineHeight:
                                 attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              display: 'inline-block',
                               width: pItem.chs[wIndex].trim() === '' ? '6px' : '',
                             }"
                             @click.stop="

+ 0 - 8
src/views/book/courseware/preview/components/article/PhraseModelChs.vue

@@ -117,7 +117,6 @@
                               fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                               lineHeight:
                                 attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              display: 'inline-block',
                               color:
                                 newWordList.indexOf(pItem.chs) > -1 || pItem.words
                                   ? attrib
@@ -174,7 +173,6 @@
                               fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                               lineHeight:
                                 attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              display: 'inline-block',
                             }"
                             @click.stop="
                               viewNotes(
@@ -245,7 +243,6 @@
                               fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                               lineHeight:
                                 attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              display: 'inline-block',
                             }"
                             @click.stop="
                               viewNotes(
@@ -311,7 +308,6 @@
                             fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                             lineHeight:
                               attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                            display: 'inline-block',
                             color:
                               newWordList.indexOf(pItem.chs) > -1 || pItem.words
                                 ? attrib
@@ -446,7 +442,6 @@
                                 fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                                 lineHeight:
                                   attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                                display: 'inline-block',
                               }"
                               @click.stop="viewNotes($event, pItem.words ? pItem.words : pItem.chs)"
                               >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.chs[wIndex] : '' }}</span
@@ -505,7 +500,6 @@
                               fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                               lineHeight:
                                 attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              display: 'inline-block',
                             }"
                             @click.stop="
                               viewNotes(
@@ -582,7 +576,6 @@
                               fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                               lineHeight:
                                 attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              display: 'inline-block',
                             }"
                             @click.stop="
                               viewNotes(
@@ -663,7 +656,6 @@
                               fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                               lineHeight:
                                 attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              display: 'inline-block',
                             }"
                             @click.stop="viewNotes($event, pItem.words ? pItem.words : pItem.chs)"
                             >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.chs[wIndex] : '' }}</span

+ 0 - 8
src/views/book/courseware/preview/components/article/WordModelChs.vue

@@ -121,7 +121,6 @@
                               fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                               lineHeight:
                                 attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              display: 'inline-block',
                               backgroundColor:
                                 item.timeList &&
                                 item.timeList[pItem.sentIndex] &&
@@ -181,7 +180,6 @@
                               fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                               lineHeight:
                                 attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              display: 'inline-block',
                               backgroundColor:
                                 item.timeList &&
                                 item.timeList[pItem.sentIndex] &&
@@ -264,7 +262,6 @@
                               fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                               lineHeight:
                                 attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              display: 'inline-block',
                               backgroundColor:
                                 item.timeList &&
                                 item.timeList[pItem.sentIndex] &&
@@ -333,7 +330,6 @@
                             fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                             lineHeight:
                               attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                            display: 'inline-block',
                             backgroundColor:
                               item.timeList &&
                               item.timeList[pItem.sentIndex] &&
@@ -468,7 +464,6 @@
                                 fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                                 lineHeight:
                                   attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                                display: 'inline-block',
                               }"
                               >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.chs[wIndex] : '' }}</span
                             >
@@ -524,7 +519,6 @@
                               fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                               lineHeight:
                                 attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              display: 'inline-block',
                             }"
                           >
                             {{
@@ -592,7 +586,6 @@
                               fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                               lineHeight:
                                 attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              display: 'inline-block',
                             }"
                           >
                             {{
@@ -661,7 +654,6 @@
                               fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                               lineHeight:
                                 attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              display: 'inline-block',
                             }"
                             >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.chs[wIndex] : '' }}</span
                           >

+ 25 - 18
src/views/book/courseware/preview/components/article/index.vue

@@ -6,7 +6,7 @@
     <div class="main">
       <div class="NPC-ArticleView NPC-ArticleView-container">
         <div class="ArticleView-header">
-          <a class="ArticleView-full" @click="fullScreen">
+          <a class="ArticleView-full" @click="fullScreen" title="黑板模式">
             <svg-icon
               icon-class="icon-full"
               size="24"
@@ -16,15 +16,7 @@
             />
           </a>
           <div>
-            <div
-              v-if="
-                (tokenData && tokenData.popedom_code_list && tokenData.popedom_code_list.indexOf(2100001) != -1) ||
-                (tokenData && tokenData.user_type === 'APP')
-              "
-              :style="{ marginLeft: '40px' }"
-              @click="submit"
-              title="文本分析"
-            >
+            <div :style="{ marginLeft: '40px', cursor: 'pointer' }" @click="submit" title="文本分析">
               <svg-icon
                 icon-class="icon-wbfx"
                 size="24"
@@ -77,6 +69,7 @@
                     ? data.unified_attrib.topic_color
                     : '',
               }"
+              title="本课生词"
               ><svg-icon icon-class="icon-article-ci" size="24"
             /></a>
             <a
@@ -88,6 +81,7 @@
                     ? data.unified_attrib.topic_color
                     : '',
               }"
+              title="语音练习"
               ><svg-icon icon-class="icon-article-practice" size="24"
             /></a>
             <a
@@ -99,6 +93,7 @@
                     ? data.unified_attrib.topic_color
                     : '',
               }"
+              title="取词模式"
               ><svg-icon icon-class="icon-article-phrase" size="24"
             /></a>
           </div>
@@ -239,7 +234,8 @@ import Practice from './Practicechs.vue'; // 语音练习模式
 import WordModel from './WordModelChs.vue'; // 语音练习模式
 import Voicefullscreen from './Voicefullscreen.vue';
 import { getToken } from '@/utils/auth';
-import { analysSubmit, GetFileURLMap } from '@/api/app';
+import { GetFileURLMap } from '@/api/app';
+import { analysSubmit, getSysConfig } from '@/api/article';
 import NewWordPreview from '../new_word/NewWordPreview.vue';
 import NotesPreview from '../notes/NotesPreview.vue';
 
@@ -297,6 +293,7 @@ export default {
       colLength: 1,
       courseware_id: this.$route.params.id,
       multilingualTextList: {},
+      analyser_url: '',
     };
   },
   computed: {},
@@ -406,19 +403,29 @@ export default {
       return pinyin;
     },
     submit() {
+      let access_token =
+        this.tokenData && this.tokenData.gcls_sys_session_info ? this.tokenData.gcls_sys_session_info.access_token : '';
       let loading = this.$loading({
         lock: true,
         text: 'Loading',
         spinner: 'el-icon-loading',
         background: 'rgba(0, 0, 0, 0.7)',
       });
-      analysSubmit({
-        app_user_id: '',
-        text: this.data.content,
-      })
-        .then((res) => {
-          window.open(`${window.location.origin}/GCLS-TC/#/textanalysis/Result?id=${res.record.id}&type=文本分析`);
-          loading.close();
+      getSysConfig()
+        .then((ress) => {
+          analysSubmit({
+            app_user_id: '',
+            text: this.data.content,
+          })
+            .then((res) => {
+              window.open(
+                `${ress.text_analyser_page_address}GCLS-TC/#/textanalysis/Result?id=${res.record.id}&type=文本分析&AccessToken=${access_token}`,
+              );
+              loading.close();
+            })
+            .catch((res) => {
+              loading.close();
+            });
         })
         .catch((res) => {
           loading.close();

+ 0 - 4
src/views/book/courseware/preview/components/dialogue_article/NormalModelChs.vue

@@ -178,7 +178,6 @@
                                     attrib && attrib.font_size
                                       ? attrib.font_size.replace('pt', '') * 1.4 + 'pt'
                                       : '28px',
-                                  display: 'inline-block',
                                   color:
                                     pItem.chstimeList &&
                                     pItem.chstimeList[wIndex] &&
@@ -272,7 +271,6 @@
                               fontFamily: item.wordsList[pIndex + 1].config.fontFamily,
                               height:
                                 attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              display: 'inline-block',
                               color:
                                 pItem.chstimeList &&
                                 pItem.chstimeList[pItem.leg - 1] &&
@@ -375,7 +373,6 @@
                               fontFamily: item.wordsList[pIndex + 2].config.fontFamily,
                               height:
                                 attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              display: 'inline-block',
                               color:
                                 pItem.chstimeList &&
                                 pItem.chstimeList[pItem.leg - 1] &&
@@ -485,7 +482,6 @@
                                 fontFamily: pItem.config.fontFamily,
                                 height:
                                   attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                                display: 'inline-block',
                                 color:
                                   pItem.chstimeList &&
                                   pItem.chstimeList[wIndex] &&

+ 0 - 4
src/views/book/courseware/preview/components/dialogue_article/PhraseModelChs.vue

@@ -134,7 +134,6 @@
                               fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                               lineHeight:
                                 attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              display: 'inline-block',
                               color:
                                 newWordList.indexOf(pItem.chs) > -1 || pItem.words
                                   ? attrib
@@ -189,7 +188,6 @@
                               fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                               lineHeight:
                                 attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              display: 'inline-block',
                             }"
                             @click.stop="
                               viewNotes(
@@ -266,7 +264,6 @@
                               fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                               lineHeight:
                                 attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              display: 'inline-block',
                             }"
                             @click.stop="
                               viewNotes(
@@ -333,7 +330,6 @@
                             fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                             lineHeight:
                               attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                            display: 'inline-block',
                             color:
                               newWordList.indexOf(pItem.chs) > -1 || pItem.words
                                 ? attrib

+ 0 - 4
src/views/book/courseware/preview/components/dialogue_article/WordModelChs.vue

@@ -136,7 +136,6 @@
                               fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                               lineHeight:
                                 attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              display: 'inline-block',
                               color:
                                 paraIndex == pItem.paraIndex &&
                                 sentIndex == pItem.sentIndex &&
@@ -189,7 +188,6 @@
                               fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                               lineHeight:
                                 attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              display: 'inline-block',
                             }"
                             >{{
                               NumberList.indexOf(item.wordsList[pIndex + 1].pinyin) == -1
@@ -257,7 +255,6 @@
                               fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                               lineHeight:
                                 attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                              display: 'inline-block',
                             }"
                             >{{
                               NumberList.indexOf(item.wordsList[pIndex + 2].pinyin) == -1
@@ -316,7 +313,6 @@
                             fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
                             lineHeight:
                               attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
-                            display: 'inline-block',
                             color:
                               paraIndex == pItem.paraIndex &&
                               sentIndex == pItem.sentIndex &&

+ 31 - 17
src/views/book/courseware/preview/components/dialogue_article/index.vue

@@ -6,7 +6,7 @@
     <div class="main">
       <div class="NPC-ArticleView NPC-ArticleView-container">
         <div class="ArticleView-header">
-          <a class="ArticleView-full" @click="fullScreen" title="全屏">
+          <a class="ArticleView-full" @click="fullScreen" title="黑板模式">
             <svg-icon
               icon-class="icon-full"
               size="24"
@@ -16,16 +16,11 @@
             />
           </a>
           <div>
-            <div
-              v-if="
+            <!-- v-if="
                 (tokenData && tokenData.popedom_code_list && tokenData.popedom_code_list.indexOf(2100001) != -1) ||
                 (tokenData && tokenData.user_type === 'APP')
-              "
-              class="left"
-              :style="{ marginLeft: '40px' }"
-              @click="submit"
-              title="文本分析"
-            >
+              " -->
+            <div class="left" :style="{ marginLeft: '40px', cursor: 'pointer' }" @click="submit" title="文本分析">
               <!-- <img src="@/assets/wbfx-icon.png" alt="" /> -->
               <svg-icon
                 icon-class="icon-wbfx"
@@ -79,6 +74,7 @@
                     ? data.unified_attrib.topic_color
                     : '',
               }"
+              title="本课生词"
               ><svg-icon icon-class="icon-article-ci" size="24"
             /></a>
             <a
@@ -90,6 +86,7 @@
                     ? data.unified_attrib.topic_color
                     : '',
               }"
+              title="语音练习"
               ><svg-icon icon-class="icon-article-practice" size="24"
             /></a>
             <a
@@ -101,6 +98,7 @@
                     ? data.unified_attrib.topic_color
                     : '',
               }"
+              title="取词模式"
               ><svg-icon icon-class="icon-article-phrase" size="24"
             /></a>
           </div>
@@ -224,7 +222,8 @@ import Practice from './Practicechs.vue'; // 语音练习模式
 import WordModel from './WordModelChs.vue'; // 语音练习模式
 import Voicefullscreen from '../article/Voicefullscreen.vue';
 import { getToken } from '@/utils/auth';
-import { analysSubmit, GetFileURLMap } from '@/api/app';
+import { GetFileURLMap } from '@/api/app';
+import { analysSubmit, getSysConfig } from '@/api/article';
 import NewWordPreview from '../new_word/NewWordPreview.vue';
 import NotesPreview from '../notes/NotesPreview.vue';
 
@@ -284,6 +283,7 @@ export default {
       NpcNewWordMp3: [],
       colLength: 1,
       multilingualTextList: {},
+      analyser_url: '',
     };
   },
   computed: {},
@@ -393,19 +393,33 @@ export default {
       return pinyin;
     },
     submit() {
+      let access_token =
+        this.tokenData && this.tokenData.gcls_sys_session_info ? this.tokenData.gcls_sys_session_info.access_token : '';
       let loading = this.$loading({
         lock: true,
         text: 'Loading',
         spinner: 'el-icon-loading',
         background: 'rgba(0, 0, 0, 0.7)',
       });
-      analysSubmit({
-        app_user_id: '',
-        text: this.data.content,
-      })
-        .then((res) => {
-          window.open(`${window.location.origin}/GCLS-TC/#/textanalysis/Result?id=${res.record.id}&type=文本分析`);
-          loading.close();
+      getSysConfig()
+        .then((ress) => {
+          let content = '';
+          this.data.detail.forEach((item) => {
+            content += item.para + '\n';
+          });
+          analysSubmit({
+            app_user_id: '',
+            text: content,
+          })
+            .then((res) => {
+              window.open(
+                `${ress.text_analyser_page_address}GCLS-TC/#/textanalysis/Result?id=${res.record.id}&type=文本分析&AccessToken=${access_token}`,
+              );
+              loading.close();
+            })
+            .catch((res) => {
+              loading.close();
+            });
         })
         .catch((res) => {
           loading.close();

+ 16 - 2
src/views/book/courseware/preview/components/newWord_template/NewWordTemplatePreview.vue

@@ -118,7 +118,14 @@
                   />
                 </template>
                 <template v-else-if="items && items.type === 'lian'">
-                  <span class="items-lian">{{ items.con }}</span>
+                  <span
+                    class="items-lian"
+                    :style="{
+                      color:
+                        data.unified_attrib && data.unified_attrib.topic_color ? data.unified_attrib.topic_color : '',
+                    }"
+                    >{{ items.con }}</span
+                  >
                 </template>
                 <Strockplayredline
                   v-if="items && items.type === 'hanzi'"
@@ -314,7 +321,14 @@
                     />
                   </template>
                   <template v-else-if="items && items.type === 'lian'">
-                    <span class="items-lian">{{ items.con }}</span>
+                    <span
+                      class="items-lian"
+                      :style="{
+                        color:
+                          data.unified_attrib && data.unified_attrib.topic_color ? data.unified_attrib.topic_color : '',
+                      }"
+                      >{{ items.con }}</span
+                    >
                   </template>
                   <Strockplayredline
                     v-if="items && items.type === 'hanzi'"

+ 53 - 54
src/views/book/courseware/preview/components/new_word/NewWordPreview.vue

@@ -1,9 +1,9 @@
 <!-- eslint-disable vue/no-v-html -->
 <template>
-  <div class="newWord-preview" :style="getAreaStyle()">
+  <div ref="previewContainer" class="newWord-preview" :style="getAreaStyle()">
     <SerialNumberPosition v-if="isEnable(data.property.sn_display_mode)" :property="data.property" />
 
-    <div v-if="data" class="main">
+    <main v-if="data" ref="newWordMain" class="main">
       <div class="NPC-zhedie" :style="{ width: width }">
         <!-- :style="{
             backgroundColor:
@@ -13,12 +13,12 @@
           <div class="NPC-top-left">
             <span
               class="NPC-topTitle-text"
-              v-html="data.title_con"
               :style="{
                 color:
                   data.unified_attrib && data.unified_attrib.topic_color ? data.unified_attrib.topic_color : '#de4444',
                 fontSize: data.unified_attrib && data.unified_attrib.font_size ? data.unified_attrib.font_size : '',
               }"
+              v-html="data.title_con"
             ></span>
             <span v-if="showLang" class="NPC-topTitle-text">
               {{ titleTrans[getLang()] }}
@@ -693,7 +693,7 @@
         </div>
         <audio ref="newwordAudio"></audio>
       </div>
-    </div>
+    </main>
     <el-dialog title="" :visible.sync="showCard" width="100%" class="wordCard-dialog" top="0">
       <i class="el-icon-arrow-left" :class="[showIndex === 0 ? 'disabled' : '']" @click="changeShowIndex('-')"></i>
       <writeTableZoom
@@ -720,7 +720,7 @@
 </template>
 
 <script>
-import { getNewWordData, isEnable } from '@/views/book/courseware/data/newWord';
+import { getNewWordData } from '@/views/book/courseware/data/newWord';
 
 import PreviewMixin from '../common/PreviewMixin';
 import SoundRecord from '../../common/SoundRecord.vue';
@@ -746,7 +746,12 @@ export default {
     writeTableZoom,
   },
   mixins: [PreviewMixin],
-  props: ['newData'],
+  props: {
+    newData: {
+      type: Object,
+      default: null,
+    },
+  },
   data() {
     return {
       data: this.newData ? this.newData : getNewWordData(),
@@ -775,6 +780,7 @@ export default {
       width: 0,
       showCard: false, // 卡片放大
       showIndex: 0, // 卡片放大索引
+      dataHeight: 0, // 组件列表中容器高度
     };
   },
   watch: {
@@ -788,7 +794,7 @@ export default {
               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.hasOwnProperty('unified_attrib') && oldVal && !oldVal.hasOwnProperty('unified_attrib'))
+            (val && val.hasOwn('unified_attrib') && oldVal && !oldVal.hasOwn('unified_attrib'))
           ) {
             // this.wordShow = isEnable(this.data.property.is_word_show);
             this.initData();
@@ -798,10 +804,18 @@ export default {
       deep: true,
       immediate: true,
     },
+    is_list(newVal) {
+      this.$nextTick(() => {
+        const height = `${this.$refs.newWordMain.clientHeight}px`;
+        this.$emit('handleHeightChange', this.id, newVal ? this.dataHeight : height);
+      });
+    },
   },
   mounted() {
     let totalWidth = document.querySelector('.newWord-preview').offsetWidth;
     this.width = `${totalWidth - (this.data.property.sn_display_mode === 'true' ? 15 : 0)}px`;
+
+    this.dataHeight = this.$refs.previewContainer.style.height;
   },
   methods: {
     palyAudio(url, sIndex) {
@@ -821,21 +835,20 @@ export default {
         this.mp3_index = sIndex;
         node.play();
       }
-      this.handleListenPlay(sIndex);
+      this.handleListenPlay();
     },
-    handleListenPlay(sIndex) {
-      let _this = this;
+    handleListenPlay() {
       if (this.playWord) {
-        this.playWord.addEventListener('play', function () {
-          _this.playClass = 'nn';
+        this.playWord.addEventListener('play', () => {
+          this.playClass = 'nn';
         });
-        this.playWord.addEventListener('pause', function () {
-          _this.mp3_index = -1;
-          _this.playClass = '';
+        this.playWord.addEventListener('pause', () => {
+          this.mp3_index = -1;
+          this.playClass = '';
         });
-        this.playWord.addEventListener('ended', function () {
-          _this.mp3_index = -1;
-          _this.playClass = '';
+        this.playWord.addEventListener('ended', () => {
+          this.mp3_index = -1;
+          this.playClass = '';
         });
       }
     },
@@ -863,7 +876,7 @@ export default {
     },
     handlePlayVoice3(mp3) {
       let audio = document.getElementsByTagName('audio');
-      if (audio && audio.length > 0 && window.location.href.indexOf('GCLS-Learn') == -1) {
+      if (audio && audio.length > 0 && window.location.href.indexOf('GCLS-Learn') === -1) {
         audio.forEach((item) => {
           if (item.src !== mp3) {
             item.pause();
@@ -873,19 +886,19 @@ export default {
       if (!mp3) {
         return;
       }
-      if (!this.audio.paused) {
-        this.audio.pause();
-      } else {
+      if (this.audio.paused) {
         this.audio.pause();
         this.audio.load();
         this.audio.src = mp3;
         this.audio.loop = false;
         this.audio.play();
+      } else {
+        this.audio.pause();
       }
     },
     handlePlayVoice(mp3) {
       let audio = document.getElementsByTagName('audio');
-      if (audio && audio.length > 0 && window.location.href.indexOf('GCLS-Learn') == -1) {
+      if (audio && audio.length > 0 && window.location.href.indexOf('GCLS-Learn') === -1) {
         audio.forEach((item) => {
           if (item.src !== mp3) {
             item.pause();
@@ -952,13 +965,13 @@ export default {
         item.forEach((sItem, sIndex) => {
           sItem.mIndex = sIndex;
           sItem.sIndex = resIndex;
-          resIndex++;
+          resIndex += 1;
           sItem.def_str = sItem.definition_list;
           if (this.data.lrc_arr && this.data.lrc_arr[itemNumber]) {
             sItem.bg = this.data.lrc_arr[itemNumber].bg;
             sItem.ed = this.data.lrc_arr[itemNumber].ed;
           }
-          itemNumber++;
+          itemNumber += 1;
           Bookanswer[index].push({
             recordList: [],
           });
@@ -1007,9 +1020,7 @@ export default {
       this.ed = null;
     },
     handleWav(list, tmIndex, tmsIndex) {
-      tmIndex = tmIndex || 0;
-      tmsIndex = tmsIndex || 0;
-      this.$set(this.answer.answer_list[tmIndex][tmsIndex], 'recordList', list);
+      this.$set(this.answer.answer_list[tmIndex || 0][tmsIndex || 0], 'recordList', list);
     },
     // 翻面
     changeShowLeft(item) {
@@ -1019,10 +1030,10 @@ export default {
     changeShowIndex(type) {
       if (type === '+') {
         if (this.showIndex !== this.data.new_word_list.length - 1) {
-          this.showIndex++;
+          this.showIndex += 1;
         }
       } else if (this.showIndex !== 0) {
-        this.showIndex--;
+        this.showIndex -= 1;
       }
       this.$refs.writeTableZoom.changeRota();
     },
@@ -1311,26 +1322,6 @@ export default {
     }
   }
 
-  @keyframes firstrotate {
-    0% {
-      transform: rotateZ(0deg);
-    }
-
-    100% {
-      transform: rotateZ(180deg);
-    }
-  }
-
-  @keyframes huifuRotate {
-    0% {
-      transform: rotateZ(180deg);
-    }
-
-    100% {
-      transform: rotateZ(0deg);
-    }
-  }
-
   .luyin-box-wordphrase {
     height: 24px;
   }
@@ -1762,6 +1753,7 @@ export default {
   align-items: center;
 
   :deep .el-dialog {
+    background: transparent;
     box-shadow: none;
   }
 
@@ -1787,10 +1779,6 @@ export default {
     left: auto;
   }
 
-  :deep .el-dialog {
-    background: transparent;
-  }
-
   :deep .el-dialog__headerbtn {
     position: fixed;
     top: 20px;
@@ -1804,7 +1792,18 @@ export default {
   }
 }
 </style>
+
 <style lang="scss">
+@keyframes firstrotate {
+  0% {
+    transform: rotateZ(0deg);
+  }
+
+  100% {
+    transform: rotateZ(180deg);
+  }
+}
+
 .NPC-zhedie {
   .topTitle {
     display: flex;

+ 0 - 6
src/views/book/courseware/preview/components/video_interaction/VideoInteractionPreview.vue

@@ -65,7 +65,6 @@ import ExercisePreview from './ExercisePreview.vue';
 import Report from './Report.vue';
 import PreviewMixin from '../common/PreviewMixin';
 import { getVideoInteractionData } from '@/views/book/courseware/data/videoInteraction';
-import { GetFileURLMap } from '@/api/app';
 import { getConfig } from '@/utils/auth';
 export default {
   name: 'VideoInteractionPreview',
@@ -100,11 +99,6 @@ export default {
   mounted() {},
   methods: {
     initData() {
-      this.data.video_list.forEach((item) => {
-        GetFileURLMap({ file_id_list: [item.file_id] }).then(({ url_map }) => {
-          this.video_info = url_map[item.file_id];
-        });
-      });
       this.data.file_info_list = this.data.file_info_list.sort((a, b) => Number(a.currentTime) - Number(b.currentTime));
     },
     handleTimeUpdate(event) {

+ 1 - 1
src/web_preview/index.vue

@@ -871,7 +871,7 @@ $total-width: $courseware-width + $courseware-left-margin + $courseware-right-ma
 
   .audit-content {
     display: flex;
-    min-width: 1400px;
+    min-width: 1810px;
     height: calc(100vh - 46px);
 
     .left-menu {