支持模板预览/字段字典、产品绑定 LabelTemplateId、订单 Pending→Ready 生成 PDF,以及 order/print、批量与仓内 printUrl。 Co-authored-by: Cursor <cursoragent@cursor.com>
57 lines
1.4 KiB
C#
57 lines
1.4 KiB
C#
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; }
|
||
}
|