深度画布联调

This commit is contained in:
lzp
2026-03-17 10:53:43 +08:00
parent 8267f13491
commit 9aa9c8193c
7 changed files with 80 additions and 47 deletions

View File

@@ -1,7 +1,7 @@
<template>
<fullscreen-dialog v-model="dialogVisible" hide-destroy>
<div class="canvas-box">
<depth-canvas :config="config" @close="close" />
<depth-canvas :config="config" @workbench="onWorkbench" @close="onClose" />
</div>
</fullscreen-dialog>
</template>
@@ -12,23 +12,25 @@
import { ref } from 'vue'
const dialogVisible = ref(false)
const config = ref({
width: 750,
height: 600,
id: '',
url: ''
})
const open = (options) => {
config.value = options
dialogVisible.value = true
// config.value = options || {}
const defaultConfig = {
canvasWidth: 750,
canvasHeight: 600,
canvasViewWidth: 750,
canvasViewHeight: 600,
}
config.value = { ...defaultConfig, ...options || {} }
}
const close = () => {
// 工作区
const onWorkbench = (options) => {
dialogVisible.value = false
config.value.onWorkbench?.(options)
}
// 关闭
const onClose = () => {
dialogVisible.value = false
config.value.onClose?.()
}
defineExpose({
open,
close