1、带参数导出
var MyForm = document.createElement("form");
var MyinputBeginDate = document.createElement("input");
MyinputBeginDate.name = 'beginDate';
MyinputBeginDate.value = this.state.date[0]? this.state.date[0]:"";
var MyinputEndDate = document.createElement("input");
MyinputEndDate.name = 'endDate';
MyinputEndDate.value = this.state.date[1]?this.state.date[1]:"" ;
var MyinputIsSubmit = document.createElement("input");
MyinputIsSubmit.name = 'isSubmit';
MyinputIsSubmit.value = this.state.isSubmit;
var MyinputFaultStatus = document.createElement("input");
MyinputFaultStatus.name = 'faultStatus';
MyinputFaultStatus.value = this.state.faultStatus;
MyForm.appendChild(MyinputBeginDate);
MyForm.appendChild(MyinputEndDate);
MyForm.appendChild(MyinputIsSubmit);
MyForm.appendChild(MyinputFaultStatus);
MyForm.action = java_url+":"+java_port+"/boss/declare/downloadExcel";
MyForm.target = "dLoadIfm";
MyForm.method = "post";
var Iframe = document.createElement("iframe");
Iframe .name = "dLoadIfm";
MyForm.style.display = "none";
Iframe.style.display = "none";
document.body.appendChild(Iframe);
document.body.appendChild(MyForm);
MyForm.submit();
2、不带参数导出
let iframe = document.createElement("iframe");
iframe.style.display = "none";
iframe.style.width="10px"
iframe.style.height="10px"
iframe.src=java_url+":"+java_port+"/boss/report/generateReport/null"
document.body.appendChild(iframe);