Pārlūkot izejas kodu

文本分析功能

natasha 1 mēnesi atpakaļ
vecāks
revīzija
fa1f2e70f0

+ 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流
@@ -34,3 +34,8 @@ export function fileToBase64Text(data) {
 export function getCoursewareWordExampleSentenceList(data) {
   return http.post(`${process.env.VUE_APP_EepServer}?MethodName=book_content_manager-GetCoursewareWordExampleSentenceList_Sort`, data);
 }
+
+// 得到文本分析地址
+export function getSysConfig() {
+  return http.post(`${process.env.VUE_APP_EepServer}?MethodName=sys_config_manager-GetSysConfig`);
+}

+ 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="

+ 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] &&

+ 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'"

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