bin2100166581 opened a new issue, #913:
URL: https://github.com/apache/fesod/issues/913

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/apache/fesod/issues) and 
found nothing similar.
   
   
   ### Motivation
   
   一、需求背景
   目前项目中大量使用 FastExcel 进行 Excel 导入导出,用户反馈滚动时表头会滑出视野,查看长列表数据非常不便。希望在 VO 实体类上通过注解 
即可实现导出时自动冻结表头(首行固定在顶部),无需手动调用 freezePane,统一规范、降低使用成本。
   二、需求目标
   支持通过注解开启 Excel 冻结窗格
   支持冻结首行(最常用)、冻结首列、同时冻结首行 + 首列
   兼容现有 @ExcelProperty、下拉框、自动列宽、合并单元格等功能
   对原有代码无侵入,不影响现有导出逻辑
   三、功能设计(建议)
   1. 新增注解:@ExcelFreezePane
   java
   运行
   /**
    * Excel 冻结窗格注解(导出时生效)
    */
   @Target({ElementType.TYPE})
   @Retention(RetentionPolicy.RUNTIME)
   public @interface ExcelFreezePane {
   
       /**
        * 冻结行数(默认 1 行,即冻结表头)
        */
       int row() default 1;
   
       /**
        * 冻结列数(默认 0 列)
        */
       int column() default 0;
   
   }
   2. 使用方式(VO 上加一行即可)
   java
   运行
   @Data
   @ExcelIgnoreUnannotated
   @ExcelFreezePane // 冻结首行(默认)
   public class SzbcpmMigrantWorkerImportVo implements Serializable {
       // ... 字段
   }
   3. 扩展用法
   java
   运行
   // 冻结首行 + 首列
   @ExcelFreezePane(row = 1, column = 1)
   
   // 冻结前2行
   @ExcelFreezePane(row = 2)
   四、实现逻辑(建议)
   在 ExcelUtil 或 FastExcel 构建阶段读取 VO 类上的 @ExcelFreezePane 注解
   如果存在注解,则自动调用:
   java
   运行
   builder.freezePane(column, row);
   无注解则保持原有逻辑,不冻结
   五、业务价值
   所有导出模板自动固定表头,用户体验大幅提升
   统一规范,避免每个导出都要手动加 freezePane
   零代码侵入,业务 VO 只加一个注解即可
   适配考勤、工资、人员导入导出等长表格高频场景
   六、优先级
   中高(影响大量导入导出体验)
   七、影响范围
   仅影响 FastExcel 导出
   不影响原有功能
   无兼容性风险
   
   ### Solution
   
   _No response_
   
   ### Alternatives
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to