SanHQin 10 tháng trước cách đây
mục cha
commit
bf5605b4b0

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
src/assets/icon/course/Countdown.svg


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
src/assets/icon/course/Countdown2.svg


+ 1 - 0
src/assets/icon/course/edit.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1721093563614" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4275" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M469.333333 128a42.666667 42.666667 0 0 1 0 85.333333H213.333333v597.333334h597.333334v-256l0.298666-4.992A42.666667 42.666667 0 0 1 896 554.666667v256a85.333333 85.333333 0 0 1-85.333333 85.333333H213.333333a85.333333 85.333333 0 0 1-85.333333-85.333333V213.333333a85.333333 85.333333 0 0 1 85.333333-85.333333z m414.72 12.501333a42.666667 42.666667 0 0 1 0 60.330667L491.861333 593.066667a42.666667 42.666667 0 0 1-60.330666-60.330667l392.192-392.192a42.666667 42.666667 0 0 1 60.330666 0z" fill="#000000" p-id="4276"></path></svg>

+ 139 - 121
src/components/classRoomHelper/component/searchArea.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="search">
-    <div class="s_top" ref="chatRef" v-if="cardType==0">
+    <div class="s_top" ref="chatRef" v-if="cardType == 0">
       <div class="s_t_chat" v-for="(item, index) in chatList" :key="index">
         <div
           class="s_t_c_user"
@@ -29,7 +29,7 @@
           "
         >
           <div class="s_t_c_a_left">
-						<img style="border-radius: 100%;" v-if="item.filename" :src="item.filename">
+						<el-avatar v-if="item.filename" :src="item.filename"></el-avatar>
             <span v-else>Ai</span>
           </div>
           <div class="s_t_c_a_right">
@@ -98,9 +98,24 @@
                 src="../../../assets/icon/course/copyTxt.png"
                 alt=""
               />
-              <img @click.stop="aiTalkAll(item)" v-if="aiTalkUid==item.uid && aiIsTalk" style="width: 15px;margin-bottom:7px;" :src="require('../../../assets/icon/course/megaphone.svg')">
-							<img @click.stop="aiTalkAll(item)" v-else style="width: 15px;margin-bottom:7px;" :src="require('../../../assets/icon/course/megaphone3.svg')">
-							<img v-if="chatList.length-2 == index" @click.stop="refresh(item)" style="width: 15px;margin-bottom:7px;" :src="require('../../../assets/icon/course/refresh.svg')">
+              <img
+                @click.stop="aiTalkAll(item)"
+                v-if="aiTalkUid == item.uid && aiIsTalk"
+                style="width: 15px;margin-bottom:7px;"
+                :src="require('../../../assets/icon/course/megaphone.svg')"
+              />
+              <img
+                @click.stop="aiTalkAll(item)"
+                v-else
+                style="width: 15px;margin-bottom:7px;"
+                :src="require('../../../assets/icon/course/megaphone3.svg')"
+              />
+              <img
+                v-if="chatList.length - 2 == index"
+                @click.stop="refresh(item)"
+                style="width: 15px;margin-bottom:7px;"
+                :src="require('../../../assets/icon/course/refresh.svg')"
+              />
             </div>
             <!-- <div
               class="s_t_c_a_r_contentImage"
@@ -190,7 +205,7 @@
         </div>
       </div>
     </div>
-    <div class="s_bottom" v-if="cardType==0">
+    <div class="s_bottom" v-if="cardType == 0">
       <div class="s_b_btnAreaTop">
         <div class="s_b_bat_left">
           <el-tooltip
@@ -224,9 +239,9 @@
           </el-tooltip>
         </div>
         <div class="s_b_bat_right">
-					<!-- <img :src="require('../../../assets/icon/course/bulb.svg')"> -->
-					<img :src="require('../../../assets/icon/course/bulb2.svg')">
-				</div>
+          <!-- <img :src="require('../../../assets/icon/course/bulb.svg')"> -->
+          <img :src="require('../../../assets/icon/course/bulb2.svg')" />
+        </div>
       </div>
       <div class="s_b_btnArea">
         <div
@@ -253,7 +268,6 @@
 					<img src="../../../assets/icon/course/sRio2.png" style="margin-right: 5px;" alt="" v-else> -->
           搜索视频
         </div>
-<!-- 
 				<div class="s_b_ba-item" @click.stop="choiceRole()">
             <img
               style="width: 20px;"
@@ -261,14 +275,7 @@
               alt=""
             />
             选择智能体
-          </div> -->
-        <!-- <div class="s_b_ba-item" @click="clear()" v-if="!openAtBox">
-          清空聊天记录
-        </div>
-
-				<div :class="['s_b_ba-item',recordType==1?'s_b_ba_active':'']" @click="$parent.startAssistant()" v-if="!openAtBox">
-          语音助手
-        </div> -->
+          </div>
       </div>
 
       <div class="s_b_atBox" v-if="openAtBox" v-loading="loading">
@@ -592,7 +599,7 @@
       </div>
     </div>
 
-		<div class="choiceTopArea" v-if="cardType == 1">
+    <div class="choiceTopArea" v-if="cardType == 1">
       <div class="choiceTop">
         <div class="choiceRoleHeader">
           <div>切换角色:</div>
@@ -814,10 +821,10 @@ export default {
       aiTalkList: [],
       aiIsTalk: false,
       aiTalkUid: "",
-			choseRoleItem: {},
-			cardType:0,
-			roleList:[],
-			sortOption: 0, //切换角色 0我的 1 社区
+      choseRoleItem: {},
+      cardType: 0,
+      roleList: [],
+      sortOption: 0 //切换角色 0我的 1 社区
     };
   },
   computed: {
@@ -941,16 +948,15 @@ export default {
       }
     },
     talk() {
-      
-			let iiframe = this.$refs["iiframe"];
+      let iiframe = this.$refs["iiframe"];
       iiframe.contentWindow.window.document.getElementById(
         "languageOptions"
       ).selectedIndex = 2; //普通话
       iiframe.contentWindow.testdoContinuousPronunciationAssessment();
-			this.isTalk = true;
+      this.isTalk = true;
       iiframe.contentWindow.onRecognizedResult = e => {
         let _msg = e.privText;
-				console.log(_msg)
+        console.log(_msg);
         if (_msg) this.text += _msg;
       };
     },
@@ -1053,7 +1059,34 @@ export default {
       this.$hevueImgPreview(url);
     },
     clear() {
-      this.chatList = [];
+      // this.chatList = [];
+      this.$confirm("确定清空聊天记录吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(_ => {
+          this.loading = true;
+          let params = {
+            user_id: this.userid,
+						id:"602def61-005d-11ee-91d8-005056b8q12w",
+            session_name: `${this.courseId}-studyStudent-md`
+          };
+
+          this.ajax
+            .post("https://gpt4.cocorobo.cn/delete_park_session", params)
+            .then(res => {
+              this.chatList = [];
+							this.stopSend();
+              this.$message.success("清除聊天记录成功");
+              this.loading = false;
+            })
+            .catch(err => {
+              this.loading = false;
+              this.$message.error("清除聊天记录失败");
+            });
+        })
+        .catch(_ => {});
     },
     atTask(name, index, type, data) {
       let _result = name;
@@ -1102,7 +1135,7 @@ export default {
         aiContent: "",
         oldContent: "",
         isShowSynchronization: false,
-        filename: "",
+        filename: this.choseRoleItem?this.choseRoleItem.headUrl:"",
         index: this.chatList.length,
         is_mind_map: false,
         loading: true
@@ -1138,11 +1171,11 @@ export default {
       } else if (this.sendType == 3) {
         this.text = "";
         let params = {
-					n:1,
-					prompt:_text,
-					quality:"standard",
-					size:"1024x1024",
-					style:"natural"
+          n: 1,
+          prompt: _text,
+          quality: "standard",
+          size: "1024x1024",
+          style: "natural"
         };
         // this.$message.info(_text);
         this.chatList.push({
@@ -1163,31 +1196,34 @@ export default {
           .then(res => {
             let data = res.data.FunctionResponse;
             // console.log('res',res.data.FunctionResponse.result);
-						let _result = [];
-						if(!data.image_url_list.length){
-							this.chatLoading = false;
-							this.chatList.pop();
-							this.chatList.pop();
-							return this.$message.error("生成图片失败")
-						}
-						data.image_url_list.forEach(i=>{
-							_result.push({
-								image:i
-							})
-						})
-
-            this.chatList.find(i => i.uid == _uuid).aiContent = JSON.stringify(_result);
+            let _result = [];
+            if (!data.image_url_list.length) {
+              this.chatLoading = false;
+              this.chatList.pop();
+              this.chatList.pop();
+              return this.$message.error("生成图片失败");
+            }
+            data.image_url_list.forEach(i => {
+              _result.push({
+                image: i
+              });
+            });
+
+            this.chatList.find(i => i.uid == _uuid).aiContent = JSON.stringify(
+              _result
+            );
             this.chatList.find(i => i.uid == _uuid).loading = false;
-						console.log(this.chatList.find(i => i.uid == _uuid).aiContent)
+            console.log(this.chatList.find(i => i.uid == _uuid).aiContent);
             this.chatLoading = false;
             this.insertChat(_uuid);
-						this.scrollBottom();
-          }).catch(e=>{
-						this.chatLoading = false;
-						this.chatList.pop();
-						this.chatList.pop();
-						this.$message.error("生成失败")
-					});
+            this.scrollBottom();
+          })
+          .catch(e => {
+            this.chatLoading = false;
+            this.chatList.pop();
+            this.chatList.pop();
+            this.$message.error("生成失败");
+          });
         return;
       } else if (this.sendType == 1 || _text.indexOf("图片") != -1) {
         // console.log("图片");
@@ -1220,8 +1256,8 @@ export default {
             this.chatList.find(i => i.uid == _uuid).aiContent = JSON.stringify(
               data
             );
-						console.log("👇")
-						console.log(this.chatList.find(i => i.uid == _uuid).aiContent)
+            console.log("👇");
+            console.log(this.chatList.find(i => i.uid == _uuid).aiContent);
             this.chatList.find(i => i.uid == _uuid).loading = false;
             this.chatLoading = false;
             this.insertChat(_uuid);
@@ -1236,30 +1272,6 @@ export default {
 
         return;
       }
-      //         num=0
-      //       	_msg = `
-      //         NOTICE
-      // Language: Please use the same language as the user requirement, if the user speaks Chinese, the specific text of your answer should also be in Chinese.
-      // ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
-      // Instruction: Based on the context, follow "Format example", write content.
-
-      // # Context
-      // ## 任务
-      // 你的任务是根据用户的请求,结合以下“课程信息”包含的子条目(“课程标题”,“主题”,“学科”以及“年级”),向用户输出相关的4张图片,将结果2*2的形式返回给用户。
-      // 课程信息
-      // 课程标题:${this.courseDetail.title}
-      // 分类:${this.courseDetail.name?this.courseDetail.name:"无"}
-      // 学生年级:${this.courseDetail.classname?this.courseDetail.classname:"无"}
-
-      // ## 规则
-      //     1. 输出内容应该与“课程信息”相关,避免提供无关的信息。
-      //     2. 当课程信息中的子条目内容为“无”时,无视这些条目进行输出即可。
-      //     3. 搜索建议的结果应该符合伦理规范。
-
-      // ## 输出格式
-      //     1. 以2*2的格式输出应包括4张相关的图片。
-      //       `
-      //       }
       let history = [];
       this.nowChatList.forEach(i => {
         if (i.content == "wanSearch") {
@@ -1295,7 +1307,7 @@ export default {
         history.push({ type: "text", text: _text });
       }
       let params = {
-        assistant_id: "f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b",
+        assistant_id: this.choseRoleItem?this.choseRoleItem.assistant_id:"f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b",
         userId: this.userid,
         message: _text,
         session_name: `${this.courseId}-studyStudent-md`,
@@ -1325,7 +1337,6 @@ export default {
       //   model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
       // };
       this.text = "";
-      // console.log('56465166541561616',params);
 
       this.ajax
         // .post("https://claude3.cocorobo.cn/chat", params)
@@ -1648,10 +1659,10 @@ ${_atList
           let _text = _eData.content.replace("'", "").replace("'", "");
           if (_allText == "") {
             _allText = _text.replace(/^\n+/, ""); //去掉回复消息中偶尔开头就存在的连续换行符
-						_talkText += _text.replace(/^\n+/, "");
+            _talkText += _text.replace(/^\n+/, "");
           } else {
             _allText += _text;
-						_talkText += _text;
+            _talkText += _text;
           }
           _mdText = _allText + "_";
           _mdText = _mdText.replace(/\\n/g, "\n");
@@ -1667,19 +1678,19 @@ ${_atList
             });
             _index = 0;
           }
-					if (this.openMegaphone && /[,。:;?!)]/.test(_talkText)) {
+          if (this.openMegaphone && /[,。:;?!)]/.test(_talkText)) {
             let _resultText = this.removeMarkdown(_talkText);
-						if(this.aiTalkUid!=_uid){
-							this.aiTalkList = [];
-						}
-						this.aiTalkList.push(_resultText);
+            if (this.aiTalkUid != _uid) {
+              this.aiTalkList = [];
+            }
+            this.aiTalkList.push(_resultText);
             _talkText = "";
-            if (this.aiTalkUid!=_uid){
-								this.aiTalkUid = _uid;
-								this.aiTalk(0)
-						}else if(!this.aiIsTalk){
-								this.aiTalk(1)
-						};
+            if (this.aiTalkUid != _uid) {
+              this.aiTalkUid = _uid;
+              this.aiTalk(0);
+            } else if (!this.aiIsTalk) {
+              this.aiTalk(1);
+            }
           }
           // 处理流数据
         }
@@ -2529,12 +2540,12 @@ ${_wordData}
           _talkTextIiframe2.contentWindow.closesynthesizer();
           this.aiIsTalk = false;
           if (this.aiTalkList.length) this.aiTalk(0);
-					else this.aiTalkUid = ""
+          else this.aiTalkUid = "";
         } catch (error) {
           // console.log("error")
           this.aiIsTalk = false;
           if (this.aiTalkList.length) this.aiTalk(0);
-					else this.aiTalkUid = ""
+          else this.aiTalkUid = "";
         }
       } else {
         let _text = this.aiTalkList.shift();
@@ -2554,11 +2565,10 @@ ${_wordData}
           );
         } else {
           try {
-						_talkTextIiframe2.contentWindow.closesynthesizer();
-					} catch (error) {
-						return
-
-					}
+            _talkTextIiframe2.contentWindow.closesynthesizer();
+          } catch (error) {
+            return;
+          }
         }
       }
 
@@ -2566,8 +2576,8 @@ ${_wordData}
       // 	this.aiIsTalk = true;
       // }
     },
-		aiTalkAll(item){
-			if (this.aiTalkUid == item.uid && this.aiIsTalk) {
+    aiTalkAll(item) {
+      if (this.aiTalkUid == item.uid && this.aiIsTalk) {
         try {
           this.aiTalkList = [];
           let _talkTextIiframe2 = this.$refs.iiframe2;
@@ -2585,16 +2595,18 @@ ${_wordData}
         this.aiTalkList.push(_resultText);
         this.aiTalk(0);
       }
-		},
-		choseRole(item) {
+    },
+    choseRole(item) {
       this.choseRoleItem = item;
       console.log("选择角色", this.choseRoleItem);
+			this.scrollBottom();
     },
     noChangeRole() {
       this.cardType = 0;
-      this.choseRoleItem = {};
+      this.choseRoleItem = null;
+			this.scrollBottom();
     },
-		changeRole() {
+    changeRole() {
       this.cardType = 0;
       if (this.choseRoleItem.assistant_id) {
         // this.chatList = [];
@@ -2619,10 +2631,10 @@ ${_wordData}
         this.scrollBottom();
       }
     },
-		optBtn(val) {
+    optBtn(val) {
       this.sortOption = val;
     },
-		getRoleList() {
+    getRoleList() {
       this.roleList = [];
       let params = {
         userId: this.userid
@@ -2665,10 +2677,10 @@ ${_wordData}
           console.log("获取公共角色失败", e);
         });
     },
-		choiceRole() {
+    choiceRole() {
       if (this.loading) return this.$message.info("请稍等");
       this.cardType = 1;
-    },
+    }
   },
   mounted() {
     this.getChatList().then(_ => {
@@ -2679,8 +2691,8 @@ ${_wordData}
     this.sendType = 0;
     this.initTaskList();
     this.getWorkData();
-		this.getPublicRoleList();
-		this.getRoleList();
+    this.getPublicRoleList();
+    this.getRoleList();
   }
 };
 </script>
@@ -2909,6 +2921,12 @@ ${_wordData}
   margin-right: 5px;
 }
 
+.s_t_c_a_left>img{
+	width: 35px;
+  height: 35px;
+	border-radius: 50%;
+}
+
 .s_t_c_a_left > span {
   width: 32px;
   height: 32px;
@@ -2956,8 +2974,8 @@ ${_wordData}
   margin-right: 5px;
 }
 
-.s_b_bat_right{
-	width: auto;
+.s_b_bat_right {
+  width: auto;
   height: 100%;
   display: flex;
   align-items: flex-end;
@@ -3477,9 +3495,9 @@ ${_wordData}
   height: 100%;
 }
 
-.choiceTopArea{
-	width: 100%;
-	height: 100%
+.choiceTopArea {
+  width: 100%;
+  height: 100%;
 }
 
 .choiceTop {

+ 27 - 10
src/components/classRoomHelper/index.vue

@@ -22,13 +22,14 @@
         :fileId="fileId"
         v-if="itemType == 2"
       />
-      <dialogArea
+			<!-- <countdown ref="countdownRef" v-show="itemType==3"/> -->
+      <!-- <dialogArea
         :courseDetail="courseDetail"
 				:openMegaphone="openMegaphone"
         ref="dialogAreaRef"
         :fileId="fileId"
         v-if="itemType == 3"
-      />
+      /> -->
     </div>
     <div class="ch_nav_box">
       <div class="ch_nav_box_top">
@@ -155,7 +156,7 @@
           <!-- <span :style="`background:url(${itemType==1?require('../../assets/icon/course/up_active.png'):require('../../assets/icon/course/up.png')});`"></span> -->
           <div>对话</div>
         </div>
-
+<!-- 
         <div
           :class="[
             'ch_nav_box_middle_item',
@@ -165,18 +166,29 @@
         >
           <img
             v-if="itemType == 3"
-            :src="require('../../assets/icon/course/dialog_active.png')"
+            :src="require('../../assets/icon/course/Countdown2.svg')"
           />
           <img
             v-if="itemType != 3"
-            :src="require('../../assets/icon/course/dialog.png')"
+            :src="require('../../assets/icon/course/Countdown.svg')"
           />
-          <!-- <span :style="`background:url(${itemType==3?require('../../assets/icon/course/dialog_active.png'):require('../../assets/icon/course/dialog.png')});`"></span> -->
-          <div>智能体</div>
-        </div>
+          <div>倒计时</div>
+        </div> -->
       </div>
       <div class="ch_nav_box_bottom">
 
+
+				<div @click.stop="commentAndAnnotate()">
+					<el-tooltip
+            class="item"
+            effect="dark"
+            content="批注"
+            placement="top"
+          >
+            <img :src="require('../../assets/icon/course/edit.svg')" />
+          </el-tooltip>
+				</div>
+
 				<div @click.stop="startAssistant()" :class="[recordType==1?'ch_nav_box_middle_item_active':'']">
 					<el-tooltip
             class="item"
@@ -234,6 +246,7 @@ 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 countdown from "./component/countdown.vue";
 export default {
   emits: ["refresh", "goStep", "backPage", "authority", "review","stopRecording","startRecording"],
   components: {
@@ -241,7 +254,8 @@ export default {
     taskArea,
     dialogArea,
     levitatedSphere,
-    timepiece
+    timepiece,
+		// countdown
   },
   props: {
     courseDetail: {
@@ -396,7 +410,10 @@ export default {
     changeRecordType(type) {
 			this.recordLoading = false;
       this.recordType = type;
-    }
+    },
+		commentAndAnnotate(){
+			this.$message.info("批注")
+		}
   }
 };
 </script>

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác