diff --git a/src/components/Canvas/FlowCanvas/components/header-tools.vue b/src/components/Canvas/FlowCanvas/components/header-tools.vue
index 32249a3..2f840b0 100644
--- a/src/components/Canvas/FlowCanvas/components/header-tools.vue
+++ b/src/components/Canvas/FlowCanvas/components/header-tools.vue
@@ -11,10 +11,14 @@
-
+
+
@@ -26,7 +30,8 @@
import { TOOLS } from '../manager/ToolManager'
const props = defineProps({
zoom: { default: 1, type: Number },
- step: { default: 0.1, type: Number }
+ step: { default: 0.1, type: Number },
+ downloadData: { default: {}, type: Object }
})
const emit = defineEmits(['export', 'import'])
const stateManager = inject('stateManager') as any
@@ -109,8 +114,21 @@
cursor: not-allowed;
}
}
- > button {
- width: 10rem;
+ > div{
+ position: relative;
+ > .mask{
+ position: absolute !important;
+ top: 0;
+ left: 0;
+ height: 100%;
+ width: 100%;
+ zoom: .6;
+ pointer-events: none;
+ }
+ }
+ button {
+ // width: 10rem;
+ padding: 0 2.4rem;
height: 3rem;
border-radius: 0.4rem;
border: none;
@@ -118,12 +136,15 @@
color: #fff;
font-size: 1.1rem;
display: flex;
+ gap: 0.8rem;
align-items: center;
justify-content: center;
- gap: 0.8rem;
+ position: relative;
+ cursor: pointer;
&:active {
opacity: 0.8;
}
}
+
}
diff --git a/src/components/Canvas/FlowCanvas/components/nodes/cards/index.vue b/src/components/Canvas/FlowCanvas/components/nodes/cards/index.vue
index 447593c..ee7c74c 100644
--- a/src/components/Canvas/FlowCanvas/components/nodes/cards/index.vue
+++ b/src/components/Canvas/FlowCanvas/components/nodes/cards/index.vue
@@ -155,12 +155,6 @@
}
})
})
- stateManager.recordState()
- // } else {
- // subordNode.data.data.url =
- // 'https://s3-alpha-sig.figma.com/img/8ce2/f1a4/12b93da90e5f17109e7430f14837fd14?Expires=1773619200&Key-Pair-Id=APKAQ4GOSFWCW27IBOMQ&Signature=kmLsTFtXJqfvuxj6husWlDkRDMOIRDjzUUjb7zh79GkBKihUHc0f59k5OAImHTPdaiEREUCCpn~8sQ-si5lenuauJpApCmAU~NsxjfQhuh9m5O~GiHenr2fKu0DIJ75-oCE3859fyxoSFXQgZ9PRmeb98kikMR6uRX9nI5TPUHgKO8ZgkhDBTW~iyaDT~1ybnoK7elPa6T2VzfO-bpIyY-MZ71VRq3RxwmZRxduqHEb3Dh-jjrHyh2SoQsHmUjSJOf-uYilfvpGUResZAjAq8ZVLEjvhzKC2bmCNZIp3RmhYO8ctU7pd5t91J6Xaa6jBLtGfMxbqIm652EC79K0RoA__'
- // setTimeout(() => stateManager.recordState())
- // }
}
//删除功能卡片
const onDeleteClick = ()=>{
diff --git a/src/components/Canvas/FlowCanvas/components/nodes/cards/to-real-style.vue b/src/components/Canvas/FlowCanvas/components/nodes/cards/to-real-style.vue
index 2e9d4d2..e28b9d8 100644
--- a/src/components/Canvas/FlowCanvas/components/nodes/cards/to-real-style.vue
+++ b/src/components/Canvas/FlowCanvas/components/nodes/cards/to-real-style.vue
@@ -28,23 +28,23 @@
const shortcutList = ref([
{
label: 'Change the...',
- value: 'Change the...'
+ value: 'Change the style to a realistic design. '
},
{
label: 'Bright Colors...',
- value: 'Bright Colors...'
+ value: 'Bright colors with modern patterns, change the style to a realistic furniture design. '
},
{
label: 'Make the...',
- value: 'Make the...'
+ value: 'Make the structure more refined and balanced, change the style to a realistic furniture style. '
},
{
label: 'Imagine...',
- value: 'Imagine...'
+ value: 'Imagine this furniture with detailed fabric textures, change the style to a realistic design. '
},
{
label: 'Wood Materials with...',
- value: 'Wood Materials with...'
+ value: 'Wood materials with natural oak texture and soft fabric, change the style to a realistic furniture design.'
}
])
const modeList = ref([
diff --git a/src/components/Canvas/FlowCanvas/components/nodes/result-image.vue b/src/components/Canvas/FlowCanvas/components/nodes/result-image.vue
index 1373186..edde429 100644
--- a/src/components/Canvas/FlowCanvas/components/nodes/result-image.vue
+++ b/src/components/Canvas/FlowCanvas/components/nodes/result-image.vue
@@ -161,6 +161,7 @@
item.scale.x = -item.scale.x
})
stateManager.recordState()
+ stateManager.exportFlow(stateManager.saveCanvasTimeInterval)
}
},
{
@@ -174,6 +175,7 @@
item.scale.y = -item.scale.y
})
stateManager.recordState()
+ stateManager.exportFlow(stateManager.saveCanvasTimeInterval)
}
}
])
diff --git a/src/components/Canvas/FlowCanvas/flow-canvas.vue b/src/components/Canvas/FlowCanvas/flow-canvas.vue
index ae727e8..314951f 100644
--- a/src/components/Canvas/FlowCanvas/flow-canvas.vue
+++ b/src/components/Canvas/FlowCanvas/flow-canvas.vue
@@ -47,7 +47,7 @@
-
+
()
const nodeTypes = ref([NODE_TYPE.INPUT, NODE_TYPE.SECONDARY, NODE_TYPE.OUTPUT, NODE_TYPE.ALONE])
-
// 状态管理器
- const stateManager = new StateManager({ vueFlow })
+ const stateManager = new StateManager({ vueFlow,sketchId:props.config.imgId })
provide('stateManager', stateManager)
// 事件管理器
@@ -191,29 +190,34 @@
}
// 导出流程
const getFlowJson = () => {
- if(!stateManager.isSave.value)return ''
return JSON.stringify(stateManager.nodes.value)
}
- const exportFlow = () => {
+ const downloadData = ref({
+ amount: 0,
+ progress: 0,
+ status: 'success',//success
+ })
+ const exportFlow = async () => {
// console.log(vueFlow.value)
// console.log(vueFlow.value.toImage)
let arr = stateManager.nodes.value.filter((v) => v.data.type === NODE_COMPONENT.RESULT_IMAGE)
let imgList = []
- arr.forEach((v) => {
+ arr.forEach((v,i) => {
v.data.data.imageProcessTasks.forEach((item,index) => {
let url = item.url
let name = url?.split(".").pop().split("?").shift();
- imgList.push({url:url,name:`${v.data.type}${index == 0?'':index}.${name}`})
+ imgList.push({url:url,name:`${v.data.type}${i}-${index == 0?'':index}.${name}`})
})
})
- downImgListToZip(imgList)
- console.log(imgList)
+ downloadData.value.amount = imgList.length
+ downloadData.value.status = 'loading'
+ await downImgListToZip(imgList,(progress)=>{
+ downloadData.value.progress = progress
+ if(progress == downloadData.value.amount){
+ downloadData.value.status = 'success'
+ }
+ })
return
- // flowManager.exportFlow()
- const str = getFlowJson()
- stateManager.isSave.value = false
- emit('exportFlow', str)
- // localStorage.setItem('flow_json', str)
}
// 导入流程
const importFlow = async (json) => {
diff --git a/src/components/Canvas/FlowCanvas/index.vue b/src/components/Canvas/FlowCanvas/index.vue
index 98f83a6..2b64496 100644
--- a/src/components/Canvas/FlowCanvas/index.vue
+++ b/src/components/Canvas/FlowCanvas/index.vue
@@ -1,6 +1,6 @@
-
+
@@ -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
})