//场景导出的模板定义了模板类 但是需要模板类表头为不同的颜色时 可以适用此方法
@Data
// 定义模板类除表头的其他字段样式
@ContentFontStyle(fontName = "宋体", fontHeightInPoints = 12)
// 定义表头样式 默认字体为 宋体 默认字体高度为14 默认颜色为灰色
@HeadFontStyle
public class AbilityTemplateImport {
@ExcelProperty("指标名称")
private String targetName;
@ExcelProperty("指标代码")
private String targetCode;
// 设置所需要的颜色样式 这里是绿色
@HeadStyle(fillForegroundColor = 42)
@ExcelProperty("进展情况*")
private String tutorRemark;
// 设置所需要的颜色样式 这里是绿色
@HeadStyle(fillForegroundColor = 42)
@ExcelProperty("自我评分*")
private String selfScore;
}
@ContentFontStyle / @HeadFontStyle 注解 两个注解有着相同的字段
fontName 字体(例如:宋体 黑体 仿宋等)
fontHeightInPoints 字体高度(字体的字号)
italic 是否倾斜
strikeout 是否加删除线
color 颜色
bold 是否加粗 等等