Skip to content

Commit 7b942c4

Browse files
committed
update: 任务失败下载可用的已完成数据
1 parent 8162dd5 commit 7b942c4

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

admin/src/api/api_excel.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,11 @@ export function startTask(params) {
4444
params
4545
})
4646
}
47+
48+
export function download_log(params) {
49+
return request({
50+
url: '/api/download_log',
51+
method: 'post',
52+
params
53+
})
54+
}

admin/src/views/api_excel/index.vue

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
</template>
5656
</el-table-column>
5757

58-
<el-table-column label="进度条" width="100" align="center" display="none">
58+
<el-table-column label="进度条" width="1" align="center" display="none">
5959
<template slot-scope="scope">
6060
<div v-if="scope.row.state === 0">
6161
<el-progress :text-inside="true" :stroke-width="18" :percentage="0"/>
@@ -72,7 +72,7 @@
7272
</template>
7373
</el-table-column>
7474

75-
<el-table-column label="操作" width="200" align="center">
75+
<el-table-column label="操作" width="300" align="center">
7676
<template slot-scope="scope">
7777
<div>
7878
<el-button
@@ -89,6 +89,11 @@
8989
size="mini"
9090
type="success"
9191
@click="download(scope.$index, scope.row)">点击下载</el-button>
92+
<el-button
93+
v-else-if="scope.row.state === 5"
94+
size="mini"
95+
type="warning"
96+
@click="download_log(scope.$index, scope.row)">下载已测试数据</el-button>
9297

9398
<el-button
9499
size="mini"
@@ -121,7 +126,7 @@
121126
</template>
122127

123128
<script>
124-
import { getList, deleteAct, search, startTask } from '@/api/api_excel'
129+
import { getList, deleteAct, search, startTask, download_log } from '@/api/api_excel'
125130
126131
export default {
127132
filters: {
@@ -246,6 +251,14 @@ export default {
246251
download(index, row) {
247252
window.location.href = this.url + row.finish_url
248253
},
254+
download_log(index, row) {
255+
download_log({ id: row.id }).then(res => {
256+
console.log(res)
257+
if (res.code === 200) {
258+
window.location.href = this.url + res.data.failed_done_file
259+
}
260+
})
261+
},
249262
fetchData() {
250263
this.listLoading = true
251264
const params = Object.assign({ 'page': this.listQuery.page }, { 'perPage': this.perpage })
@@ -254,6 +267,7 @@ export default {
254267
this.listLoading = false
255268
this.total = response.data.total
256269
this.url = response.data.appUrl
270+
console.log('type', Object.prototype.toString.call(this.list))
257271
258272
this.initWebSocket(8)
259273
})

0 commit comments

Comments
 (0)