| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- function excelExport(checkAllSign,checkData,url,sum,token,reservation = null) {
- if (checkAllSign) {
- if (sum > 10000){
- if (!confirm('导出条数超过一万条,耗时可能过长,您确定继续吗?'))return;
- }
- if (sum > 1000000){
- tempTip.setDuration(3000);
- tempTip.showSuccess('导出条数超过百万条,超出最大执行条目!');
- return;
- }
- let thisUrl=document.URL;
- let parameter=thisUrl.split('?',2);
- url += "?checkAllSign=true";
- if (reservation) {
- for (let key in reservation){
- url += "&"+key+"="+reservation[key];
- }
- }
- if (parameter[1])url+="&"+parameter[1];
- location.href=url;
- }else {
- if (checkData && checkData.length <= 0) {
- tempTip.setDuration(3000);
- tempTip.showSuccess('没有勾选任何记录');
- } else {
- let html = '<form hidden method="post" target="_blank" action="'+url+'">' +
- '<input name="_token" value="'+token+'">' +
- "<input name='data' value='"+checkData+"' >" ;
- if (reservation){
- for (let key in reservation){
- html += '<input name="'+key+'" value="'+reservation[key]+'">';
- }
- }
- html += '</form>';
- let form=$(html);
- $('body').append(form);
- form.submit();
- }
- }
- }
|