|
@ -637,9 +637,23 @@ export default { |
|
|
// 删除文件 |
|
|
// 删除文件 |
|
|
this.projectFileList.splice(index, 1); |
|
|
this.projectFileList.splice(index, 1); |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 点击预览下载文件 |
|
|
handleProjectPreview(file) { |
|
|
handleProjectPreview(file) { |
|
|
console.log(file.fileName); |
|
|
// console.log(file); |
|
|
getFileStream({ fileName: file.fileName }); |
|
|
getFileStream({ fileName: file.fileName }).then((res) => { |
|
|
|
|
|
const blob = new Blob([res], { |
|
|
|
|
|
// type类型后端返回来的数据中会有,根据自己实际进行修改 |
|
|
|
|
|
// 表格下载为 application/xlsx,压缩包为 application/zip等, |
|
|
|
|
|
type: "application/xlsx", |
|
|
|
|
|
}); //excel,pdf等 |
|
|
|
|
|
const href = URL.createObjectURL(blob); //创建新的URL表示指定的blob对象 |
|
|
|
|
|
const a = document.createElement("a"); //创建a标签 |
|
|
|
|
|
a.style.display = "none"; |
|
|
|
|
|
a.href = href; // 指定下载链接 |
|
|
|
|
|
a.download = file.name; //指定下载文件名 |
|
|
|
|
|
a.click(); //触发下载 |
|
|
|
|
|
URL.revokeObjectURL(a.href); //释放URL对象 |
|
|
|
|
|
}); |
|
|
}, |
|
|
}, |
|
|
handleProjectExceed(files, fileList) { |
|
|
handleProjectExceed(files, fileList) { |
|
|
this.$message.warning( |
|
|
this.$message.warning( |
|
@ -671,7 +685,21 @@ export default { |
|
|
this.opinionFileList.splice(index, 1); |
|
|
this.opinionFileList.splice(index, 1); |
|
|
}, |
|
|
}, |
|
|
handleOpinionPreview(file) { |
|
|
handleOpinionPreview(file) { |
|
|
console.log(file); |
|
|
// console.log(file); |
|
|
|
|
|
getFileStream({ fileName: file.fileName }).then((res) => { |
|
|
|
|
|
const blob = new Blob([res], { |
|
|
|
|
|
// type类型后端返回来的数据中会有,根据自己实际进行修改 |
|
|
|
|
|
// 表格下载为 application/xlsx,压缩包为 application/zip等, |
|
|
|
|
|
type: "application/xlsx", |
|
|
|
|
|
}); //excel,pdf等 |
|
|
|
|
|
const href = URL.createObjectURL(blob); //创建新的URL表示指定的blob对象 |
|
|
|
|
|
const a = document.createElement("a"); //创建a标签 |
|
|
|
|
|
a.style.display = "none"; |
|
|
|
|
|
a.href = href; // 指定下载链接 |
|
|
|
|
|
a.download = file.name; //指定下载文件名 |
|
|
|
|
|
a.click(); //触发下载 |
|
|
|
|
|
URL.revokeObjectURL(a.href); //释放URL对象 |
|
|
|
|
|
}); |
|
|
}, |
|
|
}, |
|
|
handleOpinionExceed(files, fileList) { |
|
|
handleOpinionExceed(files, fileList) { |
|
|
this.$message.warning( |
|
|
this.$message.warning( |
|
|