Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于@HeadFontStyle注解问题 #4055

Open
linyun0815 opened this issue Nov 29, 2024 · 1 comment
Open

关于@HeadFontStyle注解问题 #4055

linyun0815 opened this issue Nov 29, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@linyun0815
Copy link

触发Bug的代码

@Data
@ContentRowHeight(20)
@HeadRowHeight(20)
@ColumnWidth(25)
@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER, fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, borderBottom = BorderStyleEnum.THIN, borderTop = BorderStyleEnum.THIN, borderLeft = BorderStyleEnum.THIN, borderRight = BorderStyleEnum.THIN)
public class SysUserVo {
    /** 登录账号 */
    @HeadFontStyle(color = Font.COLOR_RED)
    @ExcelProperty(value = "登录账号", index = 1)
    private String userName;
    /** 用户昵称 */
    @ExcelProperty(value = "用户昵称", index = 2)
    private String nickName;
    /** 用户邮箱 */
    @ExcelProperty(value = "邮箱", index = 3)
    private String email;
    /** 手机号码 */
    @ExcelProperty(value = "手机号码", index = 4)
    private String phoneNumber;
    /** 用户性别(0男 1女 2未知) */
    @ExcelProperty(value = "性别", index = 5, converter = EConverter.class)
    private SexEnum sex;
    /** 密码(明文) */
    @ExcelProperty(value = "密码", index = 6)
    private String password;
    /** 账号状态(0正常 1停用) */
    @ExcelProperty(value = "状态", index = 7, converter = EConverter.class)
    private StatusEnum status;
    /** 备注 */
    @ExcelProperty(value = "备注", index = 8)
    private String remark;
}

没有达到的效果

在userName字段上添加@HeadFontStyle(color = Font.COLOR_RED),应实现的效果时仅有'登录账号'列的列名字体为红色,可是实际效果却是excel表中所有列都变更为红色,效果如下图, 想要实现对应的效果还需要再类名上添加@HeadFontStyle(color = Font.COLOR_NORMAL),这是否有些多余?
屏幕截图 2024-11-29 120300

@linyun0815 linyun0815 added the bug Something isn't working label Nov 29, 2024
@linyun0815
Copy link
Author

easyexcel的版本为4.0.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants