85 lines
2.6 KiB
C#
85 lines
2.6 KiB
C#
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; }
|
||
}
|
||
}
|