|
@@ -21,6 +21,9 @@
|
|
|
<baseMessage
|
|
|
:data="bmData.jsonData"
|
|
|
:imageList="imageList.jsonData"
|
|
|
+ @saveData="saveBaseData"
|
|
|
+ @saveImage="saveBaseImage"
|
|
|
+ @delImage="delBaseImageList"
|
|
|
v-loading="baseMessageLoading"
|
|
|
/>
|
|
|
|
|
@@ -30,6 +33,7 @@
|
|
|
@delItem="delAnalysisItem"
|
|
|
@editItem="editAnalysisItem"
|
|
|
title="通用课堂分析"
|
|
|
+ :dialogTagDataList="dialogTagDataList"
|
|
|
:analysisItemList="dataList.filter((i) => i.Type === 0)"
|
|
|
:type="0"
|
|
|
:tid="tid"
|
|
@@ -42,6 +46,7 @@
|
|
|
@delItem="delAnalysisItem"
|
|
|
@editItem="editAnalysisItem"
|
|
|
title="科学课堂分析"
|
|
|
+ :dialogTagDataList="dialogTagDataList"
|
|
|
:analysisItemList="dataList.filter((i) => i.Type === 1)"
|
|
|
:type="1"
|
|
|
:tid="tid"
|
|
@@ -54,6 +59,7 @@
|
|
|
@delItem="delAnalysisItem"
|
|
|
@editItem="editAnalysisItem"
|
|
|
title="扩展分析"
|
|
|
+ :dialogTagDataList="dialogTagDataList"
|
|
|
:analysisItemList="dataList.filter((i) => i.Type === 2)"
|
|
|
:type="2"
|
|
|
:tid="tid"
|
|
@@ -66,6 +72,7 @@
|
|
|
@delItem="delAnalysisItem"
|
|
|
@editItem="editAnalysisItem"
|
|
|
title="增值性分析"
|
|
|
+ :dialogTagDataList="dialogTagDataList"
|
|
|
:analysisItemList="dataList.filter((i) => i.Type === 3)"
|
|
|
:type="3"
|
|
|
:tid="tid"
|
|
@@ -112,6 +119,7 @@
|
|
|
placeholder="请输入内容"
|
|
|
prefix-icon="el-icon-search"
|
|
|
v-model="input2"
|
|
|
+ clearable
|
|
|
>
|
|
|
</el-input>
|
|
|
</div>
|
|
@@ -153,9 +161,7 @@
|
|
|
<div style="display: flex; flex-wrap: wrap">
|
|
|
<div
|
|
|
class="a-d-b-item"
|
|
|
- v-for="(item, index) in dialogTagDataList.filter(
|
|
|
- (i) => i.type == tagIndex
|
|
|
- )"
|
|
|
+ v-for="(item, index) in searchDataList"
|
|
|
:key="index"
|
|
|
>
|
|
|
<div class="a-d-b-i-top">
|
|
@@ -205,6 +211,7 @@ import baseMessage from "./baseMessage.vue"; //基本信息
|
|
|
import analysis from "./analysis.vue";
|
|
|
|
|
|
export default {
|
|
|
+ emits:["changeChatAreaAudioUrl"],
|
|
|
components: {
|
|
|
baseMessage,
|
|
|
// currencyAnalysis,
|
|
@@ -244,64 +251,87 @@ export default {
|
|
|
{
|
|
|
title: "OMO智慧课堂分析",
|
|
|
brief: "多维度分析课堂整体情况",
|
|
|
+ value: "4cc367c1-0076-11ef-aaca-12e77c4cb76b",
|
|
|
type: 0,
|
|
|
},
|
|
|
{
|
|
|
title: "教学阶段九事件分析",
|
|
|
brief: "使用加涅九事件分析教学环节",
|
|
|
+ value: "5e0466b3-0075-11ef-aaca-12e77c4cb76b",
|
|
|
type: 0,
|
|
|
},
|
|
|
{
|
|
|
title: "布鲁姆问题分类",
|
|
|
brief: "多维度分析课堂整体情况",
|
|
|
+ value: "eac63117-00a7-11ef-aaca-12e77c4cb76b",
|
|
|
type: 0,
|
|
|
},
|
|
|
{
|
|
|
title: "麦卡锡问题分类",
|
|
|
brief: "多维度分析课堂整体情况",
|
|
|
+ value: "18545cf7-0125-11ef-aaca-12e77c4cb76b",
|
|
|
type: 0,
|
|
|
},
|
|
|
{
|
|
|
title: "学生回答情况",
|
|
|
brief: "多维度分析课堂整体情况",
|
|
|
+ value: "d3f75199-eb4e-11ee-aaca-12e77c4cb76b",
|
|
|
type: 0,
|
|
|
},
|
|
|
- { title: "课堂时间分配", brief: "多维度分析课堂整体情况", type: 0 },
|
|
|
- { title: "师生互动分析", brief: "多维度分析课堂整体情况", type: 0 },
|
|
|
- { title: "教学模式分析", brief: "多维度分析课堂整体情况", type: 0 },
|
|
|
+ // {
|
|
|
+ // title: "课堂时间分配",
|
|
|
+ // brief: "多维度分析课堂整体情况",
|
|
|
+ // type: 0
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // title: "师生互动分析",
|
|
|
+ // brief: "多维度分析课堂整体情况",
|
|
|
+ // type: 0
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // title: "教学模式分析",
|
|
|
+ // brief: "多维度分析课堂整体情况",
|
|
|
+ // type: 0
|
|
|
+ // },
|
|
|
{
|
|
|
title: "课堂活动类型",
|
|
|
brief: "多维度分析课堂整体情况",
|
|
|
+ value: "41d2d2d4-0125-11ef-aaca-12e77c4cb76b",
|
|
|
type: 1,
|
|
|
},
|
|
|
{
|
|
|
title: "学科核心素养发展",
|
|
|
- brief: "使用加涅九事件分析教学环节",
|
|
|
+ brief: "学科核心素养发展",
|
|
|
+ value: "b13a98de-0125-11ef-aaca-12e77c4cb76b",
|
|
|
type: 1,
|
|
|
},
|
|
|
{
|
|
|
title: "科学教育目标分析",
|
|
|
- brief: "多维度分析课堂整体情况",
|
|
|
+ brief: "科学教育目标分析",
|
|
|
+ value: "b13a98de-0125-11ef-aaca-12e77c4cb76b",
|
|
|
type: 1,
|
|
|
},
|
|
|
{
|
|
|
title: "PORTAAL课堂观察",
|
|
|
- brief: "使用加涅九事件分析教学环节",
|
|
|
+ brief: "PORTAAL课堂观察",
|
|
|
+ value: "8ab07d41-e143-11ee-aaca-12e77c4cb76b",
|
|
|
type: 1,
|
|
|
},
|
|
|
{
|
|
|
title: "5E课程改编",
|
|
|
- brief: "多维度分析课堂整体情况",
|
|
|
+ brief: "5E课程改编",
|
|
|
+ value: "f757826e-0125-11ef-aaca-12e77c4cb76b",
|
|
|
type: 2,
|
|
|
},
|
|
|
{
|
|
|
title: "5EX课程改编",
|
|
|
- brief: "使用加涅九事件分析教学环节",
|
|
|
+ brief: "5EX课程改编",
|
|
|
+ value: "0b6b08b7-0126-11ef-aaca-12e77c4cb76b",
|
|
|
type: 2,
|
|
|
},
|
|
|
{
|
|
|
- title: "UTOP课程观察",
|
|
|
- brief: "多维度分析课堂整体情况",
|
|
|
+ title: "UTOP课堂观察",
|
|
|
+ brief: "UTOP课堂观察",
|
|
|
value: "8e3a389b-014f-11ef-aaca-12e77c4cb76b",
|
|
|
type: 3,
|
|
|
},
|
|
@@ -318,9 +348,9 @@ export default {
|
|
|
type: 3,
|
|
|
},
|
|
|
{
|
|
|
- title: "课堂质量评价",
|
|
|
- brief: "多维度分析课堂整体情况",
|
|
|
- value: "25e53379-0152-11ef-aaca-12e77c4cb76b",
|
|
|
+ title: "课程质量评价",
|
|
|
+ brief: "多维度分析课堂整体情况",
|
|
|
+ value:"25e53379-0152-11ef-aaca-12e77c4cb76b",
|
|
|
type: 3,
|
|
|
},
|
|
|
{
|
|
@@ -332,7 +362,7 @@ export default {
|
|
|
{
|
|
|
title: "RTOP课堂观察",
|
|
|
brief: "多维度分析课堂整体情况",
|
|
|
- value: "2ace7ff6-0154-11ef-aaca-12e77c4cb76b",
|
|
|
+ value: "a7107221-f7f5-11ee-aaca-12e77c4cb76b",
|
|
|
type: 3,
|
|
|
},
|
|
|
],
|
|
@@ -341,32 +371,45 @@ export default {
|
|
|
imageList: {},
|
|
|
};
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ searchDataList() {
|
|
|
+ let _data = this.dialogTagDataList.filter((i) => i.type == this.tagIndex);
|
|
|
+ if (this.input2) {
|
|
|
+ return _data.filter((i) => i.title.indexOf(this.input2) > -1);
|
|
|
+ } else {
|
|
|
+ return _data;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
methods: {
|
|
|
delAnalysisItem(id) {
|
|
|
let _index = this.dataList.findIndex((i) => i.id == id);
|
|
|
if (_index > -1) {
|
|
|
- this.dataList.splice(_index, 1);
|
|
|
- this.$message.success("删除成功");
|
|
|
+ let _data = this.dataList[_index];
|
|
|
+ let params = {
|
|
|
+ id: _data.id,
|
|
|
+ type: _data.Type,
|
|
|
+ tid: this.tid,
|
|
|
+ };
|
|
|
+ this.ajax
|
|
|
+ .post("https://gpt4.cocorobo.cn/delete_classroom_observation", params)
|
|
|
+ .then((res) => {
|
|
|
+ this.dataList.splice(_index, 1);
|
|
|
+ this.$message.success("删除成功");
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ this.$message.error("删除失败");
|
|
|
+ });
|
|
|
} else {
|
|
|
this.$message.error("删除失败");
|
|
|
}
|
|
|
},
|
|
|
editAnalysisItem(id, _data) {
|
|
|
let _index = this.dataList.findIndex((i) => i.id == id);
|
|
|
- if (_index > -1) {
|
|
|
+ if (_index != -1) {
|
|
|
this.dataList[_index] = _data;
|
|
|
- if (this.dataList[_index].id) {
|
|
|
- let pram2 = {
|
|
|
- id: this.dataList[_index].id,
|
|
|
- json_data: this.dataList[_index].json_data,
|
|
|
- };
|
|
|
- this.ajax.post(
|
|
|
- "https://gpt4.cocorobo.cn/update_classroom_observation",
|
|
|
- pram2
|
|
|
- );
|
|
|
- }
|
|
|
+ this.saveData(this.dataList[_index])
|
|
|
this.$forceUpdate();
|
|
|
- this.$message.success("执行成功");
|
|
|
} else {
|
|
|
this.$message.info("执行错误");
|
|
|
}
|
|
@@ -397,177 +440,65 @@ export default {
|
|
|
addAnalysisItem(title) {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
this.dialogVisible = false;
|
|
|
- let assistant_id = {
|
|
|
- 课堂观察: { value: "8ab07d41-e143-11ee-aaca-12e77c4cb76b", type: 0 },
|
|
|
- 教学阶段九事件分析: {
|
|
|
- value: "5e0466b3-0075-11ef-aaca-12e77c4cb76b",
|
|
|
- type: 0,
|
|
|
- },
|
|
|
- OMO智慧课堂分析: {
|
|
|
- value: "4cc367c1-0076-11ef-aaca-12e77c4cb76b",
|
|
|
- type: 0,
|
|
|
- },
|
|
|
- 布鲁姆问题分类: {
|
|
|
- value: "eac63117-00a7-11ef-aaca-12e77c4cb76b",
|
|
|
- type: 0,
|
|
|
- },
|
|
|
- 麦卡锡问题分类: {
|
|
|
- value: "18545cf7-0125-11ef-aaca-12e77c4cb76b",
|
|
|
- type: 0,
|
|
|
- },
|
|
|
- 学生回答统计: {
|
|
|
- value: "2c6ede88-0125-11ef-aaca-12e77c4cb76b",
|
|
|
- type: 0,
|
|
|
- },
|
|
|
- 课堂活动类型: {
|
|
|
- value: "41d2d2d4-0125-11ef-aaca-12e77c4cb76b",
|
|
|
- type: 1,
|
|
|
- },
|
|
|
- 素养目标分析: {
|
|
|
- value: "b13a98de-0125-11ef-aaca-12e77c4cb76b",
|
|
|
- type: 1,
|
|
|
- },
|
|
|
- 科学教育目标分析: {
|
|
|
- value: "d6cd48ab-0125-11ef-aaca-12e77c4cb76b",
|
|
|
- type: 1,
|
|
|
- },
|
|
|
- "5E课程改编": {
|
|
|
- value: "f757826e-0125-11ef-aaca-12e77c4cb76b",
|
|
|
- type: 2,
|
|
|
- },
|
|
|
- "5EX课程改编": {
|
|
|
- value: "0b6b08b7-0126-11ef-aaca-12e77c4cb76b",
|
|
|
- type: 2,
|
|
|
- },
|
|
|
- UTOP课程观察: {
|
|
|
- value: "8e3a389b-014f-11ef-aaca-12e77c4cb76b",
|
|
|
- type: 3,
|
|
|
- },
|
|
|
- RST模型: {
|
|
|
- value: "e649112e-0150-11ef-aaca-12e77c4cb76b",
|
|
|
- type: 3,
|
|
|
- },
|
|
|
- RTOP模型: {
|
|
|
- value: "68265b18-0151-11ef-aaca-12e77c4cb76b",
|
|
|
- type: 3,
|
|
|
- },
|
|
|
- 课堂质量评价: {
|
|
|
- value: "25e53379-0152-11ef-aaca-12e77c4cb76b",
|
|
|
- type: 3,
|
|
|
- },
|
|
|
- SCOP课堂观察: {
|
|
|
- value: "d0c76d35-0152-11ef-aaca-12e77c4cb76b",
|
|
|
- type: 3,
|
|
|
- },
|
|
|
- RTOP课堂观察: {
|
|
|
- value: "2ace7ff6-0154-11ef-aaca-12e77c4cb76b",
|
|
|
- type: 3,
|
|
|
- },
|
|
|
- };
|
|
|
- let file_ids = {
|
|
|
- "03": ["file-E8SvjCHbmhmjKczRWr11OuHx"],
|
|
|
- "04": ["file-r5phg4I2oFqly4WpW7oOOTnA"],
|
|
|
- };
|
|
|
+ let assistant = this.dialogTagDataList.find((i) => i.title == title);
|
|
|
+
|
|
|
let parm = {
|
|
|
- assistant_id: assistant_id[title] ? assistant_id[title].value : null,
|
|
|
+ assistant_id: assistant ? assistant.value : null,
|
|
|
message:
|
|
|
"请使用代码解析器获取文件,帮我根据要求完整的分析,输出请按照要求。",
|
|
|
session_name: new Date().getTime(),
|
|
|
userId: "1cf9dc4b-d95f-11ea-af4c-52540005ab01",
|
|
|
- file_ids: this.fileId ? [this.fileId] : file_ids[this.tid],
|
|
|
+ file_ids: this.fileId,
|
|
|
};
|
|
|
|
|
|
if (!parm.assistant_id) {
|
|
|
resolve();
|
|
|
return this.$message.error("未找到对应的AI助手");
|
|
|
}
|
|
|
- this.dataList.push({
|
|
|
- id: assistant_id[title].value,
|
|
|
- Type: assistant_id[title].type,
|
|
|
- createTime: new Date(),
|
|
|
- tId: this.tid,
|
|
|
- tIndex: 2,
|
|
|
- jsonData: {
|
|
|
- dataFileList: [],
|
|
|
- fileList: [],
|
|
|
- fileList2: [],
|
|
|
- name: title,
|
|
|
+ let newIndexData = this.dataList.filter((i) => i.Type == assistant.type).sort((a,b)=>new Date(a.createtime)-new Date(b.createtime))
|
|
|
+ newIndexData = newIndexData.length?newIndexData[newIndexData.length-1]:null;
|
|
|
+ let newIndex = newIndexData?newIndexData.tIndex+1:assistant.type==0?2:0;
|
|
|
+ let params = {
|
|
|
+ index: newIndex,
|
|
|
+ json_data: JSON.stringify({
|
|
|
+ name: assistant.title,
|
|
|
result: "",
|
|
|
- },
|
|
|
- });
|
|
|
+ fileList: [],
|
|
|
+ dataFileList: [],
|
|
|
+ content: "",
|
|
|
+ }),
|
|
|
+ tid: this.tid,
|
|
|
+ type: assistant.type.toString(),
|
|
|
+ };
|
|
|
|
|
|
- if (assistant_id[title].type == 0) {
|
|
|
- this.$refs.analysis0.getReport(
|
|
|
- this.dataList.filter((i) => i.Type == 0).length - 1
|
|
|
- );
|
|
|
- } else if (assistant_id[title].type == 1) {
|
|
|
- this.$refs.analysis1.getReport(
|
|
|
- this.dataList.filter((i) => i.Type == 1).length - 1
|
|
|
- );
|
|
|
- } else if (assistant_id[title].type == 2) {
|
|
|
- this.$refs.analysis1.getReport(
|
|
|
- this.dataList.filter((i) => i.Type == 2).length - 1
|
|
|
- );
|
|
|
- } else if (assistant_id[title].type == 3) {
|
|
|
- this.$refs.analysis1.getReport(
|
|
|
- this.dataList.filter((i) => i.Type == 3).length - 1
|
|
|
- );
|
|
|
- }
|
|
|
- this.$message.success("添加成功");
|
|
|
- resolve();
|
|
|
- // this.ajax
|
|
|
- // .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm)
|
|
|
- // .then((res) => {
|
|
|
- // let result = res.data.FunctionResponse;
|
|
|
- // if(!result.message || result.message.indexOf('由于我无法直接访问您上传的文件内容')>-1){
|
|
|
- // this.loading = false;
|
|
|
- // resolve();
|
|
|
- // return this.$message.error(`${title}无法生成`)
|
|
|
- // }
|
|
|
- // this.dataList.push({
|
|
|
- // id:assistant_id[result.title].value,
|
|
|
- // Type:assistant_id[result.title].type,
|
|
|
- // createTime:new Date(),
|
|
|
- // tId:this.tid,
|
|
|
- // tIndex:2,
|
|
|
- // jsonData:{
|
|
|
- // dataFileList:[],
|
|
|
- // fileList:[],
|
|
|
- // fileList2:[],
|
|
|
- // name:result.title,
|
|
|
- // result:result.message
|
|
|
- // }
|
|
|
- // })
|
|
|
- // resolve();
|
|
|
- // this.loading = false;
|
|
|
- // })
|
|
|
- // .catch((e) => {
|
|
|
- // this.$message.error(`${title}无法生成`)
|
|
|
- // this.loading = false;
|
|
|
- // resolve();
|
|
|
- // });
|
|
|
+ // 这里调用添加
|
|
|
+ this.ajax
|
|
|
+ .post("https://gpt4.cocorobo.cn/insert_classroom_observation", params)
|
|
|
+ .then((res) => {
|
|
|
+ let _data = res.data.FunctionResponse;
|
|
|
+ if (_data.message && _data.message == "创建成功") {
|
|
|
+ let _result = JSON.parse(_data.result)[0];
|
|
|
+ _result.jsonData = JSON.parse(_result.jsonData);
|
|
|
+ this.dataList.push(_result);
|
|
|
+ if (_result.Type == 0) {
|
|
|
+ this.$refs.analysis0.getReport(_result.id);
|
|
|
+ } else if (_result.Type == 1) {
|
|
|
+ this.$refs.analysis1.getReport(_result.id);
|
|
|
+ } else if (_result.Type == 2) {
|
|
|
+ this.$refs.analysis2.getReport(_result.id);
|
|
|
+ } else if (_result.Type == 3) {
|
|
|
+ this.$refs.analysis3.getReport(_result.id);
|
|
|
+ }
|
|
|
+ this.$message.success("添加成功");
|
|
|
+ resolve();
|
|
|
+ } else {
|
|
|
+ this.$message.error("创建失败");
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
},
|
|
|
- // 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() {
|
|
|
+ if(!this.tid)return;
|
|
|
let pram = {
|
|
|
tid: this.tid,
|
|
|
// tid:'02',
|
|
@@ -599,14 +530,15 @@ export default {
|
|
|
? JSON.parse(res.data.FunctionResponse.result)
|
|
|
: [];
|
|
|
if (_data.length == 0) {
|
|
|
- this.baseMessageLoading = false;
|
|
|
- return (this.currencyLoading = false);
|
|
|
+ return this.insertBaseMessage().then(_=>{
|
|
|
+ this.getCurrencyAndBaseMessageData();
|
|
|
+ })
|
|
|
}
|
|
|
- let _bmData = _data[0];
|
|
|
+ let _bmData = _data.find(i=>i.tIndex==0);
|
|
|
// 基础信息
|
|
|
_bmData.jsonData = JSON.parse(_bmData.jsonData);
|
|
|
// 图片
|
|
|
- let _imageList = _data[1];
|
|
|
+ let _imageList = _data.find(i=>i.tIndex==1);
|
|
|
_imageList.jsonData = JSON.parse(_imageList.jsonData);
|
|
|
//通用分析
|
|
|
let currency = [];
|
|
@@ -619,11 +551,17 @@ export default {
|
|
|
this.dataList.push(...currency);
|
|
|
this.bmData = _bmData;
|
|
|
this.imageList = _imageList;
|
|
|
+ if(this.imageList.jsonData.fileList.length>0){
|
|
|
+ this.$emit("changeChatAreaAudioUrl",this.imageList.jsonData.fileList[0]);
|
|
|
+ }else{
|
|
|
+ this.$emit("changeChatAreaAudioUrl",{name:"",url:""});
|
|
|
+ }
|
|
|
this.baseMessageLoading = false;
|
|
|
this.currencyLoading = false;
|
|
|
});
|
|
|
},
|
|
|
getScienceData() {
|
|
|
+ if(!this.tid)return;
|
|
|
let pram = {
|
|
|
tid: this.tid,
|
|
|
// tid:'02',
|
|
@@ -650,6 +588,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
getExtendData() {
|
|
|
+ if(!this.tid)return;
|
|
|
let pram = {
|
|
|
tid: this.tid,
|
|
|
// tid:'02',
|
|
@@ -676,6 +615,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
getValueAddedData() {
|
|
|
+ if(!this.tid)return;
|
|
|
let pram = {
|
|
|
tid: this.tid,
|
|
|
// tid:'02',
|
|
@@ -709,57 +649,163 @@ export default {
|
|
|
this.getValueAddedData();
|
|
|
// this.getFileId();
|
|
|
},
|
|
|
- saveData(fn) {
|
|
|
+ saveData(data) {
|
|
|
+ return new Promise((resolve,reject)=>{
|
|
|
+ this.ajax.post(
|
|
|
+ "https://gpt4.cocorobo.cn/update_classroom_observation",
|
|
|
+ {
|
|
|
+ id: data.id,
|
|
|
+ json_data: JSON.stringify(data.jsonData),
|
|
|
+ }
|
|
|
+ ).then(res=>{
|
|
|
+ resolve();
|
|
|
+ })
|
|
|
+ })
|
|
|
// return;
|
|
|
- let saveDataList = [];
|
|
|
+ // let saveDataList = [];
|
|
|
|
|
|
- // 保存基础信息
|
|
|
- saveDataList.push({
|
|
|
- id: this.bmData.id,
|
|
|
- json_data: JSON.stringify(this.bmData.jsonData),
|
|
|
- });
|
|
|
+ // // 保存基础信息
|
|
|
+ // saveDataList.push({
|
|
|
+ // id: this.bmData.id,
|
|
|
+ // json_data: JSON.stringify(this.bmData.jsonData),
|
|
|
+ // });
|
|
|
|
|
|
- // 所有分析
|
|
|
- this.dataList.forEach((i1) => {
|
|
|
- i1.forEach((i2) => {
|
|
|
- saveDataList.push({
|
|
|
- id: i2.id,
|
|
|
- json_data: JSON.stringify(i2.jsonData),
|
|
|
- });
|
|
|
- });
|
|
|
- });
|
|
|
- let promises = [];
|
|
|
- saveDataList.forEach((i) => {
|
|
|
- promises.push(
|
|
|
- new Promise((resolve) => {
|
|
|
- let pram = {
|
|
|
- id: i.id,
|
|
|
- json_data: i.json_data,
|
|
|
- };
|
|
|
- this.ajax
|
|
|
- .post(
|
|
|
- "https://gpt4.cocorobo.cn/update_classroom_observation",
|
|
|
- pram
|
|
|
- )
|
|
|
- .then((res) => {
|
|
|
- console.log(res);
|
|
|
- resolve();
|
|
|
- });
|
|
|
- })
|
|
|
- );
|
|
|
- });
|
|
|
+ // // 所有分析
|
|
|
+ // this.dataList.forEach((i1) => {
|
|
|
+ // i1.forEach((i2) => {
|
|
|
+ // saveDataList.push({
|
|
|
+ // id: i2.id,
|
|
|
+ // json_data: JSON.stringify(i2.jsonData),
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ // let promises = [];
|
|
|
+ // saveDataList.forEach((i) => {
|
|
|
+ // promises.push(
|
|
|
+ // new Promise((resolve) => {
|
|
|
+ // let pram = {
|
|
|
+ // id: i.id,
|
|
|
+ // json_data: i.json_data,
|
|
|
+ // };
|
|
|
+ // this.ajax
|
|
|
+ // .post(
|
|
|
+ // "https://gpt4.cocorobo.cn/update_classroom_observation",
|
|
|
+ // pram
|
|
|
+ // )
|
|
|
+ // .then((res) => {
|
|
|
+ // console.log(res);
|
|
|
+ // resolve();
|
|
|
+ // });
|
|
|
+ // })
|
|
|
+ // );
|
|
|
+ // });
|
|
|
|
|
|
- Promise.all(promises).then((res) => {
|
|
|
- this.$message.success("保存成功");
|
|
|
- fn ? fn() : "";
|
|
|
+ // Promise.all(promises).then((res) => {
|
|
|
+ // this.$message.success("保存成功");
|
|
|
+ // fn ? fn() : "";
|
|
|
+ // });
|
|
|
+ },
|
|
|
+ saveBaseData(){
|
|
|
+ this.bmData.json_data = JSON.stringify(this.bmData.jsonData);
|
|
|
+ this.saveData(this.bmData)
|
|
|
+ },
|
|
|
+ saveBaseImage(newImage){
|
|
|
+ if(this.imageList.jsonData.fileList1.length==0){
|
|
|
+ this.imageList.jsonData.fileList1.push(newImage);
|
|
|
+ }else if(this.imageList.jsonData.fileList2.length==0){
|
|
|
+ this.imageList.jsonData.fileList2.push(newImage)
|
|
|
+ }else if(this.imageList.jsonData.fileList3.length==0){
|
|
|
+ this.imageList.jsonData.fileList3.push(newImage)
|
|
|
+ }else{
|
|
|
+ this.$message.error("最多只能上传3张图片");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.imageList.json_data = JSON.stringify(this.imageList.jsonData);
|
|
|
+ this.saveData(this.imageList);
|
|
|
+ },
|
|
|
+ delBaseImageList(key){
|
|
|
+ this.imageList.jsonData[key] = [];
|
|
|
+ this.imageList.json_data = JSON.stringify(this.imageList.jsonData);
|
|
|
+ this.saveData(this.imageList).then(res=>{
|
|
|
+ this.$message.success("删除图片成功")
|
|
|
});
|
|
|
},
|
|
|
+ // 切换录音文件
|
|
|
+ changeAudioUrl(data){
|
|
|
+ this.imageList.jsonData.fileList = [];
|
|
|
+ let audio = {
|
|
|
+ name:data.key,
|
|
|
+ status:"success",
|
|
|
+ uid:"1",
|
|
|
+ url:data.Location
|
|
|
+ }
|
|
|
+ this.imageList.jsonData.fileList.push(audio)
|
|
|
+ this.saveData(this.imageList).then(res=>{
|
|
|
+ this.$message.success("更换录文件成功");
|
|
|
+ this.$emit("changeChatAreaAudioUrl",audio);
|
|
|
+ })
|
|
|
+ },
|
|
|
getReport() {
|
|
|
this.$refs.analysis0.getReport();
|
|
|
this.$refs.analysis1.getReport();
|
|
|
this.$refs.analysis2.getReport();
|
|
|
this.$refs.analysis3.getReport();
|
|
|
},
|
|
|
+ insertBaseMessage() {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ // 添加基础信息
|
|
|
+ let params = {
|
|
|
+ index: "0",
|
|
|
+ json_data: JSON.stringify({
|
|
|
+ courseName: "",
|
|
|
+ studentNum: "0",
|
|
|
+ subject: "",
|
|
|
+ textbook: "",
|
|
|
+ classroom_resources: "",
|
|
|
+ activity_structure: "",
|
|
|
+ activity_methods: "",
|
|
|
+ name: "",
|
|
|
+ }),
|
|
|
+ tid: this.tid,
|
|
|
+ type: "0",
|
|
|
+ };
|
|
|
+ // 添加课堂图片
|
|
|
+ let params2 = {
|
|
|
+ index: "1",
|
|
|
+ tid: this.tid,
|
|
|
+ type: "0",
|
|
|
+ json_data: JSON.stringify({
|
|
|
+ fileList: [],
|
|
|
+ name: "课堂记录",
|
|
|
+ fileList1: [],
|
|
|
+ fileList2: [],
|
|
|
+ fileList3: [],
|
|
|
+ }),
|
|
|
+ };
|
|
|
+ this.ajax
|
|
|
+ .post("https://gpt4.cocorobo.cn/insert_classroom_observation", params)
|
|
|
+ .then((res) => {
|
|
|
+ let _data = res.data.FunctionResponse;
|
|
|
+ if (_data.message && _data.message == "创建成功") {
|
|
|
+ this.ajax
|
|
|
+ .post(
|
|
|
+ "https://gpt4.cocorobo.cn/insert_classroom_observation",
|
|
|
+ params2
|
|
|
+ )
|
|
|
+ .then((res2) => {
|
|
|
+ let _data2 = res2.data.FunctionResponse;
|
|
|
+ if (_data2.message && _data2.message == "创建成功") {
|
|
|
+ } else {
|
|
|
+ this.$message.error("创建课堂图片失败");
|
|
|
+ }
|
|
|
+ resolve();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message.error("创建基础信息失败");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getData();
|