|
@@ -1,9 +1,9 @@
|
|
|
<template>
|
|
|
- <div style="width:calc(100% - 40px)">
|
|
|
+ <div class="height_100">
|
|
|
<div class="header">
|
|
|
<div style="color:black">{{ FileName }}</div>
|
|
|
<div>
|
|
|
- <el-link style="font-size: 16px" @click="downLoad"><i class="fa el-icon-download"></i><span style="margin-left:10px">下载</span></el-link>
|
|
|
+ <el-link style="font-size: 16px" @click="downLoadFile"><i class="fa el-icon-download"></i><span style="margin-left:10px">下载</span></el-link>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div style="display:flex;justify-content: center;height: calc(100% - 30px);">
|
|
@@ -60,14 +60,9 @@ export default {
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
- downLoadFile(row){
|
|
|
- var item = JSON.parse(JSON.stringify(row))
|
|
|
+ downLoadFile(){
|
|
|
var href = ''
|
|
|
- if(item.originalName){
|
|
|
- href = `http://${this.$c.hostname}:8801/fileManager/downloadSystemFile?fileId=${item.id}`
|
|
|
- }else{
|
|
|
- href = `/api/report/api/download/downloadFile?url=${encodeURIComponent(item.url)}`
|
|
|
- }
|
|
|
+ href = this.$commonJS.checkViewer(this.row.guid)
|
|
|
const anchor = document.createElement('a');
|
|
|
const fileName = 'download';
|
|
|
if ('download' in anchor) {
|
|
@@ -85,31 +80,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- downLoad() {
|
|
|
- if (this.row.originalName) {
|
|
|
- this.downLoadFile(this.row)
|
|
|
- return false
|
|
|
- }
|
|
|
- if(this.reportId){
|
|
|
- const href = `/api/report/api/download/downloadFile?url=${encodeURIComponent(this.row.url)}`
|
|
|
- const anchor = document.createElement('a');
|
|
|
- const fileName = 'download';
|
|
|
- if ('download' in anchor) {
|
|
|
- anchor.href = href;
|
|
|
- anchor.setAttribute("download", fileName);
|
|
|
- anchor.className = "download-js-link";
|
|
|
- anchor.innerHTML = "downloading...";
|
|
|
- anchor.style.display = "none";
|
|
|
- document.body.appendChild(anchor);
|
|
|
- setTimeout(function () {
|
|
|
- anchor.click();
|
|
|
- document.body.removeChild(anchor);
|
|
|
- }, 66);
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- downLoad2(this.row.url)
|
|
|
- },
|
|
|
+
|
|
|
},
|
|
|
}
|
|
|
</script>
|