|
@@ -64,6 +64,11 @@
|
|
|
>批量导出doc</span
|
|
|
>
|
|
|
</span>
|
|
|
+ <span>
|
|
|
+ <span @click="regenerateTheReport" style="color:#409EFF"
|
|
|
+ >批量重新生成报告</span
|
|
|
+ >
|
|
|
+ </span>
|
|
|
<span>
|
|
|
<span @click="delSelectBtn" style="color: red;">删除</span>
|
|
|
<!-- <img
|
|
@@ -252,11 +257,11 @@ export default {
|
|
|
i => !i.isOtherData && i.jsonData.name != "词频词汇分析"
|
|
|
);
|
|
|
|
|
|
- _analysisList.forEach(i=>{
|
|
|
- if(i.jsonData.spectrogramData){
|
|
|
- delete i.jsonData.spectrogramData
|
|
|
+ _analysisList.forEach(i => {
|
|
|
+ if (i.jsonData.spectrogramData) {
|
|
|
+ delete i.jsonData.spectrogramData;
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
let promiseList = [];
|
|
|
|
|
|
fileDataList.forEach(i => {
|
|
@@ -778,6 +783,25 @@ export default {
|
|
|
.catch(() => {
|
|
|
console.log("不暂停");
|
|
|
});
|
|
|
+ } else if (type === "regenerateTheReport" && id) {
|
|
|
+ this.$confirm("您确定要重新生成任报告吗?。", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.dataList.find(i => i.id === id).status = "0";
|
|
|
+ this.dataList
|
|
|
+ .find(i => i.id === id)
|
|
|
+ .jsonData.steps.find(i => i.type == "generateReport").status =
|
|
|
+ "0";
|
|
|
+ if (!this.dataList.some(i => i.status == "1")) {
|
|
|
+ this.startTask(id);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ console.log("不暂停");
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
async startTask(id) {
|
|
@@ -1237,7 +1261,20 @@ export default {
|
|
|
this.dataList.find(i => i.id === _startData.id).jsonData
|
|
|
)
|
|
|
);
|
|
|
+ if (
|
|
|
+ this.dataList
|
|
|
+ .find(i => i.id === _startData.id)
|
|
|
+ .jsonData.steps.find(i => i.type === "createClass").status ===
|
|
|
+ "1"
|
|
|
+ ) {
|
|
|
+ this.dataList.find(i => i.id === _startData.id).status = "2";
|
|
|
+ if (this.dataList.find(i => i.status == "0")) {
|
|
|
+ let id = this.dataList.find(i => i.status == "0").id;
|
|
|
+ this.startTask(id);
|
|
|
+ }
|
|
|
+ }
|
|
|
});
|
|
|
+
|
|
|
if (!this.nowDoTaskId.includes(_startData.id)) break;
|
|
|
} else if (_step.type === "createClass") {
|
|
|
//创建课堂
|
|
@@ -1311,6 +1348,13 @@ export default {
|
|
|
this.nowDoTaskId = this.nowDoTaskId.filter(i => i !== id);
|
|
|
}
|
|
|
|
|
|
+ if (
|
|
|
+ stopTask.jsonData.steps.find(i => i.type == "createClass").status == 1
|
|
|
+ ) {
|
|
|
+ this.dataList.find(i => i.id === id).status = "2";
|
|
|
+ this.nowDoTaskId = this.nowDoTaskId.filter(i => i !== id);
|
|
|
+ }
|
|
|
+
|
|
|
console.log(stopTask);
|
|
|
|
|
|
let _waitTask = this.dataList.find(i => i.status === "0");
|
|
@@ -1369,42 +1413,50 @@ export default {
|
|
|
|
|
|
let fileList = [];
|
|
|
|
|
|
- for(let i=0;i<_copyExportData.length;i++){
|
|
|
+ for (let i = 0; i < _copyExportData.length; i++) {
|
|
|
// _copyExportData[i].jsonData.baseMessage.courseName =
|
|
|
// _copyExportData[i].jsonData.baseMessage.courseName + "_" + i;
|
|
|
fileList.push(await this.getDocFnPromise(_copyExportData[i]));
|
|
|
}
|
|
|
|
|
|
if (fileList.length == 1) {
|
|
|
- saveAs(fileList[0], `${fileList[0].name}`);
|
|
|
- this.$message.success("导出报告成功");
|
|
|
-
|
|
|
- } else if (fileList.length > 1) {
|
|
|
- const zip = new JSZip();
|
|
|
-
|
|
|
- fileList.forEach((i, index) => {
|
|
|
- let fileName = i.name;
|
|
|
-
|
|
|
- if (fileList.map(i => i.name).filter((fi,findex)=>findex!==index).includes(fileName))fileName = fileName.replace(/\.[^/.]+$/, "") + `(${index}).` + fileName.replace(/^.*\./, "");
|
|
|
- // let fileName = i.name;
|
|
|
- // let fileNames = fileList.map(file => file.name);
|
|
|
- // let count = 1;
|
|
|
- // while (fileNames.includes(fileName)) {
|
|
|
- // let nameWithoutExtension = fileName.replace(/\.[^/.]+$/, "");
|
|
|
- // let extension = fileName.replace(nameWithoutExtension, "");
|
|
|
- // fileName = `${nameWithoutExtension}(${count})${extension}`;
|
|
|
- // count++;
|
|
|
- // }
|
|
|
- zip.file(fileName, i, { binary: true });
|
|
|
- });
|
|
|
- zip.generateAsync({ type: "blob" }).then(content => {
|
|
|
- // 生成二进制流
|
|
|
- saveAs(content, `课堂观察报告.zip`); // 利用file-saver保存文件 自定义文件名
|
|
|
- });
|
|
|
+ saveAs(fileList[0], `${fileList[0].name}`);
|
|
|
+ this.$message.success("导出报告成功");
|
|
|
+ } else if (fileList.length > 1) {
|
|
|
+ const zip = new JSZip();
|
|
|
|
|
|
- this.$message.success("导出报告成功");
|
|
|
- }
|
|
|
- _notify.close();
|
|
|
+ fileList.forEach((i, index) => {
|
|
|
+ let fileName = i.name;
|
|
|
+
|
|
|
+ if (
|
|
|
+ fileList
|
|
|
+ .map(i => i.name)
|
|
|
+ .filter((fi, findex) => findex !== index)
|
|
|
+ .includes(fileName)
|
|
|
+ )
|
|
|
+ fileName =
|
|
|
+ fileName.replace(/\.[^/.]+$/, "") +
|
|
|
+ `(${index}).` +
|
|
|
+ fileName.replace(/^.*\./, "");
|
|
|
+ // let fileName = i.name;
|
|
|
+ // let fileNames = fileList.map(file => file.name);
|
|
|
+ // let count = 1;
|
|
|
+ // while (fileNames.includes(fileName)) {
|
|
|
+ // let nameWithoutExtension = fileName.replace(/\.[^/.]+$/, "");
|
|
|
+ // let extension = fileName.replace(nameWithoutExtension, "");
|
|
|
+ // fileName = `${nameWithoutExtension}(${count})${extension}`;
|
|
|
+ // count++;
|
|
|
+ // }
|
|
|
+ zip.file(fileName, i, { binary: true });
|
|
|
+ });
|
|
|
+ zip.generateAsync({ type: "blob" }).then(content => {
|
|
|
+ // 生成二进制流
|
|
|
+ saveAs(content, `课堂观察报告.zip`); // 利用file-saver保存文件 自定义文件名
|
|
|
+ });
|
|
|
+
|
|
|
+ this.$message.success("导出报告成功");
|
|
|
+ }
|
|
|
+ _notify.close();
|
|
|
|
|
|
// _exportList.forEach((i, index) => {
|
|
|
// i.jsonData.baseMessage.courseName =
|
|
@@ -1434,8 +1486,36 @@ export default {
|
|
|
// .catch(err => {
|
|
|
// console.log("err", err);
|
|
|
// });
|
|
|
- }
|
|
|
- },
|
|
|
+ },
|
|
|
+ async regenerateTheReport(){
|
|
|
+ let _generateList = 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"
|
|
|
+ );
|
|
|
+
|
|
|
+ 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";
|
|
|
+ })
|
|
|
+
|
|
|
+ if (!this.dataList.some(i => i.status == "1")) {
|
|
|
+ this.startTask(_generateList[0].id);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
mounted() {
|
|
|
this.getTaskList();
|
|
|
this.getDialogTagDataList();
|