From 691a8a720d1838d5dbfa3401ed02ef870adc37bd Mon Sep 17 00:00:00 2001 From: lzp Date: Tue, 31 Mar 2026 17:22:46 +0800 Subject: [PATCH] 1 --- .../Canvas/DepthCanvas/depth-canvas.vue | 12 ++++++++---- src/components/Canvas/DepthCanvas/index.vue | 18 +++++++++++++----- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/components/Canvas/DepthCanvas/depth-canvas.vue b/src/components/Canvas/DepthCanvas/depth-canvas.vue index e4a1fe2..2bbd79e 100644 --- a/src/components/Canvas/DepthCanvas/depth-canvas.vue +++ b/src/components/Canvas/DepthCanvas/depth-canvas.vue @@ -53,10 +53,14 @@ } }) const onWorkbench = async () => { - exportCanvasToImage(canvasManager.canvas).then((url) => { - const { canvas, images } = canvasManager.getCanvasDisUrlJSON() - emit('workbench', { url, canvas, images }) - }) + if (stateManager.historyIndex.value === 0) { + emit('close') + } else { + exportCanvasToImage(canvasManager.canvas).then((url) => { + const { canvas, images } = canvasManager.getCanvasDisUrlJSON() + emit('workbench', { url, canvas, images }) + }) + } } // 准备就绪 diff --git a/src/components/Canvas/DepthCanvas/index.vue b/src/components/Canvas/DepthCanvas/index.vue index 1d4f7d5..8276ed6 100644 --- a/src/components/Canvas/DepthCanvas/index.vue +++ b/src/components/Canvas/DepthCanvas/index.vue @@ -1,7 +1,16 @@ @@ -62,9 +71,8 @@ } // 关闭 const onClose = () => { - depthCanvasRef.value.onWorkbench() - // dialogVisible.value = false - // config.value.onClose?.() + dialogVisible.value = false + config.value.onClose?.() } defineExpose({