调整画布保存机制,把保存画布接口放到状态管理中,完善toRealStyle提示词

This commit is contained in:
X1627315083@163.com
2026-03-19 10:36:12 +08:00
parent 276115ef65
commit ce9843fed9
9 changed files with 94 additions and 63 deletions

View File

@@ -1,6 +1,6 @@
<template>
<fullscreen-dialog v-model="dialogVisible" @close="close" hide-destroy>
<flow-canvas ref="flowCanvasRef" :config="config" @exportFlow="exportFlow" />
<flow-canvas ref="flowCanvasRef" :config="config" />
</fullscreen-dialog>
</template>
@@ -31,22 +31,7 @@
config.value.json = json
dialogVisible.value = true
}
const exportFlow = async (str) => {
if(!config.value.imgId || !str)return
await new Promise((resolve) => {
putSketchFlowCanvas({
id: config.value.imgId,
canvasData: str },true).then(() => {
resolve(true)
}).catch(() => {
resolve(true)
})
})
}
const close = async () => {
const str = flowCanvasRef.value?.getFlowJson()
await exportFlow(str)
dialogVisible.value = false
}
const handleBeforeUnload = (event) => {
@@ -67,7 +52,6 @@
defineExpose({
open,
close,
exportFlow
})
</script>
<style lang="less" scoped>