调整画布保存机制,把保存画布接口放到状态管理中,完善toRealStyle提示词
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user