This commit is contained in:
X1627315083@163.com
2026-03-17 11:06:32 +08:00
parent 9aa9c8193c
commit 2ad392037e
5 changed files with 27 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
<template>
<fullscreen-dialog v-model="dialogVisible" hide-destroy>
<flow-canvas :config="config" @exportFlow="exportFlow" />
<fullscreen-dialog v-model="dialogVisible" @close="close" hide-destroy>
<flow-canvas ref="flowCanvasRef" :config="config" @exportFlow="exportFlow" />
</fullscreen-dialog>
</template>
@@ -12,6 +12,7 @@
const dialogVisible = ref(false)
const config = ref({}) as any
const flowCanvasRef = ref<any>()
const open = async (options) => {
let json = []
await new Promise((resolve) => {
@@ -29,7 +30,7 @@
dialogVisible.value = true
}
const exportFlow = async (str) => {
if(!config.value.imgId)return
if(!config.value.imgId || !str)return
await new Promise((resolve) => {
putSketchFlowCanvas({
id: config.value.imgId,
@@ -41,7 +42,9 @@
})
}
const close = () => {
const close = async () => {
const str = flowCanvasRef.value?.getFlowJson()
await exportFlow(str)
dialogVisible.value = false
}
defineExpose({