|
@@ -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) {
|