|
@@ -751,6 +751,7 @@ export default {
|
|
|
//按顺序处理任务
|
|
|
let _step = _stepList[i];
|
|
|
console.log(_step);
|
|
|
+ if(!nowDoTaskId.includes(_startData.id))break;
|
|
|
if (_step.status === "1") continue;
|
|
|
if (_step.type === "uploadFile") continue;
|
|
|
if (_step.type === "getVideoVoice") {
|
|
@@ -761,6 +762,7 @@ export default {
|
|
|
).jsonData.steps = _stepList;
|
|
|
let _fileData = _startData.jsonData.fileData;
|
|
|
let audioFile = await this.getVideoToVoiceAndUploadMixin(_fileData);
|
|
|
+ if(!nowDoTaskId.includes(_startData.id))break;
|
|
|
_startData.jsonData.fileData.videoUrl = _fileData.url;
|
|
|
_startData.jsonData.fileData.fileObj = audioFile.fileObj;
|
|
|
_startData.jsonData.fileData.url = audioFile.audioUrl.Location;
|
|
@@ -794,6 +796,7 @@ export default {
|
|
|
i => i.id === _startData.id
|
|
|
).jsonData.steps = _stepList;
|
|
|
let { editorBarData } = await this.getTextContentMixin(fileData);
|
|
|
+ if(!nowDoTaskId.includes(_startData.id))break;
|
|
|
this.dataList.find(
|
|
|
i => i.id === _startData.id
|
|
|
).jsonData.baseMessage.editorBarData = editorBarData;
|
|
@@ -893,7 +896,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
let { editorBarData} = await this.automaticCodingMixin({ tableList: _tableList});
|
|
|
-
|
|
|
+ if(!nowDoTaskId.includes(_startData.id))break;
|
|
|
|
|
|
_stepList[i].status = "1";
|
|
|
|
|
@@ -933,6 +936,7 @@ export default {
|
|
|
).jsonData.steps = _stepList;
|
|
|
let _fileData = _startData.jsonData.baseMessage.editorBarData;
|
|
|
let { fileId } = await this.getFileIdMixin(_fileData.url);
|
|
|
+ if(!nowDoTaskId.includes(_startData.id))break;
|
|
|
this.dataList.find(
|
|
|
i => i.id === _startData.id
|
|
|
).jsonData.file_ids = fileId;
|
|
@@ -1024,6 +1028,7 @@ export default {
|
|
|
|
|
|
await Promise.all(promises).then(() => {
|
|
|
console.log(`${_startData.id}:已完成分析获取`);
|
|
|
+ if(!nowDoTaskId.includes(_startData.id))return;
|
|
|
console.log("data👉",JSON.parse(JSON.stringify(_startData)))
|
|
|
console.log(_startData.jsonData.analysisList);
|
|
|
_stepList[i].status = "1";
|
|
@@ -1033,6 +1038,7 @@ export default {
|
|
|
this.dataList.find(
|
|
|
i => i.id === _startData.id
|
|
|
).jsonData = _startData.jsonData
|
|
|
+
|
|
|
this.updateTask(_startData.id);
|
|
|
_startData.jsonData = JSON.parse(
|
|
|
JSON.stringify(
|
|
@@ -1040,6 +1046,7 @@ export default {
|
|
|
)
|
|
|
);
|
|
|
});
|
|
|
+ if(!nowDoTaskId.includes(_startData.id))break;
|
|
|
} else if (_step.type === "createClass") {
|
|
|
//创建课堂
|
|
|
_stepList[i].status = "2";
|
|
@@ -1048,9 +1055,10 @@ export default {
|
|
|
).jsonData.steps = _stepList;
|
|
|
|
|
|
//创建课堂 赋值好fileid 替换创建后课堂的基础数据 继续下一个任务
|
|
|
-
|
|
|
let newOption = await this.createClassMixin(_startData.jsonData);
|
|
|
|
|
|
+ if(!nowDoTaskId.includes(_startData.id))break;
|
|
|
+
|
|
|
this.$emit("addNewCourseOption", newOption.data);
|
|
|
this.dataList.find(i => i.id === _startData.id).jsonData.createId =
|
|
|
newOption.tid;
|
|
@@ -1071,81 +1079,6 @@ export default {
|
|
|
let id = this.dataList.find(i => i.status == "0").id;
|
|
|
this.startTask(id);
|
|
|
}
|
|
|
-
|
|
|
- // let _analysisList = _startData.jsonData.analysisList;
|
|
|
- // let createJson = _analysisList.map(i=>{return {
|
|
|
- // jsonData: i.jsonData,
|
|
|
- // type: i.Type,
|
|
|
- // index: i.tIndex
|
|
|
- // }})
|
|
|
- // var OpenCC = require("opencc-js");
|
|
|
- // let converter = OpenCC.Converter({
|
|
|
- // from: "hk",
|
|
|
- // to: "cn"
|
|
|
- // });
|
|
|
- // createJson = createJson.filter(
|
|
|
- // i =>
|
|
|
- // !i.isOtherData &&
|
|
|
- // converter(i.jsonData.name) != converter("词频词汇分析")
|
|
|
- // );
|
|
|
- // let params = {
|
|
|
- // tid: uuidv4(),
|
|
|
- // userid: this.userId,
|
|
|
- // template: createJson
|
|
|
- // }
|
|
|
- // this.ajax
|
|
|
- // .post(
|
|
|
- // "https://gpt4.cocorobo.cn/insert_classroom_observation_template",
|
|
|
- // params
|
|
|
- // )
|
|
|
- // .then(res => {
|
|
|
- // let _data = res.data.FunctionResponse;
|
|
|
- // if (converter(_data.message) == converter("创建成功")) {
|
|
|
- // this.ajax
|
|
|
- // .post("https://gpt4.cocorobo.cn/insert_classroom_observation", {
|
|
|
- // tid: params.tid,
|
|
|
- // type: 10,
|
|
|
- // index: 0,
|
|
|
- // json_data: JSON.stringify({ file_ids: _startData.jsonData.file_ids }),
|
|
|
- // userid: this.userId
|
|
|
- // })
|
|
|
- // .then(res2 => {
|
|
|
- // let _data2 = res2.data.FunctionResponse;
|
|
|
- // if (converter(_data2.message) == converter("创建成功")) {
|
|
|
- // let newOption = {id:uuidv4(),label:_startData.jsonData.baseMessage.name,value:params.tid}
|
|
|
- // console.log(newOption);
|
|
|
-
|
|
|
- // this.$emit("addNewCourseOption",newOption);
|
|
|
- // _stepList[i].status = "1";
|
|
|
- // this.dataList.find(
|
|
|
- // i => i.id === _startData.id
|
|
|
- // ).jsonData.steps = _stepList;
|
|
|
- // this.dataList.find(
|
|
|
- // i => i.id === _startData.id
|
|
|
- // ).status = "2";
|
|
|
- // this.updateTask(_startData.id);
|
|
|
- // _startData.jsonData = JSON.parse(
|
|
|
- // JSON.stringify(
|
|
|
- // this.dataList.find(i => i.id === _startData.id).jsonData
|
|
|
- // )
|
|
|
- // );
|
|
|
- // console.log(`${_startData.id}:已创建课堂`);
|
|
|
-
|
|
|
- // // 查看是否有需要开启的任务
|
|
|
- // if(this.dataList.find(i=>i.status=='0')){
|
|
|
- // let id = this.dataList.find(i=>i.status=='0').id;
|
|
|
- // this.startTask(id);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }).catch(err=>{
|
|
|
- // console.log("存储fileId失败")
|
|
|
- // console.log(err)
|
|
|
- // })
|
|
|
- // }
|
|
|
- // }).catch(err=>{
|
|
|
- // console.log("创建课堂失败")
|
|
|
- // console.log(err)
|
|
|
- // })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1156,6 +1089,7 @@ export default {
|
|
|
if (_waitTask) {
|
|
|
//暂停这个任务,
|
|
|
this.dataList.find(i => i.id === id).status = "0";
|
|
|
+ this.nowDoTaskId = this.nowDoTaskId.filter(i=>i!==id);
|
|
|
// 开始另一个任务
|
|
|
this.startTask(_waitTask.id);
|
|
|
} else {
|
|
@@ -1169,6 +1103,7 @@ export default {
|
|
|
if (_waitTask) {
|
|
|
//停止这个任务,
|
|
|
this.dataList.find(i => i.id === id).status = "3";
|
|
|
+ this.nowDoTaskId = this.nowDoTaskId.filter(i=>i!==id);
|
|
|
// 开始另一个任务
|
|
|
this.startTask(_waitTask.id);
|
|
|
} else {
|