修改文件导出改为post传参;修复拦截修复策略必选属性为空不提示问题
This commit is contained in:
@@ -117,27 +117,24 @@ Date.prototype.Format = function (fmt) {
|
||||
function aJaxImportPost(url, params) {
|
||||
top.$.jBox.tip("onloading",'loading',{opacity:0.5,persistent:true});
|
||||
// 创建form元素
|
||||
var temp_form = document.createElement("form");
|
||||
temp_form.id = "temp_form";
|
||||
var temp_form = document.createElement("form");
|
||||
// 设置form属性
|
||||
temp_form .id = 'temp_form';
|
||||
temp_form .action = url;
|
||||
temp_form .target = "_self";
|
||||
temp_form .method = "post";
|
||||
temp_form .style.display = "none";
|
||||
temp_form .style.display = "none";
|
||||
// 处理需要传递的参数
|
||||
for (var x in params) {
|
||||
var opt = document.createElement("textarea");
|
||||
opt.name = x;
|
||||
opt.value = params[x];
|
||||
temp_form .appendChild(opt);
|
||||
}
|
||||
document.body.appendChild(temp_form);
|
||||
url=url+"?";
|
||||
url+="&"+$('#temp_form').serialize();
|
||||
}
|
||||
document.body.appendChild(temp_form);
|
||||
var xmlResquest = new XMLHttpRequest();
|
||||
xmlResquest.open("POST", url, true);
|
||||
xmlResquest.setRequestHeader("Content-type", "application/json");
|
||||
xmlResquest.setRequestHeader("Content-Disposition","attachment");
|
||||
xmlResquest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
||||
xmlResquest.responseType = "blob";
|
||||
xmlResquest.onload = function (oEvent) {
|
||||
var contDisp = xmlResquest.getResponseHeader("content-disposition")
|
||||
@@ -150,13 +147,12 @@ function aJaxImportPost(url, params) {
|
||||
elink.href = URL.createObjectURL(blob);
|
||||
document.body.appendChild(elink);
|
||||
elink.click();
|
||||
document.body.removeChild(elink);
|
||||
|
||||
document.body.removeChild(elink);
|
||||
};
|
||||
xmlResquest.onreadystatechange = function() {
|
||||
if (xmlResquest.readyState==4) {
|
||||
top.$.jBox.closeTip();
|
||||
}
|
||||
};
|
||||
xmlResquest.send();
|
||||
xmlResquest.send($("#temp_form").serialize());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user