|
@@ -39,7 +39,7 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div class="part-box-action">
|
|
|
- <el-button
|
|
|
+ <!-- <el-button
|
|
|
type="danger"
|
|
|
icon="el-icon-delete"
|
|
|
@click="toRemove('DELETE')"
|
|
@@ -50,7 +50,7 @@
|
|
|
icon="el-icon-delete-solid"
|
|
|
@click="toRemove('CLEAR')"
|
|
|
>清空</el-button
|
|
|
- >
|
|
|
+ > -->
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="part-box">
|
|
@@ -70,21 +70,9 @@
|
|
|
:index="indexMethod"
|
|
|
></el-table-column>
|
|
|
<el-table-column prop="printPlanName" label="项目"></el-table-column>
|
|
|
- <el-table-column prop="type" label="类别">
|
|
|
- <!-- <template slot-scope="scope">
|
|
|
- {{ scope.row.type | dataTaskTypeFilter }}
|
|
|
- </template> -->
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="status" label="状态">
|
|
|
- <!-- <template slot-scope="scope">
|
|
|
- {{ scope.row.status | dataTaskStatusFilter }}
|
|
|
- </template> -->
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="result" label="结果">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ scope.row.result | dataTaskResultFilter }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ <el-table-column prop="type" label="类别"> </el-table-column>
|
|
|
+ <el-table-column prop="status" label="状态"> </el-table-column>
|
|
|
+ <el-table-column prop="result" label="结果"> </el-table-column>
|
|
|
<el-table-column prop="createTime" label="创建时间" width="180">
|
|
|
<span slot-scope="scope">{{
|
|
|
scope.row.createTime | timestampFilter
|
|
@@ -108,7 +96,6 @@
|
|
|
title="导出日志"
|
|
|
></el-button>
|
|
|
<el-button
|
|
|
- v-if="scope.row.hasResultFile"
|
|
|
class="btn-table-icon"
|
|
|
type="text"
|
|
|
icon="icon icon-circle-right"
|
|
@@ -141,7 +128,8 @@ import {
|
|
|
DATA_TASK_RESULT
|
|
|
} from "@/constants/enumerate";
|
|
|
import { dataTaskList, removeDataTask } from "../api";
|
|
|
-import { download, randomCode } from "@/plugins/utils";
|
|
|
+import { attachmentDownload } from "../../login/api";
|
|
|
+import { downloadBlob } from "@/plugins/utils";
|
|
|
|
|
|
export default {
|
|
|
name: "data-task-manage",
|
|
@@ -219,39 +207,35 @@ export default {
|
|
|
if (this.loading) return;
|
|
|
|
|
|
this.loading = true;
|
|
|
- const res = await download({
|
|
|
- type: "post",
|
|
|
- url: this.GLOBAL.domain + "/api/admin/exam/task_review/export",
|
|
|
- data: {
|
|
|
- id: row.id
|
|
|
- },
|
|
|
- fileName: `${Date.now()}${randomCode()}.zip`,
|
|
|
- header: this.getHeadIds()
|
|
|
- }).catch(error => {
|
|
|
- this.$message.error(error + "文件下载失败,请重新尝试!");
|
|
|
- });
|
|
|
+ const res = await downloadBlob(() => {
|
|
|
+ return attachmentDownload({ id: row.id, type: "REPORT" });
|
|
|
+ }, `${row.printPlanName}-日志文件.txt`).catch(() => {});
|
|
|
+
|
|
|
this.loading = false;
|
|
|
- if (!res) return;
|
|
|
- this.$message.success("文件下载成功!");
|
|
|
+
|
|
|
+ if (res) {
|
|
|
+ this.$message.success("文件下载成功!");
|
|
|
+ } else {
|
|
|
+ this.$message.error("文件下载失败,请重新尝试!");
|
|
|
+ }
|
|
|
},
|
|
|
async toDonwloadFile(row) {
|
|
|
if (this.loading) return;
|
|
|
|
|
|
this.loading = true;
|
|
|
- const res = await download({
|
|
|
- type: "post",
|
|
|
- url: this.GLOBAL.domain + "/api/admin/exam/task_review/export",
|
|
|
- data: {
|
|
|
- id: row.id
|
|
|
- },
|
|
|
- fileName: `${Date.now()}${randomCode()}.zip`,
|
|
|
- header: this.getHeadIds()
|
|
|
- }).catch(error => {
|
|
|
- this.$message.error(error + "文件下载失败,请重新尝试!");
|
|
|
- });
|
|
|
+ const type = row.hasResultFile ? "RESULT" : "IMPORT_FILE";
|
|
|
+ const typeName = row.hasResultFile ? "导出文件" : "导入文件";
|
|
|
+ const res = await downloadBlob(() => {
|
|
|
+ return attachmentDownload({ id: row.id, type });
|
|
|
+ }, `${row.printPlanName}-${typeName}.txt`).catch(() => {});
|
|
|
+
|
|
|
this.loading = false;
|
|
|
- if (!res) return;
|
|
|
- this.$message.success("文件下载成功!");
|
|
|
+
|
|
|
+ if (res) {
|
|
|
+ this.$message.success("文件下载成功!");
|
|
|
+ } else {
|
|
|
+ this.$message.error("文件下载失败,请重新尝试!");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
};
|