Files
XplorePlane/XP.ReportEngine/Models/TemplateElement.cs
T

85 lines
2.6 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.
using System.Collections.Generic;
namespace XP.ReportEngine.Models
{
public class TemplateElement
{
/// <summary>
/// 元素类型:text / image / table / divider / grid
/// </summary>
public string Type { get; set; }
/// <summary>
/// 文本内容(可含 ${} 绑定表达式)| Text content with binding expressions
/// </summary>
public string Content { get; set; }
/// <summary>
/// 样式名称引用 | Style name reference
/// </summary>
public string Style { get; set; }
/// <summary>
/// 数据绑定键 | Data binding key
/// </summary>
public string DataKey { get; set; }
/// <summary>
/// 位置坐标 [x, y]mm| Position coordinates in mm
/// </summary>
public float[] Position { get; set; }
/// <summary>
/// 尺寸 [width, height]mm| Size in mm
/// </summary>
public float[] Size { get; set; }
/// <summary>
/// 表格列定义 | Table column definitions
/// </summary>
public List<ColumnDefinition> Columns { get; set; }
/// <summary>
/// 是否显示边框 | Whether to show border
/// </summary>
public bool Border { get; set; }
/// <summary>
/// 定位方式:absolute / flow | Positioning mode
/// </summary>
public string Positioning { get; set; } = "absolute";
/// <summary>
/// 表格数据行(数据绑定阶段填充,用于排版计算和渲染)
/// Table data rows (populated during data binding phase, used for layout calculation and rendering)
/// </summary>
[Newtonsoft.Json.JsonIgnore]
public List<Dictionary<string, object>> TableData { get; set; }
/// <summary>
/// 图像数据(数据绑定阶段填充)| Image data (populated during data binding phase)
/// </summary>
[Newtonsoft.Json.JsonIgnore]
public ImageData ImageData { get; set; }
}
public class ColumnDefinition
{
public string Header { get; set; }
public string Field { get; set; }
public float Width { get; set; }
public string Align { get; set; } = "left";
}
public class StyleDefinition
{
public string Font { get; set; }
public float Size { get; set; } = 12f;
public bool Bold { get; set; }
public bool Italic { get; set; }
public string Color { get; set; } = "#000000";
public string Align { get; set; } = "left";
public string BackgroundColor { get; set; }
}
}