Kaynağa Gözat

课堂观察

SanHQin 10 ay önce
ebeveyn
işleme
2a68c0f8a4

+ 24 - 0
src/assets/icon/classroomObservation/generate.svg

@@ -0,0 +1,24 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g clip-path="url(#clip0_596_2943)">
+<path d="M5.13724 5.78772C5.03644 6.20372 4.98295 6.63824 4.98295 7.08532C4.98295 9.22704 6.21038 11.0821 8.0001 11.9854C7.25816 12.3601 6.41953 12.571 5.53153 12.571C4.57518 12.571 3.67621 12.3262 2.89313 11.8961L2.59941 11.435C1.96673 10.4426 1.6001 9.26384 1.6001 7.99961C1.6001 4.90429 3.79758 2.32212 6.71758 1.7283C7.13198 1.64395 7.56078 1.59961 8.0001 1.59961C8.43941 1.59961 8.86821 1.64395 9.28261 1.7283C8.83187 1.8275 8.4017 1.98224 8.0001 2.18521C6.58387 2.89995 5.51987 4.21058 5.13724 5.78772Z" fill="url(#paint0_linear_596_2943)"/>
+<path d="M13.4008 11.4353C13.4568 11.1214 13.4858 10.7982 13.4858 10.4684C13.4858 8.48783 12.4362 6.75252 10.8629 5.78794C10.0296 5.27709 9.04921 4.98269 8.00006 4.98269C6.95092 4.98269 5.97058 5.27709 5.13721 5.78794C5.51984 4.2108 6.58384 2.90017 8.00006 2.18543C8.40166 1.98246 8.83184 1.82772 9.28258 1.72852C12.2026 2.32234 14.4001 4.90452 14.4001 7.99983C14.4001 9.26406 14.0334 10.4428 13.4008 11.4353Z" fill="url(#paint1_linear_596_2943)"/>
+<path d="M13.4861 10.4676C13.4861 10.8182 13.4534 11.1611 13.3901 11.4934L13.0563 11.9231C11.8856 13.4296 10.0561 14.399 8.00034 14.399C5.94456 14.399 4.11508 13.4296 2.94434 11.9231C3.71531 12.3361 4.59622 12.5704 5.53176 12.5704C6.46731 12.5704 7.25839 12.3595 8.00034 11.9848C9.79005 11.0815 11.0175 9.22642 11.0175 7.08471C11.0175 6.63762 10.964 6.20311 10.8632 5.78711C12.4365 6.75168 13.4861 8.487 13.4861 10.4676Z" fill="url(#paint2_linear_596_2943)"/>
+</g>
+<defs>
+<linearGradient id="paint0_linear_596_2943" x1="2.2321" y1="11.235" x2="10.5107" y2="2.95641" gradientUnits="userSpaceOnUse">
+<stop stop-color="#364EE7"/>
+<stop offset="1" stop-color="#938DFF"/>
+</linearGradient>
+<linearGradient id="paint1_linear_596_2943" x1="6.99824" y1="2.798" x2="14.518" y2="10.318" gradientUnits="userSpaceOnUse">
+<stop stop-color="#364EE7"/>
+<stop offset="1" stop-color="#2CCAFF"/>
+</linearGradient>
+<linearGradient id="paint2_linear_596_2943" x1="11.4051" y1="6.10002" x2="6.53108" y2="14.5421" gradientUnits="userSpaceOnUse">
+<stop stop-color="#364EE7"/>
+<stop offset="1" stop-color="#4DE69A"/>
+</linearGradient>
+<clipPath id="clip0_596_2943">
+<rect width="12.8" height="12.8" fill="white" transform="translate(1.6001 1.59961)"/>
+</clipPath>
+</defs>
+</svg>

+ 3 - 0
src/assets/icon/classroomObservation/success.svg

@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M6.82591 11.9987C6.66084 11.9987 6.50208 11.937 6.38237 11.8248L2.96638 8.63944C2.71059 8.40129 2.70177 8.00563 2.94622 7.75615C3.19067 7.50666 3.59767 7.4991 3.85346 7.73724L6.77047 10.4577L12.0614 4.19651C12.287 3.93064 12.6914 3.89158 12.9649 4.11083C13.2383 4.33008 13.2774 4.72321 13.0531 4.99034L7.32237 11.7719C7.20896 11.9067 7.04264 11.9886 6.86497 11.9987H6.82591Z" fill="#17C469"/>
+</svg>

+ 43 - 3
src/components/pages/classroomObservation/components/analysisItem.vue

@@ -8,14 +8,21 @@
 				<span class="ai-h-l-text">{{ data.jsonData.name }}</span>
 			</div>
 			<div class="ai-h-right">
-				<span style="width: 100px; color: red" v-if="loadNum == 2"
+				<span style="width: 100px;" class="generateError" v-if="loadNum == 2"
 					>优化失败
 				</span>
 				<span
-					:class="loading ? 'text1' : 'text2'"
 					style="width: 100px"
 					v-if="loadNum == 1"
-					>{{ loading ? "优化中..." : "优化完成" }}
+					>
+					<span v-if="loading" class="generate">
+						<img :src="require('../../../../assets/icon/classroomObservation/generate.svg')">
+						生成中...
+					</span>
+					<span v-else class="generateSuccess">           
+						<img :src="require('../../../../assets/icon/classroomObservation/success.svg')">
+						生成完成
+					</span>
 				</span>
 				<span
 					v-if="loadNum == 0 && !openItem"
@@ -515,4 +522,37 @@ td,
 th {
 	padding: 10px;
 }
+
+.generate{
+	color: #00000099;
+	font-size: 16px;
+	display: flex;
+	align-items: center;
+}
+
+.generate>img{
+	margin-right: 5px;
+	width: 20px;
+	height: 20px;
+}
+
+.generateSuccess{ 
+	color: #17C469;
+	font-size: 16px;
+	display: flex;
+	align-items: center;
+}
+
+.generateSuccess>img{
+	margin-right: 5px;
+	width: 20px;
+	height: 20px;
+}
+
+.generateError{
+	color: #e60012;
+	font-size: 16px;
+	display: flex;
+	align-items: center;
+}
 </style>

+ 2 - 0
src/components/pages/classroomObservation/components/baseMessage.vue

@@ -170,6 +170,7 @@
 					<div class="m-m-formImage" v-loading="uploadVideoLoading">
 								<div
 									class="m-m-fi-imageItem"
+									style="max-width:33%;"
 									v-for="(item, index) in imageList.videoList?imageList.videoList:[]"
 									:key="index"
 									@click.stop="previewVideo(item.url)"
@@ -186,6 +187,7 @@
 							<div
 								class="m-m-fi-imageItem"
 								@click.stop="addVideo()"
+								style="max-width:33%;"
 								v-if="
 									(imageList.videoList&&imageList.videoList.length<=0) || !imageList.videoList
 								"

+ 340 - 0
src/components/pages/classroomObservation/components/bindingFormDialog.vue

@@ -0,0 +1,340 @@
+<template>
+	<div>
+		<el-dialog
+			:center="true"
+			:visible.sync="dialogVisible"
+			width="800px"
+			class="bindingFormDialog"
+		>
+			<div class="a-d-top">
+				<div class="a-d-topTit">
+					<div>绑定表单</div>
+				</div>
+				<div class="a_d_t_input">
+					<el-input
+						placeholder="请输入标题"
+						prefix-icon="el-icon-search"
+						v-model="text"
+						@submit.native.prevent="search()"
+						clearable
+					>
+					</el-input>
+					<el-button
+						size="mini"
+						:disabled="loading"
+						style="margin-left: 10px"
+						@click="search()"
+						type="primary"
+						>搜索</el-button
+					>
+				</div>
+				<div class="a-d-t-right">
+					<span @click.stop="dialogVisible = false">×</span>
+				</div>
+			</div>
+			<div class="bfd_box" v-loading="loading">
+				<el-table :data="list" border>
+					<el-table-column
+						prop="title"
+						label="标题"
+						style="width: 33%"
+						align="center"
+					>
+					</el-table-column>
+					<el-table-column
+						prop="uname"
+						label="创建人"
+						style="width: 33%"
+						align="center"
+					>
+					</el-table-column>
+					<el-table-column
+						prop="uname"
+						label="操作"
+						style="width: 33%"
+						align="center"
+					>
+						<template slot-scope="scope">
+							<el-button
+								type="info"
+								size="small"
+								:disabled="true"
+								v-if="scope.row.courseId == chooseForm.testId"
+								>已绑定</el-button
+							>
+							<el-button
+								v-else
+								size="small"
+								type="primary"
+								@click.stop="choose(scope.row)"
+								>绑定</el-button
+							>
+						</template>
+					</el-table-column>
+				</el-table>
+			</div>
+			<div class="bfd_bottom">
+				<div class="bfd_b_left">
+					<el-pagination
+						background
+						:current-page="pageData.nowPage"
+						layout="prev, pager, next"
+						@current-change="currentChange"
+						:page-size="pageData.pageSize"
+						:total="pageData.total"
+					>
+					</el-pagination>
+				</div>
+			</div>
+		</el-dialog>
+	</div>
+</template>
+
+<script>
+export default {
+	emits: ["success"],
+	props: {
+		tid: {
+			type: String,
+			default: "",
+		},
+	},
+	data() {
+		return {
+			loading: false,
+			dialogVisible: false,
+			userId: this.$route.query["userid"],
+			oid: this.$route.query["oid"],
+			org: this.$route.query["org"],
+			chooseForm: {
+				testId: "",
+				checkUrl: "",
+				doUrl: "",
+			},
+			list: [],
+			pageData: {
+				nowPage: 1,
+				total: 0,
+				pageSize: 20,
+			},
+			text: "",
+		};
+	},
+	methods: {
+		open(_json) {
+			if (_json.testData) {
+				this.chooseForm = _json.testData;
+			} else {
+				this.chooseForm = {};
+			}
+			this.text = "";
+			this.pageData.nowPage = 1;
+			this.loading = false;
+			this.dialogVisible = true;
+			this.getData();
+		},
+		close() {
+			this.text = "";
+			this.dialogVisible = false;
+			this.chooseForm = {
+				testId: "",
+				checkUrl: "",
+				doUrl: "",
+			};
+			this.pageData.nowPage = 1;
+			this.list = [];
+			this.pageData.total = 0;
+		},
+		search(){
+			this.pageData.nowPage = 1
+			this.getData();
+		},
+		choose(row) {
+			this.$confirm("确定绑定该表单吗?", "提示", {
+				confirmButtonText: "确定",
+				cancelButtonText: "取消",
+				type: "warning",
+			})
+				.then(() => {
+					let _result = {
+						testId: row.courseId,
+						checkUrl: `https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/#/checkToTest?cid=${row.courseId}&userid=${this.userId}&oid=${this.oid}&org=${this.org}&tid=${this.tid}&isN=1&role=0&type=2,`,
+						doUrl: `https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/#/doTest?cid=${row.courseId}&userid=${this.userId}&oid=${this.oid}&org=${this.org}&tid=${this.tid}&isN=1&role=0&type=2`,
+					};
+					this.loading = true;
+					this.submitBtn(_result);
+				})
+				.catch(() => {
+					this.$message({
+						type: "info",
+						message: "已取消绑定",
+					});
+				});
+		},
+		submitBtn(_data) {
+			if (!_data.testId) return this.$message.error("未选择表单");
+			this.$emit("success", _data);
+		},
+		currentChange(page) {
+			this.pageData.nowPage = page;
+			this.getData();
+		},
+		getData() {
+			if (this.loading) return this.$message.info("请稍等...");
+			this.loading = true;
+
+			this.list = [];
+			let params = {
+				type: 4,
+				uid: this.userId,
+				oid: this.oid,
+				org: this.org,
+				typea: "",
+				typeb: "",
+				typec: "",
+				typed: "",
+				typef: "",
+				typeE: "",
+				cu: "",
+				cn: this.text,
+				page: this.pageData.nowPage,
+				pageSize: this.pageData.pageSize,
+			};
+			this.ajax
+				.get(this.$store.state.api + "selectTesttCourse", params)
+				.then((res) => {
+					let _data = res.data[0];
+					this.pageData.total = 0
+					if (_data.length > 0) {
+						this.list = _data;
+						this.pageData.total = _data[0].num;
+					}
+					this.loading = false;
+				})
+				.catch((err) => {
+					console.log(err);
+					this.$message.error("获取表单失败");
+					this.loading = false;
+				});
+		},
+	},
+};
+</script>
+
+<style scoped>
+.bindingFormDialog >>> .el-dialog {
+	min-width: 800px;
+
+	height: 700px;
+	box-shadow: 0px 0 8px 0px #555555;
+	border-radius: 8px;
+	background-color: #fff;
+	/* top: 0px; */
+	/* margin: 0 auto; */
+	overflow: hidden;
+}
+.bindingFormDialog >>> .el-dialog__body {
+	height: 100%;
+	min-width: 800px;
+	flex-shrink: 0;
+	box-sizing: border-box;
+	padding-bottom: 50px;
+	padding-top: 10px;
+}
+.bindingFormDialog >>> .el-dialog__header {
+	display: none !important;
+}
+
+.a-d-top {
+	/* background: #adadad; */
+	display: flex;
+	flex-direction: row;
+	flex-wrap: nowrap;
+	align-items: center;
+	justify-content: space-between;
+	height: 54px;
+	border-radius: 8px 8px 0 0;
+	user-select: none;
+	border-bottom: 1px #ccc solid;
+}
+.a-d-top >>> .el-input__inner {
+	width: 320px;
+	height: 32px;
+}
+.a-d-top >>> .el-input__icon {
+	line-height: 32px;
+}
+
+.a-d-topTit {
+	/* width: 171px; */
+	/* margin-left: 20px; */
+	height: 32px;
+	display: flex;
+	align-items: center;
+	font-family: PingFang SC;
+	box-sizing: border-box;
+	padding: 5px;
+	line-height: 22px;
+	justify-content: center;
+	/* text-align: left; */
+}
+
+.a-d-t-right {
+	width: 40px;
+	height: 40px;
+	margin-right: 10px;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+	color: black !important;
+}
+
+.a-d-t-right > span {
+	width: 25px;
+	height: 25px;
+	border-radius: 25px;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	/* align-items: center; */
+	font-size: 22px;
+	color: #fff;
+	/* background-color: #adadad; */
+	cursor: pointer;
+	/* background-color: #e6e6e6; */
+	color: #adadad;
+}
+
+.bfd_box {
+	width: 100%;
+	height: calc(100% - 80px);
+	overflow: auto;
+}
+
+.bfd_bottom {
+	width: 100%;
+	height: calc(70px);
+	margin-top: 10px;
+	display: flex;
+}
+
+.bfd_b_left {
+	flex: 1;
+	height: 100%;
+	display: flex;
+	align-items: center;
+}
+
+.a_d_t_input {
+	display: flex;
+	align-items: center;
+}
+
+/* .bfd_b_right {
+	width: 200px;
+	height: 100%;
+	display: flex;
+	align-items: center;
+	justify-content: flex-end;
+} */
+</style>

+ 29 - 16
src/components/pages/classroomObservation/components/chatArea.vue

@@ -368,13 +368,13 @@
 </template>
 
 <script>
-import startPage from "./startPage.vue";
-import transcription from "./transcription.vue";
-import tape from "./tape.vue";
+import startPage from "./startPage";
+import transcription from "./transcription";
+import tape from "./tape";
 import { v4 as uuidv4 } from "uuid";
 import Recorder from "js-audio-recorder";
 import MarkdownIt from "markdown-it";
-import EditorBar from "./wangEnduit.vue";
+import EditorBar from "./wangEnduit";
 const lamejs = require("lamejs");
 import vpdf from "./vpdf";
 const recorder = new Recorder({
@@ -863,19 +863,31 @@ export default {
 
 				// })
 				_historyMessage.push({ role: "user", content: _text });
+				// let params = JSON.stringify({
+				// 	model: "gpt-3.5-turbo",
+				// 	temperature: 0,
+				// 	max_tokens: 4096,
+				// 	top_p: 1,
+				// 	frequency_penalty: 0,
+				// 	presence_penalty: 0,
+				// 	messages: _historyMessage,
+				// 	uid: _uuid,
+				// 	mind_map_question: "",
+				// });
 				let params = JSON.stringify({
-					model: "gpt-3.5-turbo",
-					temperature: 0,
-					max_tokens: 4096,
-					top_p: 1,
-					frequency_penalty: 0,
-					presence_penalty: 0,
-					messages: _historyMessage,
-					uid: _uuid,
-					mind_map_question: "",
-				});
+        message: {
+          anthropic_version: "bedrock-2023-05-31",
+          max_tokens: 4096,
+          temperature: 0,
+          top_p: 1,
+          messages: _historyMessage
+        },
+        uid: _uuid,
+        model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
+      });
 				this.ajax
-					.post("https://gpt4.cocorobo.cn/chat", params)
+					// .post("https://gpt4.cocorobo.cn/chat", params)
+					.post("https://claude3.cocorobo.cn/chat", params)
 					.then((res) => {
 						if (res.data.FunctionResponse.result == "发送成功") {
 						} else {
@@ -889,7 +901,8 @@ export default {
 			}
 		},
 		getAiContent(_uid) {
-			let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
+			let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_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();

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

@@ -16,6 +16,7 @@
 				使用分析模板
 			</div>
 			<div class="m-o-btn" @click.stop="saveAsTemplate()">另存为模板</div>
+			<div class="m-o-btn" :disabled="bmData.jsonData?false:true" @click="$refs.bindingFormDialogRef.open(bmData.jsonData)">绑定表单</div>
 		</div>
 		<div class="ma-main">
 			<baseMessage
@@ -137,7 +138,7 @@
 			</div>
 			<div style="display: flex; height: 100%">
 				<div class="a-d-t-left">
-					<div class="itemTit">我的模块</div>
+					<!-- <div class="itemTit">我的模块</div> -->
 					<div
 						:style="
 							tagIndex == index
@@ -213,6 +214,8 @@
 			</div>
 			<!-- </div> -->
 		</el-dialog>
+		<!-- 绑定 表单 -->
+		<bindingFormDialog ref="bindingFormDialogRef" :tid="tid" @success="bindingForm"/>
 	</div>
 </template>
 
@@ -222,6 +225,7 @@ import baseMessage from "./baseMessage.vue"; //基本信息
 // import scienceAnalysis from "./scienceAnalysis.vue"; //科学课堂分析
 // import extendAnalysis from "./extendAnalysis.vue"; //扩展分析
 import analysis from "./analysis.vue";
+import bindingFormDialog from './bindingFormDialog.vue'
 
 export default {
 	emits:["changeChatAreaAudioUrl","changeTranscription","changeOptionData","updateTime"],
@@ -231,6 +235,7 @@ export default {
 		// scienceAnalysis,
 		// extendAnalysis,
 		analysis,
+		bindingFormDialog,
 	},
 	props: {
 		tid: {
@@ -496,6 +501,15 @@ export default {
 		}
 	},
 	methods: {
+		// 绑定表单
+		bindingForm(obj){
+			this.bmData.jsonData.testData = obj;
+			this.saveData(this.bmData).then(_=>{
+				this.$message.success("绑定成功");
+				this.$refs.bindingFormDialogRef.close();
+			})
+			
+		},
 		delAnalysisItem(id) {
 			let _index = this.dataList.findIndex((i) => i.id == id);
 			if (_index > -1) {
@@ -1085,7 +1099,8 @@ export default {
 	font-weight: 600;
 	line-height: 22px;
 	text-align: left;
-	margin-bottom: 20px;
+	margin-top: 20px;
+	/* margin-bottom: 20px; */
 }
 
 .a-d-t-l-item:hover {
@@ -1141,8 +1156,15 @@ export default {
 	box-sizing: border-box;
 	margin-bottom: 10px;
 	margin-right: 20px;
+	transform: .3s;
+	box-shadow: 0 16px 24px 2px #f0f2f5;
 	/* position: relative; */
 }
+
+.a-d-b-item:hover{
+	box-shadow: 0 16px 24px 2px #0000001c;
+}
+
 .a-d-b-item:hover .a-d-b-i-bottomBtn {
 	display: block !important;
 }