(function(doc, win) { var docEl = doc.documentElement, resizeEvt = "orientationchange" in window ? "orientationchange" : "resize", recalc = function() { if (docEl.clientWidth > 750) { docEl.style.fontSize = "100px"; doc.getElementById("app").style.width = "750px"; } else { var width = docEl.clientWidth / 7.5; docEl.style.fontSize = width + "px"; doc.getElementById("app").style.width = "auto"; } }; if (!doc.addEventListener) return; win.addEventListener(resizeEvt, recalc, false); doc.addEventListener("DOMContentLoaded", recalc, false); })(document, window); // 导出 function downloadExcel(data, fileName) { if (!data) { return } const a = moment().format('YYYYMMDDHHmmss') const fname = fileName + a const blob = new Blob([data], { type: 'application/vnd.ms-excel' }) if (window.navigator && window.navigator.msSaveOrOpenBlob) { console.log('22222') navigator.msSaveBlob(blob, fname + '.xlsx') } else { const link = document.createElement('a') link.style.display = 'none' var href = URL.createObjectURL(blob) link.href = href alert('111111') // window.location.href = 'https://jg-ocs.oss-cn-beijing.aliyuncs.com/templ/promo/sendOutOrderImport.xlsx' link.setAttribute('download', fname + '.xlsx') document.body.appendChild(link) link.click() document.body.removeChild(link) window.URL.revokeObjectURL(href) // 释放掉blob对象 } }