SanHQin преди 10 месеца
родител
ревизия
0b95c78bd3

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

@@ -25,7 +25,7 @@
 					</span>
 				</span>
 				<span
-					v-if="loadNum == 0 && !openItem"
+					v-if="loadNum == 0 && !openItem && tid"
 					class="ai-h-r-icon4"
 					@click.stop="delBtn()"
 				>
@@ -83,7 +83,7 @@
 					</el-tooltip>
 				</span>
 
-				<span v-if="loadNum != 1 && openItem" @click.stop="editBtn()">
+				<span v-if="loadNum != 1 && openItem && tid" @click.stop="editBtn()">
 					<el-tooltip
 						class="item"
 						effect="light"

+ 1 - 1
src/components/pages/classroomObservation/components/baseMessage.vue

@@ -179,7 +179,7 @@
 								<!-- <div>{{ item }}</div> -->
 									<el-image
 										class="itemUrl"
-										:src="require('../../../../assets/icon/classroomObservation/videoFile.svg')"
+										:src="require('../../../../assets/icon/classroomObservation/isVideo.png')"
 										fit="cover"
 									></el-image>
 									<span @click.stop="delVideo('videoList')"></span>

+ 2 - 1
src/components/pages/classroomObservation/components/bindingFormDialog.vue

@@ -82,6 +82,7 @@
 						@current-change="currentChange"
 						:page-size="pageData.pageSize"
 						:total="pageData.total"
+						:disabled="loading"
 					>
 					</el-pagination>
 				</div>
@@ -201,7 +202,7 @@ export default {
 				pageSize: this.pageData.pageSize,
 			};
 			this.ajax
-				.get(this.$store.state.api + "selectTesttCourse", params)
+				.get(this.$store.state.api + "selectTesttCourse3", params) //selectTesttCourse
 				.then((res) => {
 					let _data = res.data[0];
 					this.pageData.total = 0

+ 18 - 8
src/components/pages/classroomObservation/components/chatArea.vue

@@ -104,7 +104,7 @@
 							<div class="ca-b-o-h-s-l-text">课堂观察</div>
 							<span class="ca-b-o-h-s-l-icon2 el-icon-caret-top"></span>
 						</div> -->
-						<!-- 
+						
 						<div class="ca-b-o-h-l-select" style="color: #3681fc">
 							<div
 								style="cursor: pointer"
@@ -124,11 +124,12 @@
 									:key="index + 'lag'"
 									:class="i.label == languageRadio ? 'radioBg' : ''"
 									v-model.number="languageRadio"
+									@input="languageShow = false"
 									:label.Num="i.label"
 									>{{ i.lang }}</el-radio
 								>
 							</div>
-						</div> -->
+						</div>
 
 						<div
 							class="ca-b-o-h-l-btn"
@@ -505,7 +506,7 @@ export default {
 			controlsStatus: 0, //0--点击开始录音  1--录音中   2--录音完毕预览  3--文字输入
 			pageStatus: 0, //0--ai对话  1--原文文稿  2--转录文稿
 			showIndexPage: true, //是否显示初始页面
-			languageRadio: 1, //设置选择语言
+			languageRadio: 2, //设置选择语言
 			languageShow: false, //控制显示
 			loading: false,
 			chatLoading: false,
@@ -544,9 +545,9 @@ export default {
 				"https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E8%BD%AC%E5%BD%95%E6%96%87%E7%A8%BF1713172600896.xlsx",
 			// 设置list
 			languageList: [
-				{ label: 1, lang: "普通话" },
-				{ label: 2, lang: "广东话" },
-				{ label: 3, lang: "英语" },
+				{ label: 2, lang: "普通话" },
+				{ label: 3, lang: "粤语" },
+				{ label: 13, lang: "英语" },
 			],
 			// 语音文字list
 			tapeList: [
@@ -608,7 +609,11 @@ export default {
 		},
 		// 上传录音
 		uploadRecording() {
-			if (!this.tid) return this.$message.error("请选择课堂");
+			if(!this.tid){
+				return this.$parent.addNewCourse().then(_=>{
+					this.uploadRecording();
+				})
+			}
 			if (this.uploadFileLoading) return this.$message.info("请稍等...");
 			let input = document.createElement("input");
 			input.type = "file";
@@ -673,7 +678,11 @@ export default {
 			}
 		},
 		recordedStart() {
-			if (!this.tid) return this.$message.error("请选择课堂");
+			if(!this.tid){
+				return this.$parent.addNewCourse().then(_=>{
+					this.recordedStart();
+				})
+			}
 			if (this.uploadFileLoading) return this.$message.info("请稍等...");
 			// 开始录音
 			if (this.audioUrl) {
@@ -1769,6 +1778,7 @@ export default {
 			}
 		},
 		changeEditorBar({ transcriptionData, editorBarData }) {
+			if(!transcriptionData || editorBarData)return;
 			this.transcriptionData.content = transcriptionData;
 			try {
 				let _result = JSON.parse(editorBarData);

Файловите разлики са ограничени, защото са твърде много
+ 0 - 1
src/components/pages/classroomObservation/components/messageArea.vue


+ 105 - 88
src/components/pages/classroomObservation/index.vue

@@ -16,10 +16,7 @@
 					class="co-h2-l-icon"
 					@click="$refs.addNewCourseDialogRef.open()"
 				></span> -->
-				<span
-					class="co-h2-l-icon"
-					@click="addNewCourse()"
-				></span>
+				<span class="co-h2-l-icon" @click="addNewCourse()"></span>
 				<span class="co-h2-l-hr"></span>
 				<span class="co-h2-l-text">
 					<el-select
@@ -187,12 +184,12 @@ export default {
 		return {
 			loading: false,
 			dialogVisibleShare: false,
-			createTime:new Date().toLocaleString().replaceAll('/','-'),
+			createTime: new Date().toLocaleString().replaceAll("/", "-"),
 			tid: "",
 			fileId: "",
 			fileIdId: "",
 			optionData: [],
-			userId:this.$route.query["userid"]
+			userId: this.$route.query["userid"],
 		};
 	},
 	methods: {
@@ -205,62 +202,69 @@ export default {
 			});
 		},
 		addNewCourse() {
-			if (this.loading) return this.$message.info("请稍等");
-			this.loading = true;
-			let date = new Date();
-			let month = date.getMonth()+1
-			let day = date.getDate();
-			let classroomName =  `${month<10?'0'+month:month}${day<10?'0'+day:day}新建课堂`
-			let sum = this.optionData.filter(i=>i.label.indexOf(classroomName)!=-1).length;
-			if(!sum==0){
-				classroomName+=sum;
-			}
-			let params = {
-				tid:uuidv4(),
-				name:classroomName,
-				userid:this.userId
-			}
-			this.ajax
-				.post(
-					"https://gpt4.cocorobo.cn/insert_classroom_observation_tid",
-					params
-				)
-				.then((res) => {
-					let _data = res.data.FunctionResponse;
-					if (_data.message == "创建成功") {
-						this.tid = params.tid;
-						// 设置该课堂的tid
-						this.ajax
-							.post("https://gpt4.cocorobo.cn/insert_classroom_observation", {
-								tid: this.tid,
-								type: 10,
-								index: 0,
-								json_data: JSON.stringify({ file_ids: "" }),
-								userid:this.userId
-							})
-							.then((res2) => {
-								let _data2 = res2.data.FunctionResponse;
-								if (_data2.message == "创建成功") {
-									this.loading = false;
-									this.$nextTick(() => {
-										this.getCourseList().then((_) => {
-											this.getFileIdId();
-											this.$refs.messageAreaRef.getData();
-											this.$refs.chatAreaRef.getData();
+			return new Promise((resolve, reject) => {
+				if (this.loading) return this.$message.info("请稍等");
+				this.loading = true;
+				let date = new Date();
+				let month = date.getMonth() + 1;
+				let day = date.getDate();
+				let classroomName = `${month < 10 ? "0" + month : month}${
+					day < 10 ? "0" + day : day
+				}新建课堂`;
+				let sum = this.optionData.filter(
+					(i) => i.label.indexOf(classroomName) != -1
+				).length;
+				if (!sum == 0) {
+					classroomName += sum;
+				}
+				let params = {
+					tid: uuidv4(),
+					name: classroomName,
+					userid: this.userId,
+				};
+				this.ajax
+					.post(
+						"https://gpt4.cocorobo.cn/insert_classroom_observation_tid",
+						params
+					)
+					.then((res) => {
+						let _data = res.data.FunctionResponse;
+						if (_data.message == "创建成功") {
+							// 设置该课堂的tid
+							this.tid = params.tid;
+							this.ajax
+								.post("https://gpt4.cocorobo.cn/insert_classroom_observation", {
+									tid: params.tid,
+									type: 10,
+									index: 0,
+									json_data: JSON.stringify({ file_ids: "" }),
+									userid: this.userId,
+								})
+								.then((res2) => {
+									let _data2 = res2.data.FunctionResponse;
+									if (_data2.message == "创建成功") {
+										this.loading = false;
+										this.$nextTick(() => {
+											this.getCourseList().then((_) => {
+												this.getFileIdId();
+												this.$refs.messageAreaRef.getData();
+												this.$refs.chatAreaRef.getData();
+												resolve();
+											});
 										});
-									});
-								} else {
-									this.$message.error("创建fileIds失败");
-								}
-							});
-					} else if (_data.message == "tid重复") {
-						this.$message.error("该课堂已存在");
-						this.loading = false;
-					} else {
-						this.$message.error("创建失败");
-						this.loading = false;
-					}
-				});
+									} else {
+										this.$message.error("创建fileIds失败");
+									}
+								});
+						} else if (_data.message == "tid重复") {
+							this.$message.error("该课堂已存在");
+							this.loading = false;
+						} else {
+							this.$message.error("创建失败");
+							this.loading = false;
+						}
+					});
+			});
 		},
 		updateFileId(newValue) {
 			this.fileId = newValue;
@@ -268,7 +272,16 @@ export default {
 		// 生成报告
 		getReport() {
 			if (!this.fileId) return;
-			this.$refs.messageAreaRef.getReport();
+			this.$confirm("操作将覆盖原有内容,是否继续?", "提示", {
+				confirmButtonText: "确定",
+				cancelButtonText: "取消",
+				type: "warning",
+			})
+				.then(() => {
+					this.$refs.messageAreaRef.getReport();
+				}).catch(e=>{
+					console.log("取消生成报告")
+				})
 		},
 		//预览
 		preview() {
@@ -320,23 +333,26 @@ export default {
 					// });
 					let params = {
 						tid: _value,
-					}
+					};
 					this.ajax
-					.post("https://gpt4.cocorobo.cn/update_classroom_observation_isdel", params)
-					.then((res) => {
-						this.$message({
-							type: "success",
-							message: "删除成功!",
-						});
-						// 清空tid
-						this.tid = "";
-						this.getCourseList().then((_) => {
-							if (!this.tid) return;
-							this.getFileIdId();
-							this.$refs.messageAreaRef.getData();
-							this.$refs.chatAreaRef.getData();
+						.post(
+							"https://gpt4.cocorobo.cn/update_classroom_observation_isdel",
+							params
+						)
+						.then((res) => {
+							this.$message({
+								type: "success",
+								message: "删除成功!",
+							});
+							// 清空tid
+							this.tid = "";
+							this.getCourseList().then((_) => {
+								if (!this.tid) return;
+								this.getFileIdId();
+								this.$refs.messageAreaRef.getData();
+								this.$refs.chatAreaRef.getData();
+							});
 						});
-					});
 				})
 				.catch(() => {});
 		},
@@ -376,22 +392,22 @@ export default {
 			this.loading = true;
 			return new Promise((resolve, reject) => {
 				this.ajax
-					.post("https://gpt4.cocorobo.cn/get_classroom_observation_all",{
-						userid:this.userId
+					.post("https://gpt4.cocorobo.cn/get_classroom_observation_all", {
+						userid: this.userId,
 					})
 					.then((res) => {
 						let _data = res.data.FunctionResponse.result;
-						let _result = []
+						let _result = [];
 						try {
 							_result = _data ? JSON.parse(_data) : [];
 						} catch (error) {
-							_result = []
+							_result = [];
 						}
 
-						if (_result.length <= 0) { 
+						if (_result.length <= 0) {
 							this.loading = false;
-							return
-						};
+							return;
+						}
 						let _optionData = _result.map((item) => {
 							item.jsonData = item.jsonData ? JSON.parse(item.jsonData) : {};
 							return {
@@ -399,7 +415,7 @@ export default {
 									? item.jsonData.courseName
 									: `${item.tId}课堂`,
 								value: item.tId,
-								id:item.id
+								id: item.id,
 							};
 						});
 						_optionData = _optionData.filter(
@@ -407,9 +423,10 @@ export default {
 						);
 						this.optionData = _optionData;
 						if (this.optionData.length > 0) {
-							this.$refs.chatAreaRef.$refs.startPageRef.showIntroduce = false
+							this.$refs.chatAreaRef.$refs.startPageRef.showIntroduce = false;
 						}
 						this.loading = false;
+						console.log(this.optionData);
 						resolve();
 					});
 			});
@@ -437,9 +454,9 @@ export default {
 			}
 			console.log(this.optionData);
 		},
-		updateTime(time){
+		updateTime(time) {
 			this.createTime = time;
-		}
+		},
 	},
 	mounted() {
 		this.getCourseList().then((_) => {

Някои файлове не бяха показани, защото твърде много файлове са промени