admin/src/Oms.Application/Labeling/Hiprint/LabelDrawOps.cs
zzh b679151eb1 feat: Hiprint模板转QuestPDF异步出面单,并接通打印链路
支持模板预览/字段字典、产品绑定 LabelTemplateId、订单 Pending→Ready 生成 PDF,以及 order/print、批量与仓内 printUrl。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-18 14:52:39 +08:00

57 lines
1.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

namespace Oms.Application.Labeling.Hiprint;
/// <summary>
/// 中间绘制指令(与具体 PDF 引擎解耦)。
/// 坐标单位:pt;页面尺寸:mm(再换算)。
/// </summary>
public sealed class LabelPageIr
{
public float WidthMm { get; init; } = 100f;
public float HeightMm { get; init; } = 150f;
public List<LabelDrawOp> Ops { get; init; } = [];
}
public abstract class LabelDrawOp
{
public float LeftPt { get; init; }
public float TopPt { get; init; }
public float WidthPt { get; init; }
public float HeightPt { get; init; }
}
public sealed class LabelTextOp : LabelDrawOp
{
public string Text { get; init; } = string.Empty;
public float FontSizePt { get; init; } = 10f;
public bool Bold { get; init; }
public string? ColorHex { get; init; }
public string Align { get; init; } = "left";
public bool Wrap { get; init; }
}
public sealed class LabelBarcodeOp : LabelDrawOp
{
public string Content { get; init; } = string.Empty;
public bool QrCode { get; init; }
}
public sealed class LabelLineOp : LabelDrawOp
{
public bool Vertical { get; init; }
public string? ColorHex { get; init; }
public float ThicknessPt { get; init; } = 1f;
}
public sealed class LabelRectOp : LabelDrawOp
{
public string? BorderColorHex { get; init; }
public float BorderWidthPt { get; init; } = 1f;
}
public sealed class LabelImageOp : LabelDrawOp
{
public string? Src { get; init; }
}