SanHQin il y a 2 mois
Parent
commit
6ebfe6373b

+ 1 - 1
dist/index.html

@@ -32,7 +32,7 @@
       width: 100%;
       background: #e6eaf0;
       font-family: '黑体';
-    }</style><link href=./static/css/app.acc3f4ca6d20b29571fd60acf4e1a76e.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.00bfcafc8431113801f1.js></script><script type=text/javascript src=./static/js/vendor.a54a39a7efbf3fedeee2.js></script><script type=text/javascript src=./static/js/app.af71ded20783c519d2b0.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.fbcf59ccb94c5f6983d31876f4866972.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.00bfcafc8431113801f1.js></script><script type=text/javascript src=./static/js/vendor.a54a39a7efbf3fedeee2.js></script><script type=text/javascript src=./static/js/app.bd772b92cb6974bbb98d.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/static/css/app.fbcf59ccb94c5f6983d31876f4866972.css


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/static/css/app.fbcf59ccb94c5f6983d31876f4866972.css.map


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/static/js/app.bd772b92cb6974bbb98d.js


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/static/js/app.bd772b92cb6974bbb98d.js.map


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/static/js/manifest.00bfcafc8431113801f1.js.map


+ 4 - 2
src/components/pages/classroomObservation/components/analysis.vue

@@ -108,7 +108,8 @@
               ![
                 converter('S-T分析:课堂时间分配'),
                 converter('S-T分析:师生互动分析'),
-                converter('S-T分析:教学模式分析')
+                converter('S-T分析:教学模式分析'),
+								// converter('课堂活动光谱图')
               ].includes(converter(item.jsonData.name))
           "
           :dialogTagDataList="dialogTagDataList"
@@ -128,7 +129,8 @@
             [
               converter('S-T分析:课堂时间分配'),
               converter('S-T分析:师生互动分析'),
-              converter('S-T分析:教学模式分析')
+              converter('S-T分析:教学模式分析'),
+							// converter('课堂活动光谱图')
             ].includes(converter(item.jsonData.name))
           "
           :dialogTagDataList="dialogTagDataList"

+ 133 - 7
src/components/pages/classroomObservation/components/analysisSpecialItem.vue

@@ -176,6 +176,9 @@
         "
       />
 
+			<!-- 光谱图 -->
+			<!-- <echartsSpectrogram style="max-height: 200px;max-width: 90%;width: 90%;height: 200px;margin: auto;"  v-if=" converter(data.jsonData.name) == converter('课堂活动光谱图')" :data="{}"/> -->
+
       <eChartTemplate
         style="width: 100%;height: 400px;"
         :data="data.jsonData.eChartData"
@@ -210,12 +213,14 @@ let converter2 = OpenCC.Converter({
 import mdView from "./mdView.vue";
 import eChartTemplate from "./eChartTemplate";
 import { v4 as uuidv4 } from "uuid";
+import echartsSpectrogram from './echartsSpectrogram'
 // import editNameDialog from './editNameDialog.vue'
 export default {
   emits: ["delItem", "editItem", "saveItem"],
   components: {
     mdView,
-    eChartTemplate
+    eChartTemplate,
+		echartsSpectrogram
     // editNameDialog
   },
   props: {
@@ -422,11 +427,15 @@ export default {
       };
     },
     getData(type = 0) {
-      if (!this.bmData.editorBarData || this.bmData.editorBarData.type != 0) {
+      if (this.data.jsonData.name != this.converter("课堂活动光谱图") &&(!this.bmData.editorBarData || this.bmData.editorBarData.type != 0)) {
         this.loadNum = 2;
         return this.$message.info("请上传表格形式的转录文稿");
       }
-      try {
+
+			if(this.data.jsonData.name == this.converter("课堂活动光谱图")){
+				return this.getSpectrogram(type)
+			}
+      try {	
         let _result = [];
         let _data = this.bmData.editorBarData.content;
         let _div = document.createElement("div");
@@ -446,11 +455,11 @@ export default {
           _result.push(obj);
         });
         if (_result.length == 0) return this.$message.error("未找到表格数据");
-        if (this.data.jsonData.name == "S-T分析:课堂时间分配") {
+        if (this.data.jsonData.name == this.converter("S-T分析:课堂时间分配")) {
           this.getTimeAllocationData(_result, type);
-        } else if (this.data.jsonData.name == "S-T分析:师生互动分析") {
+        } else if (this.data.jsonData.name == this.converter("S-T分析:师生互动分析")) {
           this.getInteractionAnalysisData(_result, type);
-        } else if (this.data.jsonData.name == "S-T分析:教学模式分析") {
+        } else if (this.data.jsonData.name == this.converter("S-T分析:教学模式分析")) {
           this.getTeachingModeData(_result, type);
         } else {
           return this.$message.error("未找到对应的分析");
@@ -832,7 +841,124 @@ CH:${_CH}
           });
         }
       });
-    }
+    },
+		getSpectrogram(type=1){
+			if(type===0){
+				this.$message.info("图表");
+				this.loading = false;
+				return;
+			}
+			this.$nextTick(() => {
+        this.loading = true;
+        this.openItem = false;
+        this.loadNum = 1;
+        let type = 0; //0 用agentId  1:用提示词 3:啥都没有
+        let assistant =
+          this.dialogTagDataList.find(i => i.id == this.data.jsonData.mId) ||
+          this.dialogTagDataList.find(i => i.name == this.data.jsonData.name);
+
+        let _msg = `使用文件检索的方式完整的去分析文件内容,并请完全按照要求输出。`;
+
+        if (!assistant) {
+          this.loading = false;
+          this.loadNum = 2;
+          type = 3;
+          return this.$message.error("未找到对应的AI助手");
+        }
+
+        if (assistant.tips) {
+          type = 1;
+        } else if (assistant.agentid) {
+          type = 0;
+        } else {
+          this.loading = false;
+          this.loadNum = 2;
+          type = 3;
+          return this.$message.error("未找到对应的AI助手");
+        }
+
+        // console.log('👇')
+        // return console.log(_msg)
+        let parm = {
+          assistant_id:
+            type == 0
+              ? assistant.agentid
+              : "f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b",
+          message: type == 0 ? _msg : assistant.tips,
+          session_name: uuidv4(),
+          userId: this.userId,
+          file_ids: this.fileId ? [this.fileId] : "",
+          model: "gpt-4o-2024-08-06"
+        };
+
+        // 👇
+        // const _uid = uuidv4();
+        // let parm = {
+        // 	assistant_id: assistant ? assistant.value : null,
+        // 	userId: this.userId, //602def61-005d-11ee-91d8-005056b86db5
+        // 	message:
+        // 		"请使用代码解析器获取文件,帮我根据要求完整的分析,输出请按照要求。",
+        // 	session_name: new Date().getTime(),
+        // 	uid: _uid,
+        // 	file_ids: this.fileId ? [this.fileId] : [],
+        // };
+        if (!parm.assistant_id) {
+          this.loading = false;
+          this.loadNum = 2;
+          return this.$message.error("未找到对应的AI助手");
+        }
+        // this.ajax
+        // 	.post("https://gpt4.cocorobo.cn/ai_agent_park_chat_new", parm)
+        // 	.then((res) => {
+        // 		if (res.data.FunctionResponse.result == "发送成功") {
+        // 		} else {
+        // 			this.$message.warning(res.data.FunctionResponse.result);
+        // 		}
+        // 	})
+        // 	.catch((err) => {
+        // 		console.log(err);
+        // 	});
+        // this.getAtAuContent(_uid);
+        // 👆
+
+        this.ajax
+          .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm)
+          .then(res => {
+            let _data = res.data.FunctionResponse;
+            // if (
+            // 	!_data.message ||
+            // 	_data.message.indexOf("由于我无法直接访问您上传的文件内容") > -1
+            // ) {
+            // 	this.loading = false;
+            // 	this.loadNum = 2;
+            // 	// this.$message.error("AI无法识别优化");
+            // 	return
+            // }
+            let _copyData = JSON.parse(JSON.stringify(this.data));
+            // _copyData.jsonData.result = "";
+            _copyData.jsonData.content = _data.message;
+            _copyData.jsonData.dataFileList = [];
+            _copyData.jsonData.fileList = [];
+            _copyData.json_data = JSON.stringify(_copyData.jsonData);
+            if (this.historyResult.length == 0) {
+              this.historyResult.push(_copyData.jsonData);
+            } else {
+              this.historyResult.splice(
+                this.showIndex + 1,
+                0,
+                _copyData.jsonData
+              );
+            }
+            this.changeShowIndex(1);
+            this.loading = false;
+          })
+          .catch(err => {
+            this.loadNum = 2;
+            // this.$message.error("AI无法识别优化");
+            this.loading = false;
+          });
+      });
+		}
   },
   mounted() {
     if (this.data.jsonData.content) {

+ 69 - 0
src/components/pages/classroomObservation/components/echartsSpectrogram.vue

@@ -0,0 +1,69 @@
+<template>
+  <div>
+    <canvas class="canvas" ref="canvasRef"></canvas>
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    data: {}
+  },
+  methods: {
+    init() {
+      const canvas = this.$refs.canvasRef;
+      const ctx = canvas.getContext("2d");
+
+      // 定义各区域数据(宽度比例)
+      const segments = [
+        { label: "老师", color: "#0000FF", percentage: 30 },
+        { label: "学生", color: "#008000", percentage: 20 },
+        { label: "老师", color: "#0000FF", percentage: 10 },
+        { label: "学生", color: "#008000", percentage: 20 },
+        { label: "老师", color: "#0000FF", percentage: 20 }
+      ];
+
+      // 画布宽度
+      const canvasWidth = canvas.width;
+
+      // 当前x位置的起始点
+      let currentX = 0;
+
+      // 计算并绘制每个区域
+      segments.forEach(segment => {
+        const segmentWidth = (segment.percentage / 100) * canvasWidth;
+        ctx.fillStyle = segment.color;
+        ctx.fillRect(currentX, 10, segmentWidth, canvas.height - 20);
+
+        // 更新x位置
+        currentX += segmentWidth;
+      });
+
+      // 绘制红色垂直线(指定位置)
+      const redLinePositions = [80, 160, 400, 420, 520, 540, 680, 720]; // 像素位置
+      ctx.strokeStyle = "red";
+      ctx.lineWidth = 2;
+
+      redLinePositions.forEach(position => {
+        ctx.beginPath();
+        ctx.moveTo(position, 0);
+        ctx.lineTo(position, canvas.height + 20);
+        ctx.stroke();
+      });
+    }
+  },
+  mounted() {
+		this.init();
+		window.addEventListener("resize", () => {
+			this.init();
+    });
+	}
+};
+</script>
+
+<style scoped>
+.canvas{
+	width: 100%;
+	height: 150px;
+}
+</style>

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff