diff --git a/src/views/print/index.vue b/src/views/print/index.vue index 0be3b97..5daa06e 100644 --- a/src/views/print/index.vue +++ b/src/views/print/index.vue @@ -254,16 +254,17 @@ const logEvent = async (eventname, event) => { break; } }; -const nodes = ref([{ - id: pid.value, - name: 'area', - type: 'area', - position: { - x: 0, - y: 0 - }, - data: {} -}]); +// const nodes = ref([{ +// id: pid.value, +// name: 'area', +// type: 'area', +// position: { +// x: 0, +// y: 0 +// }, +// data: {} +// }]); +const nodes = ref([]); const edges = ref([]); const setPage = (type, width, height) => { @@ -308,6 +309,9 @@ onMounted(() => { zoom: 1 }); }); + nodes.value = JSON.parse(localStorage.getItem('printNodes') || '[]'); + pid.value = nodes.value.find(e => e.name === 'area')?.id; + console.log(nodes.value); }); watch(() => flowRef.value?.viewport, () => { if (flowRef.value && (flowRef.value.viewport.x !== 0 || flowRef.value.viewport.y !== 0)) { diff --git a/src/views/print/view.vue b/src/views/print/view.vue index cfd1667..322c985 100644 --- a/src/views/print/view.vue +++ b/src/views/print/view.vue @@ -3,7 +3,7 @@
+ :style="{pageBreakAfter: 'always',width: cmToPx(pageWidth)+'px',height: cmToPx(pageHeight)+'px',marginBottom:'4px'}">