lsc преди 11 месеца
родител
ревизия
99f7310473

+ 9 - 9
src/components/pages/classroomObservation/components/analysisItem.vue

@@ -217,15 +217,15 @@ export default {
 				_copyData.jsonData.fileList = [];
 				_copyData.json_data = JSON.stringify(_copyData.jsonData)
 				this.$emit("editItem",this.data.id,_copyData);
-				// let pram2 = {
-				// 	id: _copyData.id,
-				// 	json_data: _copyData.json_data,
-				// };
-				// this.ajax
-				// .post(
-				// 	"https://gpt4.cocorobo.cn/update_classroom_observation",
-				// 	pram2
-				// )
+				let pram2 = {
+					id: _copyData.id,
+					json_data: _copyData.json_data,
+				};
+				this.ajax
+				.post(
+					"https://gpt4.cocorobo.cn/update_classroom_observation",
+					pram2
+				)
 				this.loading = false;
 			}).catch(err=>{
 				this.$message.error("AI无法识别优化")

+ 20 - 0
src/components/pages/classroomObservation/components/chatArea.vue

@@ -230,6 +230,16 @@ const clickOutside = {
 };
 export default {
 	emits:["updateFileId"],
+	props: {
+		tid: {
+			type: String,
+			require:true,
+		},
+		fileIdid: {
+			type: String,
+			default: ''
+		}
+	},
 	components: {
 		startPage,
 		transcription,
@@ -454,6 +464,16 @@ Markdown表格Markdown表格Markdown表格Markdown表格Markdown表格Markdown
 									let _data = res.data.FunctionResponse;
 									if(_data.result && _data.result.id){
 										_this.$emit("updateFileId", _data.result.id)
+										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
+										)
 									}else{
 										_this.$message.error("上传失败")
 									}

+ 22 - 1
src/components/pages/classroomObservation/components/messageArea.vue

@@ -178,6 +178,7 @@ import currencyAnalysis from "./currencyAnalysis.vue"; //通用课堂分析
 import scienceAnalysis from "./scienceAnalysis.vue"; //科学课堂分析
 import extendAnalysis from "./extendAnalysis.vue"; //扩展分析
 import analysis from "./analysis.vue";
+
 export default {
 	components: {
 		baseMessage,
@@ -1029,6 +1030,25 @@ BSCS 5E教学模型是一种广泛应用于科学教育的教学策略,它鼓
 					});
 			});
 		},
+		getFileId() {
+			let pram = {
+				tid: this.tid,
+				type: "10",
+			};
+			this.ajax
+				.post("https://gpt4.cocorobo.cn/get_classroom_observation_new", pram)
+				.then((res) => {
+					let _data = res.data.FunctionResponse.result.length
+						? JSON.parse(res.data.FunctionResponse.result)
+						: [];
+					this.$emit('updateFileIdid', _data[0].id)
+					if(_data[0].jsonData !='' ){
+						this.$emit("updateFileId", JSON.parse(_data[0].jsonData).file_ids)				
+					}else {
+						this.$emit("updateFileId", '')				
+					}
+				});
+		},
 		getCurrencyAndBaseMessageData() {
 			let pram = {
 				tid: this.tid,
@@ -1122,9 +1142,10 @@ BSCS 5E教学模型是一种广泛应用于科学教育的教学策略,它鼓
 			this.getCurrencyAndBaseMessageData();
 			this.getScienceData();
 			this.getExtendData();
+			this.getFileId();
 		},
 		saveData(fn) {
-			return;
+			// return;
 			let saveDataList = [];
 
 			// 保存基础信息

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

@@ -54,10 +54,10 @@
 		</div>
 		<div class="co-main">
 			<div class="co-m-left">
-				<chatArea :tid="tid" @updateFileId="updateFileId"/>
+				<chatArea :tid="tid" @updateFileId="updateFileId" :fileIdid="fileIdid"/>
 			</div>
 			<div class="co-m-right">
-				<messageArea :tid="tid" :fileId="fileId" ref="messageAreaRef"/>
+				<messageArea :tid="tid" :fileId="fileId" ref="messageAreaRef" @updateFileId="updateFileId"  @updateFileIdid="updateFileIdid"/>
 			</div>
 		</div>
 	</div>
@@ -79,6 +79,7 @@ export default {
 			loading: false,
 			tid:'03',
 			fileId:"",
+			fileIdid:"",
 			optionData:[
 				{label:"03课程",value:'03'},
 				{label:"04课程",value:'04'},
@@ -97,6 +98,9 @@ export default {
 		updateFileId(newValue){
 			this.fileId = newValue;
 		},
+		updateFileIdid(newValue){
+			this.fileIdid = newValue;
+		},
 		// 跳转
 		goTo(path) {
 			this.$message.info(`去到:${path}`);