var uploader;var $msglist;var filelist;var errorfile;var errorcount;var handlecount;var successcount;var allMaxSize=500;$(function(){initUpLoader()});function onSelectFile(){$msglist.html("");var a=uploader.getFiles();if(a.length>0){uploader.removeFile(a[0].id)}uploader.reset();$("#bntStartUpload").linkbutton({text:"开始上传"});$("#bntStartUpload").linkbutton({disabled:false});$("#bntShowDataList").linkbutton({disabled:true});$("#bntStartAccept").linkbutton({disabled:true});$(".webuploader-element-invisible").trigger("click");$(".msg-box-upload").show();$(".msg-box-upload").css({padding:10});onResetAcceptFormatDesignPage()}function onStartUpload(){var a=uploader.getFiles();if(a.length==0){$("#bntStartUpload").linkbutton({disabled:true});$(".msg-box-upload").hide();return openMessageDlg("请选择一个文件进行上传!")}$("#ctlBtn").trigger("click")}function checkErrorFile(){var c=base_path+"com/webuploader/download.do?filename="+errorfile;var b=window.open(c)}function initUpLoader(){$("#uploadMsgProgress").hide();$(".msg-box-upload").hide();$("#bntStartUpload").linkbutton({disabled:true});$("#bntShowDataList").linkbutton({disabled:true});$("#bntStartAccept").linkbutton({disabled:true});$msglist=$("#msglist");var c=$("#ctlBtn");var d="pending";var a={};var b;if(jsonFormatDesign.code.indexOf("I_RDRIMPORTDATA")>-1||jsonFormatDesign.code.indexOf("I_HLDIMPORTEXCELDATA")>-1||jsonFormatDesign.code.indexOf("I_BIBIMPORTEXCELDATA")>-1||jsonFormatDesign.code.indexOf("I_ORDERMENUBIBIMPORTEXCELDATA")>-1||jsonFormatDesign.code.indexOf("I_ORDERXLSBIBIMPORTEXCELDATA")>-1){b="uploadExcel.do";a={title:"excel",extensions:"xls,xlsx",mimeTypes:"application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}else{if(jsonFormatDesign.code.indexOf("I_BIBIMPORTDATA")>-1){b="uploadMarc.do";a={}}else{if(jsonFormatDesign.code.indexOf("I_CIRIMPORTDATA")>-1||jsonFormatDesign.code.indexOf("E_BIBLABEL")>-1||jsonFormatDesign.code.indexOf("I_CIRDATABACTH")>-1){b="uploadFile.do";a={title:"txt",extensions:"txt"}}else{if(jsonFormatDesign.code.indexOf("I_BIBDATABATCHRECORD")>-1||jsonFormatDesign.code.indexOf("I_HLDIMPORTDATA")>-1){b="uploadFileSplit.do";a={}}}}}uploader=WebUploader.create({pick:"#picker",swf:BASE_URL+"/Uploader.swf",server:base_path+"com/webuploader/"+b,accept:a,auto:true,disableGlobalDnd:true,fileNumLimit:1,fileSizeLimit:allMaxSize*1024*1024,});uploader.on("fileQueued",function(e){$msglist.append('