From df33a96186de897ecc7d7080ac54708f97a719b1 Mon Sep 17 00:00:00 2001 From: qiuhongwu Date: Fri, 2 Feb 2024 10:42:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8D=B0=E5=90=AF=E5=8A=A8=E5=8D=95?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../heli/deliverorder/shipmentsPrint.vue | 2 +- .../views/heli/projectorder/startprint.vue | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/deliverorder/shipmentsPrint.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/deliverorder/shipmentsPrint.vue index 3045106c..6bebc065 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/deliverorder/shipmentsPrint.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/deliverorder/shipmentsPrint.vue @@ -570,7 +570,7 @@ onMounted(() => { const base64String = canvas.toDataURL('image/png') logoDataUrl.value = base64String } - logoImage.src = '/src/assets/imgs/exlogo.png' // 替换为您的Logo图片路径 + logoImage.src = '/src/assets/imgs/exlogo.png' // 替换为Logo图片路径 }) diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/projectorder/startprint.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/projectorder/startprint.vue index 54f3c15c..6d802efb 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/projectorder/startprint.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/projectorder/startprint.vue @@ -7,7 +7,7 @@
- +
@@ -389,6 +389,23 @@ const resetForm = () => { approveUserName: undefined } } + + +const logoDataUrl = ref('') // 存储Logo的Base64编码数据URL +onMounted(() => { + // 在组件挂载后,将Logo图片转换为Base64编码数据URL + const logoImage = new Image() + logoImage.onload = () => { + const canvas = document.createElement('canvas') + canvas.width = logoImage.width + canvas.height = logoImage.height + const context = canvas.getContext('2d') + context.drawImage(logoImage, 0, 0) + const base64String = canvas.toDataURL('image/png') + logoDataUrl.value = base64String + } + logoImage.src = '/src/assets/imgs/exlogo.png' // 替换为Logo图片路径 +})