Kaynağa Gözat

Merge branch 'beta' into HK

lsc 1 yıl önce
ebeveyn
işleme
f851ee2e85

+ 4 - 0
dist/index.html

@@ -27,7 +27,11 @@
     html,
     body{
       font-family: '黑体';
+<<<<<<< HEAD
     }</style><link href=./static/css/app.12d454b91b159749af9397c661b03e8b.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.db8aabf79454924ff575.js></script><script type=text/javascript src=./static/js/app.bd2bc87be4ad630488bc.js></script></body></html><script>function stopSafari() {
+=======
+    }</style><link href=./static/css/app.9620f48f5b232dacf7706814a23f499b.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.733814fc48c2bd2222aa.js></script><script type=text/javascript src=./static/js/app.3771410f2bd504e274a9.js></script></body></html><script>function stopSafari() {
+>>>>>>> beta
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
dist/static/css/app.9620f48f5b232dacf7706814a23f499b.css


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
dist/static/css/app.9620f48f5b232dacf7706814a23f499b.css.map


BIN
dist/static/img/ai.da539cd.png


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 0
dist/static/js/app.3771410f2bd504e274a9.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 0
dist/static/js/app.3771410f2bd504e274a9.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 0
dist/static/js/app.bd2bc87be4ad630488bc.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
dist/static/js/app.bd2bc87be4ad630488bc.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
dist/static/js/vendor.733814fc48c2bd2222aa.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 0
dist/static/js/vendor.733814fc48c2bd2222aa.js.map


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
dist/static/js/vendor.db8aabf79454924ff575.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
dist/static/js/vendor.db8aabf79454924ff575.js.map


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


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


+ 9 - 1
src/common/axios.config.js

@@ -17,7 +17,15 @@ axios.interceptors.request.use((config) => {
     }
     if (config.url === 'https://gpt.cocorobo.cn/chat' || config.url === 'https://gpt4.cocorobo.cn/imageAnalyse' || config.url === 'https://gpt4.cocorobo.cn/create_free_assistants' || config.url === 'https://gpt4.cocorobo.cn/assistants_completion_response') {
         config.data = config.data //序列化post 参数
-    } else if (config.data && config.data[0].post == '1' && config.method === 'post') {
+    }else if(config.url.indexOf('https://gpt4.cocorobo.cn/')!=-1){
+			config.headers = {
+				'Content-Type': 'application/json',
+		}
+	 }else if(config.url.indexOf('https://gpt.cocorobo.cn/')!=-1){
+        config.headers = {
+            'Content-Type': 'application/json',
+    }
+ } else if (config.data && config.data[0].post == '1' && config.method === 'post') {
         config.data = 'mode=' + (Object.values(config.data[0]).join(',')) //序列化post 参数
     } else if (config.method === 'post') {
 

+ 1206 - 675
src/components/classRoomHelper/component/dialogArea.vue

@@ -1,72 +1,173 @@
 <template>
-	<div class="dialog">
-		<div v-show="cardType == 0">
-			<div class="d_top" ref="chatRef">
-				<div class="d_t_chat" v-for="(item,index) in chatList" :key="index">
-					<div class="d_t_c_user" v-if="item.role =='user'">
-						<div class="d_t_c_u_left">
-							<div class="d_t_c_u_l_content">{{item.content}}</div>
-							<div class="d_t_c_u_l_time">{{item.time}}</div>
-						</div>
-						<div class="d_t_c_u_right">
-							<span>我</span>
-						</div>
-					</div>
+  <div class="dialog">
+    <div v-show="cardType == 0">
+      <div class="d_top" ref="chatRef">
+        <div class="d_t_chat" v-for="(item, index) in chatList" :key="index">
+          <div class="d_t_c_user" v-if="item.content">
+            <div class="d_t_c_u_left">
+              <div class="d_t_c_u_l_content">{{ item.content }}</div>
+              <div class="d_t_c_u_l_time">{{ item.createtime }}</div>
+            </div>
+            <div class="d_t_c_u_right">
+              <span>我</span>
+            </div>
+          </div>
 
-					<div class="d_t_c_ai" v-if="item.role =='ai'">
-						<div class="d_t_c_a_left">
-							<span>Ai</span>
-						</div>
-						<div class="d_t_c_a_right">
-							<div class="d_t_c_a_r_content"  v-loading="loading && index==chatList.length-1">{{ item.content }}</div>
-							<div class="d_t_c_a_r_time">{{item.time}}</div>
-						</div>
-						
-					</div>
-				</div>
-				
-			</div>
-			<div class="d_bottom">
-				<div class="d_b_btnArea">
-					<div class="d_b_ba-item" @click.stop="choiceRole()">
-					<img style="width: 20px;" src="../../../assets/icon/course/role.png" alt="">
-					选择角色
-				</div>
-				</div>
-				<div class="d_b_inputArea">
-					<div class="d_b_tape" @click="goTape()"></div>
-					<div class="d_b_input">
-						<el-input :disabled="loading" @keyup.enter.native="send()" class="d_b_i_left" v-model="text"></el-input>
-						<div class="d_b_i_right" @click="sendFile()">
+          <div class="d_t_c_ai">
+            <div class="d_t_c_a_left">
+              <el-avatar v-if="item.filename" :src="item.filename"></el-avatar>
+              <span v-else>Ai</span>
+            </div>
+            <div class="d_t_c_a_right">
+              <div class="d_t_c_a_r_content" style="display: flex;justify-content: space-between;flex-wrap: wrap;" v-if="item.content.includes('图片')">
+                <div
+                  v-if="!pan(item.aiContent).length"
+                  class="d_t_c_a_r_content"
+                  v-loading="item.loading"
+                  v-html="item.aiContent"
+                ></div>
+                
+                <div v-else v-for="i in pan(item.aiContent)">
+                    <img style="width: 120px;height: 120px;" :src="i.image" alt="" @click="previewImg(i.image)">
+                </div>
+              </div>
+              <div
+                v-else
+                class="d_t_c_a_r_content"
+                v-loading="item.loading"
+                v-html="item.aiContent"
+              ></div>
+              <div class="d_t_c_a_r_time">{{ item.createtime }}</div>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div class="d_bottom">
+        <div class="d_b_btnArea">
+          <div class="d_b_ba-item" @click.stop="choiceRole()">
+            <img
+              style="width: 20px;"
+              src="../../../assets/icon/course/role.png"
+              alt=""
+            />
+            选择角色
+          </div>
+          <div class="d_b_ba-item" @click.stop="clear()">
+            清空聊天记录
+          </div>
+        </div>
+        <div class="d_b_inputArea">
+          <!-- <div class="d_b_tape" @click="goTape()"></div> -->
+          <div class="d_b_input">
+            <el-input
+              :disabled="loading || chatLoading"
+              v-loading="loading || chatLoading"
+              @keyup.enter.native="send()"
+              class="d_b_i_left"
+              v-model="text"
+            ></el-input>
+            <!-- <div class="d_b_i_right" @click="sendFile()">
 							<span></span>
-						</div>
-					</div>
-					<div class="d_b_btn" @click="send()">
-						<span></span>
-					</div>
-				</div>
-			</div>
-		</div>
-		<div class="" v-show="cardType == 1">
-			<div class="choiceTop">
-				<div class="choiceRoleHeader">
-					<div>切换角色:</div>
-					<span>您希望以下哪个角色回答您的问题,请选择:</span>
-				</div>
-
-				<div class="characterBlock" v-for="(item,index) in roleList" :key="item.id" @click.stop="roleType=index">
-					<div class="imgLeft">
-						<div class="img">
-							<img style="width: 100%;height: 100%;" :src="item.avatar">
-						</div>
-					</div>
-					<div class="txtRight">
-						<div class="bir">{{ item.bir }}</div>
-						<div :style="{color: '#fff',display: roleType ==index?'block':'none'  }">已选择</div>
-						<!-- <span></span> -->
-					</div>
-				</div>
-				<div class="characterBlock" @click="addCharacter">
+						</div> -->
+          </div>
+          <div class="d_b_btn" @click="send()">
+            <span></span>
+          </div>
+        </div>
+      </div>
+    </div>
+    <div class="" v-show="cardType == 1">
+      <div class="choiceTop">
+        <div class="choiceRoleHeader">
+          <div>切换角色:</div>
+          <span>您希望以下哪个角色回答您的问题,请选择:</span>
+        </div>
+        <div class="choiceSelect">
+          <el-button
+            class="option"
+            :style="{
+              background: sortOption == 0 ? '#36A9FC' : '',
+              color: sortOption == 0 ? '#fff' : ''
+            }"
+            @click="optBtn(0)"
+            plain
+            >我的</el-button
+          >
+          <el-button
+            class="option"
+            :style="{
+              background: sortOption == 1 ? '#36A9FC' : '',
+              color: sortOption == 1 ? '#fff' : ''
+            }"
+            @click="optBtn(1)"
+            plain
+            >社区</el-button
+          >
+        </div>
+        <div
+          class="characterBlock"
+          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.avatar" />
+            </div>
+          </div>
+          <div class="txtRight">
+            <div class="bir">{{ item.assistantName }}</div>
+            <div
+              :style="{
+                color: '#fff',
+                display:
+                  choseRoleItem.assistant_id == item.assistant_id
+                    ? 'block'
+                    : 'none'
+              }"
+            >
+              已选择
+            </div>
+            <!-- <span></span> -->
+          </div>
+        </div>
+        <div
+          class="characterBlock"
+          v-if="sortOption == 1"
+          v-for="(item, index) in roleList2"
+          :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')
+                "
+              />
+            </div>
+          </div>
+          <div class="txtRight">
+            <div class="bir">{{ item.assistantName }}</div>
+            <div
+              :style="{
+                color: '#fff',
+                display:
+                  choseRoleItem.assistant_id == item.assistant_id
+                    ? 'block'
+                    : 'none'
+              }"
+            >
+              已选择
+            </div>
+            <!-- <span></span> -->
+          </div>
+        </div>
+        <!-- <div class="characterBlock" @click="addCharacter">
 					<div class="imgLeft">
 						<div class="img2">
 							<img style="width: 100%;height: 100%;" src="https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/basil_add-outline1715564539170.png">
@@ -75,9 +176,9 @@
 					<div class="txtRight">
 						<div style="color: #fff;margin-left: 5px;">添加新角色</div>
 					</div>
-				</div>
+				</div> -->
 
-				<!-- <div class="filterSubjects">
+        <!-- <div class="filterSubjects">
 					<div class="fs_title">筛选科目</div>
 					<div class="fs_box">
 						<div :class="['fs_b_item',subjectsType==index?'fs_b_itemActive':'']" v-for="(item,index) in subjectsList" :key="index" @click="subjectsType = index">{{ item }}</div>
@@ -93,667 +194,1097 @@
 						</div>
 					</div>
 				</div> -->
-			</div>
-			<div class="choiceBottom">
-				<el-button class="cb_btn" size="mini" @click="noChangeRole()">取消</el-button>
-				<el-button class="cb_btn" size="mini" type="primary"  @click="changeRole()">确定</el-button>
-			</div>
-		</div>
-	</div>
+      </div>
+      <div class="choiceBottom">
+        <el-button class="cb_btn" size="mini" @click="noChangeRole()"
+          >取消</el-button
+        >
+        <el-button
+          class="cb_btn"
+          size="mini"
+          type="primary"
+          @click="changeRole()"
+          >确定</el-button
+        >
+      </div>
+    </div>
+  </div>
 </template>
 
 <script>
-	export default {
-		data(){
-			return{
-				cardType:0,//0-对话 1-选角色
-				text:"",
-				subjectsList:['语文',"数学","英语","科学","信息","历史","地理","政治","生物","化学","物理","其他"],
-				subjectsType:-1,
-				rightSubjects:-1,
-				roleType:-1,
-				rightRole:-1,
-				loading:false,
-				roleList:[
-					{id:0,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"爱因斯坦",bir:'我是爱因斯坦'},
-					{id:1,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"居里夫人",bir:'我是居里夫人'},
-					{id:2,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"达尔文",bir:'我是达尔文'},
-					// {id:3,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"莱昂纳多·达芬奇"},
-					// {id:4,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"列文虎克"},
-					// {id:5,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"詹姆斯·瓦特"},
-					// {id:6,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"瑞秋·卡森"},
-					// {id:7,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"尼古拉·特斯拉"},
-					// {id:8,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"约翰·穆尔"},
-					// {id:9,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"艾萨克·牛顿"},
-					// {id:10,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"伽利略"},
-					// {id:11,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"格雷戈尔·孟德尔"},
-					// {id:12,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"张衡"},
-					// {id:13,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"李时珍"},
-					// {id:14,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"钱学森"},
-					// {id:15,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"阿基米德"},
-					// {id:16,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"霍金"},
-					// {id:17,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"蔡伦"},
-					// {id:18,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"詹姆斯·瓦特"},
-					// {id:19,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"路易·巴斯德"},
-					// {id:20,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"阿尔弗雷德·诺贝尔"},
-					// {id:21,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"詹姆斯·麦克斯韦"},
-					// {id:22,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"亚历山大·格拉汉姆·贝尔"},
-					// {id:23,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"约翰内斯·开普勒"},
-					// {id:24,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"安德烈·安培"},
-				],
-				chatList:[
-					{
-						role:"ai",
-						content:`您好,有什么可以帮助您的吗?`,
-						time:new Date().toLocaleString().replace(/\//ig,'-')
-					},
-				],
-			}
-		},
-		methods: {
-			addCharacter(){
-				this.$message.info("点击了添加新角色")
-			},
-			choiceRole(){
-				if(this.loading)return this.$message.info("请稍等")
-				this.cardType = 1;
-			},
-			sendFile(){
-				if(this.loading)return this.$message.info("请稍等")
-				this.$message.info("点击了附件")
-			},
-			goTape(){
-				if(this.loading)return this.$message.info("请稍等")
-				this.$message.info(`点击了语音`)
-			},
-			send(){
-				if (this.loading) return this.$message.info("请稍等");
-				if(this.text.trim().length==0)return this.$message.info("请输入内容")
-				this.loading = true;
-				this.chatList.push({
-					role:"user",
-					content:this.text,
-					time:new Date().toLocaleString().replace(/\//ig,'-')
-				})
-				
-				this.chatList.push({
-					role:"ai",
-					content:"",//这里需要调用接口
-					time:new Date().toLocaleString().replace(/\//ig,'-')
-				})
-				this.$nextTick(() => {
-				  	this.$refs.chatRef.scrollTop = this.$refs.chatRef.scrollHeight;
-					});;
-				setTimeout(()=>{
-					let aiContent="对不起,这个问题我回答不了。"
-					switch(this.text){
-						case "为什么要进行垃圾分类?":
-							aiContent=`想象一下,我们的家里如果有很多东西乱丢一团,找东西的时候会很麻烦对吧?而且如果不清理,家里会变得很脏,还可能招来小虫子。垃圾也是一样的,如果我们把所有的垃圾都扔在一起,不仅会污染环境,还会浪费很多可以再利用的资源。
-垃圾分类就是把不同类型的垃圾分开扔。比如,有的垃圾是可以再回收利用的,像纸张、塑料瓶、玻璃瓶等,这些如果分开收集,就可以送到特殊的地方去重新处理,变成新的东西再次使用。还有一些垃圾是厨余垃圾,比如剩饭剩菜,这种可以做成肥料帮助植物生长。而其他一些不能回收的垃圾,就需要另外处理,确保它们不会对环境造成伤害。
-通过垃圾分类,我们可以减少污染,节约资源,让我们的城市更干净,也保护了我们的地球。所以,学会正确的垃圾分类,是每个人都应该做的一件重要的事情哦!`
-							break;
-						case "玻璃是可回收垃圾吗?为什么?":
-							aiContent=`是的,玻璃是可以回收的垃圾。因为玻璃可以被融化后重新制成新的玻璃制品,比如瓶子和罐子。这样做可以减少我们从自然中取材料来制造新玻璃,也可以减少垃圾的数量,保护我们的环境。所以,当我们用完玻璃制品后,应该把它们放到回收箱里,而不是扔到普通垃圾桶里。这样我们就可以帮助地球更健康。`
-							break;
-					}
-					if(this.rightRole==1){
-						switch(this.text){
-							case "为什么要进行垃圾分类":
-								aiContent=`
-								尊敬的小朋友们,今天我们要探讨一个非常重要的话题——为什么我们要进行垃圾分类。我是居里夫人,虽然我的主要研究领域是放射性元素,但我一直相信科学可以改善我们的生活环境和保护我们的地球。
-首先,我们要知道地球是我们共同的家,保护环境就是保护我们自己的家园。在我的研究生涯中,我发现了镭和钋这样的放射性元素,这些发现不仅推动了科学的进步,也让我们更加意识到科学研究与环境保护之间的联系。
-垃圾分类,简单来说,就是将垃圾分成几类,比如可回收物、有害垃圾、湿垃圾(厨余垃圾)和干垃圾。这样做的目的是让垃圾能够更有效地被回收和处理,减少对环境的污染。
-想象一下,如果我们把所有的垃圾都混在一起,那么回收和处理这些垃圾就会变得非常困难。有些有害垃圾可能会释放出有毒物质,污染土壤和水源,这对我们的健康是非常不利的。而且,混合的垃圾很难进行有效的资源回收,这意味着更多的资源会被浪费。
-通过垃圾分类,我们可以将可回收的材料如纸张、塑料、金属和玻璃分开收集,这些材料可以被再利用,制成新的产品。这不仅可以减少对自然资源的开采,还可以减少能源消耗和碳排放,帮助我们对抗全球变暖。
-此外,有害垃圾如废电池和废药品需要特殊处理,防止它们对环境造成伤害。通过正确分类,我们可以确保这些有害物质得到安全处理,保护我们的地球。
-我在研究放射性元素时,深刻体会到科学与环境之间的密切关系。每一次实验,我都尽可能地减少对环境的影响。这种对环境负责的态度,也是我们进行垃圾分类的原因之一。
-亲爱的小朋友们,通过垃圾分类,我们不仅可以保护环境,还可以学习到责任感和科学的方法。希望你们从小培养保护环境的意识,用实际行动为保护我们的地球贡献自己的力量。记住,每一个小小的行动,都是对未来的投资。
-								`
-								break;
-						}
-					}
-					// this.chatList.push({
-					// 	role:"ai",
-					// 	content:aiContent,//这里需要调用接口
-					// 	time:new Date().toLocaleString().replace(/\//ig,'-')
-					// })
-					this.chatList[this.chatList.length - 1].content = aiContent;
-          this.chatList[
-            this.chatList.length - 1
-          ].time = new Date().toLocaleString().replace(/\//gi, "-");
-					this.loading = false;
-					this.$nextTick(() => {
-				  	this.$refs.chatRef.scrollTop = this.$refs.chatRef.scrollHeight;
-					});
-					this.text = "";
-					
-				},5000)
-				// this.chatList.push({
-				// 	role:"user",
-				// 	content:this.text,
-				// 	time:"2023-11-11 11:10:11"
-				// },{
-				// 	role:"ai",
-				// 	content:`小朋友,你真棒!`,//这里需要调用接口
-				// 	time:"2023-11-11 11:10:11"
-				// })
-				// this.text = "";
-				// // 元素滚动条触底
-				
-			},
-			changeRole(){
-				this.loading = true;
-				this.cardType = 0;
-				this.rightSubjects = this.subjectsType;
-				this.rightRole = this.roleType;
-				this.chatList = [];
-				this.chatList.push({
-					role:"ai",
-					content:"",//这里需要调用接口
-					time:new Date().toLocaleString().replace(/\//ig,'-')
-				})
-				setTimeout(()=>{
-					let aiContent = "你好";
-					switch(this.rightRole){
-						case 0:
-							aiContent = "你好,我是爱因斯坦,相对论的提出者,相信科学的力量可以揭示宇宙的奥秘。"
-							break;
-						case 1:
-							aiContent = "你好,我是居里夫人,放射性研究的先驱,第一位获得两次诺贝尔奖的女性。"
-							break;
-						case 2:
-							aiContent = "你好,我是查尔斯·达尔文,进化论的创立者,相信物种通过自然选择不断进化。"
-							break;
-						case 3:
-							aiContent = "你好,我是达芬奇,文艺复兴的象征,艺术与科学的多面手。"
-							break;
-						case 4:
-							aiContent = "你好,我是列文虎克,通过我的简单显微镜,开启了微生物学的大门。"
-							break;
-						case 5:
-							aiContent = "你好,我是詹姆斯·瓦特,改良了蒸汽机,为工业革命提供了动力。"
-							break;
-						case 6:
-							aiContent = "你好,我是瑞秋·卡森,环保运动的先驱,通过《寂静的春天》提醒世界关注环境保护。"
-							break;
-						case 7:
-							aiContent = "你好,我是特斯拉,交流电的推广者,致力于无线电和电力传输的研究。"
-							break;
-						case 8:
-							aiContent = "你好,我是约翰·穆尔,自然保护的倡导者,努力保护美国的森林和野生地区。"
-							break;
-						case 9:
-							aiContent = "你好,我是牛顿,万有引力和三大运动定律的发现者,为现代物理学奠定了基础。"
-							break;
-						case 10:
-							aiContent = "你好,我是伽利略,通过望远镜观测支持了日心说,被誉为现代观测天文学之父。"
-							break;
-						case 11:
-							aiContent = "你好,我是孟德尔,遗传学的奠基人,通过豌豆实验发现了遗传的基本规律。"
-							break;
-						case 12:
-							aiContent = "你好,我是张衡,东汉杰出的天文学家和科学家,发明了地动仪。"
-							break;
-						case 13:
-							aiContent = "你好,我是李时珍,中国古代著名的医学家,编纂了《本草纲目》。"
-							break;
-						case 14:
-							aiContent = "你好,我是钱学森,现代火箭科学的奠基人之一,被誉为“中国航天之父”。"
-							break;
-						case 15:
-							aiContent = "你好,我是阿基米德,古希腊的数学家和物理学家,提出了浮力原理。"
-							break;
-						case 16:
-							aiContent = "你好,我是斯蒂芬·霍金,研究黑洞和宇宙起源,致力于解释宇宙的奥秘。"
-							break;
-						case 17:
-							aiContent = "你好,我是蔡伦,东汉时期改进了造纸术,使纸张更加广泛地应用于社会。"
-							break;
-						case 18:
-							aiContent = "你好,我是詹姆斯·瓦特,改良了蒸汽机,为工业革命提供了动力。"
-							break;
-						case 19:
-							aiContent = "你好,我是路易·巴斯德,微生物学的奠基人,发现了疫苗和巴斯德消毒法。"
-							break;
-						case 20:
-							aiContent = "你好,我是诺贝尔,发明了炸药,为和平与科学的贡献设立了诺贝尔奖。"
-							break;
-						case 21:
-							aiContent = "你好,我是麦克斯韦,统一了电磁理论,提出了麦克斯韦方程组。"
-							break;
-						case 22:
-							aiContent = "你好,我是贝尔,电话的发明者,致力于通信技术的发展和听力障碍人士的教育。"
-							break;
-						case 23:
-							aiContent = "你好,我是开普勒,行星运动三大定律的发现者,为天文学和物理学的发展做出了重要贡献。"
-							break;
-						case 24:
-							aiContent = "你好,我是安培,电磁学的先驱之一,提出了电流的磁效应。"
-							break;
-					}
-					this.chatList[this.chatList.length - 1].content = aiContent;
-          this.chatList[
-            this.chatList.length - 1
-          ].time = new Date().toLocaleString().replace(/\//gi, "-");
-					this.loading = false;
-				},2000)
-
-			},
-			noChangeRole(){
-				this.cardType = 0;
-				this.subjectsType = this.rightSubjects;
-				this.roleType = this.rightRole;
-			}
-		},
-	}
+import { v4 as uuidv4 } from "uuid";
+import MarkdownIt from "markdown-it";
+export default {
+  data() {
+    return {
+      cardType: 0, //0-对话 1-选角色
+      userid: this.$route.query.userid,
+      courseId: this.$route.query.courseId,
+      org: this.$route.query.org,
+      choseRoleItem: {},
+      text: "",
+      sortOption: 0, //切换角色 0我的 1 社区
+      subjectsList: [
+        "语文",
+        "数学",
+        "英语",
+        "科学",
+        "信息",
+        "历史",
+        "地理",
+        "政治",
+        "生物",
+        "化学",
+        "物理",
+        "其他"
+      ],
+      subjectsType: -1,
+      rightSubjects: -1,
+      roleType: -1,
+      rightRole: -1,
+      loading: false,
+      chatLoading: false,
+      roleList2: [
+        {
+          id: 3,
+          avatar: require("../../../assets/icon/course/aiAvatar.png"),
+          name: "莱昂纳多·达芬奇",
+          bir: "我是莱昂纳多·达芬奇"
+        },
+        {
+          id: 4,
+          avatar: require("../../../assets/icon/course/aiAvatar.png"),
+          name: "列文虎克",
+          bir: "我是列文虎克"
+        },
+        {
+          id: 5,
+          avatar: require("../../../assets/icon/course/aiAvatar.png"),
+          name: "詹姆斯·瓦特",
+          bir: "我是詹姆斯·瓦特"
+        },
+        {
+          id: 6,
+          avatar: require("../../../assets/icon/course/aiAvatar.png"),
+          name: "瑞秋·卡森",
+          bir: "我是瑞秋·卡森"
+        },
+        {
+          id: 7,
+          avatar: require("../../../assets/icon/course/aiAvatar.png"),
+          name: "尼古拉·特斯拉",
+          bir: "我是尼古拉·特斯拉"
+        },
+        {
+          id: 8,
+          avatar: require("../../../assets/icon/course/aiAvatar.png"),
+          name: "约翰·穆尔",
+          bir: "我是约翰·穆尔"
+        }
+      ],
+      roleList: [
+        {
+          id: 0,
+          avatar: require("../../../assets/icon/course/aiAvatar.png"),
+          name: "爱因斯坦",
+          bir: "我是爱因斯坦"
+        },
+        {
+          id: 1,
+          avatar: require("../../../assets/icon/course/aiAvatar.png"),
+          name: "居里夫人",
+          bir: "我是居里夫人"
+        },
+        {
+          id: 2,
+          avatar: require("../../../assets/icon/course/aiAvatar.png"),
+          name: "达尔文",
+          bir: "我是达尔文"
+        }
+        // {id:3,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"莱昂纳多·达芬奇"},
+        // {id:4,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"列文虎克"},
+        // {id:5,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"詹姆斯·瓦特"},
+        // {id:6,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"瑞秋·卡森"},
+        // {id:7,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"尼古拉·特斯拉"},
+        // {id:8,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"约翰·穆尔"},
+        // {id:9,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"艾萨克·牛顿"},
+        // {id:10,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"伽利略"},
+        // {id:11,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"格雷戈尔·孟德尔"},
+        // {id:12,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"张衡"},
+        // {id:13,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"李时珍"},
+        // {id:14,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"钱学森"},
+        // {id:15,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"阿基米德"},
+        // {id:16,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"霍金"},
+        // {id:17,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"蔡伦"},
+        // {id:18,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"詹姆斯·瓦特"},
+        // {id:19,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"路易·巴斯德"},
+        // {id:20,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"阿尔弗雷德·诺贝尔"},
+        // {id:21,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"詹姆斯·麦克斯韦"},
+        // {id:22,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"亚历山大·格拉汉姆·贝尔"},
+        // {id:23,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"约翰内斯·开普勒"},
+        // {id:24,avatar:require("../../../assets/icon/course/aiAvatar.png"),name:"安德烈·安培"},
+      ],
+      chatList: []
+    };
+  },
+  computed: {
+    pan() {
+      return (content) => {
+        try {
+        return JSON.parse(content)
+      } catch (error) {
+        return []
+      }
+      };
+    }
+  },
+  methods: {
+    previewImg(url) {
+      this.$hevueImgPreview(url);
+    },
+    clear() {
+      this.chatList = [];
+    },
+    // addCharacter(){
+    // 	this.$message.info("点击了添加新角色")
+    // },
+    optBtn(val) {
+      this.sortOption = val;
+    },
+    choiceRole() {
+      if (this.loading) return this.$message.info("请稍等");
+      this.cardType = 1;
+    },
+    // sendFile() {
+    //   if (this.loading) return this.$message.info("请稍等");
+    //   this.$message.info("点击了附件");
+    // },
+    // goTape() {
+    //   if (this.loading) return this.$message.info("请稍等");
+    //   this.$message.info(`点击了语音`);
+    // },
+    send(_text = this.text) {
+      if (this.loading || this.chatLoading) return this.$message.info("请稍等");
+      if (_text.trim().length == 0) return this.$message.info("请输入内容");
+      this.chatLoading = true;
+      if (this.choseRoleItem.assistant_id) {
+        let _uid = uuidv4();
+        let _item = this.choseRoleItem;
+        this.chatList.push({
+          loading: true,
+          role: "user",
+          content: `${_text}`,
+          uid: _uid,
+          AI: "AI",
+          aiContent: "",
+          oldContent: "",
+          isShowSynchronization: false,
+          filename: _item.headUrl,
+          index: this.chatList.length,
+          is_mind_map: false,
+          fileid: _item.assistantName
+          // createtime: new Date().toLocaleString().replaceAll("/", "-")
+        });
+        this.text = "";
+        let params = {
+          assistant_id: this.choseRoleItem.assistant_id,
+          userId: this.userid,
+          message: _text,
+          session_name: `${this.courseId}-studyStudent`,
+          uid: _uid,
+          file_ids: []
+        };
+        this.ajax
+          .post("https://gpt4.cocorobo.cn/ai_agent_park_chat_new", params)
+          .then(res => {
+            if (res.data.FunctionResponse.result == "发送成功") {
+            } else {
+              this.chatLoading = false;
+              this.$message.warning(res.data.FunctionResponse.result);
+            }
+          })
+          .catch(err => {
+            this.chatLoading = false;
+            console.log(err);
+          });
+        this.getAtAuContent(_uid);
+      } else {
+        let _uuid = uuidv4();
+
+        
+
+        this.chatList.push({
+          role: "user",
+          content: `${_text}`,
+          uid: _uuid,
+          AI: "AI",
+          aiContent: "",
+          oldContent: "",
+          isShowSynchronization: false,
+          filename: "",
+          index: this.chatList.length,
+          is_mind_map: false,
+          loading: true
+        });
+        this.scrollBottom();
+        let params = {
+          model: "gpt-3.5-turbo",
+          temperature: 0,
+          max_tokens: 4096,
+          top_p: 1,
+          frequency_penalty: 0,
+          presence_penalty: 0,
+          messages: [{ role: "user", content: _text }],
+          uid: _uuid,
+          mind_map_question: ""
+        };
+        this.text = "";
+        console.log('发送信息',params);
+
+        this.ajax
+          .post("https://gpt4.cocorobo.cn/chat", params)
+          .then(res => {
+            if (res.data.FunctionResponse.result == "发送成功") {
+            } else {
+              this.chatLoading = false;
+              this.$message.warning(res.data.FunctionResponse.result);
+            }
+          })
+          .catch(e => {
+            this.chatLoading = false;
+            console.log(e);
+          });
+        this.getAiContent(_uuid);
+      }
+    },
+    // 获取ai对话
+    getAiContent(_uid) {
+      let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
+      let _allText = "";
+      let _mdText = "";
+      const md = new MarkdownIt();
+      _source.onmessage = _e => {
+        if (_e.data.replace("'", "").replace("'", "") == "[DONE]") {
+          //对话已经完成
+          _mdText = _mdText.replace("_", "");
+          _source.close();
+          this.scrollBottom();
+          this.chatLoading = false;
+          this.chatList.find(i => i.uid == _uid).aiContent = _mdText;
+          this.chatList.find(i => i.uid == _uid).isalltext = true;
+          this.chatList.find(i => i.uid == _uid).isShowSynchronization = true;
+          this.chatList.find(i => i.uid == _uid).loading = false;
+          // 这里保存对话
+          this.insertChat(_uid);
+          return;
+        } else {
+          //对话还在继续
+          let _text = "";
+          _text = _e.data.replaceAll("'", "");
+          if (_allText == "") {
+            _allText = _text.replace(/^\n+/, ""); //去掉回复消息中偶尔开头就存在的连续换行符
+          } else {
+            _allText += _text;
+          }
+          _mdText = _allText + "_";
+          _mdText = _mdText.replace(/\\n/g, "\n");
+          _mdText = _mdText.replace(/\\/g, "");
+          if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
+          //转化返回的回复流数据
+          _mdText = md.render(_mdText);
+          this.chatList.find(i => i.uid == _uid).aiContent = _mdText;
+          this.chatList.find(i => i.uid == _uid).loading = false;
+          this.scrollBottom();
+          // 处理流数据
+        }
+      };
+    },
+    getAtAuContent(_uid) {
+      let _source = new EventSource(
+        `https://gpt4.cocorobo.cn/question/${_uid}`
+      ); //http://gpt4.cocorobo.cn:8011/question/   https://gpt4.cocorobo.cn/question/
+      let _allText = "";
+      let _mdText = "";
+      const md = new MarkdownIt();
+      _source.onmessage = _e => {
+        let _eData = JSON.parse(_e.data);
+        if (_eData.content.replace("'", "").replace("'", "") == "[DONE]") {
+          let _result = [];
+          if ("result" in _eData) {
+            _result = _eData.result;
+            for (let i = 0; i < _result.length; i++) {
+              _mdText = _mdText.replace(_result[i].text, _result[i].fileName);
+            }
+          }
+          _mdText = _mdText.replace("_", "");
+          this.chatLoading = false;
+          this.chatList.find(i => i.uid == _uid).aiContent = _mdText;
+          this.chatList.find(i => i.uid == _uid).isalltext = true;
+          this.chatList.find(i => i.uid == _uid).isShowSynchronization = true;
+          this.chatList.find(i => i.uid == _uid).loading = false;
+
+          this.insertChat(_uid);
+        } else {
+          let _text = _eData.content.replace("'", "").replace("'", "");
+          if (_allText == "") {
+            _allText = _text.replace(/^\n+/, ""); //去掉回复消息中偶尔开头就存在的连续换行符
+          } else {
+            _allText += _text;
+          }
+          _mdText = _allText + "_";
+          _mdText = _mdText.replace(/\\n/g, "\n");
+          _mdText = _mdText.replace(/\\/g, "");
+          if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
+          //转化返回的回复流数据
+          _mdText = md.render(_mdText);
+          this.chatList.find(i => i.uid == _uid).aiContent = _mdText;
+          this.chatList.find(i => i.uid == _uid).loading = false;
+          this.$nextTick(() => {
+            this.$refs.chatRef.scrollTop = this.$refs.chatRef.scrollHeight;
+          });
+          // 处理流数据
+        }
+      };
+    },
+    //保存消息
+    insertChat(_uid) {
+      let _data = this.chatList.find(i => i.uid == _uid);
+      if (!_data) return;
+      let params = {
+        userId: this.userid,
+        userName: "qgt",
+        groupId: "602def61-005d-11ee-91d8-005056b8q12w",
+        answer: _data.aiContent,
+        problem: _data.content,
+        file_id: _data.fileid ? _data.fileid : "",
+        alltext: _data.aiContent,
+        type: "chat",
+        filename: _data.filename,
+        session_name: `${this.courseId}-studyStudent` //这是对话记录位置
+      };
+      this.ajax
+        .post("https://gpt4.cocorobo.cn/insert_chat", params)
+        .then(res => {});
+    },
+    // 获取对应的聊天记录
+    getChatList() {
+      return new Promise((resolve, reject) => {
+        if (this.loading) return this.$message.info("请稍等...");
+        this.chatList = [];
+        this.loading = true;
+        this.chatLoading = true;
+        let params = {
+          userid: this.userid,
+          groupid: "602def61-005d-11ee-91d8-005056b8q12w",
+          // session_name:``
+          session_name: `${this.courseId}-studyStudent`
+        };
+        this.ajax
+          .post("https://gpt4.cocorobo.cn/get_agent_park_chat", params)
+          .then(res => {
+            let _data = JSON.parse(res.data.FunctionResponse);
+            if (_data.length > 0) {
+              let _chatList = [];
+              for (let i = 0; i < _data.length; i++) {
+                _chatList.push({
+                  loading: false,
+                  role: "user",
+                  content: _data[i].problem,
+                  uid: _data[i].id,
+                  AI: "AI",
+                  aiContent: _data[i].answer,
+                  oldContent: _data[i].answer,
+                  isShowSynchronization: false,
+                  filename: _data[i].filename,
+                  index: i,
+                  is_mind_map: false,
+                  fileid: _data[i].fileid
+                });
+              }
+              this.chatList = _chatList;
+              // console.log(' this.chatList', this.chatList);
+              this.loading = false;
+              this.chatLoading = false;
+            } else {
+              //没有对话记录
+              this.chatLoading = false;
+              this.loading = false;
+            }
+            resolve();
+          })
+          .catch(err => {
+            console.log(err);
+            this.$message.error("获取对话记录失败");
+            this.loading = false;
+            this.chatLoading = false;
+            resolve();
+          });
+      });
+    },
+    getRoleList() {
+      this.roleList = [];
+      let params = {
+        userId: this.userid
+      };
+      this.ajax
+        .post("https://gpt4.cocorobo.cn/get_ai_agent_assistant_list", params)
+        .then(res => {
+          let _data = res.data.FunctionResponse.result;
+          if (_data.length == 0) return;
+          if (_data) {
+            this.roleList = JSON.parse(_data);
+          }
+        })
+        .catch(e => {
+          console.log("获取角色列表失败");
+          this.roleList = [];
+        });
+    },
+    getPublicRoleList() {
+      this.roleList2 = [];
+      let params = {
+        userId: this.userid,
+        // organizeid: this.org,
+        organizeid: "45facc0a-1211-11ec-80ad-005056b86db5"
+      };
+      this.ajax
+        .post(
+          "https://gpt4.cocorobo.cn/get_ai_agent_assistant_share_list",
+          params
+        )
+        .then(res => {
+          let _data = res.data.FunctionResponse.result;
+          if (_data.length == 0) return;
+          if (_data) {
+            this.roleList2 = JSON.parse(_data);
+          }
+        })
+        .catch(e => {
+          this.roleList2 = [];
+          console.log("获取公共角色失败", e);
+        });
+    },
+    changeRole() {
+      this.cardType = 0;
+      // this.rightSubjects = this.subjectsType;
+      // this.rightRole = this.roleType;
+      if (this.choseRoleItem.assistant_id) {
+        this.chatList = [];
+        let _uuid = uuidv4();
+        this.chatList.push({
+          role: "user",
+          content: `您好,${this.choseRoleItem.assistantName}`,
+          uid: _uuid,
+          AI: "AI",
+          aiContent: this.choseRoleItem.prologue
+            ? this.choseRoleItem.prologue
+            : "您好,有什么需要我帮忙的吗?",
+          oldContent: "",
+          isShowSynchronization: false,
+          filename: this.choseRoleItem.headUrl,
+          index: this.chatList.length,
+          is_mind_map: false,
+          loading: false
+        });
+        this.scrollBottom();
+      }
+
+      // let params = {
+      //   model: "gpt-3.5-turbo",
+      //   temperature: 0,
+      //   max_tokens: 4096,
+      //   top_p: 1,
+      //   frequency_penalty: 0,
+      //   presence_penalty: 0,
+      //   messages: [{ role: "user", content: `你好,${_text}` }],
+      //   uid: _uuid,
+      //   mind_map_question: ""
+      // };
+      // this.text = "";
+
+      // this.ajax
+      //   .post("https://gpt4.cocorobo.cn/chat", params)
+      //   .then(res => {
+      //     if (res.data.FunctionResponse.result == "发送成功") {
+      //     } else {
+      //       this.$message.warning(res.data.FunctionResponse.result);
+      //     }
+      //   })
+      //   .catch(e => {
+      //     console.log(e);
+      //   });
+      // this.getAiContent(_uuid);
+      // this.chatList.push({
+      //   role: "ai",
+      //   content: "", //这里需要调用接口
+      //   time: new Date().toLocaleString().replace(/\//gi, "-")
+      // });
+      // setTimeout(() => {
+      //   let aiContent = "你好";
+      //   switch (this.rightRole) {
+      //     case 0:
+      //       aiContent =
+      //         "你好,我是爱因斯坦,相对论的提出者,相信科学的力量可以揭示宇宙的奥秘。";
+      //       break;
+      //     case 1:
+      //       aiContent =
+      //         "你好,我是居里夫人,放射性研究的先驱,第一位获得两次诺贝尔奖的女性。";
+      //       break;
+      //     case 2:
+      //       aiContent =
+      //         "你好,我是查尔斯·达尔文,进化论的创立者,相信物种通过自然选择不断进化。";
+      //       break;
+      //     case 3:
+      //       aiContent =
+      //         "你好,我是达芬奇,文艺复兴的象征,艺术与科学的多面手。";
+      //       break;
+      //     case 4:
+      //       aiContent =
+      //         "你好,我是列文虎克,通过我的简单显微镜,开启了微生物学的大门。";
+      //       break;
+      //     case 5:
+      //       aiContent =
+      //         "你好,我是詹姆斯·瓦特,改良了蒸汽机,为工业革命提供了动力。";
+      //       break;
+      //     case 6:
+      //       aiContent =
+      //         "你好,我是瑞秋·卡森,环保运动的先驱,通过《寂静的春天》提醒世界关注环境保护。";
+      //       break;
+      //     case 7:
+      //       aiContent =
+      //         "你好,我是特斯拉,交流电的推广者,致力于无线电和电力传输的研究。";
+      //       break;
+      //     case 8:
+      //       aiContent =
+      //         "你好,我是约翰·穆尔,自然保护的倡导者,努力保护美国的森林和野生地区。";
+      //       break;
+      //     case 9:
+      //       aiContent =
+      //         "你好,我是牛顿,万有引力和三大运动定律的发现者,为现代物理学奠定了基础。";
+      //       break;
+      //     case 10:
+      //       aiContent =
+      //         "你好,我是伽利略,通过望远镜观测支持了日心说,被誉为现代观测天文学之父。";
+      //       break;
+      //     case 11:
+      //       aiContent =
+      //         "你好,我是孟德尔,遗传学的奠基人,通过豌豆实验发现了遗传的基本规律。";
+      //       break;
+      //     case 12:
+      //       aiContent =
+      //         "你好,我是张衡,东汉杰出的天文学家和科学家,发明了地动仪。";
+      //       break;
+      //     case 13:
+      //       aiContent =
+      //         "你好,我是李时珍,中国古代著名的医学家,编纂了《本草纲目》。";
+      //       break;
+      //     case 14:
+      //       aiContent =
+      //         "你好,我是钱学森,现代火箭科学的奠基人之一,被誉为“中国航天之父”。";
+      //       break;
+      //     case 15:
+      //       aiContent =
+      //         "你好,我是阿基米德,古希腊的数学家和物理学家,提出了浮力原理。";
+      //       break;
+      //     case 16:
+      //       aiContent =
+      //         "你好,我是斯蒂芬·霍金,研究黑洞和宇宙起源,致力于解释宇宙的奥秘。";
+      //       break;
+      //     case 17:
+      //       aiContent =
+      //         "你好,我是蔡伦,东汉时期改进了造纸术,使纸张更加广泛地应用于社会。";
+      //       break;
+      //     case 18:
+      //       aiContent =
+      //         "你好,我是詹姆斯·瓦特,改良了蒸汽机,为工业革命提供了动力。";
+      //       break;
+      //     case 19:
+      //       aiContent =
+      //         "你好,我是路易·巴斯德,微生物学的奠基人,发现了疫苗和巴斯德消毒法。";
+      //       break;
+      //     case 20:
+      //       aiContent =
+      //         "你好,我是诺贝尔,发明了炸药,为和平与科学的贡献设立了诺贝尔奖。";
+      //       break;
+      //     case 21:
+      //       aiContent =
+      //         "你好,我是麦克斯韦,统一了电磁理论,提出了麦克斯韦方程组。";
+      //       break;
+      //     case 22:
+      //       aiContent =
+      //         "你好,我是贝尔,电话的发明者,致力于通信技术的发展和听力障碍人士的教育。";
+      //       break;
+      //     case 23:
+      //       aiContent =
+      //         "你好,我是开普勒,行星运动三大定律的发现者,为天文学和物理学的发展做出了重要贡献。";
+      //       break;
+      //     case 24:
+      //       aiContent =
+      //         "你好,我是安培,电磁学的先驱之一,提出了电流的磁效应。";
+      //       break;
+      //   }
+      //   this.chatList[this.chatList.length - 1].content = aiContent;
+      //   this.chatList[
+      //     this.chatList.length - 1
+      //   ].time = new Date().toLocaleString().replace(/\//gi, "-");
+      //   this.loading = false;
+      // }, 2000);
+    },
+    choseRole(item) {
+      this.choseRoleItem = item;
+      console.log("选择角色", this.choseRoleItem);
+    },
+    noChangeRole() {
+      this.cardType = 0;
+      this.choseRoleItem = {};
+      // this.subjectsType = this.rightSubjects;
+      // this.roleType = this.rightRole;
+    },
+    scrollBottom() {
+      this.$nextTick(() => {
+        this.$refs.chatRef.scrollTop = this.$refs.chatRef.scrollHeight;
+      });
+    }
+  },
+  mounted() {
+    this.getRoleList();
+    this.getPublicRoleList();
+    this.getChatList().then(_ => {
+      this.scrollBottom();
+    });
+  }
+};
 </script>
 
 <style scoped>
-.dialog{
-	width: 100%;
-	height: 100%;
-	box-sizing: border-box;
-}
-
-.dialog>div{
-	width: 100%;
-	height: 100%;
-}
-
-.characterBlock{
-	display: flex;
-	background: rgba(54, 169, 252, 1);
-	width: 80%;
-	height: 80px;
-	margin: 0 auto;
-	border-radius: 10px;
-	margin-bottom: 15px;
-	cursor: pointer;
-}
-.characterBlock > .imgLeft{
-	width: 100px;
-	display: flex;
-	justify-content: center;
-	align-items: center;
-}
-.characterBlock > .imgLeft > .img{
-	width: 60px;
-	height: 60px;
-	overflow: hidden;
-	border-radius: 50%;	
-}
-.characterBlock > .imgLeft > .img2{
-	width: 70px;
-	height: 70px;
-	overflow: hidden;
-	border-radius: 50%;	
-}
-.characterBlock > .txtRight{
-	flex: 1;
-	display: flex;
-	justify-content: flex-start;
-	align-items: center;
-}
-.characterBlock > .txtRight > .bir{
-	width: 150px;
-	height: 35px;
-	display: flex;
-	align-items: center;
-	background-color: #fff;
-	border-radius: 10px;
-	box-sizing: border-box;
-	padding: 5px 10px;
-	box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
-	margin-right: 10px;
-}
-
-.d_top{
-	width: 100%;
-	height: calc(100% - 90px);
-	overflow: auto;
-	box-sizing: border-box;
-	padding: 20px 0;
-}
-
-.d_t_chat{
-	width: 100%;
-	display: flex;
-	box-sizing: border-box;
-	padding: 10px;
-}
-
-.d_t_chat>div{
-	display: flex;
-	align-items: flex-start;
-	width: 100%;
-}
-
-.d_t_c_user{
-	box-sizing: border-box;
-	padding-left: 35px;
-}
-
-.d_t_c_u_left{
-	width: 90%;
-	height: auto;
-}
-
-.d_t_c_u_l_content{
-	width: auto;
-	max-width: 100%;
-	height: auto;
-	box-sizing: border-box;
-	padding: 10px;
-	color: white;
-	background-color: #3681FC;
-	border-radius: 8px 2px 8px 8px;
-  white-space: pre-line
-}
-
-.d_t_c_u_l_time{
-	width: 100%;
-	display: flex;
-	justify-content: flex-end;
-	font-size: 12px;
-	color: #9F9F9F;
-	margin-top: 5px;
-}
-
-.d_t_c_u_right{
-	width: 35px;
-	height: 35px;
-	display: flex;
-	justify-content: center;
-	margin-left: 5px
-}
-
-.d_t_c_u_right>span{
-	width: 32px;
-	height: 32px;
-	display: flex;
-	justify-content: center;
-	align-items: center;
-	color: white;
-	background-color: #3681FC;
-	border-radius: 50%;;
-}
-
-.d_t_c_ai{
-	box-sizing: border-box;
-	padding-right: 35px;
-}
-
-.d_t_c_a_right{
-	min-width: 90%;
-	height: auto;
-}
-
-.d_t_c_a_r_content{
-	width: auto;
-	max-width: 100%;
-	height: auto;
-	box-sizing: border-box;
-	padding: 10px;
-	background-color: #F6F8FF;
-	border-radius: 2px 8px 8px 8px;
+.dialog {
+  width: 100%;
+  height: 100%;
+  box-sizing: border-box;
+}
+
+.dialog > div {
+  width: 100%;
+  height: 100%;
+}
+
+.characterBlock {
+  display: flex;
+  background: rgba(54, 169, 252, 1);
+  width: 100%;
+  height: 80px;
+  margin: 0 auto;
+  border-radius: 10px;
+  margin-bottom: 15px;
+  cursor: pointer;
+}
+.characterBlock > .imgLeft {
+  width: 100px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+.characterBlock > .imgLeft > .img {
+  width: 60px;
+  height: 60px;
+  overflow: hidden;
+  border-radius: 50%;
+}
+.characterBlock > .imgLeft > .img2 {
+  width: 70px;
+  height: 70px;
+  overflow: hidden;
+  border-radius: 50%;
+}
+.characterBlock > .txtRight {
+  flex: 1;
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+}
+.characterBlock > .txtRight > .bir {
+  width: 180px;
+  height: 35px;
+  display: flex;
+  align-items: center;
+  background-color: #fff;
+  border-radius: 10px;
+  box-sizing: border-box;
+  padding: 5px 10px;
+  box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
+  margin-right: 10px;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+
+.d_top {
+  width: 100%;
+  height: calc(100% - 90px);
+  overflow: auto;
+  box-sizing: border-box;
+  padding: 20px 0;
+}
+
+.d_t_chat {
+  width: 100%;
+  display: flex;
+  box-sizing: border-box;
+  padding: 10px;
+  flex-direction: column;
+}
+
+.d_t_chat > div {
+  display: flex;
+  align-items: flex-start;
+  width: 100%;
+}
+
+.d_t_c_user {
+  box-sizing: border-box;
+  padding-left: 35px;
+}
+
+.d_t_c_u_left {
+  width: 90%;
+  height: auto;
+}
+
+.d_t_c_u_l_content {
+  width: auto;
+  max-width: 100%;
+  height: auto;
+  box-sizing: border-box;
+  padding: 10px;
+  color: white;
+  background-color: #3681fc;
+  border-radius: 8px 2px 8px 8px;
   white-space: pre-line;
-	word-break: break-all;
-}
-
-.d_t_c_a_r_time{
-	width: 100%;
-	display: flex;
-	justify-content: flex-start;
-	font-size: 12px;
-	color: #9F9F9F;
-	margin-top: 5px;
-}
-
-.d_t_c_a_left{
-	width: 35px;
-	height: 35px;
-	display: flex;
-	justify-content: center;
-	margin-right: 5px
-}
-
-.d_t_c_a_left>span{
-	width: 32px;
-	height: 32px;
-	display: flex;
-	justify-content: center;
-	align-items: center;
-	color: white;
-	background-color: #3681FC;
-	border-radius: 50%;
-}
-
-.d_bottom{
-	width: 100%;
-	height: 90px;
-	display: flex;
-	flex-direction: column;
-	justify-content: space-between;
-}
-
-.d_b_btnArea{
-	width: 100%;
-	height: 30px;
-	display: flex;
-	align-items: center;
-	box-sizing: border-box;
-	padding: 0 10px;
-}
-
-.d_b_ba-item{
-	width: auto;
-	box-sizing: border-box;
-	padding: 0 10px;
-	height: 25px;
-	background-color: white;
-	display: flex;
-	justify-content: center;
-	align-items: center;
-	/* 阴影 */
-	box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.363);
-	border-radius: 15px;
-	font-size: 14px;
-	cursor: pointer;
 }
-
-
-.d_b_inputArea{
-	width: 100%;
-	height: 55px;
-	box-sizing: border-box;
-	border-top: solid 1px #EDEDED;
-	display: flex;
-	justify-content: center;
-	align-items: center;
+
+.d_t_c_u_l_time {
+  width: 100%;
+  display: flex;
+  justify-content: flex-end;
+  font-size: 12px;
+  color: #9f9f9f;
+  margin-top: 5px;
 }
 
-.d_b_tape{
-	width: 35px;
-	height: 35px;
-	background: url("../../../assets/icon/course/tape.png") no-repeat;
-	background-size: 50% 60%;
-	background-position: center;
-	cursor: pointer;
+.d_t_c_u_right {
+  width: 35px;
+  height: 35px;
+  display: flex;
+  justify-content: center;
+  margin-left: 5px;
 }
 
-.d_b_input{
-	width: 65%;
-	height: 45px;
-	background-color: #F3F3F3;
-	border-radius: 50px;
-	margin: 0 10px;
-	display: flex;
-	align-items: center;
+.d_t_c_u_right > span {
+  width: 32px;
+  height: 32px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  color: white;
+  background-color: #3681fc;
+  border-radius: 50%;
 }
 
-.d_b_i_left{
-	width: calc(100% - 45px);
-	height: 100%;
-}
-
-.d_b_i_left>>>.el-input__inner{
-	border: none;
-	background-color: #F3F3F3;
-	outline: none;
-	border-radius: 50px 0 0 50px;
+.d_t_c_ai {
+  box-sizing: border-box;
+  padding-right: 35px;
+  margin-top: 10px;
 }
 
+.d_t_c_a_right {
+  min-width: 90%;
+  height: auto;
+}
 
-.d_b_i_right{
-	width: 45px;
-	height: 45px;
-	display: flex;
-	justify-content: center;
-	align-items: center;
+.d_t_c_a_r_content {
+  width: auto;
+  max-width: 100%;
+  height: auto;
+  box-sizing: border-box;
+  padding: 10px;
+  background-color: #f6f8ff;
+  border-radius: 2px 8px 8px 8px;
+  white-space: pre-line;
+  word-break: break-all;
 }
 
-.d_b_i_right>span{
-	width: 35px;
-	height: 35px;
-	background: url("../../../assets/icon/course/file.png") no-repeat;
-	background-size: 50% 60%;
-	background-position: center;
-	cursor: pointer;
+.d_t_c_a_r_time {
+  width: 100%;
+  display: flex;
+  justify-content: flex-start;
+  font-size: 12px;
+  color: #9f9f9f;
+  margin-top: 5px;
 }
 
-.d_b_btn{
-	width: 40px;
-	height: 40px;
-	background-color: #3681FC;
-	display: flex;
-	justify-content: center;
-	align-items: center;
-	border-radius: 50%;
-	cursor: pointer;
+.d_t_c_a_left {
+  width: 35px;
+  height: 35px;
+  display: flex;
+  justify-content: center;
+  margin-right: 5px;
 }
 
-.d_b_btn>span{
-	width: 30px;
-	height: 30px;
-	background: url("../../../assets/icon/course/send.png") no-repeat;
-	background-size: 70% 70%;
-	background-position: center;
-	
+.d_t_c_a_left > span {
+  width: 32px;
+  height: 32px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  color: white;
+  background-color: #3681fc;
+  border-radius: 50%;
 }
 
-.choiceTop{
-	width: 100%;
-	height: 95%;
-	overflow-x: hidden;
+.d_bottom {
+  width: 100%;
+  height: 90px;
+  display: flex;
+  flex-direction: column;
+  justify-content: space-between;
 }
 
-.choiceBottom{
-	width: 100%;
-	height: 5%;
-	display: flex;
-	align-items: center;
-	justify-content: flex-end;
+.d_b_btnArea {
+  width: 100%;
+  height: 30px;
+  display: flex;
+  align-items: center;
+  box-sizing: border-box;
+  padding: 0 10px;
 }
 
-.cb_btn{
-	margin: 0 10px;
+.d_b_ba-item {
+  width: auto;
+  box-sizing: border-box;
+  padding: 0 10px;
+  height: 25px;
+  background-color: white;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  /* 阴影 */
+  box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.363);
+  border-radius: 15px;
+  margin-right: 10px;
+  font-size: 14px;
+  cursor: pointer;
 }
 
-.choiceRoleHeader{
-	width: 100%;
-	margin: 10px;
-	margin-bottom: 20px;
+.d_b_inputArea {
+  width: 100%;
+  height: 55px;
+  box-sizing: border-box;
+  border-top: solid 1px #ededed;
+  display: flex;
+  justify-content: space-between;
+  padding-right: 10px;
+  align-items: center;
 }
 
-.choiceRoleHeader>div{
-	font-size: 16px;
-	font-weight: bold;
+.d_b_tape {
+  width: 35px;
+  height: 35px;
+  background: url("../../../assets/icon/course/tape.png") no-repeat;
+  background-size: 50% 60%;
+  background-position: center;
+  cursor: pointer;
 }
 
-.choiceRoleHeader>span{
-	font-size: 14px;
+.d_b_input {
+  /* width: 75%; */
+  flex: 1;
+  height: 45px;
+  background-color: #f3f3f3;
+  border-radius: 50px;
+  margin: 0 10px;
+  display: flex;
+  overflow: hidden;
+  align-items: center;
 }
 
-.filterSubjects{
-	margin: 10px;
-	width: 100%;
-	height: auto;
+.d_b_i_left {
+  width: 100%;
+  line-height: 45px;
+  height: 100%;
 }
 
-.fs_box{
-	width: 100%;
-	display: flex;
-	flex-wrap: wrap;
-	margin-top: 10px;
+.d_b_i_left >>> .el-input__inner {
+  border: none;
+  background-color: #f3f3f3;
+  outline: none;
+  border-radius: 50px 0 0 50px;
 }
 
-.fs_b_item{
-	width: auto;
-	height: 35px;
-	font-size: 14px;
-	box-sizing: border-box;
-	padding: 0 9px;
-	background-color: #F3F7FD;
-	border: solid 1px #F3F7FD;
-	border-radius: 5px;
-	margin-right:8px;
-	margin-bottom: 8px;
-	display: flex;
-	justify-content: center;
-	align-items: center;
-	cursor: pointer;
+.d_b_i_right {
+  width: 45px;
+  height: 45px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
 }
 
-.fs_b_itemActive{
-	border: solid 1px #4D8FFC;
-	color: #4D8FFC;
-	background-color: #F3F7FD;
+.d_b_i_right > span {
+  width: 35px;
+  height: 35px;
+  background: url("../../../assets/icon/course/file.png") no-repeat;
+  background-size: 50% 60%;
+  background-position: center;
+  cursor: pointer;
 }
 
-.roleList{
-	width: 100%;
-	height: auto;
-	margin: 10px;
+.d_b_btn {
+  width: 40px;
+  height: 40px;
+  background-color: #3681fc;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  border-radius: 50%;
+  cursor: pointer;
 }
 
-.r_box{
-	width: 100%;
-	height: auto;
-	display: flex;
-	flex-wrap: wrap;
+.d_b_btn > span {
+  width: 30px;
+  height: 30px;
+  background: url("../../../assets/icon/course/send.png") no-repeat;
+  background-size: 70% 70%;
+  background-position: center;
 }
 
-.r_b_item{
-	height: 40px;
-	font-size: 14px;
-	display: flex;
-	/* justify-content: center; */
-	align-items: center;
-	background-color: #F0F2F5;
-	border-radius: 5px;
-	margin: 5px;
-	cursor: pointer;
-	box-sizing: border-box;
-	padding: 0 4px;
-	border: solid 1px #F0F2F5;
+.choiceTop {
+  width: 100%;
+  height: 95%;
+  overflow-x: hidden;
+  box-sizing: border-box;
+  padding: 10px;
 }
 
-.r_b_itemActive{
-	box-sizing: border-box;
-	border: solid 1px #AECCFE;
-	color: #4D8FFB;
+.choiceBottom {
+  width: 100%;
+  height: 5%;
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
 }
 
-.r_b_item>img{
-	min-width: 24px;
-	min-height: 24px;
-	width: 24px;
-	height: 24px;
-	border-radius:50%;
-	margin-right: 10px;
-	/* margin-left: 10px; */
+.cb_btn {
+  margin: 0 10px;
 }
 
+.choiceRoleHeader {
+  width: 100%;
+  /* margin: 10px; */
+  margin-bottom: 20px;
+}
 
+.choiceRoleHeader > div {
+  font-size: 16px;
+  font-weight: bold;
+}
 
-</style>
+.choiceRoleHeader > span {
+  font-size: 14px;
+}
+.choiceSelect {
+  width: 100%;
+  display: flex;
+  height: 35px;
+  justify-content: flex-start;
+  align-items: center;
+  margin: 15px 0;
+}
+.choiceSelect > .option {
+  width: 80px;
+  height: 100%;
+  border-radius: 5px;
+  margin-right: 10px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  cursor: pointer;
+}
+.filterSubjects {
+  margin: 10px;
+  width: 100%;
+  height: auto;
+}
+
+.fs_box {
+  width: 100%;
+  display: flex;
+  flex-wrap: wrap;
+  margin-top: 10px;
+}
+
+.fs_b_item {
+  width: auto;
+  height: 35px;
+  font-size: 14px;
+  box-sizing: border-box;
+  padding: 0 9px;
+  background-color: #f3f7fd;
+  border: solid 1px #f3f7fd;
+  border-radius: 5px;
+  margin-right: 8px;
+  margin-bottom: 8px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  cursor: pointer;
+}
+
+.fs_b_itemActive {
+  border: solid 1px #4d8ffc;
+  color: #4d8ffc;
+  background-color: #f3f7fd;
+}
+
+.roleList {
+  width: 100%;
+  height: auto;
+  margin: 10px;
+}
+
+.r_box {
+  width: 100%;
+  height: auto;
+  display: flex;
+  flex-wrap: wrap;
+}
+
+.r_b_item {
+  height: 40px;
+  font-size: 14px;
+  display: flex;
+  /* justify-content: center; */
+  align-items: center;
+  background-color: #f0f2f5;
+  border-radius: 5px;
+  margin: 5px;
+  cursor: pointer;
+  box-sizing: border-box;
+  padding: 0 4px;
+  border: solid 1px #f0f2f5;
+}
+
+.r_b_itemActive {
+  box-sizing: border-box;
+  border: solid 1px #aeccfe;
+  color: #4d8ffb;
+}
+
+.r_b_item > img {
+  min-width: 24px;
+  min-height: 24px;
+  width: 24px;
+  height: 24px;
+  border-radius: 50%;
+  margin-right: 10px;
+  /* margin-left: 10px; */
+}
+</style>

+ 537 - 258
src/components/classRoomHelper/component/searchArea.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="search">
     <div class="s_top" ref="chatRef">
-      <div class="s_t_chat">
+      <!-- <div class="s_t_chat">
         <div class="s_t_c_ai">
           <div class="s_t_c_a_left">
             <span>Ai</span>
@@ -26,65 +26,108 @@
             </div>
           </div>
         </div>
-      </div>
-      <div
-        class="s_t_chat"
-        v-for="(item, index) in chatList"
-        :key="index"
-      >
-        <div class="s_t_c_user" v-if="item.role == 'user'">
+      </div> -->
+      <div class="s_t_chat" v-for="(item, index) in chatList" :key="index">
+        <div
+          class="s_t_c_user"
+          v-if="
+            item.content &&
+              item.content != 'wanSearch' &&
+              item.content != 'getImage'
+          "
+        >
           <div class="s_t_c_u_left">
             <div class="s_t_c_u_l_content">{{ item.content }}</div>
-            <div class="s_t_c_u_l_time">{{ item.time }}</div>
+            <div class="s_t_c_u_l_time">{{ item.createtime }}</div>
           </div>
           <div class="s_t_c_u_right">
             <span>我</span>
           </div>
         </div>
 
-        <div class="s_t_c_ai" v-if="item.role == 'ai'">
+        <div
+          class="s_t_c_ai"
+          v-if="item.content != 'wanSearch' && item.content != 'getImage'"
+        >
           <div class="aiCopy">
-            <img style="width: 30px;" src="https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%A4%8D%E5%88%B6%E5%9B%BE%E6%A0%871715569581741.png" alt="">
+            <img
+              style="width: 30px;"
+              src="https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%A4%8D%E5%88%B6%E5%9B%BE%E6%A0%871715569581741.png"
+              alt=""
+            />
           </div>
           <div class="s_t_c_a_left">
             <span>Ai</span>
           </div>
           <div class="s_t_c_a_right">
-            <div
-              class="s_t_c_a_r_content"
-              v-loading="loading && index == chatList.length - 1"
-              v-if="item.type == 0"
-            >{{ item.content }}
+            <div class="s_t_c_a_r_content" style="display: flex;justify-content: space-between;flex-wrap: wrap;" v-if="item.content.includes('图片')">
+              <div
+                  v-if="!pan(item.aiContent).length"
+                  class="d_t_c_a_r_content"
+                  v-loading="item.loading"
+                  v-html="item.aiContent"
+                ></div>
+              <div v-else  v-for="(i,index) in pan(item.aiContent)" :key=index>
+                  <img style="width: 120px;height: 120px;" :src="i.image" alt=""  @click="previewImg(i.image)">
+              </div>
             </div>
             <div
+              v-else
+              class="s_t_c_a_r_content"
+              v-loading="item.loading"
+              v-html="item.aiContent"
+            ></div>
+
+            <!-- <div
               class="s_t_c_a_r_contentImage"
-              v-loading="loading && index == chatList.length - 1"
-              v-if="item.type == 1"
+              v-loading="item.loading"
+
             >
-              <span style="margin-bottom: 10px;">为您找到以下图片:</span>
-              <!-- <el-image 
-  							  style="width: 45%;height: 125px;margin: 1% 1.5%;"
-  							  v-for="(item,index) in item.content"
-									:key="index"
-									:src="item"
-  							  :preview-src-list="item">
-  							</el-image> -->
-              <img
-                v-for="(item, index) in item.content"
+            
+              <span style="margin-bottom: 10px;">为您找到以下图片: {{ item.content }}</span> -->
+              <!-- {{ item.aiContent }} -->
+              <!-- <img
+                v-for="(i, index) in item.aiContent"
                 @click.stop="$hevueImgPreview(item)"
                 :key="index"
-                :src="item"
-              />
-              <div class="imgNumberBlock">
+                :src="i.image"
+              /> -->
+              <!-- <div class="imgNumberBlock">
                 <div class="imgNumber" v-for="(i,index) in imgNumList" :key="index+'b'">
                   {{ i }}
                 </div>
                 <div  class="imgNumber" style="background: none;">
                   <img style="width: 36px;height: 30px;" src="https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/Frame%20131715569413607.png" alt="">
                 </div>
+              </div> -->
+            <!-- </div> -->
+            <!-- <div class="s_t_c_a_r_time">{{ item.createtime }}</div> -->
+          </div>
+        </div>
+
+        <div class="s_t_chat" v-if="item.content == 'wanSearch'">
+          <div class="s_t_c_ai">
+            <div class="s_t_c_a_left">
+              <el-avatar v-if="item.filename" :src="item.filename"></el-avatar>
+              <span v-else>Ai</span>
+            </div>
+            <div class="s_t_c_a_right">
+              <div class="s_t_c_a_r_content2" v-loading="item.loading">
+                <div class="s_t_c_a_r_c_title">
+                  <img :src="require('../../../assets/icon/course/idea.png')" />
+                  <span>猜你想搜:</span>
+                </div>
+                <div
+                  class="s_t_c_a_r_c_item"
+                  v-for="(item, index) in item.aiContent"
+                  :key="index"
+                  @click="sendAiIdea(item.label)"
+                >
+                  {{ index + 1 }}.{{ item.title }}:{{ item.label }}
+                </div>
               </div>
+              <div class="s_t_c_a_r_time">{{ item.createtime }}</div>
             </div>
-            <div class="s_t_c_a_r_time">{{ item.time }}</div>
           </div>
         </div>
       </div>
@@ -92,36 +135,24 @@
     <div class="s_bottom">
       <!-- <div class="s_b_ba-item" @click.stop="choiceRole()">选择角色</div> -->
 
-      <!-- <div class="s_b_btnArea">
-        <div class="s_b_ba-item">
-          <el-checkbox
-            :disabled="loading"
-            style="display: flex;"
-            v-model="imageCheck"
-            >图片</el-checkbox
-          >
-        </div>
-        <div class="s_b_ba-item">
-          <el-checkbox
-            :disabled="loading"
-            style="display: flex;"
-            v-model="videoCheck"
-            >视频</el-checkbox
-          >
+      <div class="s_b_btnArea">
+        <div class="s_b_ba-item" @click="clear()">
+          清空聊天记录
         </div>
-      </div> -->
+      </div>
       <div class="s_b_inputArea">
-        <div class="s_b_tape" @click="goTape()"></div>
+        <!-- <div class="s_b_tape" @click="goTape()"></div> -->
         <div class="s_b_input">
           <el-input
-            :disabled="loading"
-						@keyup.enter.native="send()"
+            :disabled="loading || chatLoading"
+            v-loading="loading || chatLoading"
+            @keyup.enter.native="send()"
             class="s_b_i_left"
             v-model="text"
           ></el-input>
-          <div class="s_b_i_right" @click="sendFile()">
+          <!-- <div class="s_b_i_right" @click="sendFile()">
             <span></span>
-          </div>
+          </div> -->
         </div>
         <div class="s_b_btn" @click="send()">
           <span></span>
@@ -132,228 +163,470 @@
 </template>
 
 <script>
+import { v4 as uuidv4 } from "uuid";
+import MarkdownIt from "markdown-it";
 export default {
+  props: {
+    courseDetail: {
+      type: Object,
+      default: () => {}
+    }
+  },
   data() {
     return {
       text: "",
       loading: false,
+      chatLoading: false,
       imageCheck: false,
       videoCheck: false,
-      imgNumList:[
-        'U1','U2','U3','U4'
-      ],
-      wantSearch: [
-        {
-          index: 1,
-          title: "垃圾分类标准",
-          label: "不同国家的垃圾分类标准和方法?"
-        },
-        {
-          index: 2,
-          title: "可回收垃圾处理",
-          label: "可回收垃圾的处理流程和再利用方法?"
-        },
-        {
-          index: 3,
-          title: "有害垃圾的影响",
-          label: "有害垃圾对环境和人体健康的潜在影响?"
-        }
-      ],
-      chatList: [
-        {
-          role: "ai",
-          content: `您好,有什么可以帮助您的吗?`,
-          time: new Date().toLocaleString().replace(/\//gi, "-"),
-          type: 0
-        }
-        // 					{
-        // 						role:"user",
-        // 						content:"正十三边形的每个角是多少度?",
-        // 						time:"2023-11-11 11:10:11"
-        // 					},
-        // 					{
-        // 						role:"ai",
-        // 						content:`小朋友们,你们知道正十三边形吗?就像我们班有13个好朋友站成一个圈圈一样。如果我们想知道每个人转身看向下一个人需要转多少度,我们可以这样想:首先,所有朋友手拉手围成的圈圈是360度,对吧?但是,我们不能直接算每个人转身的角度,因为那是外面的角度,我们要算里面的角度,就像每个人转身时脚尖指向圈心的角度。
-        // 我们先用一个小技巧,算出所有内角加起来是多少度。方法是:(13-2)乘以180度,得到1980度。这是因为,想象成一个多边形,它可以分成11个三角形,每个三角形的角度和是180度。
-        // 然后,我们把1980度平分给13个角,就是每个角的度数了。算一算,1980除以13等于152度。所以,正十三边形的每个角是152度。就像每个人转身看下一个朋友,每个人需要转152度一样。`,
-        // 						time:"2023-11-11 11:10:11"
-        // 					},
-      ]
+      userid: this.$route.query.userid,
+      courseId: this.$route.query.courseId,
+      imgNumList: ["U1", "U2", "U3", "U4"],
+      chatList: []
     };
   },
+  computed: {
+    pan() {
+      return (content) => {
+        try {
+        return JSON.parse(content)
+      } catch (error) {
+        return []
+      }
+      };
+    }
+  },
   methods: {
-    choiceRole() {
-      this.cardType = 1;
+    previewImg(url) {
+      this.$hevueImgPreview(url);
     },
-    sendFile() {
-			if (this.loading) return this.$message.info("请稍等");
-      this.$message.info("点击了附件");
+    clear() {
+      this.chatList = [];
     },
-    goTape() {
-			if (this.loading) return this.$message.info("请稍等");
-      this.$message.info(`点击了语音`);
-    },
-    send() {
-      if (this.loading) return this.$message.info("请稍等");
-			if(this.text.trim().length==0)return this.$message.info("请输入内容")
-      this.loading = true;
+    // choiceRole() {
+    //   this.cardType = 1;
+    // },
+    // sendFile() {
+    //   if (this.loading) return this.$message.info("请稍等");
+    //   this.$message.info("点击了附件");
+    // },
+    // goTape() {
+    //   if (this.loading) return this.$message.info("请稍等");
+    //   this.$message.info(`点击了语音`);
+    // },
+    send(_text = this.text) {
+      if (this.loading || this.chatLoading) return this.$message.info("请稍等");
+      if (_text.trim().length == 0) return this.$message.info("请输入内容");
+      let _msg = ``;
+      this.chatLoading = true;
+      let _uuid = uuidv4();
       this.chatList.push({
         role: "user",
-        content: this.text,
-        time: new Date().toLocaleString().replace(/\//gi, "-")
-      });
-			
-      this.chatList.push({
-        role: "ai",
-        content: "",
-        type: 0,
-        time: new Date().toLocaleString().replace(/\//gi, "-")
+        content: `${_text}`,
+        uid: _uuid,
+        AI: "AI",
+        aiContent: "",
+        oldContent: "",
+        isShowSynchronization: false,
+        filename: "",
+        index: this.chatList.length,
+        is_mind_map: false,
+        loading: true
       });
-      this.$nextTick(() => {
-        this.$refs.chatRef.scrollTop = this.$refs.chatRef.scrollHeight;
-      });
-      setTimeout(() => {
-        let aiContent = "对不起,这个问题我回答不了。";
-        let type = 0;
-
-        switch (this.text) {
-          case "帮我查找几张常见的不同类型的垃圾图片":
-            aiContent = [
-              "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8721713253471000.png",
-              "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8731713253488299.png",
-              "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8741713253506303.png",
-              "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8751713253523152.png"
-            ];
-            type = 1;
-            break;
-          case "帮我查找一些B站的视频,介绍垃圾如何处理":
-            aiContent = `当然,以下是关于垃圾处理的一些B站视频链接:
-1.【科普短视频】垃圾会被怎么处理? - 这个视频通过简短的内容向观众展示垃圾处理的过程。
-https://www.bilibili.com/video/BV1UD4y1U71a
-
-2.垃圾分类,就是这么简单- 这个视频以科普的形式,向观众介绍了垃圾分类的基本知识。
-https://www.bilibili.com/video/BV1bt41157wH 
- 
-3.【环保短片】震撼环保公益短片《致我们的地球》- 这部短片通过震撼的画面和内容,强调了环保问题的重要性。
-https://www.bilibili.com/video/BV1ZD4y1U7H7/ `;
-            type = 0;
-            break;
-          case "不同国家的垃圾分类标准和方法?":
-            aiContent = `好的,我们来聊聊不同国家是怎么分类垃圾的。垃圾分类就像是帮助垃圾找到它们正确的家,这样我们的环境才能更干净,地球也会更健康。
-•日本:日本的垃圾分类做得非常细致。他们不仅仅是分可回收和不可回收,而是将垃圾分成很多种类,比如瓶子、罐头、纸张、塑料等等。在日本,居民需要按照当地的规定把垃圾分类好,然后放在特定的垃圾袋里,在指定的时间拿出去扔。如果分类错了,垃圾收集者可能不会带走垃圾哦。
-•德国:德国也非常重视垃圾分类。他们有一种叫做“绿点”的系统,很多包装上都有一个绿色的点。这意味着制造商已经支付了回收费用。德国人会把纸、塑料、玻璃和金属分开收集。他们甚至有专门的容器来收集旧衣服和鞋子。
-•美国:美国的垃圾分类方法比较简单,通常分为可回收物、有机物和其他垃圾。可回收物包括纸张、塑料、玻璃和金属等。有些城市还有专门的食物垃圾桶,用来收集厨余垃圾,这些可以被转化为肥料或者生产能源。
-•瑞典:瑞典几乎可以回收利用所有的垃圾。他们非常擅长把垃圾变成资源,比如将燃烧垃圾产生的热能用来供暖和供电。瑞典人也会把垃圾分类成多种类,确保每种垃圾都能找到最合适的处理方式。
-通过这些例子,我们可以看到,虽然不同国家的垃圾分类方法和标准不一样,但他们都有一个共同的目标,那就是保护我们的环境,让地球变得更美好。所以,我们每个人在日常生活中也要努力做好垃圾分类,为保护地球出一份力!`;
-            type = 0;
-            break;
-          case "可回收垃圾的处理流程和再利用方法?":
-            aiContent = `好的,我们来聊聊可回收垃圾的处理流程和再利用方法,就像是给垃圾进行一次神奇的变身之旅。
-首先,可回收垃圾是指那些可以被再次利用的垃圾,比如塑料瓶、纸张、玻璃瓶和金属罐头盒等。这些垃圾如果被正确处理,就可以变成新的东西,而不是被扔掉占用地球的空间。
-第一步:收集和分类
-想象一下,你在家里帮忙把不同的垃圾放在不同的垃圾桶里。比如,把塑料瓶放在一个桶里,把纸张放在另一个桶里。这样做的目的是为了让垃圾更容易被处理和回收。在学校或者社区,也有专门的垃圾桶来收集这些可回收的材料。
-第二步:运输
-收集好的可回收垃圾会被送到一个特别的地方,叫做回收中心。在那里,工人会再次检查垃圾,确保每样东西都放对了地方,并且是干净的。
-第三步:清洗和处理
-在回收中心,可回收的物品会被清洗干净,比如塑料瓶和玻璃瓶会被洗掉上面的污渍和标签。然后,这些物品会根据材料的类型被切割、压扁或者磨碎,准备变成新的东西。
-第四步:再制造
-这些被处理过的材料,比如碎纸或者塑料颗粒,会被送到不同的工厂,变成新的产品。例如,旧报纸可以被制成新的纸张或者纸板,塑料瓶可以变成塑料椅子或者玩具,玻璃瓶可以熔化后再制成新的玻璃制品。
-第五步:重新使用
-最后,这些新制成的物品会被送到商店,人们可以再次购买使用。这样一来,我们就完成了一次“垃圾变宝贝”的神奇旅程。
-通过这个流程,我们不仅节省了资源,减少了垃圾,还帮助保护了我们的环境。所以,下次当你要扔东西时,记得先想想这个东西能不能被回收,然后放到正确的垃圾桶里哦!这样你也成为了保护地球的小小英雄!`;
-            type = 0;
-            break;
-          case "有害垃圾对环境和人体健康的潜在影响?":
-            type = 0;
-            break;
-        }
-
-        if (this.imageCheck) {
-          aiContent = [
-            "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8721713253471000.png",
-            "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8731713253488299.png",
-            "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8741713253506303.png",
-            "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8751713253523152.png"
-          ];
-          type = 1;
-          this.chatList[this.chatList.length - 1].content = aiContent;
-          this.chatList[this.chatList.length - 1].type = type;
-          this.chatList[
-            this.chatList.length - 1
-          ].time = new Date().toLocaleString().replace(/\//gi, "-");
-          // this.chatList.push({
-          // 	role:"ai",
-          // 	content:aiContent,
-          // 	type:type,
-          // 	time:new Date().toLocaleString().replace(/\//ig,'-')
-          // })
-        }
-        if (this.videoCheck) {
-          aiContent = `当然,以下是关于垃圾处理的一些B站视频链接:
-							1.【科普短视频】垃圾会被怎么处理? - 这个视频通过简短的内容向观众展示垃圾处理的过程。
-							https://www.bilibili.com/video/BV1UD4y1U71a
-
-							2.垃圾分类,就是这么简单- 这个视频以科普的形式,向观众介绍了垃圾分类的基本知识。
-							https://www.bilibili.com/video/BV1bt41157wH 
-
-							3.【环保短片】震撼环保公益短片《致我们的地球》- 这部短片通过震撼的画面和内容,强调了环保问题的重要性。
-							https://www.bilibili.com/video/BV1ZD4y1U7H7/ `;
-          type = 0;
-          this.chatList[this.chatList.length - 1].content = aiContent;
-          this.chatList[this.chatList.length - 1].type = type;
-          this.chatList[
-            this.chatList.length - 1
-          ].time = new Date().toLocaleString().replace(/\//gi, "-");
-          // this.chatList.push({
-          // 	role:"ai",
-          // 	content:aiContent,
-          // 	type:type,
-          // 	time:new Date().toLocaleString().replace(/\//ig,'-')
-          // })
+      this.scrollBottom();
+      if (_text.indexOf("视频") != -1) {
+        _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
+## 任务
+你的任务是根据用户的请求,结合“课程信息”,在Ted.com等教育网站上搜索相关视频,并且按照“输出格式”将结果输出给用户。
+课程信息
+课程标题:${this.courseDetail.title}
+分类:${this.courseDetail.name ? this.courseDetail.name : "无"}
+学生年级:${this.courseDetail.classname ? this.courseDetail.classname : "无"}
+
+## 规则
+    1. 输出结果必须真实有效,不要捏造无效的视频链接
+    2. 当课程信息中的子条目内容为“无”时,无视这些条目进行输出即可。
+    3. 如果没有相关内容,请跟用户表明没有找到相关视频链接内容,然后推荐搜索建议
+    4. 在ted.com等教育网站上搜索视频,并且以有序列表的形式将结果输出给用户
+    5. 请一步步思考如何根据现有信息推送视频,但是最终输出结果不需要包含你的思考过程,只需要包含视频标题+链接。
+
+# Format example
+视频来源: Ted.com
+视频标题:How AI could save (not destroy) education
+视频内容:介绍了一款AI教育软件
+视频链接https://www.ted.com/talks/sal_khan_how_ai_could_save_not_destroy_education
+				`;
+      } else if (_text.indexOf("图片") != -1) {
+        // console.log("图片");
+        this.text = "";
+        let params = {
+          page: 1,
+          pagesize: 4,
+          query: _text
+        };
+        // this.$message.info(_text);
+        this.chatList.push({
+          role: "user",
+          content: `getImage`,
+          uid: _uuid,
+          AI: "AI",
+          aiContent: "",
+          oldContent: "",
+          isShowSynchronization: false,
+          filename: "",
+          index: this.chatList.length,
+          is_mind_map: false,
+          loading: true
+        });
+        this.ajax
+          .post("https://gpt.cocorobo.cn/search_image", params)
+          .then(res => {
+            let data = res.data.FunctionResponse.result;
+            // console.log('res',res.data.FunctionResponse.result);
+            this.chatList.find(i => i.uid == _uuid).aiContent = JSON.stringify(data);
+            this.chatList.find(i => i.uid == _uuid).loading = false;
+            this.chatLoading = false;
+            this.insertChat(_uuid);
+
+            // console.log('resresresres',res);
+            // if (res.data.FunctionResponse.result == "发送成功") {
+
+            // } else {
+            //   this.$message.warning(res.data.FunctionResponse.result);
+            // }
+          });
+
+        return;
+      }
+      console.log(9999);
+      //         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 = [];
+      if (_msg) {
+        history.push({ role: "user", content: _msg });
+      }
+      history.push({ role: "user", content: _text });
+      let params = {
+        model: "gpt-3.5-turbo",
+        temperature: 0,
+        max_tokens: 4096,
+        top_p: 1,
+        frequency_penalty: 0,
+        presence_penalty: 0,
+        messages: history,
+        uid: _uuid,
+        mind_map_question: ""
+      };
+      this.text = "";
+
+      this.ajax
+        .post("https://gpt4.cocorobo.cn/chat", params)
+        .then(res => {
+          if (res.data.FunctionResponse.result == "发送成功") {
+          } else {
+            this.$message.warning(res.data.FunctionResponse.result);
+            this.chatLoading = false;
+          }
+        })
+        .catch(e => {
+          console.log(e);
+          this.chatLoading = false;
+        });
+      this.getAiContent(_uuid);
+    },
+    // 获取ai对话
+    getAiContent(_uid) {
+      let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
+      let _allText = "";
+      let _mdText = "";
+      const md = new MarkdownIt();
+      _source.onmessage = _e => {
+        if (_e.data.replace("'", "").replace("'", "") == "[DONE]") {
+          //对话已经完成
+          _mdText = _mdText.replace("_", "");
+          _source.close();
+          this.chatLoading = false;
+          this.scrollBottom();
+          this.chatList.find(i => i.uid == _uid).aiContent = _mdText;
+          this.chatList.find(i => i.uid == _uid).isalltext = true;
+          this.chatList.find(i => i.uid == _uid).isShowSynchronization = true;
+          this.chatList.find(i => i.uid == _uid).loading = false;
+          // 这里保存对话
+          this.insertChat(_uid);
+          return;
+        } else {
+          //对话还在继续
+          let _text = "";
+          _text = _e.data.replaceAll("'", "");
+          if (_allText == "") {
+            _allText = _text.replace(/^\n+/, ""); //去掉回复消息中偶尔开头就存在的连续换行符
+          } else {
+            _allText += _text;
+          }
+          _mdText = _allText + "_";
+          _mdText = _mdText.replace(/\\n/g, "\n");
+          _mdText = _mdText.replace(/\\/g, "");
+          if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
+          //转化返回的回复流数据
+          _mdText = md.render(_mdText);
+          this.chatList.find(i => i.uid == _uid).aiContent = _mdText;
+          this.chatList.find(i => i.uid == _uid).loading = false;
+          this.scrollBottom();
+
+          // 处理流数据
         }
-        if (!this.imageCheck && !this.videoCheck) {
-					this.chatList[this.chatList.length-1].content = aiContent;
-					this.chatList[this.chatList.length-1].type = type;
-					this.chatList[this.chatList.length-1].time = new Date().toLocaleString().replace(/\//ig,'-');
-					this.text = "";
-          // this.chatList.push({
-          //   role: "ai",
-          //   content: aiContent,
-          //   type: type,
-          //   time: new Date().toLocaleString().replace(/\//gi, "-")
-          // });
+      };
+    },
+    getWAntSearchContent(_uid) {
+      let _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();
+      _source.onmessage = _e => {
+        if (_e.data.replace("'", "").replace("'", "") == "[DONE]") {
+          //对话已经完成
+          _mdText = _mdText.replace("_", "");
+          _mdText = _mdText.replace("```json", "");
+          _mdText = _mdText.replace("```", "");
+          _source.close();
+          this.chatLoading = false;
+          this.chatList.find(i => i.uid == _uid).aiContent = JSON.parse(
+            _mdText
+          );
+          this.chatList.find(i => i.uid == _uid).isalltext = true;
+          this.chatList.find(i => i.uid == _uid).isShowSynchronization = true;
+          this.chatList.find(i => i.uid == _uid).loading = false;
+          this.scrollBottom();
+          // 这里保存对话
+          return;
+        } else {
+          //对话还在继续
+          let _text = "";
+          _text = _e.data.replaceAll("'", "");
+          if (_allText == "") {
+            _allText = _text.replace(/^\n+/, ""); //去掉回复消息中偶尔开头就存在的连续换行符
+          } else {
+            _allText += _text;
+          }
+          _mdText = _allText + "_";
+          _mdText = _mdText.replace(/\\n/g, "\n");
+          _mdText = _mdText.replace(/\\/g, "");
+          if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
+          //转化返回的回复流数据
+          this.scrollBottom();
         }
-        this.$nextTick(() => {
-          this.$refs.chatRef.scrollTop = this.$refs.chatRef.scrollHeight;
-        });
-        this.loading = false;
-      }, 5000);
-      // this.chatList.push({
-      // 	role:"user",
-      // 	content:this.text,
-      // 	time:"2023-11-11 11:10:11"
-      // },{
-      // 	role:"ai",
-      // 	content:`小朋友,你真棒!`,//这里需要调用接口
-      // 	time:"2023-11-11 11:10:11"
-      // })
-      // this.text = "";
-      // // 元素滚动条触底
-      // this.$nextTick(() => {
-      //   this.$refs.chatRef.scrollTop = this.$refs.chatRef.scrollHeight;
-      // });
+      };
+    },
+    //保存消息
+    insertChat(_uid) {
+      let _data = this.chatList.find(i => i.uid == _uid);
+      if (!_data) return;
+      let params = {
+        userId: this.userid,
+        userName: "qgt",
+        groupId: "602def61-005d-11ee-91d8-005056b8q12w",
+        answer: _data.aiContent,
+        problem: _data.content,
+        file_id: _data.fileid ? _data.fileid : "",
+        alltext: _data.aiContent,
+        type: "chat",
+        filename: _data.filename,
+        session_name: `${this.courseId}-studyStudent` //这是对话记录位置
+      };
+      this.ajax
+        .post("https://gpt4.cocorobo.cn/insert_chat", params)
+        .then(res => {});
+    },
+    // 获取对应的聊天记录
+    getChatList() {
+      return new Promise((resolve, reject) => {
+        if (this.loading) return this.$message.info("请稍等...");
+        this.chatList = [];
+        this.loading = true;
+        let params = {
+          userid: this.userid,
+          groupid: "602def61-005d-11ee-91d8-005056b8q12w",
+          // session_name:``
+          session_name: `${this.courseId}-studyStudent`
+        };
+        this.ajax
+          .post("https://gpt4.cocorobo.cn/get_agent_park_chat", params)
+          .then(res => {
+            let _data = JSON.parse(res.data.FunctionResponse);
+            if (_data.length > 0) {
+              let _chatList = [];
+              for (let i = 0; i < _data.length; i++) {
+                _chatList.push({
+                  loading: false,
+                  role: "user",
+                  content: _data[i].problem,
+                  uid: _data[i].id,
+                  AI: "AI",
+                  aiContent: _data[i].answer,
+                  oldContent: _data[i].answer,
+                  isShowSynchronization: false,
+                  filename: _data[i].filename,
+                  index: i,
+                  is_mind_map: false,
+                  fileid: _data[i].fileid
+                });
+              }
+              this.chatList = _chatList;
+              this.loading = false;
+            } else {
+              //没有对话记录
+              this.loading = false;
+            }
+            resolve();
+          })
+          .catch(err => {
+            console.log(err);
+            this.$message.error("获取对话记录失败");
+            this.loading = false;
+            resolve();
+          });
+      });
     },
     sendAiIdea(text) {
-			if (this.loading) return this.$message.info("请稍等");
-      this.text = text;
-      this.send();
+      if (this.loading) return this.$message.info("请稍等");
+      this.send(text);
     },
     sendImage() {
       this.$message.info("发送图片");
     },
     sendVideo() {
       this.$message.info("发送视频");
+    },
+    getWantSearch() {
+      this.chatLoading = true;
+      let _uuid = uuidv4();
+
+      let _msg = `
+			ATTENTION: Use '##' or '####'  to SPLIT SECTIONS, not '#'.Output format carefully referenced "Format example".
+
+			## 任务
+			你的任务是根据“课程信息”,提供用户需要的搜索建议,将搜索建议的结果以有序列表的形式返回给用户。
+			## 课程信息
+			#### 课程标题:${this.courseDetail.title}
+			#### 分类:${this.courseDetail.name ? this.courseDetail.name : "无"}
+			#### 学生年级:${
+        this.courseDetail.classname ? this.courseDetail.classname : "无"
+      }
+			---
+
+			## 规则
+			- 输出结果基于“课程信息”,避免提供无关的信息。
+			- 搜索建议的结果符合伦理规范。
+			---
+
+			## 输出
+			- 输出应包括3个相关的搜索建议,每个搜索建议需要以问号的方式结束。
+			- 请一步步思考如何根据现有信息推送搜索建议,但是不需要输出搜索建议以外的内容。
+
+			---
+			## 输出格式
+			搜索建议应以有序列表形式呈现,每个建议包括关键词和简短描述。输出JSON格式的数组
+
+			---
+      ## Format example
+      [{
+          "index": 1,
+          "title": "垃圾分类标准",
+          "label": "不同国家的垃圾分类标准和方法?"
+        },
+        {
+          "index": 2,
+          "title": "可回收垃圾处理",
+          "label": "可回收垃圾的处理流程和再利用方法?"
+        },
+        {
+          "index": 3,
+          "title": "有害垃圾的影响",
+          "label": "有害垃圾对环境和人体健康的潜在影响?"
+        }]
+			`;
+      this.chatList.push({
+        role: "user",
+        content: `wanSearch`,
+        uid: _uuid,
+        AI: "AI",
+        aiContent: "",
+        oldContent: "",
+        isShowSynchronization: false,
+        filename: "",
+        index: this.chatList.length,
+        is_mind_map: false,
+        loading: true
+      });
+      this.scrollBottom();
+
+      let params = {
+        model: "gpt-3.5-turbo",
+        temperature: 0,
+        max_tokens: 4096,
+        top_p: 1,
+        frequency_penalty: 0,
+        presence_penalty: 0,
+        messages: [{ role: "user", content: _msg }],
+        uid: _uuid,
+        mind_map_question: ""
+      };
+      this.text = "";
+
+      this.ajax
+        .post("https://gpt4.cocorobo.cn/chat", params)
+        .then(res => {
+          if (res.data.FunctionResponse.result == "发送成功") {
+          } else {
+            this.chatLoading = false;
+            this.$message.warning(res.data.FunctionResponse.result);
+          }
+        })
+        .catch(e => {
+          this.chatLoading = false;
+          console.log(e);
+        });
+      this.getWAntSearchContent(_uuid);
+    },
+    scrollBottom() {
+      this.$nextTick(() => {
+        this.$refs.chatRef.scrollTop = this.$refs.chatRef.scrollHeight;
+      });
     }
+  },
+  mounted() {
+    this.getChatList().then(_ => {
+      this.scrollBottom();
+      this.getWantSearch();
+    });
   }
 };
 </script>
@@ -364,7 +637,7 @@ https://www.bilibili.com/video/BV1ZD4y1U7H7/ `;
   height: 100%;
   box-sizing: border-box;
 }
-.imgNumberBlock{
+.imgNumberBlock {
   width: 100%;
   height: 30px;
   display: flex;
@@ -375,9 +648,9 @@ https://www.bilibili.com/video/BV1ZD4y1U7H7/ `;
 .imgNumberBlock > .imgNumber {
   width: 18%;
   height: 30px;
-  white-space:initial;
+  white-space: initial;
   background: rgba(224, 234, 251, 1);
-  border-radius: 5px; 
+  border-radius: 5px;
   display: flex;
   align-items: center;
   cursor: pointer;
@@ -397,6 +670,7 @@ https://www.bilibili.com/video/BV1ZD4y1U7H7/ `;
   display: flex;
   box-sizing: border-box;
   padding: 10px;
+  flex-direction: column;
 }
 
 .s_t_chat > div {
@@ -484,13 +758,14 @@ https://www.bilibili.com/video/BV1ZD4y1U7H7/ `;
   box-sizing: border-box;
   padding-right: 35px;
   position: relative;
+  margin-top: 10px;
 }
 
-.aiCopy{
+.aiCopy {
   position: absolute;
   right: 5px;
   bottom: 0%;
-  transform: translate(0,-30%);
+  transform: translate(0, -30%);
   cursor: pointer;
 }
 
@@ -622,8 +897,9 @@ https://www.bilibili.com/video/BV1ZD4y1U7H7/ `;
   box-sizing: border-box;
   border-top: solid 1px #ededed;
   display: flex;
-  justify-content: center;
+  justify-content: space-between;
   align-items: center;
+  padding-right: 10px;
 }
 
 .s_b_tape {
@@ -636,17 +912,20 @@ https://www.bilibili.com/video/BV1ZD4y1U7H7/ `;
 }
 
 .s_b_input {
-  width: 65%;
+  /* width: 65%; */
+  flex: 1;
   height: 45px;
   background-color: #f3f3f3;
   border-radius: 50px;
   margin: 0 10px;
   display: flex;
   align-items: center;
+  overflow: hidden;
 }
 
 .s_b_i_left {
-  width: calc(100% - 45px);
+  width: 100%;
+  line-height: 45px;
   height: 100%;
 }
 

+ 893 - 592
src/components/classRoomHelper/component/taskArea.vue

@@ -1,661 +1,962 @@
 <template>
-	<div class="task">
-		<div class="taskTop">
-			<div class="tt_title">任务时间分配</div>
-			<div class="tt_item">
-				<div class="tt_i_title">
-					<span>课程时间轴</span>
-				</div>
-				<div class="tt_i_box">
-					<img :src="require('../../../assets/icon/course/group.png')">
-				</div>
-			</div>
-
-			<div class="tt_item">
-				<div class="tt_i_title">
-					<span>任务状态</span>
-					<span>学生活动中...</span>
-				</div>
-				<div class="tt_i_box">
-					<div class="tt_i_b_item">
-						<div class="tt_i_b_title">作业提交</div>
-						<div class="tt_i_b_box">
-							<div class="tt_i_b_b_item">
-								<div>提交人数</div>
-								<span>34<span>人</span></span>
-							</div>
-							<div class="tt_i_b_b_item">
-								<div>正确率</div>
-								<span>88<span>%</span></span>
-							</div>
-						</div>
-					</div>
-					<div class="tt_i_b_item">
-						<div class="tt_i_b_title">交流互动</div>
-						<div class="tt_i_b_box">
-							<div class="tt_i_b_b_item">
-								<div>参与人数</div>
-								<span>56<span>人</span></span>
-							</div>
-							<div class="tt_i_b_b_item">
-								<div>点赞数</div>
-								<span>36<span>个</span></span>
-							</div>
-							<div class="tt_i_b_b_item">
-								<div>评论数</div>
-								<span>128<span>条</span></span>
-							</div>
-						</div>
-					</div>
-				</div>
-			</div>
-		</div>
-		<div class="t_top" ref="chatRef">
-			<div class="t_t_chat" v-for="(item,index) in chatList" :key="index">
-				<div class="t_t_c_user" v-if="item.role =='user'">
-					<div class="t_t_c_u_left">
-						<div class="t_t_c_u_l_content">{{item.content}}</div>
-						<div class="t_t_c_u_l_time">{{item.time}}</div>
-					</div>
-					<div class="t_t_c_u_right">
-						<span>我</span>
-					</div>
-				</div>
-				<div class="t_t_c_ai" v-if="item.role =='ai'">
-					<div class="t_t_c_a_left">
-						<span>Ai</span>
-					</div>
-					<div class="t_t_c_a_right">
-						<div class="t_t_c_a_r_content" v-loading="loading && index == chatList.length - 1" v-html="item.content"></div>
-						<div class="t_t_c_a_r_time">{{item.time}}</div>
-					</div>
-					
-				</div>
-			</div>
-			
-		</div>
-		<div class="t_bottom">
-			<div class="t_b_btnArea">
-				<!-- <div class="s_b_ba-item" @click.stop="choiceRole()">选择角色</div> -->
-				<div class="t_b_ba_item" @click="sendType('智能总结')">智能总结</div>
-				<div class="t_b_ba_item" @click="sendType('智能出题')">智能出题</div>
-				<!-- <div class="t_b_ba_item" @click="sendType('优秀标兵')">优秀标兵</div> -->
-				<div class="t_b_ba_item" @click="sendType('扩展知识')">扩展知识</div>
-			</div>
-			<div class="t_b_inputArea">
-				<div class="t_b_tape" @click="goTape()"></div>
-				<div class="t_b_input">
-					<el-input :disabled="loading" @keyup.enter.native="send()" class="t_b_i_left" v-model="text"></el-input>
-					<div class="t_b_i_right" @click="sendFile()">
+  <div class="task">
+    <div class="taskTop" v-if="false">
+      <div class="tt_title">任务时间分配</div>
+      <div class="tt_item">
+        <div class="tt_i_title">
+          <span>课程时间轴</span>
+        </div>
+        <div class="tt_i_box">
+          <img :src="require('../../../assets/icon/course/group.png')" />
+        </div>
+      </div>
+
+      <div class="tt_item">
+        <div class="tt_i_title">
+          <span>任务状态</span>
+          <span>学生活动中...</span>
+        </div>
+        <div class="tt_i_box">
+          <div class="tt_i_b_item">
+            <div class="tt_i_b_title">作业提交</div>
+            <div class="tt_i_b_box">
+              <div class="tt_i_b_b_item">
+                <div>提交人数</div>
+                <span>34<span>人</span></span>
+              </div>
+              <div class="tt_i_b_b_item">
+                <div>正确率</div>
+                <span>88<span>%</span></span>
+              </div>
+            </div>
+          </div>
+          <div class="tt_i_b_item">
+            <div class="tt_i_b_title">交流互动</div>
+            <div class="tt_i_b_box">
+              <div class="tt_i_b_b_item">
+                <div>参与人数</div>
+                <span>56<span>人</span></span>
+              </div>
+              <div class="tt_i_b_b_item">
+                <div>点赞数</div>
+                <span>36<span>个</span></span>
+              </div>
+              <div class="tt_i_b_b_item">
+                <div>评论数</div>
+                <span>128<span>条</span></span>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+    <div class="t_top" ref="chatRef">
+      <div class="t_t_chat" v-for="(item, index) in chatList" :key="index">
+        <div class="t_t_c_user" v-if="item.content">
+          <div class="t_t_c_u_left">
+            <div class="t_t_c_u_l_content">{{ item.content }}</div>
+            <div class="t_t_c_u_l_time">{{ item.createtime }}</div>
+          </div>
+          <div class="t_t_c_u_right">
+            <span>我</span>
+          </div>
+        </div>
+        <div class="t_t_c_ai">
+          <div class="t_t_c_a_left">
+						<el-avatar v-if="item.filename" :src="item.filename"></el-avatar>
+              <span v-else>Ai</span>
+          </div>
+          <div class="t_t_c_a_right">
+            <div class="t_t_c_a_r_content" style="display: flex;justify-content: space-between;flex-wrap: wrap;" v-if="item.content.includes('图片')">
+              <div
+                  v-if="!pan(item.aiContent).length"
+                  class="d_t_c_a_r_content"
+                  v-loading="item.loading"
+                  v-html="item.aiContent"
+                ></div>
+              <div v-else v-for="i in pan(item.aiContent)">
+                  <img style="width: 120px;height: 120px;" :src="i.image" alt=""  @click="previewImg(i.image)">
+              </div>
+            </div>
+            <div
+              v-else
+              class="t_t_c_a_r_content"
+              v-loading="item.loading"
+              v-html="item.aiContent"
+            ></div>
+            <div class="t_t_c_a_r_time">{{ item.createtime }}</div>
+          </div>
+        </div>
+      </div>
+    </div>
+    <div class="t_bottom">
+      <div class="t_b_btnArea">
+        <!-- <div class="s_b_ba-item" @click.stop="choiceRole()">选择角色</div> -->
+        <div class="t_b_ba_item" @click="sendType('智能总结')">智能总结</div>
+        <div class="t_b_ba_item" @click="sendType('智能出题')">智能出题</div>
+        <!-- <div class="t_b_ba_item" @click="sendType('优秀标兵')">优秀标兵</div> -->
+        <div class="t_b_ba_item" @click="sendType('扩展知识')">扩展知识</div>
+				<div class="t_b_ba_item" @click="clear()">清空聊天记录</div>
+      </div>
+      <div class="t_b_inputArea">
+        <!-- <div class="t_b_tape" @click="goTape()"></div> -->
+        <div class="t_b_input">
+          <el-input
+            :disabled="loading || chatLoading"
+            v-loading="loading || chatLoading"
+            @keyup.enter.native="send()"
+            class="t_b_i_left"
+            v-model="text"
+          ></el-input>
+          <!-- <div class="t_b_i_right" @click="sendFile()">
 						<span></span>
-					</div>
-				</div>
-				<div class="t_b_btn" @click="send()">
-					<span></span>
-				</div>
-			</div>
-		</div>
-	</div>
+					</div> -->
+        </div>
+        <div class="t_b_btn" @click="send()">
+          <span></span>
+        </div>
+      </div>
+    </div>
+  </div>
 </template>
 
 <script>
 // import { Loading } from 'element-ui';
-
-	export default {
-		data(){
-			return{
-				text:"",
-				loading:false,
-				chatList:[
-				{
-						role:"ai",
-						content:`您好,有什么可以帮助您的吗?`,
-						time:new Date().toLocaleString().replace(/\//ig,'-')
-					},
-// 					{
-// 						role:"user",
-// 						content:"正十三边形的每个角是多少度?",
-// 						time:"2023-11-11 11:10:11"
-// 					},
-// 					{
-// 						role:"ai",
-// 						content:`小朋友们,你们知道正十三边形吗?就像我们班有13个好朋友站成一个圈圈一样。如果我们想知道每个人转身看向下一个人需要转多少度,我们可以这样想:首先,所有朋友手拉手围成的圈圈是360度,对吧?但是,我们不能直接算每个人转身的角度,因为那是外面的角度,我们要算里面的角度,就像每个人转身时脚尖指向圈心的角度。
-// 我们先用一个小技巧,算出所有内角加起来是多少度。方法是:(13-2)乘以180度,得到1980度。这是因为,想象成一个多边形,它可以分成11个三角形,每个三角形的角度和是180度。
-// 然后,我们把1980度平分给13个角,就是每个角的度数了。算一算,1980除以13等于152度。所以,正十三边形的每个角是152度。就像每个人转身看下一个朋友,每个人需要转152度一样。`,
-// 						time:"2023-11-11 11:10:11"
-// 					},
-				],
-			}
-		},
-		methods: {
-			choiceRole(){
-				this.cardType = 1;
-			},
-			sendFile(){
-				if (this.loading) return this.$message.info("请稍等");
-				this.$message.info("点击了附件")
-			},
-			goTape(){
-				if (this.loading) return this.$message.info("请稍等");
-				this.$message.info(`点击了语音`)
-			},
-			send(){
-				if (this.loading) return this.$message.info("请稍等");
-				if(this.text.trim().length==0)return this.$message.info("请输入内容")
-				this.loading = true;
-				this.chatList.push({
-					role:"user",
-					content:this.text,
-					time:new Date().toLocaleString().replace(/\//ig,'-')
-				})
-				
-				this.chatList.push({
-					role:"ai",
-					content:"",
-					time:new Date().toLocaleString().replace(/\//ig,'-')
-				})
-				this.$nextTick(() => {
-				  this.$refs.chatRef.scrollTop = this.$refs.chatRef.scrollHeight;
-				});;
-				setTimeout(()=>{
-					
-
-					let aiContent="对不起,这个问题我回答不了。"
-
-					switch(this.text){
-						case "智能总结":
-							aiContent=`在这节课上,教师和学生们围绕垃圾问题进行了深入的讨论和实践活动。截止到目前为止,课程已经教学了以下内容:
-
-1.环境调查与问题识别:学生们首先进行了实地调查,发现了大鹏新区存在的环境问题,特别是垃圾问题。学生们观察到菜市场和路边有大量垃圾堆积。
-2.垃圾产生的数据分析:教师引导学生计算家庭和学校垃圾产生的总量,并通过比喻(如成年公羊和非洲大象的重量)来形象地表达垃圾的重量,增强学生对垃圾量的直观理解。
-3.垃圾处理方法的探讨:学生们讨论了垃圾的处理方式,包括填埋、焚烧发电以及回收利用。他们探讨了这些方法的优缺点,如填埋会占用大量土地并可能污染土地和水源,焚烧则可能导致空气污染。
-4.垃圾分类的重要性:课程强调了垃圾分类的重要性,并通过实际分类活动让学生们理解不同垃圾的处理方式。学生们学习了如何将垃圾分为可回收垃圾、厨余垃圾、有害垃圾和其他垃圾,并探讨了各类垃圾的具体处理方法。
-5.实际行动的倡议:教师鼓励学生从减少一次性用品的使用开始,采取实际行动来减少垃圾产生。学生们提出了多种减少和重新利用垃圾的创意方法,如将剩饭剩菜喂给小动物或制作成堆肥。
-
-总结来说,这节课通过实地调查、数据分析和小组讨论等多种教学方法,有效地提高了学生们对环境保护和垃圾处理问题的认识和参与度。学生们通过实际操作和讨论,学习了垃圾分类的技能,并对垃圾处理的各种方法有了深入的了解和评价。`
-						break;
-						case "智能出题":
-							aiContent = `选择题:下列哪一项应该被归类为可回收物?
-A. 废弃的塑料袋
-B. 污染严重的厨房纸巾
-C. 破碎的玻璃杯
-D. 废旧的电池`
-							break;
-						case "优秀标兵":
-							aiContent = `这节课的学习数据如下:
-
-							<img src='https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8711713252928457.png' style="max-width:100%">
-1.陈小春:陈小春同学的作业完成率接近完美,考试成绩也非常优秀,课堂参与度非常积极,项目贡献被评为优秀。综合各方面表现,陈小春在学习上非常突出,是一个全面发展的学生。
-2.李雷:李雷同学的作业完成率较高,考试成绩良好,课堂参与度积极,项目贡献优秀。李雷在学习成绩和课堂表现上表现突出,是一个学习能力强的学生。
-3.林婷婷:虽然林婷婷同学的作业完成率略低于陈小春和李雷,但考试成绩与李雷持平,且课堂参与度积极,项目贡献良好。林婷婷在学习成绩上表现稳定,是一个有潜力的学生。`;
-							break;
-						case "扩展知识":
-							aiContent = `在这节关于解决垃圾问题的科学课上,学生们已经通过实际的调查和计算,以及对垃圾分类和处理方法的讨论,获得了很多实用的知识。为了进一步扩展这些知识,以下是一些可以在课堂上引入的相关主题和活动:
-
-1.全球垃圾处理策略对比:
-a.研究并讨论不同国家如何处理垃圾,例如德国、日本和瑞士的垃圾分类和处理系统。这可以帮助学生了解不同文化和政策环境下的环保策略。
-b.学生可以制作海报或演示文稿,展示每个国家的垃圾处理方法,并讨论其优缺点。
-2.垃圾减量的科技创新:
-a.探索和讨论新技术如何帮助减少垃圾产生,例如生物降解材料、可回收包装设计等。
-b.邀请一个环保技术公司的代表来讲述他们如何通过创新技术来处理或减少垃圾。
-3.实地考察:
-a.组织一次学校附近的垃圾处理设施或回收中心的参观。让学生亲眼看到垃圾是如何被分类、处理和回收的。 
-b.在参观后,学生可以讨论他们的观察结果,以及这些设施如何影响社区和环境。
-4.环保项目设计:
-a.鼓励学生设计自己的环保项目,如校园内的垃圾分类宣传、制作可持续材料的手工艺品等。
-b.这些项目可以在学校的科学展览会上展出,或者在校园网站上分享。
-5.家庭和社区的环保行动:
-a.让学生调查并记录他们家庭一周内的垃圾产生和处理情况,然后讨论如何改进。 
-b.学生可以创建一个“绿色挑战”活动,鼓励家庭成员减少垃圾产生,如使用可重复使用的购物袋、减少一次性产品使用等。
-
-通过这些扩展活动,学生不仅能够加深对垃圾问题的理解,还能学习到如何在日常生活中实际应用这些知识,从而更有效地保护我们的环境。`;
-							break;
-					}
-					this.chatList[this.chatList.length - 1].content = aiContent;
-          this.chatList[
-            this.chatList.length - 1
-          ].time = new Date().toLocaleString().replace(/\//gi, "-");
-					// this.chatList.push({
-					// 	role:"ai",
-					// 	content:aiContent,
-					// 	time:new Date().toLocaleString().replace(/\//ig,'-')
-					// })
-					this.text = "";
-					this.$nextTick(() => {
-					  this.$refs.chatRef.scrollTop = this.$refs.chatRef.scrollHeight;
-					});;
-					this.loading = false;
-				},5000)
-				// this.chatList.push({
-				// 	role:"user",
-				// 	content:this.text,
-				// 	time:"2023-11-11 11:10:11"
-				// },{
-				// 	role:"ai",
-				// 	content:`小朋友,你真棒!`,//这里需要调用接口
-				// 	time:"2023-11-11 11:10:11"
-				// })
-				// this.text = "";
-				// // 元素滚动条触底
-				// this.$nextTick(() => {
-				//   this.$refs.chatRef.scrollTop = this.$refs.chatRef.scrollHeight;
-				// });;
-			},
-			sendType(text){
-				
-				if (this.loading) return this.$message.info("请稍等");
-				this.text = text;
-				this.send();
-			},
-			sendImage(){
-				this.$message.info("发送图片")
-			},
-			sendVideo(){
-				this.$message.info("发送视频")
-			},
+import { v4 as uuidv4 } from "uuid";
+import MarkdownIt from "markdown-it";
+import { tools } from "../../../common/tools";
+export default {
+  props: {
+    courseDetail: {
+      type: Object,
+      default: () => {}
+    }
+  },
+  data() {
+    return {
+      userid: this.$route.query.userid,
+      courseId: this.$route.query.courseId,
+      text: "",
+      loading: false,
+      chatLoading: false,
+      chatList: []
+    };
+  },
+  computed: {
+    pan() {
+      return (content) => {
+        try {
+        return JSON.parse(content)
+      } catch (error) {
+        return []
+      }
+      };
+    }
+  },
+  methods: {
+    exportCourse() {
+      let _user = `<div style="font-size:30px;margin-top:10px;"><span style="color: rgb(113, 124, 141); font-weight: 400;">创建者:</span><span>${this.courseDetail.username}</span></div>`;
+      const _chapInfo = JSON.parse(this.courseDetail.chapters);
+      let _chap = "";
+
+      for (let i = 0; i < _chapInfo.length; i++) {
+        _chap += `<div style="font-size:40px;margin-top:70px;"><span>第${
+          i + 1
+        }阶段:${_chapInfo[i].dyName}</span></div>`;
+        let _task = _chapInfo[i].chapterInfo[0].taskJson;
+        for (let j = 0; j < _task.length; j++) {
+          _chap += `<div style="font-size:30px;margin-top:50px;"><span>任务${
+            j + 1
+          }:${_task[j].task}</span></div>`;
+          if (_task[j].taskDetail) {
+            _chap += `<div style="font-size:25px;margin-top:40px;">任务描述</div>`;
+            _chap += `<div style="font-size:25px;margin-top:10px;">${_task[j].taskDetail}</div>`;
+          }
+          let _tool = _task[j].toolChoose;
+          if (_tool[0].tool.length) {
+            for (let z = 0; z < _tool.length; z++) {
+              _chap += `<div style="font-size:23px;margin-top:30px;"><span>步骤${
+                z + 1
+              }:</span><span>${
+                tools[_tool[z].tool[0]] ? tools[_tool[z].tool[0]].name : ""
+              }</span></div>`;
+
+              if (_tool[z].toolDetail) {
+                _chap += `<div style="font-size:23px;margin-top:20px;">工具描述</div>`;
+                _chap += `<div style="font-size:23px;margin-top:10px;">${_tool[z].toolDetail}</div>`;
+              }
+            }
+          }
+        }
+      }
+
+      let _html = _user + _chap;
+      return _html
+    },
+    previewImg(url) {
+      this.$hevueImgPreview(url);
+    },
+		clear(){
+			this.chatList = [];
 		},
-	}
+    // 获取ai对话
+    getAiContent(_uid) {
+      let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
+      let _allText = "";
+      let _mdText = "";
+      const md = new MarkdownIt();
+      _source.onmessage = _e => {
+        if (_e.data.replace("'", "").replace("'", "") == "[DONE]") {
+          //对话已经完成
+          _mdText = _mdText.replace("_", "");
+          _source.close();
+          this.chatLoading = false;
+          this.scrollBottom();
+          this.chatList.find(i => i.uid == _uid).aiContent = _mdText;
+          this.chatList.find(i => i.uid == _uid).isalltext = true;
+          this.chatList.find(i => i.uid == _uid).isShowSynchronization = true;
+          this.chatList.find(i => i.uid == _uid).loading = false;
+          // 这里保存对话
+          this.insertChat(_uid);
+          return;
+        } else {
+          //对话还在继续
+          let _text = "";
+          _text = _e.data.replaceAll("'", "");
+          if (_allText == "") {
+            _allText = _text.replace(/^\n+/, ""); //去掉回复消息中偶尔开头就存在的连续换行符
+          } else {
+            _allText += _text;
+          }
+          _mdText = _allText + "_";
+          _mdText = _mdText.replace(/\\n/g, "\n");
+          _mdText = _mdText.replace(/\\/g, "");
+          if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
+          //转化返回的回复流数据
+          _mdText = md.render(_mdText);
+          this.chatList.find(i => i.uid == _uid).aiContent = _mdText;
+          this.chatList.find(i => i.uid == _uid).loading = false;
+          this.scrollBottom();
+          // 处理流数据
+        }
+      };
+    },
+    //保存消息
+    insertChat(_uid) {
+      let _data = this.chatList.find(i => i.uid == _uid);
+      if (!_data) return;
+      let params = {
+        userId: this.userid,
+        userName: "qgt",
+        groupId: "602def61-005d-11ee-91d8-005056b8q12w",
+        answer: _data.aiContent,
+        problem: _data.content,
+        file_id: _data.fileid ? _data.fileid : "",
+        alltext: _data.aiContent,
+        type: "chat",
+        filename: _data.filename,
+        session_name: `${this.courseId}-studyStudent` //这是对话记录位置
+      };
+      this.ajax
+        .post("https://gpt4.cocorobo.cn/insert_chat", params)
+        .then(res => {});
+    },
+    // 获取对应的聊天记录
+    getChatList() {
+      return new Promise((resolve, reject) => {
+        if (this.loading) return this.$message.info("请稍等...");
+        this.chatList = [];
+        this.loading = true;
+        this.chatLoading = true;
+        let params = {
+          userid: this.userid,
+          groupid: "602def61-005d-11ee-91d8-005056b8q12w",
+          // session_name:``
+          session_name: `${this.courseId}-studyStudent`
+        };
+        this.ajax
+          .post("https://gpt4.cocorobo.cn/get_agent_park_chat", params)
+          .then(res => {
+            let _data = JSON.parse(res.data.FunctionResponse);
+            if (_data.length > 0) {
+              let _chatList = [];
+              for (let i = 0; i < _data.length; i++) {
+                _chatList.push({
+                  loading: false,
+                  role: "user",
+                  content: _data[i].problem,
+                  uid: _data[i].id,
+                  AI: "AI",
+                  aiContent: _data[i].answer,
+                  oldContent: _data[i].answer,
+                  isShowSynchronization: false,
+                  filename: _data[i].filename,
+                  index: i,
+                  is_mind_map: false,
+                  fileid: _data[i].fileid
+                });
+              }
+              this.chatList = _chatList;
+              this.loading = false;
+              this.chatLoading = false;
+            } else {
+              //没有对话记录
+              this.loading = false;
+              this.chatLoading = false;
+            }
+            resolve();
+          })
+          .catch(err => {
+            console.log(err);
+            this.$message.error("获取对话记录失败");
+            this.loading = false;
+            this.chatLoading = false;
+            resolve();
+          });
+      });
+    },
+    // choiceRole() {
+    //   this.cardType = 1;
+    // },
+    // sendFile() {
+    //   if (this.loading) return this.$message.info("请稍等");
+    //   this.$message.info("点击了附件");
+    // },
+    // goTape() {
+    //   if (this.loading) return this.$message.info("请稍等");
+    //   this.$message.info(`点击了语音`);
+    // },
+    send(_text = this.text) {
+      if (this.loading || this.chatLoading) return this.$message.info("请稍等");
+      if (_text.trim().length == 0) return this.$message.info("请输入内容");
+      this.chatLoading = true;
+      let _uuid = uuidv4();
+
+
+
+      this.chatList.push({
+        role: "user",
+        content: `${_text}`,
+        uid: _uuid,
+        AI: "AI",
+        aiContent: "",
+        oldContent: "",
+        isShowSynchronization: false,
+        filename: "",
+        index: this.chatList.length,
+        is_mind_map: false,
+        loading: true
+      });
+      this.scrollBottom();
+
+      let params = {
+        model: "gpt-3.5-turbo",
+        temperature: 0,
+        max_tokens: 4096,
+        top_p: 1,
+        frequency_penalty: 0,
+        presence_penalty: 0,
+        messages: [{ role: "user", content: _text }],
+        uid: _uuid,
+        mind_map_question: ""
+      };
+      this.text = "";
+
+      this.ajax
+        .post("https://gpt4.cocorobo.cn/chat", params)
+        .then(res => {
+          if (res.data.FunctionResponse.result == "发送成功") {
+          } else {
+            this.$message.warning(res.data.FunctionResponse.result);
+            this.chatLoading = false;
+          }
+        })
+        .catch(e => {
+          console.log(e);
+          this.chatLoading = false;
+        });
+      this.getAiContent(_uuid);
+    },
+    sendType(_text) {
+      if (this.loading || this.chatLoading) return this.$message.info("请稍等");
+      let _msg = ``;
+      if (_text == "扩展知识") {
+        // return console.log(this.courseDetail);
+        _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
+## 任务
+你的任务是根据用户的请求,结合以下“课程信息”包含的子条目(“课程标题”,“分类”以及“年级”),向用户输出相关的扩展知识点,将结果以有序列表的形式返回给用户。
+课程信息
+课程标题:${this.courseDetail.title}
+分类:${this.courseDetail.name?this.courseDetail.name:"无"}
+学生年级:${this.courseDetail.classname?this.courseDetail.classname:"无"}
+
+## 规则
+1. 内容应该与“课程信息”相关,避免提供无关的信息。
+2. 当课程信息中的子条目内容为“无”时,无视这些条目进行即可。
+3. 搜索建议的结果应该符合伦理规范。
+4. 一步步思考如何根据“课程信息”来输出“扩展知识点”,但是你不需要“扩展知识点”以外的内容。
+
+## 格式要求
+1. 应包括5个相关的“扩展知识点”。
+2. 搜索建议应以有序列表形式呈现,每个建议包括关键词和简短描述。
+
+# Format example
+## 课程标题:垃圾回收
+分类:无
+年级:无
+1. 垃圾分类标准:不同国家的垃圾分类标准和方法。
+2. 可回收垃圾处理:可回收垃圾的处理流程和再利用方法。
+3. 有害垃圾的影响:有害垃圾对环境和人体健康的潜在影响。
+4. 垃圾减量化策略:减少垃圾产生的有效策略和实践。
+5. 环保教育活动:在学校中推广环保意识的活动和资源。
+        `;
+      } else if (_text == "智能出题") {
+        _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
+## 任务
+你的任务是根据用户的请求,结合以下“课程信息”包含的子条目(“课程标题”,“分类”以及“年级”),向用户输出相关的练习题目,将结果以有序列表的形式返回给用户。
+课程信息
+课程标题:${this.courseDetail.title}
+分类:${this.courseDetail.name?this.courseDetail.name:"无"}
+学生年级:${this.courseDetail.classname?this.courseDetail.classname:"无"}
+
+## 规则
+1. 练习题目内容应该与“课程信息”相关,避免提供无关的信息。
+2. 当课程信息中的子条目内容为“无”时,无视这些条目进行输出即可。
+3. 一步步思考如何根据“课程信息”输出“练习题目”,但是你不需要输出“练习题目”以外的内容。
+4.输出练习题目后,提示用户“希望这些题目能帮到你,如果需要其他类型题目或者更多题目,可以随时向我输入你的需求”
+
+## 格式要求
+1. 输出应包括3道相关的“练习题目”。
+2. 练习题目默认只包含3道4选1的单选题,除非用户在提示词中更具体地指明了题目类型和数量。
+3. 练习题目应以有序列表形式呈现,每个建议包括关键词和简短描述。
+
+# Format example
+## 课程标题:垃圾回收
+分类:无
+年级:无
+1. 垃圾回收的主要目的是: a) 增加垃圾的数量 b) 减少垃圾的数量 c) 提高垃圾的质量 d) 增加垃圾的种类
+2. 以下哪种垃圾是可以回收的? a) 食物残渣 b) 塑料瓶 c) 湿纸巾 d) 动物粪便
+3. 垃圾分类中,玻璃瓶通常属于哪一类? a) 可回收垃圾 b) 厨余垃圾 c) 有害垃圾 d) 其他垃圾
+
+
+					`;
+      } else if (_text == "智能总结") {
+        _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
+## 任务
+你的任务是根据用户的请求,结合以下“课程信息”包含的子条目(“课程标题”,“主题”,“学科”,“年级”以及“学习内容”),对课程进行课程总结,请根据输出格式将内容输出给用户。
+课程信息
+课程标题:${this.courseDetail.title}
+分类:${this.courseDetail.name?this.courseDetail.name:"无"}
+学生年级:${this.courseDetail.classname?this.courseDetail.classname:"无"}
+学习内容:${this.exportCourse()}
+
+## 规则
+1. “课程总结”内容应该与“课程信息”相关,避免提供无关的信息。
+2. 当课程信息中的子条目内容为“无”时,无视这些条目进行输出即可。
+3. 一步步思考如何根据“课程信息”输出“课程总结”。
+
+## 格式要求
+1. 以无序列表的形式输出“课程信息”中的“课程标题”,“主题”,“学科”以及“年级”,若这些条目中的内容为“无”,则不需要输出
+
+## 示例
+课程标题:垃圾回收
+分类:自然科学 语文 数学
+年级:无
+学习内容:垃圾回收是指将废弃物重新加工利用的过程,这不仅有助于减少环境污染,还能节约资源。首先,垃圾回收可以减少填埋场的压力,避免土地资源的浪费和地下水的污染。其次,通过回收纸张、塑料、金属等材料,我们可以减少对原材料的需求,从而保护森林、矿产等自然资源。此外,垃圾回收还能减少温室气体的排放,缓解气候变化。引导学生思考垃圾回收的意义,可以从以下几个方面入手:一是环境保护,垃圾回收能有效减少污染,保护生态系统;二是资源节约,通过回收利用,我们可以减少对自然资源的消耗;三是经济效益,垃圾回收产业可以创造就业机会,促进经济发展。通过这些思考,学生们可以更深刻地理解垃圾回收的重要性,并在日常生活中积极参与到垃圾分类和回收的行动中来,共同为可持续发展贡献力量。
+
+# Format example
+## 课程标题:垃圾回收
+分类:自然科学 语文 数学
+年级:无
+学习内容:学习内容包含一份引导学生思考为何要进行垃圾回收的文档材料
+
+					`;
+      }
+      if (!_msg) return;
+      // console.log(_msg)
+      this.chatLoading = true;
+      let _uuid = uuidv4();
+      this.chatList.push({
+        role: "user",
+        content: `${_text}`,
+        uid: _uuid,
+        AI: "AI",
+        aiContent: "",
+        oldContent: "",
+        isShowSynchronization: false,
+        filename: "",
+        index: this.chatList.length,
+        is_mind_map: false,
+        loading: true
+      });
+      this.scrollBottom();
+
+      let params = {
+        model: "gpt-3.5-turbo",
+        temperature: 0,
+        max_tokens: 4096,
+        top_p: 1,
+        frequency_penalty: 0,
+        presence_penalty: 0,
+        messages: [{ role: "user", content: _msg }],
+        uid: _uuid,
+        mind_map_question: ""
+      };
+      this.text = "";
+
+      this.ajax
+        .post("https://gpt4.cocorobo.cn/chat", params)
+        .then(res => {
+          if (res.data.FunctionResponse.result == "发送成功") {
+          } else {
+            this.$message.warning(res.data.FunctionResponse.result);
+            this.chatLoading = false;
+          }
+        })
+        .catch(e => {
+          console.log(e);
+          this.chatLoading = false;
+        });
+      this.getAiContent(_uuid);
+      // this.send(text);
+    },
+    // sendImage() {
+    //   this.$message.info("发送图片");
+    // },
+    // sendVideo() {
+    //   this.$message.info("发送视频");
+    // },
+    scrollBottom() {
+      this.$nextTick(() => {
+        this.$refs.chatRef.scrollTop = this.$refs.chatRef.scrollHeight;
+      });
+    }
+  },
+  mounted() {
+    this.getChatList().then(_ => {
+      this.scrollBottom();
+    });
+  }
+};
 </script>
 
 <style scoped>
-.task{
-	width: 100%;
-	height: 100%;
-	box-sizing: border-box;
+.task {
+  width: 100%;
+  height: 100%;
+  box-sizing: border-box;
 }
 
-.taskTop{
-	width: 100%;
-	height: 280px;
-	box-sizing: border-box;
-	padding: 10px;
-	overflow-x: hidden;
+.taskTop {
+  width: 100%;
+  height: 280px;
+  box-sizing: border-box;
+  padding: 10px;
+  overflow-x: hidden;
 }
 
-.tt_title{
-	font-size: 18px;
-	font-weight: bold;
-	margin-bottom: 5px;
+.tt_title {
+  font-size: 18px;
+  font-weight: bold;
+  margin-bottom: 5px;
 }
 
-.tt_item{
-	width: 100%;
-	height: auto;
-	margin-top: 10px;
+.tt_item {
+  width: 100%;
+  height: auto;
+  margin-top: 10px;
 }
 
-.tt_i_title{
-	display: flex;
-	justify-content: space-between;
-	align-items: center;
+.tt_i_title {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
 }
 
-.tt_i_title>span:nth-of-type(2){
-	box-sizing: border-box;
-	padding: 0 10px;
-	height: 25px;
-	background-color: #EFFCF5;
-	color: #83E0AF;
+.tt_i_title > span:nth-of-type(2) {
+  box-sizing: border-box;
+  padding: 0 10px;
+  height: 25px;
+  background-color: #effcf5;
+  color: #83e0af;
 }
 
-
-.tt_i_box{
-	width: 100%;
-	height: auto;
-	display: flex;
-	margin-top: 10px;
-	justify-content: space-between;
+.tt_i_box {
+  width: 100%;
+  height: auto;
+  display: flex;
+  margin-top: 10px;
+  justify-content: space-between;
 }
 
-.tt_i_box>img{
-	width: 100%;
-	height: 50px;
+.tt_i_box > img {
+  width: 100%;
+  height: 50px;
 }
 
-
-.tt_i_b_item{
-	width: auto;
-	height: 90px;
-	background-color: #F6F9FF;
+.tt_i_b_item {
+  width: auto;
+  height: 90px;
+  background-color: #f6f9ff;
 }
 
-.tt_i_b_title{
-	width: 100%;
-	height: 30px;
-	display: flex;
-	justify-content: center;
-	align-items: center;
-	box-sizing: border-box;
-	border: solid 1px #E0EAFB;
-	color: #626466;
+.tt_i_b_title {
+  width: 100%;
+  height: 30px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  box-sizing: border-box;
+  border: solid 1px #e0eafb;
+  color: #626466;
 }
 
-.tt_i_b_box{
-	width: auto;
-	height: 60px;
-	box-sizing: border-box;
-	border: solid 1px #E0EAFB;
-	border-top: none;
-	display: flex;
+.tt_i_b_box {
+  width: auto;
+  height: 60px;
+  box-sizing: border-box;
+  border: solid 1px #e0eafb;
+  border-top: none;
+  display: flex;
 }
 
-.tt_i_b_b_item{
-	width: 70px;
-	height: 100%;
-	display: flex;
-	flex-direction: column;
-	justify-content: center;
-	align-items: center;
-	border-left: solid 1px #E0EAFB;
+.tt_i_b_b_item {
+  width: 70px;
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+  border-left: solid 1px #e0eafb;
 }
 
-.tt_i_b_box>.tt_i_b_b_item:nth-of-type(1){
-	border-left:none
+.tt_i_b_box > .tt_i_b_b_item:nth-of-type(1) {
+  border-left: none;
 }
 
-.tt_i_b_b_item>div{
-	font-size: 14px;
-	color: #949599;
+.tt_i_b_b_item > div {
+  font-size: 14px;
+  color: #949599;
 }
 
-.tt_i_b_b_item>span{
-	font-weight: bold;
+.tt_i_b_b_item > span {
+  font-weight: bold;
 }
 
-.tt_i_b_b_item>span>span{
-	font-size: 12px;
-	font-weight: 200;
+.tt_i_b_b_item > span > span {
+  font-size: 12px;
+  font-weight: 200;
 }
 
-
-.t_top{
-	width: 100%;
-	height: calc(100% - 370px);
-	overflow: auto;
-	box-sizing: border-box;
-	padding: 20px 0;
+.t_top {
+  width: 100%;
+  height: calc(100% - 90px);
+  /* height: calc(100% - 370px); */
+  overflow: auto;
+  box-sizing: border-box;
+  padding: 20px 0;
 }
 
-.t_t_chat{
-	width: 100%;
-	display: flex;
-	box-sizing: border-box;
-	padding: 10px;
+.t_t_chat {
+  width: 100%;
+  display: flex;
+  box-sizing: border-box;
+  padding: 10px;
+  flex-direction: column;
 }
 
-.t_t_chat>div{
-	display: flex;
-	align-items: flex-start;
-	width: 100%;
+.t_t_chat > div {
+  display: flex;
+  align-items: flex-start;
+  width: 100%;
 }
 
-.t_t_c_user{
-	box-sizing: border-box;
-	padding-left: 35px;
+.t_t_c_user {
+  box-sizing: border-box;
+  padding-left: 35px;
 }
 
-.t_t_c_u_left{
-	width: 90%;
-	height: auto;
+.t_t_c_u_left {
+  width: 90%;
+  height: auto;
 }
 
-.t_t_c_u_l_content{
-	width: auto;
-	max-width: 100%;
-	height: auto;
-	box-sizing: border-box;
-	padding: 10px;
-	color: white;
-	background-color: #3681FC;
-	border-radius: 8px 2px 8px 8px;
-  white-space: pre-line
+.t_t_c_u_l_content {
+  width: auto;
+  max-width: 100%;
+  height: auto;
+  box-sizing: border-box;
+  padding: 10px;
+  color: white;
+  background-color: #3681fc;
+  border-radius: 8px 2px 8px 8px;
+  white-space: pre-line;
 }
 
-.t_t_c_u_l_time{
-	width: 100%;
-	display: flex;
-	justify-content: flex-end;
-	font-size: 12px;
-	color: #9F9F9F;
-	margin-top: 5px;
+.t_t_c_u_l_time {
+  width: 100%;
+  display: flex;
+  justify-content: flex-end;
+  font-size: 12px;
+  color: #9f9f9f;
+  margin-top: 5px;
 }
 
-.t_t_c_u_right{
-	width: 35px;
-	height: 35px;
-	display: flex;
-	justify-content: center;
-	margin-left: 5px
+.t_t_c_u_right {
+  width: 35px;
+  height: 35px;
+  display: flex;
+  justify-content: center;
+  margin-left: 5px;
 }
 
-.t_t_c_u_right>span{
-	width: 32px;
-	height: 32px;
-	display: flex;
-	justify-content: center;
-	align-items: center;
-	color: white;
-	background-color: #3681FC;
-	border-radius: 50%;;
+.t_t_c_u_right > span {
+  width: 32px;
+  height: 32px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  color: white;
+  background-color: #3681fc;
+  border-radius: 50%;
 }
 
-.t_t_c_ai{
-	box-sizing: border-box;
-	padding-right: 35px;
+.t_t_c_ai {
+  margin-top: 10px;
+  box-sizing: border-box;
+  padding-right: 35px;
 }
 
-.t_t_c_a_right{
-	min-width: 90%;
-	height: auto;
+.t_t_c_a_right {
+  min-width: 90%;
+  height: auto;
 }
 
-.t_t_c_a_r_content{
-	width: auto;
-	max-width: 100%;
-	height: auto;
-	box-sizing: border-box;
-	padding: 10px;
-	background-color: #F6F8FF;
-	border-radius: 2px 8px 8px 8px;
+.t_t_c_a_r_content {
+  width: auto;
+  max-width: 100%;
+  height: auto;
+  box-sizing: border-box;
+  padding: 10px;
+  background-color: #f6f8ff;
+  border-radius: 2px 8px 8px 8px;
   white-space: pre-line;
-	word-break: break-all;
+  word-break: break-all;
 }
 
-.t_t_c_a_r_content2{
-	background-color: #F6F8FF;
-	width: 100%;
-	height: auto;
-	box-sizing: border-box;
-	padding: 10px;
-	border-radius: 2px 8px 8px 8px;
+.t_t_c_a_r_content2 {
+  background-color: #f6f8ff;
+  width: 100%;
+  height: auto;
+  box-sizing: border-box;
+  padding: 10px;
+  border-radius: 2px 8px 8px 8px;
   white-space: pre-line;
-	box-shadow: 0 0px 10px #c5cbee;
-}
-
-.t_t_c_a_r_c_title{
-	display: flex;
-	align-items: center;
-}
-.t_t_c_a_r_c_title>img{
-	width: 16px;
-	height: 16px;
-}
-
-.t_t_c_a_r_c_item{
-	width: 100%;
-	height: auto;
-	box-sizing: border-box;
-	padding: 10px;
-	background-color: #FFFFFF;
-	border-radius: 5px;
-	margin-top: 5px;
-	color: #666666;
-	font-size: 14px;
-	cursor: pointer;
-}
-
-.t_t_c_a_r_c_item:hover{
-	border: solid #B8D2FE 1px;
-	box-shadow: 0 0 5px 2px #B8D2FE;
-}
-
-.t_t_c_a_r_c_title>span{
-	font-weight: bold;
-}
-
-
-.t_t_c_a_r_time{
-	width: 100%;
-	display: flex;
-	justify-content: flex-start;
-	font-size: 12px;
-	color: #9F9F9F;
-	margin-top: 5px;
-}
-
-.t_t_c_a_left{
-	width: 35px;
-	height: 35px;
-	display: flex;
-	justify-content: center;
-	margin-right: 5px
-}
-
-.t_t_c_a_left>span{
-	width: 32px;
-	height: 32px;
-	display: flex;
-	justify-content: center;
-	align-items: center;
-	color: white;
-	background-color: #3681FC;
-	border-radius: 50%;
-}
-
-.t_bottom{
-	width: 100%;
-	height: 90px;
-	display: flex;
-	flex-direction: column;
-	justify-content: space-between;
-}
-
-.t_b_btnArea{
-	width: 100%;
-	height: 30px;
-	display: flex;
-	align-items: center;
-	box-sizing: border-box;
-	padding: 0 10px;
-	overflow-y: hidden;
-}
-
-.t_b_ba_item{
-	width: auto;
-	box-sizing: border-box;
-	padding: 0 10px;
-	height: 25px;
-	background-color: white;
-	display: flex;
-	justify-content: center;
-	align-items: center;
-	/* 阴影 */
-	box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.363);
-	border-radius: 15px;
-	font-size: 14px;
-	cursor: pointer;
-	margin-right: 10px;
-	white-space: nowrap;
-	transition: .3s;
-}
-
-.t_b_ba_item:hover{
-	background-color: rgb(236, 236, 236);
-}
-
-
-.t_b_inputArea{
-	width: 100%;
-	height: 55px;
-	box-sizing: border-box;
-	border-top: solid 1px #EDEDED;
-	display: flex;
-	justify-content: center;
-	align-items: center;
-}
-
-.t_b_tape{
-	width: 35px;
-	height: 35px;
-	background: url("../../../assets/icon/course/tape.png") no-repeat;
-	background-size: 50% 60%;
-	background-position: center;
-	cursor: pointer;
-}
-
-.t_b_input{
-	width: 65%;
-	height: 45px;
-	background-color: #F3F3F3;
-	border-radius: 50px;
-	margin: 0 10px;
-	display: flex;
-	align-items: center;
-}
-
-.t_b_i_left{
-	width: calc(100% - 45px);
-	height: 100%;
-}
-
-.t_b_i_left>>>.el-input__inner{
-	border: none;
-	background-color: #F3F3F3;
-	outline: none;
-	border-radius: 50px 0 0 50px;
-}
-
-
-.t_b_i_right{
-	width: 45px;
-	height: 45px;
-	display: flex;
-	justify-content: center;
-	align-items: center;
-}
-
-.t_b_i_right>span{
-	width: 35px;
-	height: 35px;
-	background: url("../../../assets/icon/course/file.png") no-repeat;
-	background-size: 50% 60%;
-	background-position: center;
-	cursor: pointer;
-}
-
-.t_b_btn{
-	width: 40px;
-	height: 40px;
-	background-color: #3681FC;
-	display: flex;
-	justify-content: center;
-	align-items: center;
-	border-radius: 50%;
-	cursor: pointer;
-}
-
-.t_b_btn>span{
-	width: 30px;
-	height: 30px;
-	background: url("../../../assets/icon/course/send.png") no-repeat;
-	background-size: 70% 70%;
-	background-position: center;
-	
-}
-
-td,th{
-	padding: 10px;
-}
-
+  box-shadow: 0 0px 10px #c5cbee;
+}
 
-</style>
+.t_t_c_a_r_c_title {
+  display: flex;
+  align-items: center;
+}
+.t_t_c_a_r_c_title > img {
+  width: 16px;
+  height: 16px;
+}
+
+.t_t_c_a_r_c_item {
+  width: 100%;
+  height: auto;
+  box-sizing: border-box;
+  padding: 10px;
+  background-color: #ffffff;
+  border-radius: 5px;
+  margin-top: 5px;
+  color: #666666;
+  font-size: 14px;
+  cursor: pointer;
+}
+
+.t_t_c_a_r_c_item:hover {
+  border: solid #b8d2fe 1px;
+  box-shadow: 0 0 5px 2px #b8d2fe;
+}
+
+.t_t_c_a_r_c_title > span {
+  font-weight: bold;
+}
+
+.t_t_c_a_r_time {
+  width: 100%;
+  display: flex;
+  justify-content: flex-start;
+  font-size: 12px;
+  color: #9f9f9f;
+  margin-top: 5px;
+}
+
+.t_t_c_a_left {
+  width: 35px;
+  height: 35px;
+  display: flex;
+  justify-content: center;
+  margin-right: 5px;
+}
+
+.t_t_c_a_left > span {
+  width: 32px;
+  height: 32px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  color: white;
+  background-color: #3681fc;
+  border-radius: 50%;
+}
+
+.t_bottom {
+  width: 100%;
+  height: 90px;
+  display: flex;
+  flex-direction: column;
+  justify-content: space-between;
+}
+
+.t_b_btnArea {
+  width: 100%;
+  height: 30px;
+  display: flex;
+  align-items: center;
+  box-sizing: border-box;
+  padding: 0 10px;
+  overflow-y: hidden;
+}
+
+.t_b_ba_item {
+  width: auto;
+  box-sizing: border-box;
+  padding: 0 10px;
+  height: 25px;
+  background-color: white;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  /* 阴影 */
+  box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.363);
+  border-radius: 15px;
+  font-size: 14px;
+  cursor: pointer;
+  margin-right: 10px;
+  white-space: nowrap;
+  transition: 0.3s;
+}
+
+.t_b_ba_item:hover {
+  background-color: rgb(236, 236, 236);
+}
+
+.t_b_inputArea {
+  width: 100%;
+  height: 55px;
+  box-sizing: border-box;
+  border-top: solid 1px #ededed;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding-right: 10px;
+}
+
+.t_b_tape {
+  width: 35px;
+  height: 35px;
+  background: url("../../../assets/icon/course/tape.png") no-repeat;
+  background-size: 50% 60%;
+  background-position: center;
+  cursor: pointer;
+}
+
+.t_b_input {
+  /* width: 75%; */
+  flex: 1;
+  height: 45px;
+  background-color: #f3f3f3;
+  border-radius: 50px;
+  margin: 0 10px;
+  display: flex;
+  overflow: hidden;
+  align-items: center;
+}
+
+.t_b_i_left {
+  /* width: calc(100% - 45px); */
+  width: 100%;
+  line-height: 45px;
+  height: 100%;
+}
+
+.t_b_i_left >>> .el-input__inner {
+  border: none;
+  background-color: #f3f3f3;
+  outline: none;
+  border-radius: 50px 0 0 50px;
+}
+
+.t_b_i_right {
+  width: 45px;
+  height: 45px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+
+.t_b_i_right > span {
+  width: 35px;
+  height: 35px;
+  background: url("../../../assets/icon/course/file.png") no-repeat;
+  background-size: 50% 60%;
+  background-position: center;
+  cursor: pointer;
+}
+
+.t_b_btn {
+  width: 40px;
+  height: 40px;
+  background-color: #3681fc;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  border-radius: 50%;
+  cursor: pointer;
+}
+
+.t_b_btn > span {
+  width: 30px;
+  height: 30px;
+  background: url("../../../assets/icon/course/send.png") no-repeat;
+  background-size: 70% 70%;
+  background-position: center;
+}
+
+td,
+th {
+  padding: 10px;
+}
+</style>

+ 35 - 7
src/components/classRoomHelper/index.vue

@@ -1,9 +1,21 @@
 <template>
   <div class="ch_box" ref="ch_box">
     <div class="ch_content_box" v-if="type == 1">
-      <searchArea v-show="itemType == 1" />
-      <taskArea v-show="itemType == 2" />
-      <dialogArea v-show="itemType == 3" />
+      <searchArea
+        :courseDetail="courseDetail"
+        ref="searchAreaRef"
+        v-if="itemType == 1"
+      />
+      <taskArea
+        :courseDetail="courseDetail"
+        ref="taskAreaRef"
+        v-if="itemType == 2"
+      />
+      <dialogArea
+        :courseDetail="courseDetail"
+        ref="dialogAreaRef"
+        v-if="itemType == 3"
+      />
     </div>
     <div class="ch_nav_box">
       <div class="ch_nav_box_top">
@@ -48,7 +60,7 @@
             :src="require('../../assets/icon/course/up.png')"
           />
           <!-- <span :style="`background:url(${itemType==1?require('../../assets/icon/course/up_active.png'):require('../../assets/icon/course/up.png')});`"></span> -->
-          <div>搜索</div>
+          <div>对话</div>
         </div>
         <div
           :class="[
@@ -84,7 +96,7 @@
             :src="require('../../assets/icon/course/dialog.png')"
           />
           <!-- <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 class="ch_nav_box_bottom">
@@ -130,12 +142,18 @@ import searchArea from "./component/searchArea.vue";
 import taskArea from "./component/taskArea.vue";
 import dialogArea from "./component/dialogArea.vue";
 export default {
-  emits: ["refresh", "goStep", "backPage","authority"],
+  emits: ["refresh", "goStep", "backPage", "authority"],
   components: {
     searchArea,
     taskArea,
     dialogArea
   },
+  props: {
+    courseDetail: {
+      type: Object,
+      default: () => {}
+    }
+  },
   data() {
     return {
       type: 0,
@@ -160,7 +178,17 @@ export default {
     changeItemType(type) {
       this.type = 0;
       this.openSetting();
-      this.itemType = type;
+      this.$nextTick(() => {
+        if (this.itemType == 1 && type != 1) {
+          this.$refs.searchAreaRef.scrollBottom();
+          this.$refs.searchAreaRef.getWantSearch();
+        } else if (this.itemType == 2) {
+          this.$refs.taskAreaRef.scrollBottom();
+        } else if (this.itemType == 3) {
+          this.$refs.dialogAreaRef.scrollBottom();
+        }
+        this.itemType = type;
+      });
     }
   }
 };

+ 43 - 10
src/components/studyStudent.vue

@@ -10,7 +10,7 @@
         box-sizing: border-box;
       "
     >
-      <div class="btnAllNT">
+      <div class="btnAllNT" v-if="false">
         <!-- <img src="../../assets/icon/learn/screen.png" @click="allScrell" /> -->
         <img
           v-if="
@@ -236,9 +236,10 @@
           </div>
         </div>
       </div>
-      <div class="body_student" :class="{ navLeftCss: !mlDialog }">
-        <div class="new_topFixed"></div>
-        <div class="new_top" :class="{ navLeftCss: !mlDialog }">
+      <!-- :class="{ navLeftCss: !mlDialog }" -->
+      <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">
             <div>任务{{ taskCount + 1 }}</div>
             <el-tooltip
@@ -256,7 +257,7 @@
               </div>
             </el-tooltip>
           </div>
-          <div class="btnAll">
+          <div class="btnAll" v-show="org !== '1973f6c7-1561-11ee-91d8-005056b86db5'">
             <div class="btnLeft">
               <el-tooltip effect="light" content="刷新" placement="top">
                 <div class="reBtnIcon" @click="refreshCourse">
@@ -8036,6 +8037,22 @@
           </div>
         </el-dialog>
       </div>
+      <classRoomHelper v-show="org == '1973f6c7-1561-11ee-91d8-005056b86db5'" ref="classRoomHelperRef" :courseDetail="courseDetail" @setWidth="setClassRoomHelperWidth" @refresh="refreshCourse" @goStep="nextOrpreSteps" @authority="juriVisible = true" @backPage="goTo(
+                    '/courseDetail?userid=' +
+                      userid +
+                      '&oid=' +
+                      oid +
+                      '&org=' +
+                      org +
+                      '&cid=' +
+                      classId +
+                      '&courseId=' +
+                      id +
+                      '&tType=' +
+                      tType +
+                      '&screenType=' +
+                      screenType
+                  )"></classRoomHelper>
     </div>
     <div
       class="pButton"
@@ -8046,7 +8063,7 @@
       <!-- 批 -->
       <img src="../assets/mlBtn.png" style="width: 25px" alt="" />
     </div>
-    <div v-if="pzDialog == true" class="newDialogCss">
+    <div v-if="pzDialog == true" class="newDialogCss" :style="`right:${commentRight}`">
       <div class="pzTop2">
         <!-- <div>评论</div>
         <div @click="pzDialog = false">
@@ -11853,6 +11870,7 @@ import EnglishVoice from './EnglishVoice2/index.vue'
 import checkEnglishVoice from './checkEnglishVoice/index.vue'
 import correctText from './components/correctText.vue'
 import scoreItem from './scoreList/scoreItem.vue'
+import classRoomHelper from './classRoomHelper/index.vue'
 
 const getFile = (url) => {
   return new Promise((resolve, reject) => {
@@ -11926,7 +11944,8 @@ export default {
     EnglishVoice,
     checkEnglishVoice,
 		correctText,
-		scoreItem
+		scoreItem,
+    classRoomHelper
   },
   data() {
     return {
@@ -12290,6 +12309,7 @@ export default {
 				listdata:[],
 				isScoreList:[],	
 			},
+      classRoomHelperWidth: '85px'
     };
   },
   methods: {
@@ -12330,7 +12350,7 @@ export default {
           {
             role: "user",
             content:
-               `Role: 你是一名小学英语作文的老师,根据这篇文章的内容你去批改这篇文章,然后仅输出一篇纠错好的文章。文章:${t}`,
+             `Role: 你是一名小学英语作文的老师,根据这篇文章的内容你去批改这篇文章,然后仅输出一篇纠错好的文章。文章:${t}`,
           },
         ],
         uid: this.userid,
@@ -12725,6 +12745,7 @@ export default {
       } else if (document.querySelector(".workd_media")) {
         document.querySelector(".workd_media").style.height = "auto";
       }
+      this.$forceUpdate();
     },
     openToolAll() {
       this.toolDialogVisible = true;
@@ -16074,7 +16095,7 @@ export default {
           }, 0)
         })
       }
-      this.showType = 7;
+      this.showType = 0;
       this.isNoHomeWork = false;
       (this.studyJuri = [
         {
@@ -19792,7 +19813,10 @@ export default {
         .catch((err) => {
           console.error(err);
         });
-		}
+		},
+    setClassRoomHelperWidth(width){
+      this.classRoomHelperWidth = width
+    }
   },
   directives: {
     // 使用局部注册指令的方式
@@ -19848,6 +19872,15 @@ export default {
           : "";
       };
     },
+		commentRight(){
+			if(this.$refs["classRoomHelperRef"].type==0){
+				return "100px";
+			}else if(this.$refs["classRoomHelperRef"].type==1){
+				return "502px"
+			}else{
+				return "0px"
+			}
+		},
     checkUpload() {
       return function () {
         var studentK = [];

+ 74 - 146
src/components/studyStudentXin.vue → src/components/studyStudentJiu.vue

@@ -10,7 +10,7 @@
         box-sizing: border-box;
       "
     >
-      <div class="btnAllNT" v-if="false">
+      <div class="btnAllNT">
         <!-- <img src="../../assets/icon/learn/screen.png" @click="allScrell" /> -->
         <img
           v-if="
@@ -39,13 +39,7 @@
       <div class="pb_left" v-else-if="!(IsFollow && tType == 2)">
         <!-- <div class="courseTitle">{{ courseDetail.title }}</div> -->
         <div style="border-bottom: 1px solid #cad1dc; width: 100%">
-          <!-- <div class="courseTitle" :style="{ margin: tcid && inviteCode && '10px auto 0px'}"> -->
-          <div class="courseTitle">
-            <el-tooltip effect="light" content="收缩" placement="top">
-              <div class="mlImg" @click="setContent2(false)">
-                  <img src="../assets/icon/newIcons/launch.png" alt="" />
-              </div>
-            </el-tooltip>
+          <div class="courseTitle" :style="{ margin: tcid && inviteCode && '10px auto 0px'}">
             <div
               style="
                 max-width: calc(100% - 40px);
@@ -67,15 +61,16 @@
                 </div>
               </el-tooltip>
             </div>
-            <!-- <el-tooltip effect="light" content="收缩" placement="top">
+            <el-tooltip effect="light" content="收缩" placement="top">
               <div class="mlImg" @click="setContent2(false)">
                 <img src="../assets/icon/newIcons/isRight.png" alt="" />
               </div>
-            </el-tooltip> -->
+            </el-tooltip>
           </div>
           <div
             class="inviteBox"
             v-if="tcid && inviteCode"
+            style="padding: 0 0 8px 0"
           >
             <div>
               <span>随机码:{{ inviteCode }}</span>
@@ -95,9 +90,6 @@
                 // stageBoxIsCss: stageIndex == courseType,
                }"
             >
-              <div class="closeTri" :style="{transform:item.isOpen ? 'rotate(0deg)' : 'rotate(-90deg)'}">
-                <img src="../assets/icon/newIcons/chevronUp.png" alt />
-              </div>
               <div class="stageItemTitle" :class="{ stageNav: item.isOpen }">
                 <div>阶段{{ stageIndex + 1 }}</div>
                 <el-tooltip
@@ -113,7 +105,9 @@
               <!-- <div class="closeTri" v-if="stageIndex == courseType" :style="{transform:item.isOpen ? 'rotate(0deg)' : 'rotate(-90deg)'}">
                 <img src="../assets/icon/newIcons/downC.png" alt />
               </div> -->
-             
+              <div class="closeTri" :style="{transform:item.isOpen ? 'rotate(90deg)' : 'rotate(0deg)'}">
+                <img src="../assets/icon/newIcons/right.png" alt />
+              </div>
             </div>
             <div class="stageChild" :class="{ navActive: item.isOpen }">
               <div v-for="(nav, navIndex) in item.task" :key="navIndex">
@@ -132,14 +126,14 @@
                       v-if="navIndex == taskCount && nav.id == navId && stageIndex == courseType"
                       @click="openTask(stageIndex, navIndex, nav.id)"
                     >
-                      <img :style="{transform: nav.isOpen ? 'rotate(0deg)':'rotate(270deg)'}" src="../assets/icon/newIcons/chevronUp.png" alt />
+                      <img :style="{transform: nav.isOpen ? 'rotate(0deg)':'rotate(270deg)'}" src="../assets/icon/newIcons/bDown2.png" alt />
                     </div>
                     <div
                       class="closeTri1"
                       v-else
                       @click="openTask(stageIndex, navIndex, nav.id)"
                     >
-                      <img :style="{transform: nav.isOpen ? 'rotate(-90deg)':'rotate(-90deg)'}" src="../assets/icon/newIcons/chevronUp.png" alt />
+                      <img :style="{transform: nav.isOpen ? 'rotate(90deg)':'rotate(0deg)'}" src="../assets/icon/newIcons/right.png" alt />
                     </div>
                   </div>
                   <div v-else class="noToolBlue"></div>
@@ -242,10 +236,9 @@
           </div>
         </div>
       </div>
-      <!-- :class="{ navLeftCss: !mlDialog }" -->
-      <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="body_student" :class="{ navLeftCss: !mlDialog }">
+        <div class="new_topFixed"></div>
+        <div class="new_top" :class="{ navLeftCss: !mlDialog }">
           <div class="courseIndex">
             <div>任务{{ taskCount + 1 }}</div>
             <el-tooltip
@@ -264,7 +257,7 @@
             </el-tooltip>
           </div>
           <div class="btnAll">
-            <!-- <div class="btnLeft">
+            <div class="btnLeft">
               <el-tooltip effect="light" content="刷新" placement="top">
                 <div class="reBtnIcon" @click="refreshCourse">
                   <span>刷新</span>
@@ -289,8 +282,8 @@
                   </div>
                 </el-tooltip>
               </div>
-            </div> -->
-            <!-- <div class="btnRight">
+            </div>
+            <div class="btnRight">
               <div
                 class="last"
                 @click="nextOrpreSteps(0)"
@@ -374,7 +367,7 @@
                 </div>
                 <div class="lastText" style="color: #000">返回</div>
               </div>
-            </div> -->
+            </div>
 
             <!-- <div
               class="returnBtn lockIcon"
@@ -655,8 +648,8 @@
                   >
                     <div class="navCorOpenBox">
                       <div class="navTitile">内容列表:</div>
-                      <div class="navCorOpen" style="transform:rotate(180deg)" @click="setContent(false)">
-                        <img src="../assets/icon/newIcons/launch.png" alt="" />
+                      <div class="navCorOpen" @click="setContent(false)">
+                        <img src="../assets/icon/newIcons/isRight.png" alt="" />
                       </div>
                     </div>
                     <div class="navBox">
@@ -671,36 +664,26 @@
                           class="vedioTimeBox"
                           v-for="(vitem, vindex) in vChapterData[taskCount]"
                           :key="vindex + '1'"
-                          
                         >
-                          <div class="navListItem" :class="isClickNav == vindex ? 'isClickNav' : ''" v-if="vitem.type == 2">
+                          <div class="navListItem" v-if="vitem.type == 2">
                             <div
                               @click="lookVedio(vitem.url, vindex)"
                               class="navText"
-                              
+                              :class="isClickNav == vindex ? 'isClickNav' : ''"
                             >
                               <span v-if="vitem.text">{{ vitem.text }}-</span
                               >{{ vitem.name }}
                             </div>
-
-                            <!-- <div class="downIcon" @click="downloadFile2(vitem)"> -->
-                            <div class="downIcon">
-                              <img src="https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/Frame56551715423909783.png" alt="">
-
-                              <!-- <img
-                                :src="isClickNav == vindex ?'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/Frame1111715423625357.png':'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/Frame2221715423643605.png'"
-                                alt
-                              /> -->
+                            <div class="downIcon" @click="downloadFile2(vitem)">
+                              <img src="../assets/icon/newIcon/down.png" alt />
                             </div>
-                            <img :src="isClickNav == vindex ? 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/Frame99991715423519837.png':'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/download21715423345632.png'" alt />
-
                           </div>
 
-                          <div class="navListItem" :class="isClickNav == vindex ? 'isClickNav' : ''" v-if="vitem.type == 6">
+                          <div class="navListItem" v-if="vitem.type == 6">
                             <div
                               @click="lookText(taskCount, vindex)"
                               class="navText"
-                              
+                              :class="isClickNav == vindex ? 'isClickNav' : ''"
                             >
                               {{ vitem.name }}.doc
                             </div>
@@ -708,24 +691,20 @@
                               class="downIcon"
                               @click="checkFileFull1(vitem.type, vitem)"
                             >
-                            <!-- <img src="https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/Frame56551715423909783.png" alt=""> -->
                               <img
-                                :src="isClickNav == vindex ?'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/Frame1111715423625357.png':'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/Frame2221715423643605.png'"
+                                src="../assets/icon/newIcon/allScreen.png"
                                 alt
                               />
                             </div>
-                            <img :src="isClickNav == vindex ? 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/Frame99991715423519837.png':'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/download21715423345632.png'" alt />
-
                           </div>
                           <div
                             class="navListItem"
-                            :class="isClickNav == vindex ? 'isClickNav' : ''"
                             v-if="vitem.type == 8 || vitem.type == 14"
                           >
                             <div
                               @click="doUrl(vitem.url, vindex)"
                               class="navText"
-                              
+                              :class="isClickNav == vindex ? 'isClickNav' : ''"
                             >
                               {{ vitem.title ? vitem.title : vitem.url }}
                             </div>
@@ -733,20 +712,17 @@
                               class="downIcon"
                               @click="checkFileFull1(vitem.type, vitem)"
                             >
-                            <!-- <img src="https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/Frame56551715423909783.png" alt=""> -->
-                            <img
-                                :src="isClickNav == vindex ?'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/Frame1111715423625357.png':'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/Frame2221715423643605.png'"
+                              <img
+                                src="../assets/icon/newIcon/allScreen.png"
                                 alt
                               />
                             </div>
-                            <img :src="isClickNav == vindex ? 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/Frame99991715423519837.png':'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/download21715423345632.png'" alt />
-
                           </div>
-                          <div class="navListItem" :class="isClickNav == vindex ? 'isClickNav' : ''" v-if="vitem.type == 3">
+                          <div class="navListItem" v-if="vitem.type == 3">
                             <div
                               @click="downFile(vitem, vindex)"
                               class="navText"
-                              
+                              :class="isClickNav == vindex ? 'isClickNav' : ''"
                             >
                               <span v-if="vitem.text">{{ vitem.text }}-</span
                               >{{ vitem.name }}
@@ -755,13 +731,14 @@
                               class="downIcon"
                               @click="checkFileFull1(vitem.type, vitem)"
                             >
-                            <img
-                                :src="isClickNav == vindex ?'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/Frame1111715423625357.png':'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/Frame2221715423643605.png'"
+                              <img
+                                src="../assets/icon/newIcon/allScreen.png"
                                 alt
                               />
                             </div>
-                            <img :src="isClickNav == vindex ? 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/Frame99991715423519837.png':'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/download21715423345632.png'" alt />
-
+                            <div class="downIcon" @click="downloadFile2(vitem)">
+                              <img src="../assets/icon/newIcon/down.png" alt />
+                            </div>
                           </div>
                           <div class="navListItem" v-if="vitem.type == 12">
                             <div class="navText" @click="downloadFile2(vitem)">
@@ -772,28 +749,25 @@
                               class="downIcon"
                               @click="checkFileFull1(vitem.type, vitem)"
                             >
-                            <img
-                                :src="isClickNav == vindex ?'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/Frame1111715423625357.png':'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/Frame2221715423643605.png'"
+                              <img
+                                src="../assets/icon/newIcon/allScreen.png"
                                 alt
                               />
                             </div>
-                            <img :src="isClickNav == vindex ? '../assets/icon/newIcon/download.png':'../assets/icon/newIcon/download2.png'" alt />
+                            <div class="downIcon" @click="downloadFile2(vitem)">
+                              <img src="../assets/icon/newIcon/down.png" alt />
+                            </div>
                           </div>
-                          <div class="navListItem"  :class="isClickNav == vindex ? 'isClickNav' : ''" v-if="vitem.type == 13">
+                          <div class="navListItem" v-if="vitem.type == 13">
                             <div
                               class="navText"
                               @click="checkPhoto(vitem, vindex)"
-                             
+                              :class="isClickNav == vindex ? 'isClickNav' : ''"
                             >
                               {{ vitem.name }}
                             </div>
                             <div class="downIcon" @click="downloadFile2(vitem)">
-                              <img
-                                :src="isClickNav == vindex ?'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/Frame1111715423625357.png':'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/Frame2221715423643605.png'"
-                                alt
-                              />
-                              <!-- <img src="https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/Frame56551715423909783.png" alt=""> -->
-                              <img :src="isClickNav == vindex ? 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/Frame99991715423519837.png':'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/download21715423345632.png'" alt />
+                              <img src="../assets/icon/newIcon/down.png" alt />
                             </div>
                           </div>
                         </div>
@@ -816,12 +790,10 @@
                                 class="downIcon"
                                 @click="downloadFile2(vitem)"
                               >
-                              <img
-                                :src="isClickNav == vindex ?'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/Frame1111715423625357.png':'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/Frame2221715423643605.png'"
-                                alt
-                              />
-                              <!-- <img src="https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/Frame56551715423909783.png" alt=""> -->
-                              <img :src="isClickNav == vindex ? 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/Frame99991715423519837.png':'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/download21715423345632.png'" alt />
+                                <img
+                                  src="../assets/icon/newIcon/down.png"
+                                  alt
+                                />
                               </div>
                             </div>
                           </div>
@@ -8064,22 +8036,6 @@
           </div>
         </el-dialog>
       </div>
-      <classRoomHelper ref="classRoomHelperRef" @setWidth="setClassRoomHelperWidth" @refresh="refreshCourse" @goStep="nextOrpreSteps" @authority="juriVisible = true" @backPage="goTo(
-                    '/courseDetail?userid=' +
-                      userid +
-                      '&oid=' +
-                      oid +
-                      '&org=' +
-                      org +
-                      '&cid=' +
-                      classId +
-                      '&courseId=' +
-                      id +
-                      '&tType=' +
-                      tType +
-                      '&screenType=' +
-                      screenType
-                  )"></classRoomHelper>
     </div>
     <div
       class="pButton"
@@ -8090,7 +8046,7 @@
       <!-- 批 -->
       <img src="../assets/mlBtn.png" style="width: 25px" alt="" />
     </div>
-    <div v-if="pzDialog == true" class="newDialogCss" :style="`right:${commentRight}`">
+    <div v-if="pzDialog == true" class="newDialogCss">
       <div class="pzTop2">
         <!-- <div>评论</div>
         <div @click="pzDialog = false">
@@ -11897,7 +11853,6 @@ import EnglishVoice from './EnglishVoice2/index.vue'
 import checkEnglishVoice from './checkEnglishVoice/index.vue'
 import correctText from './components/correctText.vue'
 import scoreItem from './scoreList/scoreItem.vue'
-import classRoomHelper from './classRoomHelper/index.vue'
 
 const getFile = (url) => {
   return new Promise((resolve, reject) => {
@@ -11971,8 +11926,7 @@ export default {
     EnglishVoice,
     checkEnglishVoice,
 		correctText,
-		scoreItem,
-    classRoomHelper
+		scoreItem
   },
   data() {
     return {
@@ -12336,7 +12290,6 @@ export default {
 				listdata:[],
 				isScoreList:[],	
 			},
-      classRoomHelperWidth: '85px'
     };
   },
   methods: {
@@ -12377,7 +12330,7 @@ export default {
           {
             role: "user",
             content:
-             `Role: 你是一名小学英语作文的老师,根据这篇文章的内容你去批改这篇文章,然后仅输出一篇纠错好的文章。文章:${t}`,
+               `Role: 你是一名小学英语作文的老师,根据这篇文章的内容你去批改这篇文章,然后仅输出一篇纠错好的文章。文章:${t}`,
           },
         ],
         uid: this.userid,
@@ -12772,7 +12725,6 @@ export default {
       } else if (document.querySelector(".workd_media")) {
         document.querySelector(".workd_media").style.height = "auto";
       }
-      this.$forceUpdate();
     },
     openToolAll() {
       this.toolDialogVisible = true;
@@ -16122,7 +16074,7 @@ export default {
           }, 0)
         })
       }
-      this.showType = 0;
+      this.showType = 7;
       this.isNoHomeWork = false;
       (this.studyJuri = [
         {
@@ -19840,10 +19792,7 @@ export default {
         .catch((err) => {
           console.error(err);
         });
-		},
-    setClassRoomHelperWidth(width){
-      this.classRoomHelperWidth = width
-    }
+		}
   },
   directives: {
     // 使用局部注册指令的方式
@@ -19899,15 +19848,6 @@ export default {
           : "";
       };
     },
-		commentRight(){
-			if(this.$refs["classRoomHelperRef"].type==0){
-				return "100px";
-			}else if(this.$refs["classRoomHelperRef"].type==1){
-				return "502px"
-			}else{
-				return "0px"
-			}
-		},
     checkUpload() {
       return function () {
         var studentK = [];
@@ -20574,13 +20514,12 @@ export default {
 }
 
 .courseTitle {
-  width: 90%;
-  margin: 30px auto 15px auto;
+  width: 85%;
+  margin: 10px auto 26px auto;
   display: flex;
   flex-direction: row;
   align-items: center;
-  /* justify-content: space-between; */
-  justify-content: flex-start;
+  justify-content: space-between;
   text-align: center;
 }
 
@@ -20596,13 +20535,8 @@ export default {
 .inviteBox {
   font-size: 14px;
   /* margin-top: 5px; */
-  /* margin: 15px 0; */
-  padding: 0 15px;
-  padding-left: 46px;
-  margin-bottom: 15px;
-  width: 100%;
   color: #00000099;
-  text-align: ringht;
+  text-align: center;
 }
 
 .courseTitle >>> .el-tooltip {
@@ -21363,14 +21297,12 @@ export default {
   width: calc(100% - 20px);
   height: 50px;
   margin: 0px auto 10px;
-  box-sizing: border-box;
-  padding: 0 10px;
   display: flex;
   flex-direction: row;
   flex-wrap: nowrap;
   align-items: center;
   justify-content: space-between;
-  /* background: #f0f4fa; */
+  background: #f0f4fa;
   border-radius: 6px 6px 6px 6px;
 }
 
@@ -21380,15 +21312,15 @@ export default {
   overflow: hidden;
   text-overflow: ellipsis;
   width: 220px;
-  /* padding: 0 10px; */
+  padding: 0 10px;
   font-weight: 400;
-  /* color: #0e1e33; */
+  color: #0e1e33;
 }
 
 .downIcon {
-  width: 16px;
-  min-width: 16px;
-  height: 16px;
+  width: 20px;
+  min-width: 20px;
+  height: 20px;
   margin-right: 15px;
   cursor: pointer;
 }
@@ -22276,9 +22208,8 @@ export default {
 }
 
 .isClickNav {
-  color: #499eef;
-  /* color: #000; */
-  background: rgba(224, 234, 251, 1);
+  /* color: #499eef; */
+  color: #000;
 }
 
 .commentImg {
@@ -23771,9 +23702,9 @@ ol {
 }
 
 .navCorOpen {
-  padding-left: 15px;
+  padding-right: 15px;
   cursor: pointer;
-  width: 23px;
+  width: 45px;
   display: flex;
 }
 
@@ -23783,13 +23714,10 @@ ol {
 }
 
 .mlImg {
-  width: 23px !important;
-  /* min-width: 30px; */
-  display: flex;
-  align-content: center;
-  margin-right: 6px;
+  width: 40px !important;
+  min-width: 40px;
   cursor: pointer;
-  /* transform: rotate(180deg); */
+  transform: rotate(180deg);
 }
 
 .mlImg > img {
@@ -23888,7 +23816,7 @@ ol {
   flex-direction: row;
   flex-wrap: nowrap;
   align-items: center;
-  margin-left: 5px;
+  margin-left: 15px;
   width: calc(100% - 50px);
 }
 .stageNav{
@@ -23907,9 +23835,9 @@ ol {
 }
 .closeTri,
 .closeTri1 {
-  min-width: 25px;
-  width: 25px;
-  height: 25px;
+  min-width: 15px;
+  width: 15px;
+  height: 15px;
   transition: all .5s;
 }
 

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor