|
@@ -60,7 +60,9 @@
|
|
|
>
|
|
|
</div>
|
|
|
<span>
|
|
|
- <span @click="exportDoc" style="color:#409EFF">批量导出doc</span>
|
|
|
+ <span @click="exportDoc" style="color:#409EFF"
|
|
|
+ >批量导出doc</span
|
|
|
+ >
|
|
|
</span>
|
|
|
<span>
|
|
|
<span @click="delSelectBtn" style="color: red;">删除</span>
|
|
@@ -300,31 +302,44 @@ export default {
|
|
|
text: "文本转录",
|
|
|
status: "0",
|
|
|
progress: "0"
|
|
|
- },
|
|
|
- {
|
|
|
- type: "getFileIds",
|
|
|
- text: "获取文件fileid",
|
|
|
- status: "0"
|
|
|
- },
|
|
|
- {
|
|
|
- type:"getWordCloudMap",
|
|
|
- text:"获取词云图",
|
|
|
- status:"0"
|
|
|
- },
|
|
|
- {
|
|
|
- type: "generateReport",
|
|
|
- text: "生成报告",
|
|
|
- status: "0",
|
|
|
- progress: "0"
|
|
|
- },
|
|
|
- {
|
|
|
- type: "createClass",
|
|
|
- text: "创建课堂",
|
|
|
- status: "0",
|
|
|
- progress: "0"
|
|
|
}
|
|
|
];
|
|
|
- } else if (["audio/wav",'audio/x-m4a','audio/mpeg'].includes(i.type) ) {
|
|
|
+ if (data.jsonData.automaticCoding) {
|
|
|
+ data.jsonData.steps.push({
|
|
|
+ type: "automaticCoding",
|
|
|
+ text: "自动编码"
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ data.jsonData.steps.push(
|
|
|
+ ...[
|
|
|
+ {
|
|
|
+ type: "getFileIds",
|
|
|
+ text: "获取文件fileid",
|
|
|
+ status: "0"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "getWordCloudMap",
|
|
|
+ text: "获取词云图",
|
|
|
+ status: "0"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "generateReport",
|
|
|
+ text: "生成报告",
|
|
|
+ status: "0",
|
|
|
+ progress: "0"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "createClass",
|
|
|
+ text: "创建课堂",
|
|
|
+ status: "0",
|
|
|
+ progress: "0"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ );
|
|
|
+ } else if (
|
|
|
+ ["audio/wav", "audio/x-m4a", "audio/mpeg"].includes(i.type)
|
|
|
+ ) {
|
|
|
data.jsonData.baseMessage.imageList.fileList = [
|
|
|
{
|
|
|
name: i.name,
|
|
@@ -364,9 +379,9 @@ export default {
|
|
|
status: "0"
|
|
|
},
|
|
|
{
|
|
|
- type:"getWordCloudMap",
|
|
|
- text:"获取词云图",
|
|
|
- status:"0"
|
|
|
+ type: "getWordCloudMap",
|
|
|
+ text: "获取词云图",
|
|
|
+ status: "0"
|
|
|
},
|
|
|
{
|
|
|
type: "generateReport",
|
|
@@ -426,9 +441,9 @@ export default {
|
|
|
status: "0"
|
|
|
},
|
|
|
{
|
|
|
- type:"getWordCloudMap",
|
|
|
- text:"获取词云图",
|
|
|
- status:"0"
|
|
|
+ type: "getWordCloudMap",
|
|
|
+ text: "获取词云图",
|
|
|
+ status: "0"
|
|
|
},
|
|
|
{
|
|
|
type: "generateReport",
|
|
@@ -469,7 +484,7 @@ export default {
|
|
|
if (_data.id) {
|
|
|
data.jsonData.fileData.fileObj = fileObj;
|
|
|
data.id = _data.id;
|
|
|
- this.dataList.push(data);
|
|
|
+ this.dataList.unshift(data);
|
|
|
}
|
|
|
resolve();
|
|
|
})
|
|
@@ -484,8 +499,8 @@ export default {
|
|
|
Promise.all(promiseList)
|
|
|
.then(res => {
|
|
|
this.$message.success("创建成功");
|
|
|
- if(!this.dataList.find(i =>i.status == 1)){
|
|
|
- this.startTask(this.dataList.find(i =>i.status === "0").id);
|
|
|
+ if (!this.dataList.find(i => i.status == 1)) {
|
|
|
+ this.startTask(this.dataList.find(i => i.status === "0").id);
|
|
|
}
|
|
|
})
|
|
|
.catch(err => {
|
|
@@ -530,21 +545,33 @@ export default {
|
|
|
//修改课堂的baseMessage
|
|
|
editBaseMessageSuccess({ editId, message }) {
|
|
|
if (editId) {
|
|
|
- let _editorBarData = null
|
|
|
+ let _editorBarData = null;
|
|
|
let _transcriptionData = null;
|
|
|
- if(this.dataList.find(i=>i.id===editId).jsonData.baseMessage.editorBarData){
|
|
|
- _editorBarData = this.dataList.find(i=>i.id===editId).jsonData.baseMessage.editorBarData;
|
|
|
+ if (
|
|
|
+ this.dataList.find(i => i.id === editId).jsonData.baseMessage
|
|
|
+ .editorBarData
|
|
|
+ ) {
|
|
|
+ _editorBarData = this.dataList.find(i => i.id === editId).jsonData
|
|
|
+ .baseMessage.editorBarData;
|
|
|
}
|
|
|
|
|
|
- if(this.dataList.find(i=>i.id===editId).jsonData.baseMessage.transcriptionData){
|
|
|
- _transcriptionData = this.dataList.find(i=>i.id===editId).jsonData.baseMessage.transcriptionData;
|
|
|
+ if (
|
|
|
+ this.dataList.find(i => i.id === editId).jsonData.baseMessage
|
|
|
+ .transcriptionData
|
|
|
+ ) {
|
|
|
+ _transcriptionData = this.dataList.find(i => i.id === editId).jsonData
|
|
|
+ .baseMessage.transcriptionData;
|
|
|
}
|
|
|
this.dataList.find(i => i.id === editId).jsonData.baseMessage = message;
|
|
|
- if(_editorBarData){
|
|
|
- this.dataList.find(i=>i.id===editId).jsonData.baseMessage.editorBarData = _editorBarData;
|
|
|
+ if (_editorBarData) {
|
|
|
+ this.dataList.find(
|
|
|
+ i => i.id === editId
|
|
|
+ ).jsonData.baseMessage.editorBarData = _editorBarData;
|
|
|
}
|
|
|
- if(_transcriptionData){
|
|
|
- this.dataList.find(i=>i.id===editId).jsonData.baseMessage.transcriptionData = _transcriptionData;
|
|
|
+ if (_transcriptionData) {
|
|
|
+ this.dataList.find(
|
|
|
+ i => i.id === editId
|
|
|
+ ).jsonData.baseMessage.transcriptionData = _transcriptionData;
|
|
|
}
|
|
|
this.$forceUpdate();
|
|
|
this.$refs.editBaseMessageDialogRef.close();
|
|
@@ -649,7 +676,7 @@ export default {
|
|
|
delete dataCopy.jsonData.baseMessage.editorBarData.tableList;
|
|
|
}
|
|
|
|
|
|
- if(dataCopy.jsonData.errorMessage){
|
|
|
+ if (dataCopy.jsonData.errorMessage) {
|
|
|
delete dataCopy.jsonData.errorMessage;
|
|
|
}
|
|
|
|
|
@@ -793,7 +820,7 @@ export default {
|
|
|
//按顺序处理任务
|
|
|
let _step = _stepList[i];
|
|
|
console.log(_step);
|
|
|
- if(!this.nowDoTaskId.includes(_startData.id))break;
|
|
|
+ if (!this.nowDoTaskId.includes(_startData.id)) break;
|
|
|
if (_step.status === "1") continue;
|
|
|
if (_step.type === "uploadFile") continue;
|
|
|
if (_step.type === "getVideoVoice") {
|
|
@@ -804,17 +831,18 @@ export default {
|
|
|
).jsonData.steps = _stepList;
|
|
|
let _fileData = _startData.jsonData.fileData;
|
|
|
let audioFile = await this.getVideoToVoiceAndUploadMixin(_fileData);
|
|
|
- if(audioFile.data==3){
|
|
|
+ if (audioFile.data == 3) {
|
|
|
this.dataList.find(
|
|
|
i => i.id === _startData.id
|
|
|
- ).jsonData.errorMessage = {content:"视频提取音频失败",err:audioFile.err};
|
|
|
+ ).jsonData.errorMessage = {
|
|
|
+ content: "视频提取音频失败",
|
|
|
+ err: audioFile.err
|
|
|
+ };
|
|
|
|
|
|
- this.dataList.find(
|
|
|
- i => i.id === _startData.id
|
|
|
- ).status = "3"
|
|
|
+ this.dataList.find(i => i.id === _startData.id).status = "3";
|
|
|
break;
|
|
|
}
|
|
|
- if(!this.nowDoTaskId.includes(_startData.id))break;
|
|
|
+ if (!this.nowDoTaskId.includes(_startData.id)) break;
|
|
|
_startData.jsonData.fileData.videoUrl = _fileData.url;
|
|
|
_startData.jsonData.fileData.fileObj = audioFile.fileObj;
|
|
|
_startData.jsonData.fileData.url = audioFile.audioUrl.Location;
|
|
@@ -835,8 +863,8 @@ export default {
|
|
|
this.dataList.find(i => i.id === _startData.id).jsonData
|
|
|
)
|
|
|
);
|
|
|
- _startData.jsonData.fileData.fileObj = audioFile.fileObj;//防止文件因为json失效
|
|
|
- console.log("data👉",JSON.parse(JSON.stringify(_startData)))
|
|
|
+ _startData.jsonData.fileData.fileObj = audioFile.fileObj; //防止文件因为json失效
|
|
|
+ console.log("data👉", JSON.parse(JSON.stringify(_startData)));
|
|
|
console.log(`${_startData.id}:已完成视频转音频`);
|
|
|
} else if (_step.type === "transcription") {
|
|
|
//文本转录
|
|
@@ -848,7 +876,7 @@ export default {
|
|
|
i => i.id === _startData.id
|
|
|
).jsonData.steps = _stepList;
|
|
|
let { editorBarData } = await this.getTextContentMixin(fileData);
|
|
|
- if(!this.nowDoTaskId.includes(_startData.id))break;
|
|
|
+ if (!this.nowDoTaskId.includes(_startData.id)) break;
|
|
|
this.dataList.find(
|
|
|
i => i.id === _startData.id
|
|
|
).jsonData.baseMessage.editorBarData = editorBarData;
|
|
@@ -863,9 +891,11 @@ export default {
|
|
|
)
|
|
|
);
|
|
|
console.log(`${_startData.id}:已获取转录文稿(txt)`);
|
|
|
- console.log("data👉",JSON.parse(JSON.stringify(_startData)))
|
|
|
+ console.log("data👉", JSON.parse(JSON.stringify(_startData)));
|
|
|
} else if (
|
|
|
- ['video/mp4','audio/wav','audio/x-m4a','audio/mpeg'].includes(fileData.type)
|
|
|
+ ["video/mp4", "audio/wav", "audio/x-m4a", "audio/mpeg"].includes(
|
|
|
+ fileData.type
|
|
|
+ )
|
|
|
) {
|
|
|
//mp4与wav文件
|
|
|
_stepList[i].status = "2";
|
|
@@ -874,26 +904,30 @@ export default {
|
|
|
).jsonData.steps = _stepList;
|
|
|
|
|
|
let _file = _startData.jsonData.fileData.fileObj;
|
|
|
- if(!_file && JSON.stringify(_file)!="{}"){
|
|
|
- let fileBody = await this.getFileBody(_startData.jsonData.fileData.url);
|
|
|
- let _type = _startData.jsonData.fileData.type.split('/')[1];
|
|
|
- if(_type=='x-m4a'){
|
|
|
- _type="m4a"
|
|
|
- }else if(_type=="mpeg"){
|
|
|
- _type = "mp3"
|
|
|
+ if (!_file && JSON.stringify(_file) != "{}") {
|
|
|
+ let fileBody = await this.getFileBody(
|
|
|
+ _startData.jsonData.fileData.url
|
|
|
+ );
|
|
|
+ let _type = _startData.jsonData.fileData.type.split("/")[1];
|
|
|
+ if (_type == "x-m4a") {
|
|
|
+ _type = "m4a";
|
|
|
+ } else if (_type == "mpeg") {
|
|
|
+ _type = "mp3";
|
|
|
}
|
|
|
- _file = new File([fileBody.data], `audio.${_type}`, { type: _startData.jsonData.fileData.type });
|
|
|
+ _file = new File([fileBody.data], `audio.${_type}`, {
|
|
|
+ type: _startData.jsonData.fileData.type
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
- if (["audio/x-m4a","audio/mpeg"].includes(_file.type)) {
|
|
|
+ if (["audio/x-m4a", "audio/mpeg"].includes(_file.type)) {
|
|
|
let _data = await this.audioToWavMixin(_file);
|
|
|
- if(_data!==1){
|
|
|
+ if (_data !== 1) {
|
|
|
_file = _data.data;
|
|
|
- }else{
|
|
|
- console.log("报错👉",_data)
|
|
|
+ } else {
|
|
|
+ console.log("报错👉", _data);
|
|
|
}
|
|
|
}
|
|
|
- console.log("转录文件",_file)
|
|
|
+ console.log("转录文件", _file);
|
|
|
|
|
|
let {
|
|
|
transcriptionContent,
|
|
@@ -921,6 +955,51 @@ 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";
|
|
|
this.dataList.find(
|
|
|
i => i.id === _startData.id
|
|
@@ -939,7 +1018,7 @@ export default {
|
|
|
i => i.id === _startData.id
|
|
|
).jsonData.baseMessage.editorBarData.content = _content;
|
|
|
}
|
|
|
- if(!_tableList){
|
|
|
+ if (!_tableList) {
|
|
|
let _result = [];
|
|
|
let _data = _content;
|
|
|
let _div = document.createElement("div");
|
|
@@ -961,13 +1040,26 @@ export default {
|
|
|
|
|
|
_tableList = _result;
|
|
|
}
|
|
|
+ let editorBarData = "";
|
|
|
|
|
|
- let { editorBarData} = await this.automaticCodingMixin({ tableList: _tableList});
|
|
|
- if(!this.nowDoTaskId.includes(_startData.id))break;
|
|
|
+ if (fileData.type == "text/plain") {
|
|
|
+ let _result = await this.automaticCodingForTextMixin({
|
|
|
+ tableList: _tableList
|
|
|
+ });
|
|
|
+ editorBarData = _result.editorBarData;
|
|
|
+ } else {
|
|
|
+ let _result = await this.automaticCodingMixin({
|
|
|
+ tableList: _tableList
|
|
|
+ });
|
|
|
+ editorBarData = _result.editorBarData;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!this.nowDoTaskId.includes(_startData.id)) break;
|
|
|
|
|
|
_stepList[i].status = "1";
|
|
|
|
|
|
- this.dataList.find(i => i.id === _startData.id).jsonData = _startData.jsonData;
|
|
|
+ this.dataList.find(i => i.id === _startData.id).jsonData =
|
|
|
+ _startData.jsonData;
|
|
|
this.dataList.find(
|
|
|
i => i.id === _startData.id
|
|
|
).jsonData.baseMessage.editorBarData = editorBarData;
|
|
@@ -981,8 +1073,9 @@ export default {
|
|
|
this.dataList.find(i => i.id === _startData.id).jsonData
|
|
|
)
|
|
|
);
|
|
|
- console.log("data👉",JSON.parse(JSON.stringify(_startData)))
|
|
|
+ console.log("data👉", JSON.parse(JSON.stringify(_startData)));
|
|
|
console.log(`${_startData.id}:已获完成自动编码`);
|
|
|
+ // }
|
|
|
} else {
|
|
|
_stepList[i].status = "1";
|
|
|
this.dataList.find(
|
|
@@ -1003,7 +1096,7 @@ export default {
|
|
|
).jsonData.steps = _stepList;
|
|
|
let _fileData = _startData.jsonData.baseMessage.editorBarData;
|
|
|
let { fileId } = await this.getFileIdMixin(_fileData.url);
|
|
|
- if(!this.nowDoTaskId.includes(_startData.id))break;
|
|
|
+ if (!this.nowDoTaskId.includes(_startData.id)) break;
|
|
|
this.dataList.find(
|
|
|
i => i.id === _startData.id
|
|
|
).jsonData.file_ids = fileId;
|
|
@@ -1017,25 +1110,24 @@ export default {
|
|
|
this.dataList.find(i => i.id === _startData.id).jsonData
|
|
|
)
|
|
|
);
|
|
|
- console.log("data👉",JSON.parse(JSON.stringify(_startData)))
|
|
|
+ console.log("data👉", JSON.parse(JSON.stringify(_startData)));
|
|
|
console.log(`${_startData.id}:已获取fileId`);
|
|
|
- }else if(_step.type=="getWordCloudMap"){
|
|
|
+ } else if (_step.type == "getWordCloudMap") {
|
|
|
//文件获取fileId
|
|
|
_stepList[i].status = "2";
|
|
|
this.dataList.find(
|
|
|
i => i.id === _startData.id
|
|
|
).jsonData.steps = _stepList;
|
|
|
|
|
|
-
|
|
|
let _fileData = _startData.jsonData.baseMessage.editorBarData;
|
|
|
|
|
|
let _content = await this.getFile(_fileData.url);
|
|
|
|
|
|
- let _result = await this.getWordCloudMapMixin( _content.data);
|
|
|
+ let _result = await this.getWordCloudMapMixin(_content.data);
|
|
|
|
|
|
- this.dataList.find(
|
|
|
- i => i.id === _startData.id
|
|
|
- ).jsonData.baseMessage.imageList.NephogramList.push(_result);
|
|
|
+ this.dataList
|
|
|
+ .find(i => i.id === _startData.id)
|
|
|
+ .jsonData.baseMessage.imageList.NephogramList.push(_result);
|
|
|
|
|
|
_stepList[i].status = "1";
|
|
|
this.dataList.find(
|
|
@@ -1104,7 +1196,8 @@ export default {
|
|
|
assistantData: _assistantData,
|
|
|
baseMessage: _startData.jsonData.baseMessage
|
|
|
});
|
|
|
- if(!this.nowDoTaskId.includes(_startData.id))return resolve();
|
|
|
+ if (!this.nowDoTaskId.includes(_startData.id))
|
|
|
+ return resolve();
|
|
|
if (data.data == 1) {
|
|
|
if (_num < _maxNum) {
|
|
|
//重试
|
|
@@ -1123,16 +1216,15 @@ export default {
|
|
|
|
|
|
await Promise.all(promises).then(() => {
|
|
|
console.log(`${_startData.id}:已完成分析获取`);
|
|
|
- if(!this.nowDoTaskId.includes(_startData.id))return;
|
|
|
- console.log("data👉",JSON.parse(JSON.stringify(_startData)))
|
|
|
+ if (!this.nowDoTaskId.includes(_startData.id)) return;
|
|
|
+ console.log("data👉", JSON.parse(JSON.stringify(_startData)));
|
|
|
console.log(_startData.jsonData.analysisList);
|
|
|
_stepList[i].status = "1";
|
|
|
this.dataList.find(
|
|
|
i => i.id === _startData.id
|
|
|
).jsonData.steps = _stepList;
|
|
|
- this.dataList.find(
|
|
|
- i => i.id === _startData.id
|
|
|
- ).jsonData = _startData.jsonData
|
|
|
+ this.dataList.find(i => i.id === _startData.id).jsonData =
|
|
|
+ _startData.jsonData;
|
|
|
|
|
|
this.updateTask(_startData.id);
|
|
|
_startData.jsonData = JSON.parse(
|
|
@@ -1141,7 +1233,7 @@ export default {
|
|
|
)
|
|
|
);
|
|
|
});
|
|
|
- if(!this.nowDoTaskId.includes(_startData.id))break;
|
|
|
+ if (!this.nowDoTaskId.includes(_startData.id)) break;
|
|
|
} else if (_step.type === "createClass") {
|
|
|
//创建课堂
|
|
|
_stepList[i].status = "2";
|
|
@@ -1152,18 +1244,18 @@ export default {
|
|
|
//创建课堂 赋值好fileid 替换创建后课堂的基础数据 继续下一个任务
|
|
|
let newOption = await this.createClassMixin(_startData.jsonData);
|
|
|
|
|
|
- if([1,2,3].includes(newOption.data)){
|
|
|
+ if ([1, 2, 3].includes(newOption.data)) {
|
|
|
this.dataList.find(
|
|
|
i => i.id === _startData.id
|
|
|
- ).jsonData.errorMessage = {content:"创建课堂失败",err:data.err};
|
|
|
+ ).jsonData.errorMessage = {
|
|
|
+ content: "创建课堂失败",
|
|
|
+ err: data.err
|
|
|
+ };
|
|
|
|
|
|
- this.dataList.find(
|
|
|
- i => i.id === _startData.id
|
|
|
- ).status = "3"
|
|
|
+ this.dataList.find(i => i.id === _startData.id).status = "3";
|
|
|
break;
|
|
|
-
|
|
|
}
|
|
|
- if(!this.nowDoTaskId.includes(_startData.id))break;
|
|
|
+ if (!this.nowDoTaskId.includes(_startData.id)) break;
|
|
|
|
|
|
this.$emit("addNewCourseOption", newOption.data);
|
|
|
this.dataList.find(i => i.id === _startData.id).jsonData.createId =
|
|
@@ -1195,7 +1287,7 @@ export default {
|
|
|
if (_waitTask) {
|
|
|
//暂停这个任务,
|
|
|
this.dataList.find(i => i.id === id).status = "0";
|
|
|
- this.nowDoTaskId = this.nowDoTaskId.filter(i=>i!==id);
|
|
|
+ this.nowDoTaskId = this.nowDoTaskId.filter(i => i !== id);
|
|
|
// 开始另一个任务
|
|
|
this.startTask(_waitTask.id);
|
|
|
} else {
|
|
@@ -1205,19 +1297,20 @@ export default {
|
|
|
},
|
|
|
//停止任务
|
|
|
stopTask(id) {
|
|
|
- let stopTask = this.dataList.find(i=>i.id===id);
|
|
|
- if(stopTask.status==='0'){
|
|
|
+ let stopTask = this.dataList.find(i => i.id === id);
|
|
|
+ if (stopTask.status === "0") {
|
|
|
this.dataList.find(i => i.id === id).status = "3";
|
|
|
- }if(stopTask.status==='1'){
|
|
|
+ }
|
|
|
+ if (stopTask.status === "1") {
|
|
|
this.dataList.find(i => i.id === id).status = "3";
|
|
|
- this.nowDoTaskId = this.nowDoTaskId.filter(i=>i!==id);
|
|
|
+ this.nowDoTaskId = this.nowDoTaskId.filter(i => i !== id);
|
|
|
}
|
|
|
|
|
|
- console.log(stopTask)
|
|
|
+ console.log(stopTask);
|
|
|
|
|
|
let _waitTask = this.dataList.find(i => i.status === "0");
|
|
|
- console.log(_waitTask)
|
|
|
- if(_waitTask){
|
|
|
+ console.log(_waitTask);
|
|
|
+ if (_waitTask) {
|
|
|
// 开始另一个任务
|
|
|
this.startTask(_waitTask.id);
|
|
|
}
|
|
@@ -1233,66 +1326,69 @@ export default {
|
|
|
// this.dataList.find(i => i.id === id).status = "3";
|
|
|
// }
|
|
|
},
|
|
|
- goToEdit(id){
|
|
|
- let _data = this.dataList.find(i=>i.id===id);
|
|
|
- if(_data){
|
|
|
+ goToEdit(id) {
|
|
|
+ let _data = this.dataList.find(i => i.id === id);
|
|
|
+ if (_data) {
|
|
|
let createId = _data.jsonData.createId;
|
|
|
- this.$emit("changeClass",createId);
|
|
|
+ this.$emit("changeClass", createId);
|
|
|
this.close();
|
|
|
}
|
|
|
},
|
|
|
test() {
|
|
|
this.testMixin();
|
|
|
},
|
|
|
- exportDoc(){
|
|
|
+ exportDoc() {
|
|
|
let _exportList = this.dataList.filter(
|
|
|
i =>
|
|
|
this.selectList.includes(i.id) &&
|
|
|
(this.selectStatus === "99" ||
|
|
|
this.statusList
|
|
|
.find(i2 => i2.value === this.selectStatus)
|
|
|
- .allow.includes(i.status)) && i.status == "2"
|
|
|
+ .allow.includes(i.status)) &&
|
|
|
+ i.status == "2"
|
|
|
);
|
|
|
|
|
|
- if (_exportList.length <= 0) return this.$message.info("请先选择已经完成的任务列表");
|
|
|
-
|
|
|
+ if (_exportList.length <= 0)
|
|
|
+ return this.$message.info("请先选择已经完成的任务列表");
|
|
|
|
|
|
let promise = [];
|
|
|
|
|
|
let _notify = this.$notify.info({
|
|
|
- title: '提示',
|
|
|
- message: '正在批量导出word中,请稍等...',
|
|
|
- duration: 0,
|
|
|
- showClose: false,
|
|
|
- });
|
|
|
-
|
|
|
- _exportList.forEach((i,index)=>{
|
|
|
- i.jsonData.baseMessage.courseName = i.jsonData.baseMessage.courseName+"_"+index;
|
|
|
- promise.push(this.getDocFnPromise(i))
|
|
|
- })
|
|
|
+ title: "提示",
|
|
|
+ message: "正在批量导出word中,请稍等...",
|
|
|
+ duration: 0,
|
|
|
+ showClose: false
|
|
|
+ });
|
|
|
|
|
|
- Promise.all(promise).then(res=>{
|
|
|
- _notify.close();
|
|
|
- console.log(res)
|
|
|
- if(res.length==1){
|
|
|
- saveAs(res[0], `${res[0].name}`);
|
|
|
- this.$message.success("导出报告成功")
|
|
|
- }else if(res.length>1){
|
|
|
- const zip = new JSZip();
|
|
|
- res.forEach(i=>{
|
|
|
- zip.file(`${i.name}`, i, { binary: true });
|
|
|
- })
|
|
|
- zip.generateAsync({ type: "blob" }).then(content => {
|
|
|
- // 生成二进制流
|
|
|
- saveAs(content, `课堂观察报告.zip`); // 利用file-saver保存文件 自定义文件名
|
|
|
- });
|
|
|
- this.$message.success("导出报告成功")
|
|
|
- }
|
|
|
- }).catch(err=>{
|
|
|
- console.log("err",err)
|
|
|
- })
|
|
|
+ _exportList.forEach((i, index) => {
|
|
|
+ i.jsonData.baseMessage.courseName =
|
|
|
+ i.jsonData.baseMessage.courseName + "_" + index;
|
|
|
+ promise.push(this.getDocFnPromise(i));
|
|
|
+ });
|
|
|
|
|
|
- },
|
|
|
+ Promise.all(promise)
|
|
|
+ .then(res => {
|
|
|
+ _notify.close();
|
|
|
+ console.log(res);
|
|
|
+ if (res.length == 1) {
|
|
|
+ saveAs(res[0], `${res[0].name}`);
|
|
|
+ this.$message.success("导出报告成功");
|
|
|
+ } else if (res.length > 1) {
|
|
|
+ const zip = new JSZip();
|
|
|
+ res.forEach(i => {
|
|
|
+ zip.file(`${i.name}`, i, { binary: true });
|
|
|
+ });
|
|
|
+ zip.generateAsync({ type: "blob" }).then(content => {
|
|
|
+ // 生成二进制流
|
|
|
+ saveAs(content, `课堂观察报告.zip`); // 利用file-saver保存文件 自定义文件名
|
|
|
+ });
|
|
|
+ this.$message.success("导出报告成功");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.log("err", err);
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getTaskList();
|
|
@@ -1464,7 +1560,6 @@ export default {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: space-between;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
.b_b_o_right > div {
|