|
@@ -849,15 +849,48 @@ export default {
|
|
|
//按顺序处理任务
|
|
|
let _step = _stepList[i];
|
|
|
console.log(_step);
|
|
|
- if (!this.nowDoTaskId.includes(_startData.id)) break;
|
|
|
- if (_step.status === "1") continue;
|
|
|
+ if (!this.nowDoTaskId.includes(_startData.id)){
|
|
|
+ if (
|
|
|
+ this.dataList.find(i => i.id === _startData.id).status == "1"
|
|
|
+ ) {
|
|
|
+ this.dataList.find(i => i.id === _startData.id).status = "0";
|
|
|
+ if (this.dataList.find(i => i.status == "0")) {
|
|
|
+ let id = this.dataList.find(i => i.status == "0").id;
|
|
|
+ this.startTask(id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ };
|
|
|
+ if (_step.status == "1") {
|
|
|
+ if (_step.type == "createClass") {
|
|
|
+ if (
|
|
|
+ this.dataList.find(i => i.id === _startData.id).status == "1"
|
|
|
+ ) {
|
|
|
+ this.dataList.find(i => i.id === _startData.id).status = "2";
|
|
|
+ this.updateTask(_startData.id);
|
|
|
+ if (this.dataList.find(i => i.status == "0")) {
|
|
|
+ let id = this.dataList.find(i => i.status == "0").id;
|
|
|
+ this.startTask(id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ } else {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
if (_step.type === "uploadFile") continue;
|
|
|
if (_step.type === "getVideoVoice") {
|
|
|
//视频提取音频
|
|
|
_stepList[i].status = "2";
|
|
|
+ _stepList[i].startTime =
|
|
|
+ new Date().toLocaleDateString().replaceAll("/", "-") +
|
|
|
+ " " +
|
|
|
+ new Date().toLocaleTimeString();
|
|
|
+
|
|
|
this.dataList.find(
|
|
|
i => i.id === _startData.id
|
|
|
).jsonData.steps = _stepList;
|
|
|
+ this.$forceUpdate()
|
|
|
let _fileData = _startData.jsonData.fileData;
|
|
|
let audioFile = await this.getVideoToVoiceAndUploadMixin(_fileData);
|
|
|
if (audioFile.data == 3) {
|
|
@@ -869,6 +902,10 @@ export default {
|
|
|
};
|
|
|
|
|
|
this.dataList.find(i => i.id === _startData.id).status = "3";
|
|
|
+ if (this.dataList.find(i => i.status == "0")) {
|
|
|
+ let id = this.dataList.find(i => i.status == "0").id;
|
|
|
+ this.startTask(id);
|
|
|
+ }
|
|
|
break;
|
|
|
}
|
|
|
if (!this.nowDoTaskId.includes(_startData.id)) break;
|
|
@@ -901,9 +938,15 @@ export default {
|
|
|
if (fileData.type === "text/plain") {
|
|
|
//txt文件
|
|
|
_stepList[i].status = "2";
|
|
|
+ _stepList[i].startTime =
|
|
|
+ new Date().toLocaleDateString().replaceAll("/", "-") +
|
|
|
+ " " +
|
|
|
+ new Date().toLocaleTimeString();
|
|
|
+
|
|
|
this.dataList.find(
|
|
|
i => i.id === _startData.id
|
|
|
).jsonData.steps = _stepList;
|
|
|
+ this.$forceUpdate()
|
|
|
let { editorBarData } = await this.getTextContentMixin(fileData);
|
|
|
if (!this.nowDoTaskId.includes(_startData.id)) break;
|
|
|
this.dataList.find(
|
|
@@ -928,10 +971,15 @@ export default {
|
|
|
) {
|
|
|
//mp4与wav文件
|
|
|
_stepList[i].status = "2";
|
|
|
+ _stepList[i].startTime =
|
|
|
+ new Date().toLocaleDateString().replaceAll("/", "-") +
|
|
|
+ " " +
|
|
|
+ new Date().toLocaleTimeString();
|
|
|
+
|
|
|
this.dataList.find(
|
|
|
i => i.id === _startData.id
|
|
|
).jsonData.steps = _stepList;
|
|
|
-
|
|
|
+ this.$forceUpdate()
|
|
|
let _file = _startData.jsonData.fileData.fileObj;
|
|
|
if (!_file && JSON.stringify(_file) != "{}") {
|
|
|
let fileBody = await this.getFileBody(
|
|
@@ -954,15 +1002,28 @@ export default {
|
|
|
_file = _data.data;
|
|
|
} else {
|
|
|
console.log("报错👉", _data);
|
|
|
+ if (this.dataList.find(i => i.status == "0")) {
|
|
|
+ let id = this.dataList.find(i => i.status == "0").id;
|
|
|
+ this.startTask(id);
|
|
|
+ }
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
console.log("转录文件", _file);
|
|
|
|
|
|
let {
|
|
|
transcriptionContent,
|
|
|
- editorBarData
|
|
|
+ editorBarData,
|
|
|
+ data
|
|
|
} = await this.wavAudioToTextAndObjMixin(_file);
|
|
|
-
|
|
|
+ if (data === 1) {
|
|
|
+ //转录失败,直接退出
|
|
|
+ if (this.dataList.find(i => i.status == "0")) {
|
|
|
+ let id = this.dataList.find(i => i.status == "0").id;
|
|
|
+ this.startTask(id);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
this.dataList.find(
|
|
|
i => i.id === _startData.id
|
|
|
).jsonData.baseMessage.transcriptionData = transcriptionContent;
|
|
@@ -984,55 +1045,17 @@ export default {
|
|
|
}
|
|
|
} else if (_step.type === "automaticCoding") {
|
|
|
if (_startData.jsonData.automaticCoding) {
|
|
|
- // const fileData = _startData.jsonData.fileData;
|
|
|
- // if (fileData.type === "text/plain") {
|
|
|
- // _stepList[i].status = "2";
|
|
|
- // this.dataList.find(
|
|
|
- // i => i.id === _startData.id
|
|
|
- // ).jsonData.steps = _stepList;
|
|
|
- // //选择了字段编码
|
|
|
- // let _content =
|
|
|
- // _startData.jsonData.baseMessage.editorBarData.content;
|
|
|
- // let _tableList =
|
|
|
- // _startData.jsonData.baseMessage.editorBarData.table;
|
|
|
- // if (!_content) {
|
|
|
- // _content = await this.getFile(
|
|
|
- // _startData.jsonData.baseMessage.editorBarData.url
|
|
|
- // );
|
|
|
- // _content = _content.data;
|
|
|
- // this.dataList.find(
|
|
|
- // i => i.id === _startData.id
|
|
|
- // ).jsonData.baseMessage.editorBarData.content = _content;
|
|
|
- // }
|
|
|
-
|
|
|
- // if (!_tableList) {
|
|
|
- // let _result = [];
|
|
|
- // let _data = _content;
|
|
|
- // let _div = document.createElement("div");
|
|
|
- // _div.innerHTML = _data;
|
|
|
- // let _tableRows = _div.querySelectorAll(`table tbody tr`);
|
|
|
- // _tableRows.forEach((i, index) => {
|
|
|
- // if (index == 0) return;
|
|
|
- // let obj = {
|
|
|
- // index: i.cells[0].textContent,
|
|
|
- // startTime: i.cells[1].textContent,
|
|
|
- // endTime: i.cells[2].textContent,
|
|
|
- // value: i.cells[3].textContent,
|
|
|
- // time: i.cells[4].textContent,
|
|
|
- // role: i.cells[5] ? i.cells[5].textContent : "",
|
|
|
- // code: i.cells[6] ? i.cells[6].textContent : ""
|
|
|
- // };
|
|
|
- // _result.push(obj);
|
|
|
- // });
|
|
|
-
|
|
|
- // _tableList = _result;
|
|
|
- // }
|
|
|
- // } else {
|
|
|
const fileData = _startData.jsonData.fileData;
|
|
|
_stepList[i].status = "2";
|
|
|
+ _stepList[i].startTime =
|
|
|
+ new Date().toLocaleDateString().replaceAll("/", "-") +
|
|
|
+ " " +
|
|
|
+ new Date().toLocaleTimeString();
|
|
|
+
|
|
|
this.dataList.find(
|
|
|
i => i.id === _startData.id
|
|
|
).jsonData.steps = _stepList;
|
|
|
+ this.$forceUpdate()
|
|
|
//选择了字段编码
|
|
|
let _content =
|
|
|
_startData.jsonData.baseMessage.editorBarData.content;
|
|
@@ -1120,9 +1143,15 @@ export default {
|
|
|
} else if (_step.type === "getFileIds") {
|
|
|
//文件获取fileId
|
|
|
_stepList[i].status = "2";
|
|
|
+ _stepList[i].startTime =
|
|
|
+ new Date().toLocaleDateString().replaceAll("/", "-") +
|
|
|
+ " " +
|
|
|
+ new Date().toLocaleTimeString();
|
|
|
+
|
|
|
this.dataList.find(
|
|
|
i => i.id === _startData.id
|
|
|
).jsonData.steps = _stepList;
|
|
|
+ this.$forceUpdate()
|
|
|
let _fileData = _startData.jsonData.baseMessage.editorBarData;
|
|
|
let { fileId } = await this.getFileIdMixin(_fileData.url);
|
|
|
if (!this.nowDoTaskId.includes(_startData.id)) break;
|
|
@@ -1144,10 +1173,15 @@ export default {
|
|
|
} else if (_step.type == "getWordCloudMap") {
|
|
|
//文件获取fileId
|
|
|
_stepList[i].status = "2";
|
|
|
+ _stepList[i].startTime =
|
|
|
+ new Date().toLocaleDateString().replaceAll("/", "-") +
|
|
|
+ " " +
|
|
|
+ new Date().toLocaleTimeString();
|
|
|
+
|
|
|
this.dataList.find(
|
|
|
i => i.id === _startData.id
|
|
|
).jsonData.steps = _stepList;
|
|
|
-
|
|
|
+ this.$forceUpdate()
|
|
|
let _fileData = _startData.jsonData.baseMessage.editorBarData;
|
|
|
|
|
|
let _content = await this.getFile(_fileData.url);
|
|
@@ -1171,9 +1205,15 @@ export default {
|
|
|
} else if (_step.type === "generateReport") {
|
|
|
//生成报告
|
|
|
_stepList[i].status = "2";
|
|
|
+ _stepList[i].startTime =
|
|
|
+ new Date().toLocaleDateString().replaceAll("/", "-") +
|
|
|
+ " " +
|
|
|
+ new Date().toLocaleTimeString();
|
|
|
+
|
|
|
this.dataList.find(
|
|
|
i => i.id === _startData.id
|
|
|
).jsonData.steps = _stepList;
|
|
|
+ this.$forceUpdate()
|
|
|
let _analysisList = _startData.jsonData.analysisList;
|
|
|
|
|
|
let promises = [];
|
|
@@ -1186,6 +1226,7 @@ export default {
|
|
|
_content = _content.data;
|
|
|
_startData.jsonData.baseMessage.editorBarData.content = _content;
|
|
|
}
|
|
|
+ console.log(_analysisList.length)
|
|
|
promises = _analysisList.map((i, index) => {
|
|
|
return new Promise(async resolve => {
|
|
|
_startData.jsonData.analysisList[index].status = "default"; //默认状态
|
|
@@ -1197,7 +1238,7 @@ export default {
|
|
|
_startData.jsonData.analysisList[index].status
|
|
|
)
|
|
|
) {
|
|
|
- return resolve(_startData.jsonData.analysisList[index]);
|
|
|
+ return resolve();
|
|
|
}
|
|
|
if (_num >= _maxNum) {
|
|
|
_startData.jsonData.analysisList[index].status =
|
|
@@ -1225,8 +1266,9 @@ export default {
|
|
|
assistantData: _assistantData,
|
|
|
baseMessage: _startData.jsonData.baseMessage
|
|
|
});
|
|
|
- if (!this.nowDoTaskId.includes(_startData.id))
|
|
|
- return resolve();
|
|
|
+ console.log("👉xxx",data,index)
|
|
|
+
|
|
|
+ if (!this.nowDoTaskId.includes(_startData.id)) return resolve();
|
|
|
if (data.data == 1) {
|
|
|
if (_num < _maxNum) {
|
|
|
//重试
|
|
@@ -1279,10 +1321,15 @@ export default {
|
|
|
} else if (_step.type === "createClass") {
|
|
|
//创建课堂
|
|
|
_stepList[i].status = "2";
|
|
|
+ _stepList[i].startTime =
|
|
|
+ new Date().toLocaleDateString().replaceAll("/", "-") +
|
|
|
+ " " +
|
|
|
+ new Date().toLocaleTimeString();
|
|
|
+
|
|
|
this.dataList.find(
|
|
|
i => i.id === _startData.id
|
|
|
).jsonData.steps = _stepList;
|
|
|
-
|
|
|
+ this.$forceUpdate()
|
|
|
//创建课堂 赋值好fileid 替换创建后课堂的基础数据 继续下一个任务
|
|
|
let newOption = await this.createClassMixin(_startData.jsonData);
|
|
|
|
|
@@ -1319,6 +1366,16 @@ export default {
|
|
|
let id = this.dataList.find(i => i.status == "0").id;
|
|
|
this.startTask(id);
|
|
|
}
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log(this.dataList.find(i => i.id === _startData.id));
|
|
|
+ if (this.dataList.find(i => i.id === _startData.id).status == "1") {
|
|
|
+ this.dataList.find(i => i.id === _startData.id).status = "0";
|
|
|
+ if (this.dataList.find(i => i.status == "0")) {
|
|
|
+ let id = this.dataList.find(i => i.status == "0").id;
|
|
|
+ this.startTask(id);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1487,7 +1544,7 @@ export default {
|
|
|
// console.log("err", err);
|
|
|
// });
|
|
|
},
|
|
|
- async regenerateTheReport(){
|
|
|
+ async regenerateTheReport() {
|
|
|
let _generateList = this.dataList.filter(
|
|
|
i =>
|
|
|
this.selectList.includes(i.id) &&
|
|
@@ -1498,24 +1555,28 @@ export default {
|
|
|
i.status == "2"
|
|
|
);
|
|
|
|
|
|
- if(_generateList.length<=0)return this.$message.info("请先选择已经完成的任务列表");
|
|
|
+ if (_generateList.length <= 0)
|
|
|
+ return this.$message.info("请先选择已经完成的任务列表");
|
|
|
|
|
|
this.$confirm("确认要重新生成课堂观察报告吗?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
|
- _generateList.forEach(i=>{
|
|
|
- this.dataList.find(i2=>i2.id==i.id).status = "0";
|
|
|
- this.dataList.find(i2 => i2.id === i.id).jsonData.steps.find(i2 => i2.type == "generateReport").status ="0";
|
|
|
- })
|
|
|
+ _generateList.forEach(i => {
|
|
|
+ this.dataList.find(i2 => i2.id == i.id).status = "0";
|
|
|
+ this.dataList
|
|
|
+ .find(i2 => i2.id === i.id)
|
|
|
+ .jsonData.steps.find(i2 => i2.type == "generateReport").status =
|
|
|
+ "0";
|
|
|
+ });
|
|
|
|
|
|
if (!this.dataList.some(i => i.status == "1")) {
|
|
|
this.startTask(_generateList[0].id);
|
|
|
}
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
mounted() {
|
|
|
this.getTaskList();
|
|
|
this.getDialogTagDataList();
|