export.js 919 B

12345678910111213141516171819202122232425
  1. function excelExport(checkAllSign,checkData,url,sum,token) {
  2. if (checkAllSign) {
  3. if (sum > 10000){
  4. if (!confirm('导出条数超过一万条,耗时可能过长,您确定继续吗?'))return;
  5. }
  6. let thisUrl=document.URL;
  7. let parameter=thisUrl.split('?',2);
  8. url += "?checkAllSign=true";
  9. if (parameter[1])url+="&"+parameter[1];
  10. location.href=url;
  11. }else {
  12. if (checkData && checkData.length <= 0) {
  13. tempTip.setDuration(4000);
  14. tempTip.showSuccess('没有勾选任何记录');
  15. } else {
  16. let form=$('<form hidden method="post" target="_blank" action="'+url+'">' +
  17. '<input name="_token" value="'+token+'">' +
  18. "<input name='data' value='"+checkData+"' >" +
  19. '</form>');
  20. $('body').append(form);
  21. form.submit();
  22. }
  23. }
  24. }