Browse Source

课堂助手

SanHQin 11 months ago
parent
commit
3dc9ba5b99

File diff suppressed because it is too large
+ 1312 - 1235
src/components/classRoomHelper/component/countdown.vue


+ 13 - 9
src/components/classRoomHelper/component/languageAssistant.vue

@@ -215,21 +215,23 @@ export default {
     },
     },
     recordStart(_text) {
     recordStart(_text) {
       try {
       try {
-        this.show = true;
-        this.showIndex = 0;
+				let iiframe = this.$refs["iiframe"];
+        iiframe.contentWindow.window.document.getElementById(
+          "languageOptions"
+        ).selectedIndex = 2; //普通话
+				iiframe.contentWindow.testdoContinuousPronunciationAssessment();
+        
         // return
         // return
         var OpenCC = require("opencc-js");
         var OpenCC = require("opencc-js");
         let converter = OpenCC.Converter({
         let converter = OpenCC.Converter({
           from: "hk",
           from: "hk",
           to: "cn"
           to: "cn"
         });
         });
-        if (this.isOpen)
-          return this.$message.info("已开启语音助手,无需重复开启");
-        let iiframe = this.$refs["iiframe"];
-        iiframe.contentWindow.window.document.getElementById(
-          "languageOptions"
-        ).selectedIndex = 2; //普通话
-        iiframe.contentWindow.testdoContinuousPronunciationAssessment();
+				this.show = true;
+        this.showIndex = 0;
+				this.showTextIndex = 0;
+				this.chatLoading = false;
+				this.talkLoading = false;
         this.isOpen = true;
         this.isOpen = true;
         this.show = true;
         this.show = true;
         this.aiText = "我是可可同学,我是个小小百事通,你有什么想和我聊一聊?";
         this.aiText = "我是可可同学,我是个小小百事通,你有什么想和我聊一聊?";
@@ -331,6 +333,7 @@ export default {
                         converter("发送成功")
                         converter("发送成功")
                       ) {
                       ) {
                         this.userText = "";
                         this.userText = "";
+												this.showIndex = 0;
                       } else {
                       } else {
                         // this.$message.warning(res.data.FunctionResponse.result);
                         // this.$message.warning(res.data.FunctionResponse.result);
                         console.log(res.data.FunctionResponse.result);
                         console.log(res.data.FunctionResponse.result);
@@ -486,6 +489,7 @@ export default {
       // let _talkIndex = 0;
       // let _talkIndex = 0;
       // const md = new MarkdownIt();
       // const md = new MarkdownIt();
       this.source.onmessage = _e => {
       this.source.onmessage = _e => {
+				this.showIndex = 0;
         let _eData = JSON.parse(_e.data);
         let _eData = JSON.parse(_e.data);
         if (_eData.content.replace("'", "").replace("'", "") == "[DONE]") {
         if (_eData.content.replace("'", "").replace("'", "") == "[DONE]") {
           this.source.close();
           this.source.close();

+ 5 - 0
src/components/classRoomHelper/component/levitatedSphere.vue

@@ -107,6 +107,9 @@ export default {
       this.aiText = "您好,我是小可,有什么可以帮助您的?";
       this.aiText = "您好,我是小可,有什么可以帮助您的?";
       this.aiStatus = 0;
       this.aiStatus = 0;
       this.showIndex = 0;
       this.showIndex = 0;
+			this.showTextIndex = 0;
+			this.chatLoading = false;
+			this.talkLoading == false;
       this.show = true;
       this.show = true;
       console.log("已唤醒");
       console.log("已唤醒");
       iiframe.contentWindow.onRecognizedResult = e => {
       iiframe.contentWindow.onRecognizedResult = e => {
@@ -215,6 +218,7 @@ export default {
                       converter("发送成功")
                       converter("发送成功")
                     ) {
                     ) {
                       this.userText = "";
                       this.userText = "";
+											this.showIndex = 0;
                     } else {
                     } else {
                       // this.$message.warning(res.data.FunctionResponse.result);
                       // this.$message.warning(res.data.FunctionResponse.result);
                       console.log(res.data.FunctionResponse.result);
                       console.log(res.data.FunctionResponse.result);
@@ -371,6 +375,7 @@ export default {
       // let _talkIndex = 0;
       // let _talkIndex = 0;
       // const md = new MarkdownIt();
       // const md = new MarkdownIt();
       this.source.onmessage = _e => {
       this.source.onmessage = _e => {
+				this.showIndex = 0;
         let _eData = JSON.parse(_e.data);
         let _eData = JSON.parse(_e.data);
         if (_eData.content.replace("'", "").replace("'", "") == "[DONE]") {
         if (_eData.content.replace("'", "").replace("'", "") == "[DONE]") {
           let _result = [];
           let _result = [];

+ 17 - 4
src/components/classRoomHelper/index.vue

@@ -150,7 +150,7 @@
         </div>
         </div>
       </div>
       </div>
       <div class="ch_nav_box_bottom">
       <div class="ch_nav_box_bottom">
-        <div @click.stop="commentAndAnnotate()">
+        <div @click.stop="commentAndAnnotate()" style="z-index: 9999;">
           <el-tooltip class="item" effect="dark" content="批注" placement="top">
           <el-tooltip class="item" effect="dark" content="批注" placement="top">
             <img
             <img
               :src="require('../../assets/icon/course/edit2.svg')"
               :src="require('../../assets/icon/course/edit2.svg')"
@@ -416,7 +416,15 @@ export default {
     },
     },
     changeItemType(type) {
     changeItemType(type) {
       this.type = 0;
       this.type = 0;
-      this.openSetting();
+			
+      
+			if(this.itemType==type){
+				this.itemType = 0;
+				this.type = 1;
+				this.openSetting();
+				return;
+			}
+			this.openSetting();
       // this.$message.info("切换到"+type)
       // this.$message.info("切换到"+type)
       this.$nextTick(() => {
       this.$nextTick(() => {
         // if (this.itemType == 1 && type != 1) {
         // if (this.itemType == 1 && type != 1) {
@@ -539,8 +547,13 @@ export default {
       this.recordType = type;
       this.recordType = type;
     },
     },
     commentAndAnnotate() {
     commentAndAnnotate() {
-      this.$refs.AnnotationCanvasRef.open();
-      this.insertMemorandum(`开始使用<span class="btn">批注</span>功能`);
+			if(this.AnnotationCanvasShow){
+				this.$refs.AnnotationCanvasRef.close()
+			}else{
+				this.$refs.AnnotationCanvasRef.open();
+      	this.insertMemorandum(`开始使用<span class="btn">批注</span>功能`);
+			}
+      
     },
     },
     endCommentAndAnnotate() {
     endCommentAndAnnotate() {
       this.insertMemorandum(`结束使用<span class="btn">批注</span>功能`);
       this.insertMemorandum(`结束使用<span class="btn">批注</span>功能`);

Some files were not shown because too many files changed in this diff