/**
 * @description  二进制流文档 并且下载至本地
 * @param {String} data 二进制流文档
 * @param {String} name 文件名字
 * @param {type} type 文档类型
 */
export const toDownloadExcel = (data, name, type = '') => {
  let blob = new Blob([data], { type: type });
  let objectUrl = URL.createObjectURL(blob);
  const link = document.createElement('a')
  link.style.display = 'none'
  link.href = objectUrl
  link.setAttribute('download', name)
  document.body.appendChild(link)
  link.click()
  document.body.removeChild(link)
}