All checks were successful
Build and Deploy / deploy (push) Successful in 1m11s
无 field 时按 title/testData 输出;框高至少字号×1.4,防止设计器矮框打成空白。 Co-authored-by: Cursor <cursoragent@cursor.com>
100 lines
2.5 KiB
C#
100 lines
2.5 KiB
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace Oms.Application.Labeling.Hiprint;
|
|
|
|
/// <summary>
|
|
/// vg-print / hiprint 导出的模板根节点(只映射渲染所需字段)。
|
|
/// </summary>
|
|
public sealed class HiprintTemplateDocument
|
|
{
|
|
[JsonPropertyName("panels")]
|
|
public List<HiprintPanel> Panels { get; set; } = [];
|
|
}
|
|
|
|
public sealed class HiprintPanel
|
|
{
|
|
[JsonPropertyName("index")]
|
|
public int Index { get; set; }
|
|
|
|
/// <summary>纸宽,单位 mm。</summary>
|
|
[JsonPropertyName("width")]
|
|
public float Width { get; set; } = 100f;
|
|
|
|
/// <summary>纸高,单位 mm。</summary>
|
|
[JsonPropertyName("height")]
|
|
public float Height { get; set; } = 150f;
|
|
|
|
[JsonPropertyName("printElements")]
|
|
public List<HiprintPrintElement> PrintElements { get; set; } = [];
|
|
}
|
|
|
|
public sealed class HiprintPrintElement
|
|
{
|
|
[JsonPropertyName("options")]
|
|
public HiprintElementOptions Options { get; set; } = new();
|
|
|
|
[JsonPropertyName("printElementType")]
|
|
public HiprintElementType? PrintElementType { get; set; }
|
|
}
|
|
|
|
public sealed class HiprintElementType
|
|
{
|
|
[JsonPropertyName("type")]
|
|
public string? Type { get; set; }
|
|
|
|
[JsonPropertyName("title")]
|
|
public string? Title { get; set; }
|
|
}
|
|
|
|
public sealed class HiprintElementOptions
|
|
{
|
|
[JsonPropertyName("left")]
|
|
public float Left { get; set; }
|
|
|
|
[JsonPropertyName("top")]
|
|
public float Top { get; set; }
|
|
|
|
[JsonPropertyName("width")]
|
|
public float Width { get; set; }
|
|
|
|
[JsonPropertyName("height")]
|
|
public float Height { get; set; }
|
|
|
|
[JsonPropertyName("title")]
|
|
public string? Title { get; set; }
|
|
|
|
/// <summary>设计器「测试数据」;无 field 的纯文本有时只把文案写在这里。</summary>
|
|
[JsonPropertyName("testData")]
|
|
public string? TestData { get; set; }
|
|
|
|
[JsonPropertyName("field")]
|
|
public string? Field { get; set; }
|
|
|
|
[JsonPropertyName("fontSize")]
|
|
public float? FontSize { get; set; }
|
|
|
|
[JsonPropertyName("fontWeight")]
|
|
public string? FontWeight { get; set; }
|
|
|
|
[JsonPropertyName("fontFamily")]
|
|
public string? FontFamily { get; set; }
|
|
|
|
[JsonPropertyName("color")]
|
|
public string? Color { get; set; }
|
|
|
|
[JsonPropertyName("textAlign")]
|
|
public string? TextAlign { get; set; }
|
|
|
|
[JsonPropertyName("textType")]
|
|
public string? TextType { get; set; }
|
|
|
|
[JsonPropertyName("hideTitle")]
|
|
public bool? HideTitle { get; set; }
|
|
|
|
[JsonPropertyName("src")]
|
|
public string? Src { get; set; }
|
|
|
|
[JsonPropertyName("borderWidth")]
|
|
public float? BorderWidth { get; set; }
|
|
}
|