SanHQin 9 months ago
parent
commit
b4fd078f24

+ 92 - 50
src/components/classRoomHelper/component/countdown.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="countdown">
-    <div class="c_changeType" v-if="showType==0">
+    <div class="c_changeType" v-if="showType == 0">
       <el-button-group>
         <el-button
           :type="isCountdown ? 'danger' : type == 0 ? 'primary' : ''"
@@ -20,7 +20,7 @@
       </el-button-group>
     </div>
 
-    <div class="c_time" v-if="showType==0">
+    <div class="c_time" v-if="showType == 0">
       <div class="c_t_item" v-if="type == 0">
         <div>
           <span v-if="!isCountdown"
@@ -97,7 +97,7 @@
       </div>
     </div>
 
-    <div class="c_behaviorTag" v-if="showType==0">
+    <div class="c_behaviorTag" v-if="showType == 0">
       <div class="c_title">
         <span>行为标签</span>
         <div class="c_t_btnArea">
@@ -146,7 +146,7 @@
       </div>
     </div>
 
-    <div class="c_btnArea" v-if="showType==0">
+    <div class="c_btnArea" v-if="showType == 0">
       <span @click.stop="music()" :class="[sourceActive ? 'sourceActive' : '']"
         >音乐</span
       >
@@ -228,28 +228,33 @@
           <!-- <svg v-else t="1721117616634" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="13970" width="64" height="64"><path d="M128 128m53.333333 0l661.333334 0q53.333333 0 53.333333 53.333333l0 661.333334q0 53.333333-53.333333 53.333333l-661.333334 0q-53.333333 0-53.333333-53.333333l0-661.333334q0-53.333333 53.333333-53.333333Z" p-id="13971"></path></svg> -->
         </div>
       </div>
-      <span  @click.stop="reset()">重置</span>
+      <span @click.stop="reset()">重置</span>
     </div>
 
-		<!-- <div style="margin-bottom:30px;padding:20px;cursor: pointer;"  v-if="showType==0">
-			<span @click.stop="showType=1">教学活动备忘>></span>
-		</div>		 -->
-
-		<div v-if="showType==1" style="margin-top:20px">
-			<span style="padding:20px;cursor: pointer;" @click.stop="showType=0"><<返回</span>
-
-			<div class="c_step">
-				<div class="c_s_item" v-for="(item,index) in memorandumList" :key="index">
-					<div>0分9秒</div>
-					<div class="c_s_i_step">
-						<span></span>
-						<div></div>
-						<span></span>
-					</div>
-					<div v-html="item.message"></div>
-				</div>
+    <div
+      style="margin-bottom:30px;padding:20px;cursor: pointer;"
+      v-if="showType == 0"
+    >
+      <span @click.stop="showType = 1">教学活动备忘>></span>
+    </div>
+
+    <div v-if="showType == 1" style="padding-top:20px;height:100%;box-sizing: border-box;">
+      <span style="padding:20px;cursor: pointer;" @click.stop="showType = 0"
+        ><<返回</span
+      >
+
+      <div class="c_step" ref="stepRef">
+			<el-timeline>
+  		  <el-timeline-item
+  		    v-for="(activity, index) in memorandumList"
+  		    :key="index"
+  		    :timestamp="activity.timestamp"
+					>
+					<span v-html="activity.content"></span>
+  		  </el-timeline-item>
+  		</el-timeline>
 			</div>
-		</div>
+    </div>
     <mini-audio
       v-show="false"
       ref="audioRef"
@@ -282,10 +287,10 @@ export default {
     return {
       userid: this.$route.query.userid,
       courseId: this.$route.query.courseId,
-			showType:0,
+      showType: 0,
       sourceUrl:
         "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%80%92%E8%AE%A1%E6%97%B6%E9%9F%B3%E4%B9%901721355956636.mp3",
-      endSourceUrl: "",
+      endSourceUrl: "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%80%92%E6%95%B010%E7%A7%92%E5%8F%A0%E5%8A%A0%E9%9F%B3%E6%95%881721638403882.MP3",
       sourceActive: false,
       type: 0, //0:倒计时   1:计时器
       isCountdown: false,
@@ -314,12 +319,9 @@ export default {
         "观察记录"
       ], //常用
       choiceBehavior: [],
-			memorandumList:[
-				{
-					create_at:"",
-					message:`10:00:01 进入<span style="color:#4A8EDF">授课界面</span>\n10:00:10 点击<span style="color:#4A8EDF">录制</span>按钮,开始录制课堂`
-				}
-			],
+      memorandumList: [
+       
+      ]
     };
   },
   computed: {
@@ -389,12 +391,20 @@ export default {
       } else if (!this.isCountdown && !this.countdownTimeTimer) {
         this.countdownTimeDefault = newValue;
       }
-      if (this.$refs.audioRef.playing && this.sourceActive && newValue <= 10) {
-        this.$refs.audioRef.setVolume(newValue / 10);
+      if (this.$refs.audioRef.playing && this.sourceActive && newValue == 10) {
+				this.$refs.audioRef.stop();
+				this.$refs.endSourceUrlRef.play();
+        // this.$refs.audioRef.setVolume(newValue / 10);
       }
     }
   },
   methods: {
+		changeShowType(newType){
+			this.showType = newType;
+			if(this.showType==1){
+				this.$refs.stepRef.scrollTop = this.$refs.stepRef.scrollHeight;
+			}
+		},
     changeType(newType) {
       if (this.isCountdown || this.isKeepTime) return;
       this.type = newType;
@@ -471,9 +481,13 @@ export default {
             }
             this.$refs.audioRef.setVolume(volume / 10);
           }, 1000);
-        } else if (this.countdownTime <= 20 && this.sourceActive) {
+        } else if (this.countdownTime <= 20 && this.countdownTime>10 && this.sourceActive) {
           this.$refs.audioRef.setVolume(1);
-        }
+        }else if(this.countdownTime <=10 && this.sourceActive){
+					this.$refs.audioRef.stop();
+					this.$refs.endSourceUrlRef.setProgress((10-this.countdownTime)/10)
+					this.$refs.endSourceUrlRef.play();
+				}
         this.countdownTimeTimer = setInterval(() => {
           this.isCountdown = true;
           this.countdownTime -= 1;
@@ -522,9 +536,13 @@ export default {
       if (this.$refs.audioRef.playing && !this.sourceActive) {
         this.$refs.audioRef.pause();
       } else if (this.sourceActive) {
-        if (this.isCountdown) {
+        if (this.isCountdown > 10) {
           this.$refs.audioRef.play();
-        }
+        }else{
+					this.$refs.audioRef.stop();
+					this.$refs.endSourceUrlRef.setProgress((10-this.countdownTime)/10)
+					this.$refs.endSourceUrlRef.play();
+				}
       }
     },
     reset() {
@@ -557,9 +575,9 @@ export default {
             type: "warning"
           })
             .then(_ => {
-							if(this.$refs.audioRef.playing){
-								this.$refs.audioRef.pause();
-							}
+              if (this.$refs.audioRef.playing) {
+                this.$refs.audioRef.pause();
+              }
               // this.countdownTime = this.countdownTimeDefault;
               this.countdownTime = 0;
               this.isCountdown = false;
@@ -697,7 +715,27 @@ ${_textData}
           console.log("保存失败👇");
           console.log(e);
         });
-    }
+    },
+		insertMemorandum(_html){
+			//variable
+			//btn
+			let params = [{
+				uid:this.userid,
+				courseId:this.courseId,
+				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)
+			})
+		}
   }
 };
 </script>
@@ -964,14 +1002,18 @@ ${_textData}
   color: #fff;
 }
 
-.c_step{
-	width:100%;
-	height:auto;
-	margin-top:20px;
-}
-.c_s_item{
-	display:flex;
-	justify-content:center;
-	align-items:center;
+.c_step {
+  width: 100%;
+  height: calc(100% - 80px);
+  margin-top: 20px;
+	padding: 20px 50px;
+	box-sizing: border-box;
+	overflow: auto;
+	
+}
+.c_s_item {
+  display: flex;
+  justify-content: center;
+  align-items: center;
 }
 </style>

+ 14 - 10
src/components/classRoomHelper/component/languageAssistant.vue

@@ -2,25 +2,25 @@
   <div class="languageAssistant">
 		<div class="la_coco">
 			<el-image
-        style="width: 150px; height: 150px"
+        style="width: 105px; height: 105px;"
         v-show="showIndex == 2"
         :src="require('../../../assets/icon/course/aiVanish.svg')"
         fit="fill"
       ></el-image>
 			<el-image
-       style="width: 150px; height: 150px"
+        style="width: 105px; height: 105px;"
         v-show="showIndex == 0"
         :src="require('../../../assets/icon/course/aiWait.svg')"
         fit="fill"
       ></el-image>
 			<el-image
-       style="width: 150px; height: 150px"
+        style="width: 105px; height: 105px;"
         v-show="showIndex == 1"
         :src="require('../../../assets/icon/course/aiTalk.svg')"
         fit="fill"
       ></el-image>
 		</div>
-		<div class="la_message" ref="messageRef" >
+		<div class="la_message" :style="show?'':'height:calc(100% - 170px - 200px - 40px)'" ref="messageRef" >
 			<div class="la_m_talk" v-if="show">
 				<div v-if="showTextIndex==0" v-html="htmlContent(aiText)"></div>
 				<div v-if="showTextIndex==1">{{userText}}</div>
@@ -89,7 +89,8 @@ export default {
       return _md => {
         return md.render(_md);
       };
-    }
+    },
+
   },
   methods: {
 		scrollBottom(){
@@ -469,7 +470,7 @@ export default {
 }
 
 .la_coco{
-	height: 300px;
+	height: 170px;
 	width: 100%;
 	display: flex;
 	justify-content: center;
@@ -477,20 +478,24 @@ export default {
 }
 
 .la_message{
-	height: 400px;
+	/* max-height: 400px; */
+	/* min-height: 400px; */
+	height: auto;
+	max-height: calc(100% - 170px - 200px - 40px);
 	width: 100%;
 	/* display: flex; */
 	padding:10px;
 	box-sizing: border-box;
 	margin: 20px 0;
+	overflow:auto;
 }
 
 .la_m_talk{
 	/* width:100%; */
 	height:auto;
-	max-height:400px;
+	/* max-height: calc(100% - 170px - 200px - 40px); */
 	box-sizing: border-box;
-	overflow:auto;
+	
 }
 
 .la_m_talk>div{
@@ -504,7 +509,6 @@ export default {
 	height: 200px;
 	width: 100%;
 	display: flex;
-	margin-bottom: 100px;
 }
 
 

+ 127 - 56
src/components/classRoomHelper/component/searchArea.vue

@@ -29,7 +29,7 @@
           "
         >
           <div class="s_t_c_a_left">
-						<el-avatar v-if="item.filename" :src="item.filename"></el-avatar>
+            <el-avatar v-if="item.filename" :src="item.filename"></el-avatar>
             <span v-else>Ai</span>
           </div>
           <div class="s_t_c_a_right">
@@ -268,14 +268,14 @@
 					<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;"
-              src="../../../assets/icon/course/role.png"
-              alt=""
-            />
-            选择智能体
-          </div>
+        <div class="s_b_ba-item" @click.stop="choiceRole()">
+          <img
+            style="width: 20px;"
+            src="../../../assets/icon/course/role.png"
+            alt=""
+          />
+          选择智能体
+        </div>
       </div>
 
       <div class="s_b_atBox" v-if="openAtBox" v-loading="loading">
@@ -602,11 +602,31 @@
     <div class="choiceTopArea" v-if="cardType == 1">
       <div class="choiceTop">
         <div class="choiceRoleHeader">
-          <div>切换角色:</div>
-          <span>您希望以下哪个角色回答您的问题,请选择:</span>
+					<div
+          class="s_t_c_ai"
+        >
+          <div class="s_t_c_a_left">
+            <el-avatar :src="require('../../../assets/icon/course/aiWait.svg')"></el-avatar>
+          </div>
+          <div class="s_t_c_a_right">
+            <div
+              class="s_t_c_a_r_content"
+            >选择您需要的智能体,开始对话</div>
+          </div>
+        </div>
         </div>
+        
         <div class="choiceSelect">
-          <el-button
+					<div style="width:100%">
+						<div class="roleInput">						<el-input
+          placeholder="请输入内容"
+          v-model="roleText"
+          prefix-icon="el-icon-search"
+          clearable
+        >
+        </el-input></div>
+
+					<div class="roleBtn"> <el-button
             class="option"
             :style="{
               background: sortOption == 0 ? '#36A9FC' : '',
@@ -625,28 +645,38 @@
             @click="optBtn(1)"
             plain
             >社区</el-button
-          >
-        </div>
-        <div
+          ></div>
+					</div>
+					<div class="roleListBox">
+						<div
           class="characterBlock"
-          v-if="sortOption == 0"
-          v-for="(item, index) in roleList"
+          v-for="(item, index) in showRoleList"
           :key="item.id"
           @click.stop="choseRole(item)"
         >
           <div class="imgLeft">
             <div class="img">
-              <img v-if="item.headUrl" style="width: 100%;height: 100%;" :src="item.headUrl" />
-							<img v-else style="width: 100%;height: 100%;" :src="require('../../../assets/icon/course/ai.png')">
+              <img
+                style="width: 100%;height: 100%;"
+                :src="
+                  item.headUrl && item.headUrl != ''
+                    ? item.headUrl
+                    : require('../../../assets/icon/course/ai.png')
+                "
+              />
             </div>
           </div>
           <div class="txtRight">
-            <div class="bir">{{ item.assistantName }}</div>
+						
+						<el-tooltip class="item" effect="dark" :content="item.assistantName" placement="top">
+							<div class="bir">{{ item.assistantName }}</div>
+    				</el-tooltip>
             <div
               :style="{
                 color: '#fff',
                 display:
-									(choseRoleItem && choseRoleItem.assistant_id == item.assistant_id)
+                  choseRoleItem &&
+                  choseRoleItem.assistant_id == item.assistant_id
                     ? 'block'
                     : 'none'
               }"
@@ -655,23 +685,19 @@
             </div>
           </div>
         </div>
-        <div
+					</div>
+        </div>
+        <!-- <div
           class="characterBlock"
-          v-if="sortOption == 1"
-          v-for="(item, index) in roleList2"
+          v-if="sortOption == 0"
+          v-for="(item, index) in roleList"
           :key="item.id"
           @click.stop="choseRole(item)"
         >
           <div class="imgLeft">
             <div class="img">
-              <img
-                style="width: 100%;height: 100%;"
-                :src="
-                  item.headUrl
-                    ? item.headUrl
-                    : require('../../../assets/icon/course/ai.png')
-                "
-              />
+              <img v-if="item.headUrl" style="width: 100%;height: 100%;" :src="item.headUrl" />
+							<img v-else style="width: 100%;height: 100%;" :src="require('../../../assets/icon/course/ai.png')">
             </div>
           </div>
           <div class="txtRight">
@@ -680,7 +706,7 @@
               :style="{
                 color: '#fff',
                 display:
-                  choseRoleItem.assistant_id == item.assistant_id
+									(choseRoleItem && choseRoleItem.assistant_id == item.assistant_id)
                     ? 'block'
                     : 'none'
               }"
@@ -688,7 +714,8 @@
               已选择
             </div>
           </div>
-        </div>
+        </div> -->
+       
       </div>
       <div class="choiceBottom">
         <el-button class="cb_btn" size="mini" @click="noChangeRole()"
@@ -825,11 +852,28 @@ export default {
       choseRoleItem: null,
       cardType: 0,
       roleList: [],
-			roleList2: [],
-      sortOption: 0 //切换角色 0我的 1 社区
+      roleList2: [],
+      sortOption: 0, //切换角色 0我的 1 社区
+      roleText: ""
     };
   },
   computed: {
+    showRoleList() {
+      let _result = [];
+
+      if (this.sortOption == 0) {
+        _result = this.roleList;
+      } else if (this.sortOption == 1) {
+        _result = this.roleList2;
+      }
+
+      if (this.roleText) {
+        _result = _result.filter(
+          i => i.assistantName.indexOf(this.roleText) != -1
+        );
+      }
+      return _result;
+    },
     openAtBox() {
       // return false;
       if (this.text.length == 0) return false;
@@ -1065,13 +1109,13 @@ export default {
       this.$confirm("确定清空聊天记录吗?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning",
+        type: "warning"
       })
         .then(_ => {
           this.loading = true;
           let params = {
             user_id: this.userid,
-						id:"602def61-005d-11ee-91d8-005056b8q12w",
+            id: "602def61-005d-11ee-91d8-005056b8q12w",
             session_name: `${this.courseId}-studyStudent-md`
           };
 
@@ -1079,7 +1123,7 @@ export default {
             .post("https://gpt4.cocorobo.cn/delete_park_session", params)
             .then(res => {
               this.chatList = [];
-							this.stopSend();
+              this.stopSend();
               this.$message.success("清除聊天记录成功");
               this.loading = false;
             })
@@ -1137,7 +1181,7 @@ export default {
         aiContent: "",
         oldContent: "",
         isShowSynchronization: false,
-        filename: this.choseRoleItem?this.choseRoleItem.headUrl:"",
+        filename: this.choseRoleItem ? this.choseRoleItem.headUrl : "",
         index: this.chatList.length,
         is_mind_map: false,
         loading: true
@@ -1309,7 +1353,9 @@ export default {
         history.push({ type: "text", text: _text });
       }
       let params = {
-        assistant_id: this.choseRoleItem?this.choseRoleItem.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`,
@@ -2601,12 +2647,12 @@ ${_wordData}
     choseRole(item) {
       this.choseRoleItem = item;
       console.log("选择角色", this.choseRoleItem);
-			this.scrollBottom();
+      this.scrollBottom();
     },
     noChangeRole() {
       this.cardType = 0;
       this.choseRoleItem = null;
-			this.scrollBottom();
+      this.scrollBottom();
     },
     changeRole() {
       this.cardType = 0;
@@ -2923,10 +2969,10 @@ ${_wordData}
   margin-right: 5px;
 }
 
-.s_t_c_a_left>img{
-	width: 35px;
+.s_t_c_a_left > img {
+  width: 35px;
   height: 35px;
-	border-radius: 50%;
+  border-radius: 50%;
 }
 
 .s_t_c_a_left > span {
@@ -3524,25 +3570,26 @@ ${_wordData}
 
 .choiceRoleHeader {
   width: 100%;
+	height:100px;
+	display: flex;
   /* margin: 10px; */
-  margin-bottom: 20px;
 }
 
 .choiceRoleHeader > div {
-  font-size: 16px;
-  font-weight: bold;
+	display: flex;
 }
 
-.choiceRoleHeader > span {
-  font-size: 14px;
-}
 .choiceSelect {
   width: 100%;
+	height:calc(100% - 100px);
   display: flex;
-  height: 35px;
+	flex-direction: column;
   justify-content: flex-start;
   align-items: center;
-  margin: 15px 0;
+  padding: 10px;
+	box-sizing: border-box;
+	border-radius: 10px;
+	background: #F2F2F2;
 }
 .choiceSelect > .option {
   width: 80px;
@@ -3554,6 +3601,29 @@ ${_wordData}
   align-items: center;
   cursor: pointer;
 }
+
+.roleInput{
+	width:100%;
+	height:50px;
+}
+
+.roleBtn{
+	width:100%;
+	height:50px;
+	margin: 5px 0;
+}
+
+.roleListBox{
+	width:100%;
+	height:calc(100% - 100px - 10px);
+	overflow-x: hidden;
+	display: flex;
+	flex-direction: column;
+  justify-content: flex-start;
+  align-items: center;
+  padding: 10px;
+	box-sizing: border-box;
+}
 .filterSubjects {
   margin: 10px;
   width: 100%;
@@ -3638,7 +3708,8 @@ ${_wordData}
   display: flex;
   background: rgba(54, 169, 252, 1);
   width: 100%;
-  height: 80px;
+  height: auto;
+	padding:10px 0;
   margin: 0 auto;
   border-radius: 10px;
   margin-bottom: 15px;
@@ -3669,7 +3740,7 @@ ${_wordData}
   align-items: center;
 }
 .characterBlock > .txtRight > .bir {
-  width: 180px;
+  width: 170px;
   height: 35px;
   display: flex;
   align-items: center;