|
|
|
@ -42,7 +42,7 @@ |
|
|
|
<li>尺寸:{{ (!(fileCurrent && fileCurrent.file_dpi) || (fileCurrent && fileCurrent.file_dpi === 'null')) ? '-' : fileCurrent.file_dpi }}</li> |
|
|
|
</ul> |
|
|
|
<div class="preview-btn"> |
|
|
|
<el-button class="iconfont icon-xiazai" @click="downloadFile(fileCurrent)">下载</el-button> |
|
|
|
<el-button :loading="downloading" class="iconfont icon-xiazai" @click="downloadFile(fileCurrent)">下载</el-button> |
|
|
|
<el-button v-print="printObj" class="iconfont icon-dayin">打印</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -78,6 +78,7 @@ export default { |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
downloading: false, |
|
|
|
src: '', |
|
|
|
logo: require('../../assets/images/logo.png'), |
|
|
|
// 加载状态跟踪 |
|
|
|
@ -169,6 +170,7 @@ export default { |
|
|
|
downloadFile(row) { |
|
|
|
// filePath 保存的文件路径 |
|
|
|
// bucketType 1预归档 2档案 |
|
|
|
this.downloading = true |
|
|
|
let bucketType = null |
|
|
|
if (this.documentId) { |
|
|
|
bucketType = 1 |
|
|
|
@ -184,8 +186,10 @@ export default { |
|
|
|
} |
|
|
|
fetch(url, fetchOptions).then(res => res.blob()).then(blob => { |
|
|
|
downloadFile(blob, row.file_name.split('.')[0], row.file_type) |
|
|
|
this.downloading = false |
|
|
|
}).catch(() => { |
|
|
|
this.$message({ message: '下载文件失败', type: 'error', offset: 8 }) |
|
|
|
this.downloading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
selectFile(item) { |
|
|
|
|