|
|
|
@ -199,12 +199,10 @@ async function onPrint(row: any) {
@@ -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) |
|
|
|
|