Browse Source

课堂助手

SanHQin 8 months ago
parent
commit
85f88b7811

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


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


+ 39 - 12
src/components/classRoomHelper/component/dialogArea.vue

@@ -71,11 +71,8 @@
                   src="../../../assets/icon/course/copyTxt.png"
                   alt=""
                 />
-                <img
-                  @click.stop="aiTalkAll(item)"
-                  style="width: 15px;margin:7px 0 7px 7px;"
-                  :src="require('../../../assets/icon/course/megaphone3.svg')"
-                />
+								<img @click.stop="aiTalkAll(item)" v-if="aiTalkUid==item.uid" style="width: 15px;margin:7px 0 7px 7px;" :src="require('../../../assets/icon/course/megaphone.svg')">
+								<img @click.stop="aiTalkAll(item)" v-else style="width: 15px;margin:7px 0 7px 7px;" :src="require('../../../assets/icon/course/megaphone3.svg')">
                 <img v-if="chatList.length-2 == index" @click.stop="refresh(item)" style="width: 15px;margin:7px 0 7px 7px;" :src="require('../../../assets/icon/course/refresh.svg')">
               </div>
               <div class="d_t_c_a_r_time">{{ item.createtime }}</div>
@@ -153,7 +150,10 @@
               />
             </el-tooltip>
           </div>
-          <div class="s_b_bat_right"></div>
+          <div class="s_b_bat_right">
+						<!-- <img :src="require('../../../assets/icon/course/bulb.svg')"> -->
+						<img :src="require('../../../assets/icon/course/bulb2.svg')">
+					</div>
         </div>
         <div class="d_b_btnArea">
           <div class="d_b_ba-item" @click.stop="choiceRole()">
@@ -1163,7 +1163,7 @@ export default {
 						_talkTextIiframe2.contentWindow.closesynthesizer();
 					} catch (error) {
 						return
-						
+
 					}
         }
       }
@@ -1173,11 +1173,24 @@ export default {
       // }
     },
     aiTalkAll(item) {
-      let _resultText = this.removeMarkdown(item.aiContent);
-      this.aiTalkUid = item.uid;
-      this.aiTalkList = [];
-      this.aiTalkList.push(_resultText);
-      this.aiTalk(0)
+			if(this.aiTalkUid!=item.uid){
+				let _resultText = this.removeMarkdown(item.aiContent);
+      	this.aiTalkUid = item.uid;
+      	this.aiTalkList = [];
+      	this.aiTalkList.push(_resultText);
+      	this.aiTalk(0)
+			}else{
+				try {
+					this.aiTalkList = [];
+					let _talkTextIiframe2 = this.$refs.iiframe2;
+					_talkTextIiframe2.contentWindow.pausesynthesizer();
+          _talkTextIiframe2.contentWindow.closesynthesizer();
+					this.aiIsTalk = false;
+				} catch (error) {
+					this.aiTalkList = [];
+					this.aiIsTalk = false;
+				}
+			}
       // console.log(_resultText);
     }
   },
@@ -1721,6 +1734,20 @@ export default {
   margin-right: 5px;
 }
 
+.s_b_bat_right{
+	width: auto;
+  height: 100%;
+  display: flex;
+  align-items: flex-end;
+}
+
+.s_b_bat_right > img {
+  width: 25px;
+  height: 25px;
+  /* cursor: pointer; */
+  margin-right: 5px;
+}
+
 .voice_or_keyboard {
   width: 35px;
   height: 35px;

+ 61 - 25
src/components/classRoomHelper/component/searchArea.vue

@@ -97,7 +97,8 @@
                 src="../../../assets/icon/course/copyTxt.png"
                 alt=""
               />
-              <img @click.stop="aiTalkAll(item)" style="width: 15px;margin-bottom: 7px;" :src="require('../../../assets/icon/course/megaphone3.svg')">
+              <img @click.stop="aiTalkAll(item)" v-if="aiTalkUid==item.uid" style="width: 15px;margin:7px 0 7px 7px;" :src="require('../../../assets/icon/course/megaphone.svg')">
+							<img @click.stop="aiTalkAll(item)" v-else style="width: 15px;margin:7px 0 7px 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
@@ -221,7 +222,10 @@
             />
           </el-tooltip>
         </div>
-        <div class="s_b_bat_right"></div>
+        <div class="s_b_bat_right">
+					<!-- <img :src="require('../../../assets/icon/course/bulb.svg')"> -->
+					<img :src="require('../../../assets/icon/course/bulb2.svg')">
+				</div>
       </div>
       <div class="s_b_btnArea">
         <div
@@ -2381,33 +2385,39 @@ ${_wordData}
     aiTalk(type = 0) {
       //0 新的  1继续
       if (type == 0 && this.aiIsTalk) {
-				let _talkTextIiframe2 = this.$refs.iiframe2;
-				_talkTextIiframe2.contentWindow.pausesynthesizer();
-				_talkTextIiframe2.contentWindow.closesynthesizer();
-				this.aiIsTalk = false;
-				if(this.aiTalkList.length)this.aiTalk(0);
+        let _talkTextIiframe2 = this.$refs.iiframe2;
+        try {
+          _talkTextIiframe2.contentWindow.pausesynthesizer();
+          _talkTextIiframe2.contentWindow.closesynthesizer();
+          this.aiIsTalk = false;
+          if (this.aiTalkList.length) this.aiTalk(0);
+        } catch (error) {
+          // console.log("error")
+          this.aiIsTalk = false;
+          if (this.aiTalkList.length) this.aiTalk(0);
+        }
       } else {
         let _text = this.aiTalkList.shift();
-				let _talkTextIiframe2 = this.$refs.iiframe2;
+        let _talkTextIiframe2 = this.$refs.iiframe2;
         if (_text) {
-					this.aiIsTalk = true;
+          this.aiIsTalk = true;
           // console.log("👇说👇");
           // console.log(_text);
-					_talkTextIiframe2.contentWindow.texttospeech(
-        	  _text,
-        	  ()=>{
-							this.aiTalk(1);
-						},
-						()=>{
-							this.aiIsTalk = false;
-						}
-        	);
+          _talkTextIiframe2.contentWindow.texttospeech(
+            _text,
+            () => {
+              this.aiTalk(1);
+            },
+            () => {
+              this.aiTalk(0);
+            }
+          );
         } else {
           try {
 						_talkTextIiframe2.contentWindow.closesynthesizer();
 					} catch (error) {
 						return
-						
+
 					}
         }
       }
@@ -2417,12 +2427,24 @@ ${_wordData}
       // }
     },
 		aiTalkAll(item){
-
-			let _resultText = this.removeMarkdown(item.aiContent);
-			this.aiTalkUid = item.uid;
-			this.aiTalkList = [];
-			this.aiTalkList.push(_resultText)
-			this.aiTalk(0)
+ if(this.aiTalkUid!=item.uid){
+				let _resultText = this.removeMarkdown(item.aiContent);
+      	this.aiTalkUid = item.uid;
+      	this.aiTalkList = [];
+      	this.aiTalkList.push(_resultText);
+      	this.aiTalk(0)
+			}else{
+				try {
+					this.aiTalkList = [];
+					let _talkTextIiframe2 = this.$refs.iiframe2;
+					_talkTextIiframe2.contentWindow.pausesynthesizer();
+          _talkTextIiframe2.contentWindow.closesynthesizer();
+					this.aiIsTalk = false;
+				} catch (error) {
+					this.aiTalkList = [];
+					this.aiIsTalk = false;
+				}
+			}
 			// console.log(_resultText)
 		},
   },
@@ -2710,6 +2732,20 @@ ${_wordData}
   margin-right: 5px;
 }
 
+.s_b_bat_right{
+	width: auto;
+  height: 100%;
+  display: flex;
+  align-items: flex-end;
+}
+
+.s_b_bat_right > img {
+  width: 25px;
+  height: 25px;
+  /* cursor: pointer; */
+  margin-right: 5px;
+}
+
 .s_b_btnArea {
   width: 100%;
   height: 30px;

+ 38 - 7
src/components/classRoomHelper/component/taskArea.vue

@@ -138,7 +138,8 @@
                 src="../../../assets/icon/course/copyTxt.png"
                 alt=""
               />
-							<img @click.stop="aiTalkAll(item)" style="width: 15px;margin:7px 0 7px 7px;" :src="require('../../../assets/icon/course/megaphone3.svg')">
+							<img @click.stop="aiTalkAll(item)" v-if="aiTalkUid==item.uid" style="width: 15px;margin:7px 0 7px 7px;" :src="require('../../../assets/icon/course/megaphone.svg')">
+							<img @click.stop="aiTalkAll(item)" v-else style="width: 15px;margin:7px 0 7px 7px;" :src="require('../../../assets/icon/course/megaphone3.svg')">
               <img v-if="chatList.length-2 == index" @click.stop="refresh(item)" style="width: 15px;margin:7px 0 7px 7px;" :src="require('../../../assets/icon/course/refresh.svg')">
             </div>
             <div class="t_t_c_a_r_time">{{ item.createtime }}</div>
@@ -213,7 +214,10 @@
             />
           </el-tooltip>
         </div>
-        <div class="s_b_bat_right"></div>
+        <div class="s_b_bat_right">
+					<!-- <img :src="require('../../../assets/icon/course/bulb.svg')"> -->
+					<img :src="require('../../../assets/icon/course/bulb2.svg')">
+				</div>
       </div>
       <div class="t_b_btnArea">
         <!-- <div class="s_b_ba-item" @click.stop="choiceRole()">选择角色</div> -->
@@ -1327,11 +1331,24 @@ Instruction: Based on the context, follow "Format example", write content.
       // }
     },
     aiTalkAll(item) {
-      let _resultText = this.removeMarkdown(item.aiContent);
-      this.aiTalkUid = item.uid;
-      this.aiTalkList = [];
-      this.aiTalkList.push(_resultText);
-      this.aiTalk(0)
+      if(this.aiTalkUid!=item.uid){
+				let _resultText = this.removeMarkdown(item.aiContent);
+      	this.aiTalkUid = item.uid;
+      	this.aiTalkList = [];
+      	this.aiTalkList.push(_resultText);
+      	this.aiTalk(0)
+			}else{
+				try {
+					this.aiTalkList = [];
+					let _talkTextIiframe2 = this.$refs.iiframe2;
+					_talkTextIiframe2.contentWindow.pausesynthesizer();
+          _talkTextIiframe2.contentWindow.closesynthesizer();
+					this.aiIsTalk = false;
+				} catch (error) {
+					this.aiTalkList = [];
+					this.aiIsTalk = false;
+				}
+			}
       // console.log(_resultText);
     }
   },
@@ -1865,6 +1882,20 @@ th {
   cursor: pointer;
   margin-right: 5px;
 }
+
+.s_b_bat_right{
+	width: auto;
+  height: 100%;
+  display: flex;
+  align-items: flex-end;
+}
+
+.s_b_bat_right > img {
+  width: 25px;
+  height: 25px;
+  /* cursor: pointer; */
+  margin-right: 5px;
+}
 .voice_or_keyboard {
   width: 35px;
   height: 35px;

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