|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="messageArea">
|
|
|
+ <div class="messageArea" v-loading="loading">
|
|
|
<div class="m-operation">
|
|
|
<div class="m-o-switch">
|
|
|
<span class="m-o-s-text" @click.stop="changeShowBrief(!showBrief)"
|
|
@@ -18,27 +18,40 @@
|
|
|
<div class="m-o-btn" @click.stop="saveAsTemplate()">另存为模板</div>
|
|
|
</div>
|
|
|
<div class="ma-main">
|
|
|
- <baseMessage :data="bmData.jsonData" v-loading="currencyLoading"/>
|
|
|
+ <baseMessage
|
|
|
+ :data="bmData.jsonData"
|
|
|
+ :imageList="imageList.jsonData"
|
|
|
+ v-loading="currencyLoading"
|
|
|
+ />
|
|
|
|
|
|
<currencyAnalysis
|
|
|
@updateMessage="updateMessage"
|
|
|
@delItem="delAnalysisItem"
|
|
|
- :analysisItemList="dataList[0]"
|
|
|
+ @editItem="editAnalysisItem"
|
|
|
+ :analysisItemList="dataList.filter((i) => i.Type === 0)"
|
|
|
+ :tid="tid"
|
|
|
v-loading="currencyLoading"
|
|
|
+ ref="currencyAnalysisRef"
|
|
|
/>
|
|
|
|
|
|
<scienceAnalysis
|
|
|
@updateMessage="updateMessage"
|
|
|
@delItem="delAnalysisItem"
|
|
|
- :analysisItemList="dataList[1]"
|
|
|
+ @editItem="editAnalysisItem"
|
|
|
+ :analysisItemList="dataList.filter((i) => i.Type === 1)"
|
|
|
+ :tid="tid"
|
|
|
v-loading="scienceLoading"
|
|
|
+ ref="scienceAnalysisRef"
|
|
|
/>
|
|
|
|
|
|
<extendAnalysis
|
|
|
@updateMessage="updateMessage"
|
|
|
@delItem="delAnalysisItem"
|
|
|
- :analysisItemList="dataList[2]"
|
|
|
+ @editItem="editAnalysisItem"
|
|
|
+ :analysisItemList="dataList.filter((i) => i.Type === 2)"
|
|
|
+ :tid="tid"
|
|
|
v-loading="extendLoading"
|
|
|
+ ref="extendAnalysisRef"
|
|
|
/>
|
|
|
<!-- <div style="height: 10000px;"></div> -->
|
|
|
</div>
|
|
@@ -145,26 +158,26 @@ export default {
|
|
|
extendAnalysis,
|
|
|
analysisItem,
|
|
|
},
|
|
|
- props:{
|
|
|
- tid:{
|
|
|
- type:String,
|
|
|
- default:''
|
|
|
- }
|
|
|
+ props: {
|
|
|
+ tid: {
|
|
|
+ type: String,
|
|
|
+ default: "",
|
|
|
+ },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
showBrief: true, //是否显示模块简介
|
|
|
dialogVisible: false,
|
|
|
tagIndex: 0,
|
|
|
- loading: "",
|
|
|
- currencyLoading:false,
|
|
|
- scienceLoading:false,
|
|
|
- extendLoading:false,
|
|
|
- input2:"",
|
|
|
+ loading: false,
|
|
|
+ currencyLoading: false,
|
|
|
+ scienceLoading: false,
|
|
|
+ extendLoading: false,
|
|
|
+ input2: "",
|
|
|
dialogTagList: [
|
|
|
- { id: 1, name: "通用课堂分析" },
|
|
|
- { id: 2, name: "科学课堂分析" },
|
|
|
- { id: 3, name: "扩展分析" },
|
|
|
+ { id: 0, name: "通用课堂分析" },
|
|
|
+ { id: 1, name: "科学课堂分析" },
|
|
|
+ { id: 2, name: "扩展分析" },
|
|
|
],
|
|
|
dialogTagDataList: [
|
|
|
[
|
|
@@ -809,24 +822,30 @@ BSCS 5E教学模型是一种广泛应用于科学教育的教学策略,它鼓
|
|
|
},
|
|
|
],
|
|
|
],
|
|
|
- bmData:{},
|
|
|
- dataList: [
|
|
|
- [
|
|
|
- //通用课堂分析
|
|
|
- ],
|
|
|
- [
|
|
|
- //学科课堂分析
|
|
|
- ],
|
|
|
- [
|
|
|
- //扩展分析
|
|
|
- ],
|
|
|
- ],
|
|
|
+ bmData: {},
|
|
|
+ dataList: [],
|
|
|
+ imageList: {},
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
- delAnalysisItem(tag,index){
|
|
|
- this.dataList[tag].splice(index,1);
|
|
|
- this.$message.success("删除成功")
|
|
|
+ delAnalysisItem(id) {
|
|
|
+ let _index = this.dataList.findIndex((i) => i.id == id);
|
|
|
+ if (_index > -1) {
|
|
|
+ this.dataList.splice(_index, 1);
|
|
|
+ this.$message.success("删除成功");
|
|
|
+ } else {
|
|
|
+ this.$message.error("删除失败");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ editAnalysisItem(id, _data) {
|
|
|
+ let _index = this.dataList.findIndex((i) => i.id == id);
|
|
|
+ if (_index > -1) {
|
|
|
+ this.dataList[_index] = _data;
|
|
|
+ this.$forceUpdate();
|
|
|
+ this.$message.success("执行成功");
|
|
|
+ } else {
|
|
|
+ this.$message.info("执行错误");
|
|
|
+ }
|
|
|
},
|
|
|
updateMessage(val) {
|
|
|
// console.log(val);
|
|
@@ -853,133 +872,274 @@ BSCS 5E教学模型是一种广泛应用于科学教育的教学策略,它鼓
|
|
|
this.$message.info("另存为模板");
|
|
|
},
|
|
|
addAnalysisItem(_data) {
|
|
|
- this.dataList[this.tagIndex].push({
|
|
|
- title: _data.title,
|
|
|
- brief: _data.brief,
|
|
|
- cueWord: _data.cueWord,
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+
|
|
|
+ this.loading = true;
|
|
|
+ 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: 2,
|
|
|
+ },
|
|
|
+ "RST模型":{
|
|
|
+ value:"e649112e-0150-11ef-aaca-12e77c4cb76b",
|
|
|
+ type:2,
|
|
|
+ },
|
|
|
+ "RTOP模型":{
|
|
|
+ value:"68265b18-0151-11ef-aaca-12e77c4cb76b",
|
|
|
+ type:2,
|
|
|
+ },
|
|
|
+ "课堂质量评价":{
|
|
|
+ value:"25e53379-0152-11ef-aaca-12e77c4cb76b",
|
|
|
+ type:0,
|
|
|
+ },
|
|
|
+ "scop课堂观察":{
|
|
|
+ value:"d0c76d35-0152-11ef-aaca-12e77c4cb76b",
|
|
|
+ type:2,
|
|
|
+ },
|
|
|
+ "rtop课堂观察":{
|
|
|
+ value:"2ace7ff6-0154-11ef-aaca-12e77c4cb76b",
|
|
|
+ type:2
|
|
|
+ }
|
|
|
+ };
|
|
|
+ let file_ids = {
|
|
|
+ '03':["file-ABGckMn6mYmZSsmsAkSf9w1j"],
|
|
|
+ '04':["file-o5Z4P3oLqoADwVbCv2waEEZf"],
|
|
|
+ };
|
|
|
+ let parm = {
|
|
|
+ assistant_id: assistant_id[_data.title]
|
|
|
+ ? assistant_id[_data.title].value
|
|
|
+ : null,
|
|
|
+ message: "请帮我根据要求完整的分析,输出请按照要求。",
|
|
|
+ session_name: "获取data",
|
|
|
+ userId: "1cf9dc4b-d95f-11ea-af4c-52540005ab01",
|
|
|
+ file_ids: file_ids[this.tid],
|
|
|
+ };
|
|
|
+
|
|
|
+ if (!parm.assistant_id) {
|
|
|
+ this.loading = false;
|
|
|
+ resolve();
|
|
|
+ return this.$message.error("未找到对应的AI助手");
|
|
|
+ }
|
|
|
+ // console.log(parm);
|
|
|
+ // this.loading = false;
|
|
|
+ // return 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(`${_data.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(`${_data.title}无法生成`)
|
|
|
+ this.loading = false;
|
|
|
+ resolve();
|
|
|
+ });
|
|
|
});
|
|
|
- this.dialogVisible = false;
|
|
|
- // this.loading = this.tagIndex;
|
|
|
- // setTimeout(()=>this.loading = '',4000)
|
|
|
},
|
|
|
- getCurrencyAndBaseMessageData(){
|
|
|
+ getCurrencyAndBaseMessageData() {
|
|
|
let pram = {
|
|
|
- // tid:this.tid,
|
|
|
- tid:'01',
|
|
|
- type:'0'
|
|
|
- }
|
|
|
+ tid: this.tid,
|
|
|
+ // tid:'02',
|
|
|
+ type: "0",
|
|
|
+ };
|
|
|
this.currencyLoading = true;
|
|
|
- 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):[]
|
|
|
- if(_data.length==0){
|
|
|
- return this.currencyLoading = false;
|
|
|
- }
|
|
|
- let _bmData = _data[0]
|
|
|
- // 基础信息
|
|
|
- _bmData.jsonData = JSON.parse(_bmData.jsonData)
|
|
|
- // 图片
|
|
|
- let imageList = _data[1]
|
|
|
- //通用分析
|
|
|
- let currency = []
|
|
|
- for(let i = 2;i<_data.length;i++){
|
|
|
+ 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)
|
|
|
+ : [];
|
|
|
+ if (_data.length == 0) {
|
|
|
+ return (this.currencyLoading = false);
|
|
|
+ }
|
|
|
+ let _bmData = _data[0];
|
|
|
+ // 基础信息
|
|
|
+ _bmData.jsonData = JSON.parse(_bmData.jsonData);
|
|
|
+ // 图片
|
|
|
+ let _imageList = _data[1];
|
|
|
+ _imageList.jsonData = JSON.parse(_imageList.jsonData);
|
|
|
+ //通用分析
|
|
|
+ let currency = [];
|
|
|
+ for (let i = 2; i < _data.length; i++) {
|
|
|
let _currency = _data[i];
|
|
|
- _currency.jsonData = JSON.parse(_currency.jsonData)
|
|
|
- currency.push(_currency)
|
|
|
- }
|
|
|
+ _currency.jsonData = JSON.parse(_currency.jsonData);
|
|
|
+ currency.push(_currency);
|
|
|
+ }
|
|
|
|
|
|
- this.dataList[0].push(...currency)
|
|
|
- this.bmData = _bmData;
|
|
|
- this.currencyLoading = false;
|
|
|
- })
|
|
|
+ this.dataList.push(...currency);
|
|
|
+ this.bmData = _bmData;
|
|
|
+ this.imageList = _imageList;
|
|
|
+ this.currencyLoading = false;
|
|
|
+ });
|
|
|
},
|
|
|
- getScienceData(){
|
|
|
+ getScienceData() {
|
|
|
let pram = {
|
|
|
- // tid:this.tid,
|
|
|
- tid:'01',
|
|
|
- type:'1'
|
|
|
- }
|
|
|
+ tid: this.tid,
|
|
|
+ // tid:'02',
|
|
|
+ type: "1",
|
|
|
+ };
|
|
|
this.scienceLoading = true;
|
|
|
- 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):[]
|
|
|
- if(_data.length==0){
|
|
|
- return this.scienceLoading = false;
|
|
|
- }
|
|
|
- let science = []
|
|
|
- for(let i = 0;i<_data.length;i++){
|
|
|
+ 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)
|
|
|
+ : [];
|
|
|
+ if (_data.length == 0) {
|
|
|
+ return (this.scienceLoading = false);
|
|
|
+ }
|
|
|
+ let science = [];
|
|
|
+ for (let i = 0; i < _data.length; i++) {
|
|
|
let _science = _data[i];
|
|
|
- _science.jsonData = JSON.parse(_science.jsonData)
|
|
|
- science.push(_science)
|
|
|
- }
|
|
|
- this.dataList[1].push(...science)
|
|
|
- this.scienceLoading = false;
|
|
|
- })
|
|
|
+ _science.jsonData = JSON.parse(_science.jsonData);
|
|
|
+ science.push(_science);
|
|
|
+ }
|
|
|
+ this.dataList.push(...science);
|
|
|
+ this.scienceLoading = false;
|
|
|
+ });
|
|
|
},
|
|
|
- getExtendData(){
|
|
|
+ getExtendData() {
|
|
|
let pram = {
|
|
|
- // tid:this.tid,
|
|
|
- tid:'01',
|
|
|
- type:'2'
|
|
|
- }
|
|
|
+ tid: this.tid,
|
|
|
+ // tid:'02',
|
|
|
+ type: "2",
|
|
|
+ };
|
|
|
this.extendLoading = true;
|
|
|
- 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):[]
|
|
|
- if(_data.length==0){
|
|
|
- return this.extendLoading = false;
|
|
|
- }
|
|
|
- let extent = []
|
|
|
- for(let i = 0;i<_data.length;i++){
|
|
|
+ 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)
|
|
|
+ : [];
|
|
|
+ if (_data.length == 0) {
|
|
|
+ return (this.extendLoading = false);
|
|
|
+ }
|
|
|
+ let extent = [];
|
|
|
+ for (let i = 0; i < _data.length; i++) {
|
|
|
let _extent = _data[i];
|
|
|
- _extent.jsonData = JSON.parse(_extent.jsonData)
|
|
|
- extent.push(_extent)
|
|
|
- }
|
|
|
- this.dataList[2].push(...extent)
|
|
|
- this.extendLoading = false;
|
|
|
- })
|
|
|
+ _extent.jsonData = JSON.parse(_extent.jsonData);
|
|
|
+ extent.push(_extent);
|
|
|
+ }
|
|
|
+ this.dataList.push(...extent);
|
|
|
+ this.extendLoading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getData() {
|
|
|
+ this.dataList = [];
|
|
|
+ this.getCurrencyAndBaseMessageData();
|
|
|
+ this.getScienceData();
|
|
|
+ this.getExtendData();
|
|
|
},
|
|
|
- saveData(fn){
|
|
|
- let saveDataList = []
|
|
|
+ saveData(fn) {
|
|
|
+ return;
|
|
|
+ let saveDataList = [];
|
|
|
|
|
|
// 保存基础信息
|
|
|
saveDataList.push({
|
|
|
- id:this.bmData.id,
|
|
|
- json_data:JSON.stringify(this.bmData.jsonData),
|
|
|
- })
|
|
|
+ id: this.bmData.id,
|
|
|
+ json_data: JSON.stringify(this.bmData.jsonData),
|
|
|
+ });
|
|
|
|
|
|
// 所有分析
|
|
|
- this.dataList.forEach(i1=>{
|
|
|
- i1.forEach(i2=>{
|
|
|
+ this.dataList.forEach((i1) => {
|
|
|
+ i1.forEach((i2) => {
|
|
|
saveDataList.push({
|
|
|
- id:i2.id,
|
|
|
- json_data:JSON.stringify(i2.jsonData),
|
|
|
- })
|
|
|
- })
|
|
|
- })
|
|
|
+ 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();
|
|
|
+ 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() : "";
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getData();
|
|
|
},
|
|
|
- mounted(){
|
|
|
- console.log(this.tid)
|
|
|
- this.getCurrencyAndBaseMessageData()
|
|
|
- this.getScienceData()
|
|
|
- this.getExtendData()
|
|
|
- }
|
|
|
};
|
|
|
</script>
|
|
|
|