From 690644eff312a63bb678a41fc626923b00fd6270 Mon Sep 17 00:00:00 2001 From: taqi be Date: Tue, 21 Jan 2025 13:24:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=A0=87=E7=AD=BE=E5=AE=BD=E9=AB=98?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/deviceInfo/index.vue | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pages/deviceInfo/index.vue b/src/pages/deviceInfo/index.vue index bda1a47..b55500b 100644 --- a/src/pages/deviceInfo/index.vue +++ b/src/pages/deviceInfo/index.vue @@ -199,12 +199,10 @@ async function onPrint(row: any) { const res = await getDeviceLabelBase64(row.id) if (isResError(res)) return const pdf = new jsPDF('l', 'mm', [60, 40]) - const pdfWidth = pdf.internal.pageSize.getWidth() // 标签的宽度 const imgData = res.data - - const imgWidth = pdfWidth - const imgHeight = (pdfWidth * 3) / 4 + const imgWidth = 60 + const imgHeight = 40 // 添加图片到标签的 PDF 中 pdf.addImage(imgData, 'JPEG', 0, 0, imgWidth, imgHeight)