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)