95 lines
3.0 KiB
C#
95 lines
3.0 KiB
C#
using System.Collections.Generic;
|
||
|
||
namespace XP.ReportEngine.Models
|
||
{
|
||
/// <summary>
|
||
/// 报告模板定义 | Report template definition
|
||
/// </summary>
|
||
public class ReportTemplate
|
||
{
|
||
public DocumentSettings Document { get; set; }
|
||
public List<TemplatePage> Pages { get; set; } = new();
|
||
public Dictionary<string, StyleDefinition> Styles { get; set; } = new();
|
||
}
|
||
|
||
public class DocumentSettings
|
||
{
|
||
public string PageSize { get; set; } = "A4";
|
||
public string Orientation { get; set; } = "Portrait";
|
||
public MarginSettings Margins { get; set; } = new();
|
||
|
||
/// <summary>
|
||
/// 页眉配置(仅内容页显示,首页不显示)| Header config (content pages only, not homepage)
|
||
/// </summary>
|
||
public HeaderFooterSettings Header { get; set; }
|
||
|
||
/// <summary>
|
||
/// 页脚配置(仅内容页显示,首页不显示)| Footer config (content pages only, not homepage)
|
||
/// </summary>
|
||
public HeaderFooterSettings Footer { get; set; }
|
||
}
|
||
|
||
public class MarginSettings
|
||
{
|
||
public float Top { get; set; } = 20f;
|
||
public float Bottom { get; set; } = 20f;
|
||
public float Left { get; set; } = 20f;
|
||
public float Right { get; set; } = 20f;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 页眉/页脚配置 | Header/Footer settings
|
||
/// </summary>
|
||
public class HeaderFooterSettings
|
||
{
|
||
/// <summary>
|
||
/// 是否启用 | Whether enabled
|
||
/// </summary>
|
||
public bool Enabled { get; set; } = true;
|
||
|
||
/// <summary>
|
||
/// 左侧文本行(支持 ${} 绑定表达式)| Left-side text lines with binding expressions
|
||
/// </summary>
|
||
public List<string> Left { get; set; } = new();
|
||
|
||
/// <summary>
|
||
/// 右侧文本行(支持 ${} 绑定表达式)| Right-side text lines with binding expressions
|
||
/// </summary>
|
||
public List<string> Right { get; set; } = new();
|
||
|
||
/// <summary>
|
||
/// 右侧图像 dataKey(如 logo)| Right-side image dataKey (e.g. logo)
|
||
/// </summary>
|
||
public string RightImageKey { get; set; }
|
||
|
||
/// <summary>
|
||
/// 左侧图像 dataKey | Left-side image dataKey
|
||
/// </summary>
|
||
public string LeftImageKey { get; set; }
|
||
|
||
/// <summary>
|
||
/// 字体大小 | Font size
|
||
/// </summary>
|
||
public float FontSize { get; set; } = 8f;
|
||
|
||
/// <summary>
|
||
/// 字体颜色 | Font color
|
||
/// </summary>
|
||
public string Color { get; set; } = "#666666";
|
||
|
||
/// <summary>
|
||
/// 是否显示分隔线 | Whether to show separator line
|
||
/// </summary>
|
||
public bool ShowLine { get; set; } = true;
|
||
}
|
||
|
||
public class TemplatePage
|
||
{
|
||
/// <summary>
|
||
/// 页面类型:homepage / metricData / defectDetails / bgaInspection / voidInspection / viaFillInspection
|
||
/// </summary>
|
||
public string Type { get; set; }
|
||
public List<TemplateElement> Elements { get; set; } = new();
|
||
}
|
||
}
|