|
|
@ -526,16 +526,31 @@ export default { |
|
|
|
url: window.SITE_CONFIG["apiURL"] + url, |
|
|
|
method: "post", |
|
|
|
data: { |
|
|
|
// pageSize, |
|
|
|
// pageNo, |
|
|
|
pageSize, |
|
|
|
pageNo, |
|
|
|
...fmData, |
|
|
|
}, |
|
|
|
responseType: "blob", |
|
|
|
}) |
|
|
|
.then((res) => { |
|
|
|
let fileName = window.decodeURI( |
|
|
|
res.headers["content-disposition"].split(";")[1].split("=")[1] |
|
|
|
); |
|
|
|
console.log(res); |
|
|
|
// 明明响应标头中有content-disposition但是打印的res中没有这个字段,暂时写死一个吧 |
|
|
|
// let fileName = window.decodeURI( |
|
|
|
// res.headers["content-disposition"].split(";")[1].split("=")[1] |
|
|
|
// ); |
|
|
|
let yy = new Date().getFullYear(); |
|
|
|
var mm = |
|
|
|
new Date().getMonth() > 9 |
|
|
|
? new Date().getMonth() + 1 |
|
|
|
: new Date().getMonth() == 9 |
|
|
|
? new Date().getMonth() + 1 |
|
|
|
: "0" + (new Date().getMonth() + 1); |
|
|
|
var dd = |
|
|
|
new Date().getDate() < 10 |
|
|
|
? "0" + new Date().getDate() |
|
|
|
: new Date().getDate(); |
|
|
|
let time = `${yy}-${mm}-${dd} `; |
|
|
|
let fileName = `项目管理${time}`; |
|
|
|
console.log("filename", fileName); |
|
|
|
let blob = new Blob([res.data], { type: "application/vnd.ms-excel" }); |
|
|
|
var url = window.URL.createObjectURL(blob); |
|
|
|