SanHQin 7 months ago
parent
commit
2481797eb0

BIN
src/assets/icon/course/404.png


File diff suppressed because it is too large
+ 0 - 0
src/assets/icon/course/phone.svg


+ 16 - 6
src/components/classRoomHelper/component/languageAssistant.vue

@@ -363,6 +363,8 @@ export default {
       this.source.onmessage = _e => {
         let _eData = JSON.parse(_e.data);
         if (_eData.content.replace("'", "").replace("'", "") == "[DONE]") {
+					this.source.close();
+					this.source = null;
           let _result = [];
           if ("result" in _eData) {
             _result = _eData.result;
@@ -380,8 +382,7 @@ export default {
             if (!this.talkLoading) this.talkText();
           }
           this.chatLoading = false;
-          this.source.close();
-					this.source = null;
+          
         } else {
           // _talkIndex+=1;
           let _text = _eData.content.replace("'", "").replace("'", "");
@@ -436,15 +437,24 @@ export default {
     stopTalk() {
 			// return this.$message.info("停止")
       this.talkTextList = [];
-      let _talkTextIiframe2 = this.$refs.iiframe2;
+      try {
+				let _talkTextIiframe2 = this.$refs.iiframe2;
+			_talkTextIiframe2.contentWindow.pausesynthesizer();
       _talkTextIiframe2.contentWindow.closesynthesizer();
-      _talkTextIiframe2.contentWindow.pausesynthesizer();
-      this.talkLoading = false;
+			this.talkLoading = false;
+			} catch (error) {
+				this.talkLoading = false;
+			}
+      
     },
 		interrupt(){
 			// return this.$message.info("打断")
 			if(this.source){
-				this.source.close()
+				try {
+					this.source.close()
+				} catch (error) {
+					console.log(error)
+				}
 			}
 			this.stopTalk();
 			

+ 44 - 12
src/components/classRoomHelper/component/searchArea.vue

@@ -56,6 +56,7 @@
                   style="width: 130px;height: 130px;object-fit: cover;"
                   :src="i.image"
                   alt=""
+									@error="setDefaultSrc"
                   @click="previewImg(i.image)"
                 />
 
@@ -596,6 +597,12 @@
           />
           <div v-else @click.stop="stopSend()">停止</div>
         </div>
+
+				<div class="s_b_btn2" @click.stop="openPhone">
+					<img
+            :src="require('../../../assets/icon/course/phone.svg')"
+          />
+				</div>
       </div>
     </div>
 
@@ -979,6 +986,13 @@ export default {
     }
   },
   methods: {
+		openPhone(){
+			// this.$message.info("打开电话面板")
+			this.$parent.changeItemType(4)
+		},
+		setDefaultSrc(e){
+			e.target.src = require('../../../assets/icon/course/404.png')
+		},
     refresh(item) {
       this.send(item.content);
     },
@@ -1748,14 +1762,14 @@ ${_atList
       // this.source = new EventSource(
       //   `https://claude3.cocorobo.cn/streamChat/${_uid}`
       // );
-      this.source = new EventSource(
+      let source = new EventSource(
         `https://gpt4.cocorobo.cn/question/${_uid}`
       );
       // this.source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
       let _allText = "";
       let _mdText = "";
       this.scrollBottom();
-      this.source.onmessage = _e => {
+      source.onmessage = _e => {
         if (_e.data.replace("'", "").replace("'", "") == "[DONE]") {
           //对话已经完成
           _mdText = _mdText.replace("_", "");
@@ -1765,8 +1779,7 @@ ${_atList
           const regex = /\[\s*{[^]*}\s*\]/;
           const match = _mdText.match(regex);
           let _result = match[0];
-          this.source.close();
-          this.chatLoading = false;
+          source.close();
           this.chatList.find(i => i.uid == _uid).aiContent = JSON.parse(
             _result
           );
@@ -1872,7 +1885,6 @@ ${_atList
       this.send(text);
     },
     getWantSearch() {
-      this.chatLoading = true;
       let _uuid = uuidv4();
 
       let _msg = `
@@ -1955,12 +1967,12 @@ Instruction: Based on the context, follow "Format example", write content
         // .post("https://claude3.cocorobo.cn/chat", params)
         .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", params)
         .then(res => {
-          console.log(res);
+          // console.log(res);
           let _data = res.data.FunctionResponse.message;
           _data = _data.replaceAll("```json", "").replaceAll("```", "");
           const match = _data.match(/\[\s*{[^]*}\s*\]/);
-          console.log(_data);
-          console.log(match);
+          // console.log(_data);
+          // console.log(match);
           this.chatList.find(i => i.uid == _uuid).aiContent = JSON.parse(
             match[0]
           );
@@ -1968,7 +1980,7 @@ Instruction: Based on the context, follow "Format example", write content
           this.chatList.find(i => i.uid == _uuid).isShowSynchronization = true;
           this.chatList.find(i => i.uid == _uuid).loading = false;
           this.scrollBottom();
-          this.chatLoading = false;
+          // this.chatLoading = false;
         })
         .catch(e => {
           this.chatLoading = false;
@@ -2069,10 +2081,11 @@ Instruction: Based on the context, follow "Format example", write content
         .then(res => {
           console.log(res);
           let _data = res.data.FunctionResponse.message;
-          console.log(_data);
+          
           _data = _data.replaceAll("```json", "").replaceAll("```", "");
-
-          this.chatList.find(i => i.uid == _uuid).aiContent = JSON.parse(_data);
+					const match = _data.match(/\[\s*{[^]*}\s*\]/);
+					console.log(match[0]);
+          this.chatList.find(i => i.uid == _uuid).aiContent = JSON.parse(match[0]);
           this.chatList.find(i => i.uid == _uuid).isalltext = true;
           this.chatList.find(i => i.uid == _uuid).isShowSynchronization = true;
           this.chatList.find(i => i.uid == _uuid).loading = false;
@@ -3176,6 +3189,25 @@ ${_wordData}
   height: 30px;
 }
 
+.s_b_btn2 {
+  width: 40px;
+  height: 40px;
+  background-color: #fff;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  border-radius: 50%;
+  cursor: pointer;
+	box-sizing: 0 0 2px 2px gray;
+	margin-left:10px;
+}
+
+
+.s_b_btn2 > img {
+  width: 30px;
+  height: 30px;
+}
+
 .s_b_atBox {
   width: 95%;
   height: 450px;

+ 29 - 9
src/components/classRoomHelper/index.vue

@@ -191,7 +191,7 @@
           </el-tooltip>
 				</div>
 
-				<div @click.stop="changeItemType(4)" :class="[itemType == 4?'ch_nav_box_middle_item_active':'']">
+				<!-- <div @click.stop="changeItemType(4)" :class="[itemType == 4?'ch_nav_box_middle_item_active':'']">
 					<el-tooltip
             class="item"
             effect="dark"
@@ -200,6 +200,18 @@
           >
             <img v-if="itemType != 4" :src="require('../../assets/icon/course/robot.svg')" />
 						<img v-else :src="require('../../assets/icon/course/robot2.svg')" />
+          </el-tooltip>
+				</div> -->
+
+				<div @click.stop="startAssistant()" :class="[recordType==1?'ch_nav_box_middle_item_active':'']">
+					<el-tooltip
+            class="item"
+            effect="dark"
+            :content="recordType==0?'开启语音助手':'关闭语音助手'"
+            placement="top"
+          >
+            <img v-if="recordType!=1" :src="require('../../assets/icon/course/robot.svg')" />
+						<img v-else :src="require('../../assets/icon/course/robot2.svg')" />
           </el-tooltip>
 				</div>
 
@@ -237,8 +249,8 @@
         </div>
       </div>
     </div>
-    <!-- <levitatedSphere ref="levitatedSphereRef" @startTime="startTime" /> -->
-    <!-- <timepiece ref="timepieceRef" /> -->
+    <levitatedSphere ref="levitatedSphereRef" @startTime="startTime" />
+    <timepiece ref="timepieceRef" />
 		<AnnotationCanvas ref="AnnotationCanvasRef"/>
   </div>
 </template>
@@ -247,8 +259,8 @@
 import searchArea from "./component/searchArea.vue";
 import taskArea from "./component/taskArea.vue";
 // import dialogArea from "./component/dialogArea.vue";
-// import levitatedSphere from "./component/levitatedSphere.vue";
-// import timepiece from "./component/timepiece.vue";
+import levitatedSphere from "./component/levitatedSphere.vue";
+import timepiece from "./component/timepiece.vue";
 import countdown from "./component/countdown.vue";
 import AnnotationCanvas from './component/AnnotationCanvas.vue'
 import languageAssistant from "./component/languageAssistant.vue";
@@ -258,8 +270,8 @@ export default {
     searchArea,
     taskArea,
     // dialogArea,
-    // levitatedSphere,
-    // timepiece,
+    levitatedSphere,
+    timepiece,
 		countdown,
 		AnnotationCanvas,
 		languageAssistant
@@ -333,7 +345,8 @@ export default {
     changeItemType(type) {
       this.type = 0;
       this.openSetting();
-      this.$nextTick(() => {
+			// this.$message.info("切换到"+type)
+			this.$nextTick(() => {
         // if (this.itemType == 1 && type != 1) {
         //   this.$refs.searchAreaRef.scrollBottom();
         //   this.$refs.searchAreaRef.getWantSearch();
@@ -343,6 +356,9 @@ export default {
         //   this.$refs.dialogAreaRef.scrollBottom();
         // }
         this.itemType = type;
+				if(this.itemType==4 && this.recordType==1){//关闭悬浮语音助手
+					this.$refs.levitatedSphereRef.stopRecord();
+				}
       });
     },
     //计时
@@ -391,7 +407,11 @@ export default {
     startAssistant() {
 			if(this.recordLoading)return this.$message.info("请稍等...")
 			this.recordLoading = true;
-      if (this.recordType == 0) {
+			if (this.recordType == 0) {
+				if(this.itemType==4){
+					this.itemType = 0;
+					this.type = 0;
+				}				
 			// this.$message.info("开启")
 				// this.changeRecordType(1)
         this.$refs.levitatedSphereRef.recordStart();

+ 1 - 1
src/components/easy2/studyStudent.vue

@@ -227,7 +227,7 @@
       <div class="body_student" :style="{width: mlDialog ? 'calc(100% - '+classRoomHelperWidth+' - 20% - 40px)' : 'calc(100% - '+classRoomHelperWidth+' - 10px)', left: mlDialog ? 'calc(20% + 35px)' : '10px' }">
         <div class="new_topFixed" :style="{width: mlDialog ? 'calc(100% - '+classRoomHelperWidth+' - 20% - 40px)' : 'calc(100% - '+classRoomHelperWidth+' - 10px)', left: mlDialog ? 'calc(20% + 35px)' : '10px' }"></div>
         <div class="new_top" :style="{width: mlDialog ? 'calc(100% - '+classRoomHelperWidth+' - 20% - 40px)' : 'calc(100% - '+classRoomHelperWidth+' - 10px)', left: mlDialog ? 'calc(20% + 35px)' : '10px' }">
-          <div class="courseIndex" :style="{width: orgArray.includes(org) ? '100%' : 'calc(100% - 745px)'}">
+          <div class="courseIndex" :style="{width: (orgArray.includes(org) || oidArray.includes(oid)) ? '100%' : 'calc(100% - 745px)'}">
             <div>任务{{ taskCount + 1 }}</div>
             <el-tooltip
               effect="light"

+ 1 - 1
src/components/easy3/studyStudent.vue

@@ -227,7 +227,7 @@
       <div class="body_student" :style="{width: mlDialog ? 'calc(100% - '+classRoomHelperWidth+' - 20% - 40px)' : 'calc(100% - '+classRoomHelperWidth+' - 10px)', left: mlDialog ? 'calc(20% + 35px)' : '10px' }">
         <div class="new_topFixed" :style="{width: mlDialog ? 'calc(100% - '+classRoomHelperWidth+' - 20% - 40px)' : 'calc(100% - '+classRoomHelperWidth+' - 10px)', left: mlDialog ? 'calc(20% + 35px)' : '10px' }"></div>
         <div class="new_top" :style="{width: mlDialog ? 'calc(100% - '+classRoomHelperWidth+' - 20% - 40px)' : 'calc(100% - '+classRoomHelperWidth+' - 10px)', left: mlDialog ? 'calc(20% + 35px)' : '10px' }">
-          <div class="courseIndex" :style="{width: orgArray.includes(org) ? '100%' : 'calc(100% - 745px)'}">
+          <div class="courseIndex" :style="{width: (orgArray.includes(org) || oidArray.includes(oid)) ? '100%' : 'calc(100% - 745px)'}">
             <div>任务{{ taskCount + 1 }}</div>
             <el-tooltip
               effect="light"

+ 92 - 2
src/components/studyStudent.vue

@@ -228,6 +228,7 @@
                       <div v-if="t.tool == 26">课程设计</div>
                       <div v-if="t.tool == 62">交互视频</div>
                       <div v-if="t.tool == 71">AI智能体</div>
+											
                     </div>
                   </div>
                 </div>
@@ -240,7 +241,7 @@
       <div class="body_student" :style="{width: mlDialog ? 'calc(100% - '+classRoomHelperWidth+' - 20% - 40px)' : 'calc(100% - '+classRoomHelperWidth+' - 10px)', left: mlDialog ? 'calc(20% + 35px)' : '10px' }">
         <div class="new_topFixed" :style="{width: mlDialog ? 'calc(100% - '+classRoomHelperWidth+' - 20% - 40px)' : 'calc(100% - '+classRoomHelperWidth+' - 10px)', left: mlDialog ? 'calc(20% + 35px)' : '10px' }"></div>
         <div class="new_top" :style="{width: mlDialog ? 'calc(100% - '+classRoomHelperWidth+' - 20% - 40px)' : 'calc(100% - '+classRoomHelperWidth+' - 10px)', left: mlDialog ? 'calc(20% + 35px)' : '10px' }">
-          <div class="courseIndex" :style="{width: orgArray.includes(org) ? '100%' : 'calc(100% - 745px)'}">
+          <div class="courseIndex" :style="{width: (orgArray.includes(org) || oidArray.includes(oid)) ? '100%' : 'calc(100% - 745px)'}">
             <div>任务{{ taskCount + 1 }}</div>
             <el-tooltip
               effect="light"
@@ -12359,10 +12360,71 @@ export default {
 			},
       classRoomHelperWidth: '85px',
 			orgArray:['1973f6c7-1561-11ee-91d8-005056b86db5','777559d2-7239-11ee-b98c-005056b86db5','884c5665-a453-46f3-b7b6-01d575290aa9','0fec3a8a-ad04-11ed-b13d-005056b86db5','c9a6de59-8b4f-4be1-8565-a08081f649d3'],
-      oidArray:['f297fbdc-f0a0-11ee-b534-005056b86db5','45facc0a-1211-11ec-80ad-005056b86db5']
+      oidArray:['f297fbdc-f0a0-11ee-b534-005056b86db5','45facc0a-1211-11ec-80ad-005056b86db5'],
+			toolsList:{
+    58: "模拟驾驶",
+    59: "路径搜索",
+    60: "深度学习",
+    10: "倒计时",
+    65: "挑人",
+    7: "思维网格",
+    1: "电子白板",
+    52: "文档",
+    3: "思维导图",
+    48: "表格",
+    49: "学生分组",
+    4: "卷调查",
+    45: "选择题",
+    15: "问答",
+    16: "作业提交",
+    50: "批量上传",
+    41: "选择匹配",
+    47: "排序",
+    40: "个人评价",
+    18: "训练平台",
+    21: "AIoT Blockly",
+    23: "AI Python",
+    24: "AI Blockly",
+    32: "源码编辑",
+    57: "CocoPi",
+    63: "海龟编程",
+    28: "翻译",
+    31: "数字画板",
+    39: "GeoGebra",
+    66: "公式编辑",
+    67: "分子结构",
+    68: "时间轴",
+    69: "英语写作",
+    70: "英语口语",
+    25: "目标管理",
+    26: "课程设计",
+    62: "交互视频",
+    71: "AI智能体"
+}
     };
   },
   methods: {
+		insertMemorandum(_html){//保存行为操作
+			return;
+			//variable
+			//btn
+			let params = [{
+				uid:this.userid,
+				courseId:this.id,
+				content:_html
+			}]
+
+			this.ajax.post(this.$store.state.api+'insert_systemOperation_countdownBehavior',params).then(res=>{
+				if(res.data==1){
+					console.log('保存操作成功')
+				}else{
+					console.log('保存操作失败')
+				}
+			}).catch(e=>{
+				console.log('保存操作失败')
+				console.log(e)
+			})
+		},
     gx(){
       this.$forceUpdate();
     },
@@ -12633,10 +12695,21 @@ export default {
           a.scrollTop = a.scrollTop - 150;
         }, 0);
       }
+			let flag = this.courseType == i;
+			let flag2 = this.taskCount == j
       if (l) {
         this.courseType = i;
         // this.navId = l;
         this.taskCount = j;
+				if(flag){
+					if(flag2){
+						this.insertMemorandum(`选择<span class="variable">工具${w+1}:${this.toolsList[this.navList[i].task[j].tool[k].tool]}</span>`)
+					}else{
+						this.insertMemorandum(`选择<span class="variable">任务${this.taskCount+1}${this.navList[this.courseType].task[this.taskCount].taskName?':'+this.navList[this.courseType].task[this.taskCount].taskName:''}</span>→<span class="variable">工具${w+1}:${this.toolsList[this.navList[i].task[j].tool[k].tool]}</span>`)
+					}
+				}else{
+					this.insertMemorandum(`选择<span class="variable">阶段${this.courseType+1}${this.navList[this.courseType].dyName?':'+this.navList[this.courseType].dyName:''}</span>→<span class="variable">任务${this.taskCount+1}${this.navList[this.courseType].task[this.taskCount].taskName?':'+this.navList[this.courseType].task[this.taskCount].taskName:''}</span>→<span class="variable">工具${w+1}:${this.toolsList[this.navList[i].task[j].tool[k].tool]}</span>`)
+				}
         this.selectPz();
         this.getHomeWork();
         this.getCourseDetail(2);
@@ -16117,7 +16190,9 @@ export default {
       this.getCourseDetail(2);
       this.$forceUpdate();
     },
+
     openTask(s, n, i,ctype) {
+			console.log(s, n, i,ctype)
       if (this.IsFollow && this.tType == 2) {
         this.$message.error("已经开启跟随模式,请认真跟堂听讲");
         return;
@@ -16163,9 +16238,19 @@ export default {
         this.navList[s].task[n].isOpen = !this.navList[s].task[n].isOpen;
         return;
       }
+			let flag = this.courseType==s;
+
+			
       this.courseType = s;
+			
       this.navId = i;
       this.taskCount = n;
+			if(flag){
+				this.insertMemorandum(`进入<span class="variable">任务${this.taskCount+1}${this.navList[this.courseType].task[this.taskCount].taskName?':'+this.navList[this.courseType].task[this.taskCount].taskName:''}</span>`)
+			}else{
+				this.insertMemorandum(`进入<span class="variable">阶段${this.courseType+1}${this.navList[this.courseType].dyName?':'+this.navList[this.courseType].dyName:''}</span>→<span class="variable">任务${this.taskCount+1}${this.navList[this.courseType].task[this.taskCount].taskName?':'+this.navList[this.courseType].task[this.taskCount].taskName:''}</span>`)
+			}
+			
       if(ctype == 2){
         this.navList[s].task[n].isOpen = true
       }else{
@@ -17351,6 +17436,7 @@ export default {
       // this.isClickNav = "video" + i;
       this.isClickNav = i;
       this.$forceUpdate();
+			this.insertMemorandum(`查看文件<span class="variable">任务${this.taskCount+1}:${this.vChapterData[this.taskCount].find(i=>i.url==u).name}</span>`)
     },
     lookText(i, t) {
       this.isClickNav = "";
@@ -17360,6 +17446,7 @@ export default {
       this.showType = 1;
       // this.isClickNav = "text" + t;
       this.isClickNav = t;
+			this.insertMemorandum(`查看文件<span class="variable">任务${this.taskCount+1}:${this.vChapterData[this.taskCount][t].name}.doc</span>`)
     },
     lookTools(i, t) {
       this.chapTools = this.chapToolList[i][t];
@@ -17414,6 +17501,7 @@ export default {
       this.pptImgUrl1 = f.url;
       this.isClickNav = i;
       this.$forceUpdate();
+			this.insertMemorandum(`查看文件<span class="variable">任务${this.taskCount+1}:${this.vChapterData[this.taskCount][i].name}</span>`)
     },
     async downFile(f, i) {
       this.isClickNav = "";
@@ -17448,6 +17536,7 @@ export default {
       }
       // this.isClickNav = "word" + i;
       this.isClickNav = i;
+			this.insertMemorandum(`查看文件<span class="variable">任务${this.taskCount+1}:${this.vChapterData[this.taskCount][i].name}</span>`)
     },
     downFileList(i) {
       window.open(this.noImgList[i].url);
@@ -18373,6 +18462,7 @@ export default {
           ].toolChoose[i].videoJson;
         this.dialogVisibleVideo = true;
       }
+			this.insertMemorandum(`点击工作区<span class="variable">工具${index+1}:${this.toolsList[t]}</span>`)
     },
     teacherWorkSubmit(t, i, index, s) {
       this.sStudent = s;

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