diff --git a/frontend/src/pages/admin/CreateProductDialog.tsx b/frontend/src/pages/admin/CreateProductDialog.tsx index 9c08f31..a55a027 100644 --- a/frontend/src/pages/admin/CreateProductDialog.tsx +++ b/frontend/src/pages/admin/CreateProductDialog.tsx @@ -284,6 +284,38 @@ export default function CreateProductDialog({ open, onClose, onCreated }: Props) }; }); + // ============================================================ + // 打印标签 + // ============================================================ + + function printCurrentQRCode() { + if (!createdSn) return; + const qrUrl = `/api/v1/products/qrcode/${createdSn}`; + const printWindow = window.open("", "_blank", "width=600,height=600"); + if (!printWindow) return; + printWindow.document.write(` + + + 打印标签 - ${createdSn} + + + + +
${createdSn}
+ + + `); + printWindow.document.close(); + } + // ============================================================ // 渲染 // ============================================================ @@ -310,10 +342,10 @@ export default function CreateProductDialog({ open, onClose, onCreated }: Props)

产品创建成功!

- -