import {downloadExcel} from "@/api/report";

export default {
  PostDownloadExcel(excelQueryParam,fileName){
    downloadExcel(excelQueryParam).then(res=>{
    const blob1 = res;
    if ("download" in document.createElement("a")) {
      const elink = document.createElement("a");
      elink.download = decodeURIComponent(fileName);
      elink.style.display = "none";
      elink.href = URL.createObjectURL(blob1);
      document.body.appendChild(elink);
      elink.click();
      console.log(elink)
      URL.revokeObjectURL(elink.href);
      document.body.removeChild(elink);
    } else {
      navigator.msSaveBlob(blob1, fileName);
    }
    })
  }



}
