|
|
|
@ -35,6 +35,7 @@ |
|
|
|
label="操作"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<a type="text" size="small" @click="deleteHandle(scope.row.id)">删除</a> |
|
|
|
<a @click="downloadFile(scope.row.fileName, scope.row.url)" >下载</a> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
@ -79,6 +80,18 @@ |
|
|
|
this.getDataList() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
downloadFile(fileName, data) { |
|
|
|
if (!data) { |
|
|
|
return; |
|
|
|
} |
|
|
|
let url = window.URL.createObjectURL(new Blob([data])); |
|
|
|
let link = document.createElement('a'); |
|
|
|
link.style.display = 'none'; |
|
|
|
link.href = url; |
|
|
|
link.setAttribute('download', fileName); |
|
|
|
document.body.appendChild(link); |
|
|
|
link.click(); |
|
|
|
}, |
|
|
|
// 获取数据列表 |
|
|
|
getDataList () { |
|
|
|
this.dataListLoading = true |
|
|
|
|