<div class="location" @click="download()">
<img src="../../assets/Word.png" alt="" />
<span>导出</span>
</div>
download() {
var options = {
service_code: 'WINMET_APP_GET_CREDIT_RATING_URL',
params:{
service_code: 'WINMET_APP_GET_CREDIT_RATING_URL',
corp_id: this.corp_id,
company_name:this.company_name,
report_time:'null',
cityBondNum: "1"
}
};
fetch(options).then(res=>{
if (res.status == 'Y') {
this.funDownload(res.results);
}
})
},
funDownload (content, filename) {
var eleLink = document.createElement('a');
eleLink.download = "";
eleLink.style.display = 'none';
// 字符内容转变成blob地址
// var blob = new Blob([content],{ type: 'application/pdf' });
eleLink.href = content;
// 触发点击
document.body.appendChild(eleLink);
eleLink.click();
// 然后移除
document.body.removeChild(eleLink);
},
.location {
box-shadow: 0px 1px 5px 3px rgb(38 69 140 / 17%);
border-radius: 4px;
position: fixed;
top: 43%;
right: 3px;
width: 42px;
height: 52px;
padding: 0;
z-index: 999;
background-color: #ffffff;
cursor: pointer;
text-align: center;
/* line-height: 42px; */
}
.location img {
width: 20px;
height: 20px;
padding-top: 7px;
}
.location span {
display: block;
font-size: 6px;
}