From 48c9c5f00f66b0312e7018f7f366ef1be9621d4a Mon Sep 17 00:00:00 2001 From: 86156 <823267011@qq.com> Date: Fri, 9 Jan 2026 14:25:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=AD=A3=E5=89=8D=E7=AB=AF=E5=86=85?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/wms/coil/panels/LabelRender/index.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/klp-ui/src/views/wms/coil/panels/LabelRender/index.vue b/klp-ui/src/views/wms/coil/panels/LabelRender/index.vue index 64c760ae..7b03a6d3 100644 --- a/klp-ui/src/views/wms/coil/panels/LabelRender/index.vue +++ b/klp-ui/src/views/wms/coil/panels/LabelRender/index.vue @@ -166,7 +166,7 @@ export default { style: ` @page { size: ${paperWidthMm}mm ${paperHeightMm}mm; - margin: 0 !important; + margin: 2mm !important; /* 留出页边距,避免紧贴边框 */ padding: 0 !important; } * { @@ -181,8 +181,8 @@ export default { overflow: hidden !important; } #${printContainerId} { - width: ${paperWidthMm}mm !important; - height: ${paperHeightMm}mm !important; + width: calc(${paperWidthMm}mm - 4mm) !important; /* 两侧各2mm的页边距后可用宽度 */ + height: calc(${paperHeightMm}mm - 4mm) !important; /* 上下各2mm的页边距后可用高度 */ margin: 0 !important; padding: 0 !important; display: flex !important; @@ -190,10 +190,10 @@ export default { justify-content: center !important; } #${printContainerId} canvas { - width: ${paperWidthMm}mm !important; - height: ${paperHeightMm}mm !important; - max-width: ${paperWidthMm}mm !important; - max-height: ${paperHeightMm}mm !important; + width: 100% !important; + height: 100% !important; + max-width: calc(${paperWidthMm}mm - 4mm) !important; + max-height: calc(${paperHeightMm}mm - 4mm) !important; object-fit: contain !important; border: none !important; }