|
@@ -85,6 +85,11 @@
|
|
|
<el-button icon="el-icon-download" type="primary" @click="downloadAll" size="mini">导出全部</el-button>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="3">
|
|
|
+ <el-form-item style="margin-left:10px;" label-width="10">
|
|
|
+ <el-button icon="el-icon-download" type="primary" @click="downloadPic" size="mini">下载图片</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<!-- <el-col :span="3">
|
|
|
<el-form-item style="margin-left:10px;" label-width="10">
|
|
|
<el-button icon="el-icon-plus" type="warning" @click="autoCompleteData" size="mini">补全数据</el-button>
|
|
@@ -456,7 +461,46 @@ export default {
|
|
|
this.startDownload();
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
+ downloadPic(){
|
|
|
+ this.loading = true;
|
|
|
+
|
|
|
+ this.$api.getDataPic(this.queryParams).then((res)=>{
|
|
|
+ this.loading = false;
|
|
|
+ console.log(res.data)
|
|
|
+ var elink = document.createElement('a');
|
|
|
+ let blob=new Blob([res.data], {type: 'image/png'});
|
|
|
+ let objUrl=URL.createObjectURL(blob);
|
|
|
+ let file_name= decodeURIComponent(res.headers['content-disposition'].split('=')[1]);
|
|
|
+ console.log(file_name)
|
|
|
+
|
|
|
+ elink.download = "12.png";// this.queryParams.stock_date + gname;
|
|
|
+ elink.style.display = 'none';
|
|
|
+ elink.href = objUrl;
|
|
|
+ document.body.appendChild(elink);
|
|
|
+ elink.click();
|
|
|
+ document.body.removeChild(elink);
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
+ ways(blob, suffix,res) {
|
|
|
+ let elink = document.createElement("a"); // 创建一个<a>标签
|
|
|
+ elink.style.display = "none"; // 隐藏标签
|
|
|
+ elink.href = window.URL.createObjectURL(blob); // 配置href
|
|
|
+ // 获取后端返回的响应头中的名称
|
|
|
+ // let filename = res.headers["content-disposition"];
|
|
|
+ // let newFilename = filename.split(';')[1].split('=')[1];
|
|
|
+ //自定义名称
|
|
|
+ // let newFilename = "样例文件" + new Date().getTime() + suffix; //自定义名字
|
|
|
+ // let newFilename = decodeURIComponent(res.headers["content-disposition"].split(';')[1].split('=')[1])
|
|
|
+ // newFilename = decodeURIComponent('11.png');
|
|
|
+ elink.download = '11.png';
|
|
|
+ elink.click();
|
|
|
+ URL.revokeObjectURL(elink.href); // 释放URL 对象(弹出框进行下载)
|
|
|
+ document.body.removeChild(elink); // 移除<a>标签
|
|
|
+ },
|
|
|
+
|
|
|
del(row) {
|
|
|
this.$confirm("确定删除吗?", "提示", {
|
|
|
type: "warning",
|