This commit is contained in:
lzp
2026-03-31 17:22:46 +08:00
parent 973b803f01
commit 691a8a720d
2 changed files with 21 additions and 9 deletions

View File

@@ -53,10 +53,14 @@
} }
}) })
const onWorkbench = async () => { const onWorkbench = async () => {
exportCanvasToImage(canvasManager.canvas).then((url) => { if (stateManager.historyIndex.value === 0) {
const { canvas, images } = canvasManager.getCanvasDisUrlJSON() emit('close')
emit('workbench', { url, canvas, images }) } else {
}) exportCanvasToImage(canvasManager.canvas).then((url) => {
const { canvas, images } = canvasManager.getCanvasDisUrlJSON()
emit('workbench', { url, canvas, images })
})
}
} }
// 准备就绪 // 准备就绪

View File

@@ -1,7 +1,16 @@
<template> <template>
<fullscreen-dialog v-model="dialogVisible" @close="onClose" hide-destroy> <fullscreen-dialog
v-model="dialogVisible"
@close="() => depthCanvasRef.onWorkbench()"
hide-destroy
>
<div class="canvas-box"> <div class="canvas-box">
<depth-canvas ref="depthCanvasRef" :config="config" @workbench="onWorkbench" /> <depth-canvas
ref="depthCanvasRef"
:config="config"
@close="onClose"
@workbench="onWorkbench"
/>
</div> </div>
</fullscreen-dialog> </fullscreen-dialog>
</template> </template>
@@ -62,9 +71,8 @@
} }
// 关闭 // 关闭
const onClose = () => { const onClose = () => {
depthCanvasRef.value.onWorkbench() dialogVisible.value = false
// dialogVisible.value = false config.value.onClose?.()
// config.value.onClose?.()
} }
defineExpose({ defineExpose({