工具下载

This commit is contained in:
nisen
2023-09-05 14:54:16 +08:00
parent 8fe266a9e0
commit 5f4fc5d2e8
3 changed files with 17 additions and 16 deletions

View File

@@ -258,20 +258,21 @@ export default {
methods: { methods: {
downTool(toolInfo) { downTool(toolInfo) {
console.log(toolInfo); console.log(toolInfo);
toolDown({ window.open(`/activityApi/xboe/m/boe/tools/url/download?urlStr=${process.env.VUE_APP_BOE_WEB_URL}/upload${toolInfo.filePath}&fileName=${toolInfo.name}`)
urlStr: `${process.env.VUE_APP_BOE_WEB_URL}/upload${toolInfo.filePath}`, // toolDown({
fileName: toolInfo.name // urlStr: `${process.env.VUE_APP_BOE_WEB_URL}/upload${toolInfo.filePath}`,
}).then((result) => { // fileName: toolInfo.name
const link = document.createElement('a');// 创建a标签 // }).then((result) => {
let blob = new Blob([result.data], { type: '' }); // 设置文件类型 // const link = document.createElement('a');// 创建a标签
link.style.display = "none"; // let blob = new Blob([result.data], { type: '' }); // 设置文件类型
link.href = URL.createObjectURL(blob); // 创建URL // link.style.display = "none";
link.setAttribute("download", `${toolInfo.name}`); // link.href = URL.createObjectURL(blob); // 创建URL
document.body.appendChild(link); // link.setAttribute("download", `${toolInfo.name}`);
link.click(); // document.body.appendChild(link);
URL.revokeObjectURL(link.href); // link.click();
document.body.removeChild(link); // URL.revokeObjectURL(link.href);
}) // document.body.removeChild(link);
// })
}, },
couresreso() { couresreso() {
carouselList().then((res) => { carouselList().then((res) => {

View File

@@ -23,7 +23,7 @@
<div class="contnet">{{ item.name }}</div> <div class="contnet">{{ item.name }}</div>
<div class="case-info-date portal-time"> <div class="case-info-date portal-time">
<i class="el-icon-time" style="margin-right: 5px;"></i> <i class="el-icon-time" style="margin-right: 5px;"></i>
<time-show :time="item.createTime.split(' ')[0]"></time-show> <time-show :time="item.createTime"></time-show>
</div> </div>
</div> </div>

View File

@@ -26,7 +26,7 @@
<div class="author">发布人{{ createName }}</div> <div class="author">发布人{{ createName }}</div>
<div class="case-info-date portal-time"> <div class="case-info-date portal-time">
<i class="el-icon-time" style="margin-right: 5px;"></i> <i class="el-icon-time" style="margin-right: 5px;"></i>
<time-show :time="createTime.split(' ')[0]"></time-show> <time-show :time="createTime"></time-show>
</div> </div>
</div> </div>
<div class="topTitle">通知内容</div> <div class="topTitle">通知内容</div>