download results

This commit is contained in:
Marvin Zhang
2019-05-30 13:07:09 +08:00
parent 0e1208d10d
commit 2a8e33d3c7
2 changed files with 15 additions and 0 deletions

View File

@@ -56,6 +56,8 @@ export default {
'Stop': '停止',
'Preview': '预览',
'Extract Fields': '提取字段',
'Download': '下载',
'Download CSV': '下载CSV',
// 主页
'Total Tasks': '总任务数',

View File

@@ -15,6 +15,11 @@
</el-card>
</el-tab-pane>
<el-tab-pane :label="$t('Results')" name="results">
<div class="button-group">
<el-button type="primary" icon="el-icon-download" @click="downloadCSV">
{{$t('Download CSV')}}
</el-button>
</div>
<general-table-view :data="taskResultsData"
:columns="taskResultsColumns"
:page-num="resultsPageNum"
@@ -85,6 +90,9 @@ export default {
this.resultsPageNum = pageNum
this.resultsPageSize = pageSize
this.$store.dispatch('task/getTaskResults', this.$route.params.id)
},
downloadCSV () {
window.location.href = this.$request.baseUrl + '/tasks/' + this.$route.params.id + '/download_results'
}
},
created () {
@@ -121,4 +129,9 @@ export default {
overflow-x: auto;
overflow-y: auto;
}
.button-group {
margin-bottom: 10px;
text-align: right;
}
</style>