Jun

添加base的下载方法

......@@ -191,6 +191,30 @@ define(['i18n!base/nls/resource', 'cls', 'jquery', '../authz.jsonp?callback=defi
}
}
})
},
download:function(filename,path,url){
if(!url){
url='./download';
}
if(filename){
var form=$('<form action="'+ url +'" method="post"></form>').appendTo(document.body);
form.append('<input type="hidden" name="fileName" value="'+filename+'" />');
if(path){
form.append('<input type="hidden" name="filePath" value="'+filePath+'" />');
}
form.submit();
setTimeout(function(){
form.remove();
}, 60*10000);
}
},
downloadErrorExcel:function(fileName,path){
var url = "./excelImport/downloadError";
this.download(fileName,path,url);
},
downloadExcelTemplate:function(){
var url = "./excelImport/downloadExcelTemplate";
this.download(filename,null,url);
}
/**
* 只读但可以删除
......