SanHQin před 8 měsíci
rodič
revize
3208f55139

+ 12 - 13
src/components/pages/classroomObservation/components/chatArea.vue

@@ -1719,19 +1719,18 @@ ${JSON.stringify(_list)}
                     _this.loading = false;
                     _this.progressData.uploadLoading = false;
                     if (!_this.fileIdId) return;
-                    let pram2 = {
-                      id: _this.fileIdId,
-                      json_data: JSON.stringify({
-                        file_ids: _data.result.id
-                      })
-                      // json_data: JSON.stringify({file_ids:'file-r5phg4I2oFqly4WpW7oOOTnA'}),
-                    };
-                    _this.ajax
-                      .post(
-                        "https://gpt4.cocorobo.cn/update_classroom_observation",
-                        pram2
-                      )
-                      .then(res => {});
+                    // let pram2 = {
+                    //   id: _this.fileIdId,
+                    //   json_data: JSON.stringify({
+                    //     file_ids: _data.result.id
+                    //   })
+                    // };
+                    // _this.ajax
+                    //   .post(
+                    //     "https://gpt4.cocorobo.cn/update_classroom_observation",
+                    //     pram2
+                    //   )
+                    //   .then(res => {});
                   } else {
                     _this.$message.error("修改fileId失败");
                   }

+ 38 - 2
src/components/pages/classroomObservation/components/messageArea.vue

@@ -270,7 +270,29 @@ export default {
       // if (!this.tid) return this.$message.error("请先选择课堂");
       this.$refs.analysisTemplateDialogRef.open();
     },
-    useTemplate(json) {
+		checkUseTemplate(){
+			return new Promise(resolve => {
+				if(this.bmData && this.bmData.jsonData.editorBarData){
+					if(this.bmData.jsonData.editorBarData && (this.bmData.jsonData.editorBarData.content || this.bmData.jsonData.editorBarData.url)){
+						this.$confirm("是否保留本课堂的转录文稿数据至新课堂?","提示").then(_ => {
+							window.localStorage.setItem("saveEditorBarData",JSON.stringify({editorBarData:this.bmData.jsonData.editorBarData,fileId:this.fileId}));
+							resolve(1);
+						}).catch(_ => {
+							resolve(2);
+						})
+					}else{
+						resolve(2);
+					}
+				}else{
+					resolve(2);
+				}
+			})
+		},
+    async useTemplate(json) {
+
+			let saveStatus = await this.checkUseTemplate();
+			// console.log("是否保留👉",saveStatus)
+			// return;
       let _result = [];
       json.forEach(i => {
         if (i.isOtherData) return _result.push(i);
@@ -286,7 +308,6 @@ export default {
         .addNewCourseByTemplate(_result)
         .then(res => {
           this.$refs.analysisTemplateDialogRef.close();
-
           this.$refs.analysisTemplateDialogRef.loading = false;
         })
         .catch(e => {
@@ -644,6 +665,15 @@ export default {
                 _currency.jsonData = JSON.parse(_currency.jsonData);
                 currency.push(_currency);
               }
+
+							//判断是否有保留装了文稿数据
+							let saveEditorBarData = window.localStorage.getItem("saveEditorBarData")?JSON.parse(window.localStorage.getItem("saveEditorBarData")):null;
+							if(saveEditorBarData){
+								console.log("saveEditorBarData👉",saveEditorBarData)
+								_bmData.jsonData.editorBarData = saveEditorBarData.editorBarData;
+								// this.fileId = _saveEditorBarData.fileId;
+								window.localStorage.removeItem("saveEditorBarData");
+							}
               this.dataList.push(...currency);
               this.bmData = _bmData;
               this.dialogTagList = _dialogTagList;
@@ -671,6 +701,12 @@ export default {
                     i => i.value == type
                   ).loading = false)
                 : "";
+
+							if(saveEditorBarData){
+								console.log("保存数据👉",saveEditorBarData)
+								this.$parent.updateFileId(saveEditorBarData.fileId);
+								this.saveData(this.bmData);
+							}
               resolve();
             } else {
               if (_data.length == 0) {

+ 37 - 6
src/components/pages/classroomObservation/index.vue

@@ -48,7 +48,12 @@
             </el-option>
           </el-select>
         </span>
-        <el-tooltip class="item" effect="light" content="添加课堂"  placement="top">
+        <el-tooltip
+          class="item"
+          effect="light"
+          content="添加课堂"
+          placement="top"
+        >
           <span class="co_h2_add" @click="addNewCourse()">
             <svg
               t="1730428938505"
@@ -266,13 +271,23 @@ export default {
       }
     };
   },
+	watch:{
+		fileIdId(newValue){
+			let needUpdateFileId = window.localStorage.getItem("needUpdateFileId")?window.localStorage.getItem("needUpdateFileId"):null;
+			if(needUpdateFileId && newValue){
+				console.log("查询到needUpdateFileId,更新fileId👉",needUpdateFileId)
+				this.updateFileId(needUpdateFileId);
+				window.localStorage.removeItem("needUpdateFileId");
+			}
+		}
+	},
   methods: {
     //切换了课堂
     changeTid(newValue) {
-      this.$nextTick(() => {
+      this.$nextTick(async () => {
+        this.getFileIdId();
         this.$refs.messageAreaRef.getData();
         this.$refs.chatAreaRef.getData();
-        this.getFileIdId();
 
         // 	setTimeout(()=>{
         // 		this.$refs.messageAreaRef.init();
@@ -455,7 +470,7 @@ export default {
                   if (converter(_data2.message) == converter("创建成功")) {
                     this.loading = false;
                     this.$nextTick(() => {
-                      this.getCourseList().then(_ => {
+                      this.getCourseList().then(async _ => {
                         this.getFileIdId();
                         this.$refs.messageAreaRef
                           .getData(tagList ? tagList.dialogTagList : [])
@@ -486,6 +501,22 @@ export default {
       });
     },
     updateFileId(newValue) {
+			if(!this.fileIdId){
+				console.log("未查询到fileIdId,先保存到localStorage👉",newValue)
+				return window.localStorage.setItem("needUpdateFileId",newValue);
+			}
+      this.ajax
+        .post("https://gpt4.cocorobo.cn/update_classroom_observation", {
+          id: this.fileIdId,
+          json_data: JSON.stringify({ file_ids: newValue })
+        })
+        .then(res => {
+          console.log("保存fileId成功✌");
+        })
+        .catch(e => {
+          console.log(e);
+          console.log("保存fileId失败");
+        });
       this.fileId = newValue;
     },
     // 生成报告
@@ -1052,7 +1083,7 @@ export default {
               this.tid = "";
               this.fileIdId = "";
               this.fileId = "";
-              this.getCourseList().then(_ => {
+              this.getCourseList().then(async _ => {
                 if (!this.tid) {
                   this.$refs.messageAreaRef.init();
                   this.$refs.chatAreaRef.init();
@@ -1352,7 +1383,7 @@ export default {
   width: 20px;
   height: 20px;
   cursor: pointer;
-	margin-left: 20px;
+  margin-left: 20px;
 }
 
 .co_h2_add > svg {

+ 2 - 2
src/components/pages/pocAiClassroom/chatArea2.vue

@@ -17,12 +17,12 @@ export default {
       org: this.$route.query.org,
       oid: this.$route.query.oid,
       type: this.$route.query.type,
-      src: "https://beta.cloud.cocorobo.cn/aigpt/#/js?active_role=0"
+      src:`https://cloud.cocorobo.hk/aigpt/#/poc?muti_agent_id=90bec943-65cf-11ef-9db4-12e77c4cb76b&isPbl=false`
     };
   },
   methods: {},
   mounted() {
-   
+   this.src = `https://cloud.cocorobo.hk/aigpt/#/poc?muti_agent_id=90bec943-65cf-11ef-9db4-12e77c4cb76b&isPbl=false&session_id=${this.userId}-chat`
   }
 };
 </script>

+ 7 - 3
src/components/pages/pocAiClassroom/pocClass.vue

@@ -14,7 +14,7 @@ export default {
       org: this.$route.query.org,
       oid: this.$route.query.oid,
 			type:this.$route.query.type,
-			src:"https://beta.cloud.cocorobo.cn/aigpt/#/js?active_role=3"
+			src:"https://cloud.cocorobo.hk/aigpt/#/poc?muti_agent_id=798c3511-6b32-11ef-8ce0-12e77c4cb76b&isPbl=false&session_id=merenduihua444"
     };
   },
   methods: {
@@ -22,10 +22,14 @@ export default {
   },
   mounted() {
 		if (this.type == 1) {
-      this.src = `https://beta.cloud.cocorobo.cn/aigpt/#/js?active_role=${5}`;
+			// 2.1
+			console.log("2.1课程")
+      this.src = `https://cloud.cocorobo.hk/aigpt/#/poc?muti_agent_id=798c3511-6b32-11ef-8ce0-12e77c4cb76b&isPbl=false&session_id=${this.userId}-21`;
 			console.log("5")
     } else if (this.type == 2) {
-      this.src = `https://beta.cloud.cocorobo.cn/aigpt/#/js?active_role=${3}`;
+			//2.2
+			console.log("2.2课程")
+      this.src = `https://cloud.cocorobo.hk/aigpt/#/poc?muti_agent_id=a9883cc4-6c3d-11ef-8ce0-12e77c4cb76b&isPbl=false&session_id=${this.userId}-22`;
 			console.log(3)
     }
   }