fujunling
2023-06-20 ff182ac475ea169057956ab182d38236d7ee87a1
Source/UBCS-WEB/src/util/func.js
@@ -110,4 +110,18 @@
  static isValuableObj(value) {
    return typeof value === 'object' && value !== null && Object.keys(value).length > 0;
  }
  /**
   * 获取流文件进行文件下
   * @param value
   * @returns {Boolean}
   */
  static downloadFileByBlob(blobData, name) {
    const url = URL.createObjectURL(blobData); // 生成下载链接
    const link = document.createElement("a");
    link.href = url;
    link.download = name; // 指定文件名和格式
    document.body.appendChild(link); // 添加下载链接到页面
    link.click(); // 触发下载
    document.body.removeChild(link); //删除下载
  }
}