| | |
| | | |
| | | <script> |
| | | import {exportCode} from '@/api/GetItem' |
| | | import func from "@/util/func"; |
| | | export default { |
| | | name: "MasterTransfer", |
| | | props:['visible','tableHeadData','codeClassifyOid','tableData','selectRow'], |
| | |
| | | exportArr[`attrIdIndexMap[${index}]`] = item |
| | | }) |
| | | exportCode({codeClassifyOid:this.codeClassifyOid,'conditionMap[oid]':ids,...exportArr}).then(res=>{ |
| | | console.log('res',res) |
| | | const filename = '下载.xlsx'; // 下载的文件名 |
| | | let blob = new Blob([res.data], { |
| | | type: res.data.type + ";charset=utf-8", |
| | | }); |
| | | let src = window.URL.createObjectURL(blob); |
| | | if (src) { |
| | | let link = document.createElement("a"); |
| | | link.style.display = "none"; |
| | | link.href = src; |
| | | link.setAttribute("download", "文件名字.xls"); |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); //下载完成移除元素 |
| | | window.URL.revokeObjectURL(src); //释放掉blob对象 |
| | | // console.log('res',res) |
| | | if(res){ |
| | | func.downloadFileByBlob(res); |
| | | } |
| | | }) |
| | | |
| | | } |
| | | }; |
| | | }, |