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