1.页面上遍历checkbox
$("#checkAll").click(function(){
if(this.checked){
$(".thesisCheck").attr("checked", true);
}else{
$(".thesisCheck").attr("checked", false);
}
});
//批量下载
function plDownload(){
var valArr = new Array;
var c=0;
$('input[name="selectThesis"]:checked').each(function(i){
valArr[i] = $(this).val();
c++;
});
if(c==0){
alert("请选择需要下载的文件!");
return;
}else{
var vals = valArr.join(',');//转换为逗号隔开的字符串
if(c==1){
window.location.href = "../thesis/download.do?tcLwId="+vals;
}else{
window.location.href = "../thesis/downloadZip.do?tcLwIds="+vals;
}
}
}
//教师论文批量打包下载
/**
* 批量打包下载文件生成zip文件下载* @param session
*/
@RequestMapping("downloadZip.do")
public String downloadFiles(String tcLwIds,HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
List<File> files = new ArrayList<File>();
System.out.println("需要批量下载的教师论文文件id:tcLwIds:"+tcLwIds);
if(""==tcLwIds||null==tcLwIds){
System.out.println("下载的文件不存在");
return "redirect:tclist.do";
&n

最低0.47元/天 解锁文章
2575

被折叠的 条评论
为什么被折叠?



