From d8291e47afb82654baa077eed9c1cf3e056cee4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Fri, 13 Jun 2025 18:13:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=93=E5=8D=B0=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=20=E6=B7=BB=E5=8A=A0=E5=A4=9A=E5=BC=A0=E6=89=93?= =?UTF-8?q?=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/boardGenerate/index.vue | 15 ++- src/views/print/index.vue | 134 ++++++++++++++++---------- src/views/print/nodes/image.vue | 4 +- src/views/print/nodes/selectNode.vue | 79 +++++++++++++--- src/views/print/tool.js | 23 +++-- src/views/print/view.vue | 135 +++++++++++++++++++++------ 6 files changed, 277 insertions(+), 113 deletions(-) diff --git a/src/views/boardGenerate/index.vue b/src/views/boardGenerate/index.vue index 94a2101..af60365 100644 --- a/src/views/boardGenerate/index.vue +++ b/src/views/boardGenerate/index.vue @@ -242,19 +242,19 @@ + @change="updateNode(nodeDataForm.id,nodeDataForm,{ replace: true })" /> + @change="updateNode(nodeDataForm.id,nodeDataForm,{ replace: true })" /> + @change="updateNode(nodeDataForm.id,nodeDataForm,{ replace: true })" /> + @change="updateNode(nodeDataForm.id,nodeDataForm,{ replace: true })" /> @@ -437,10 +437,9 @@ diff --git a/src/views/print/tool.js b/src/views/print/tool.js index 916f788..6af01e0 100644 --- a/src/views/print/tool.js +++ b/src/views/print/tool.js @@ -1,5 +1,5 @@ import { useVueFlow } from '@vue-flow/core'; -import { ref, watch } from 'vue'; +import { ref } from 'vue'; import { v4 as uuidv4 } from 'uuid'; @@ -13,18 +13,25 @@ const cmToPx = (cm) => { const getOption = (e) => { + let commonOption = { field: '' }; if (e === 'text') { - return { field: '', default: '' }; + return { ...commonOption, default: '' }; } else if (e === 'image') { - return { field: '', imageSrc: '', imageType: '' }; + return { ...commonOption, imageSrc: '', imageType: '' }; } else if (e === 'barCode') { - return { field: '', default: '' }; + return { ...commonOption, default: '' }; } else if (e === 'QRCode') { - return { field: '', default: '' }; + return { ...commonOption, default: '' }; } else if (e === 'dateTime') { - return { field: '', dateTimeType: '' }; + return { ...commonOption, dateTimeType: '' }; } else if (e === 'select') { - return { field: '', default: '', selectOptions: [] }; + return { + ...commonOption, + default: '', + selectOptions: [], + horizontalAlign: 'center', + verticalAlign: 'center' + }; } else { return {}; } @@ -40,6 +47,8 @@ const getNodeSize = (e) => { return { width: cmToPx(5), height: cmToPx(5) }; } else if (e === 'dateTime') { return { width: cmToPx(8), height: cmToPx(1) }; + } else if (e === 'select') { + return { width: cmToPx(4), height: cmToPx(1) }; } else { return { width: cmToPx(5), height: cmToPx(2) }; } diff --git a/src/views/print/view.vue b/src/views/print/view.vue index 91e0120..461991d 100644 --- a/src/views/print/view.vue +++ b/src/views/print/view.vue @@ -1,53 +1,127 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - + + + 打印 + + 关闭 + + +