feat: 添加异步导出功能,优化导出图片的下载流程

This commit is contained in:
bighuixiang
2025-07-22 20:39:10 +08:00
parent 3652e0a384
commit 46ef450dfb
4 changed files with 152 additions and 56 deletions

View File

@@ -810,7 +810,7 @@ export class CanvasManager {
* @param {Boolean} options.restoreOpacityInRedGreen 红绿图模式下是否恢复透明度为1
* @returns {String} 导出的图片数据URL
*/
exportImage(options = {}) {
async exportImage(options = {}) {
if (!this.exportManager) {
console.error("导出管理器未初始化,请确保已设置图层管理器");
throw new Error("导出管理器未初始化");
@@ -852,7 +852,7 @@ export class CanvasManager {
}
}
return this.exportManager.exportImage(enhancedOptions);
return await this.exportManager.exportImage(enhancedOptions);
} catch (error) {
console.error("CanvasManager导出图片失败:", error);
throw error;