/*** data数据* maintitle 主类型,如:商品收益明细_* fileType 如:.xls* emimeType:如:application/vnd.ms-excel* customize:是否自定义时间*/
export function downLoad(data, mainTitle, fileType, emimeType, customize) {//下载文件let blob = new Blob([data], { type: emimeType });var time = moment().format('YYYYMMDDHHmmss');var fileName = mainTitle + time + fileType;var a = document.createElement('a');document.body.appendChild(a);a.download = customize ? mainTitle + fileType : fileName;a.href = URL.createObjectURL(blob);a.click();
}