refactor: 视图明细导出优化 (#2093)

Co-authored-by: wangjiahao <1522128093@qq.com>
This commit is contained in:
fit2cloudrd
2022-04-11 10:58:52 +08:00
committed by GitHub
parent ed760b19bc
commit bb98e0c4e7
4 changed files with 51 additions and 19 deletions

View File

@@ -468,7 +468,7 @@ public class PanelGroupService {
details.add(0,request.getHeader());
HSSFWorkbook wb = new HSSFWorkbook();
//明细sheet
HSSFSheet detailsSheet = wb.createSheet("视图明细");
HSSFSheet detailsSheet = wb.createSheet("数据");
//给单元格设置样式
CellStyle cellStyle = wb.createCellStyle();
@@ -503,7 +503,7 @@ public class PanelGroupService {
}
if(StringUtils.isNotEmpty(snapshot)){
//截图sheet 1px ≈ 2.33dx ≈ 0.48 dy 8*24 个单元格
HSSFSheet snapshotSheet = wb.createSheet("");
HSSFSheet snapshotSheet = wb.createSheet("");
short reDefaultRowHeight = (short)Math.round(request.getSnapshotHeight()*3.5/8);
int reDefaultColumnWidth = (int)Math.round(request.getSnapshotWidth()*0.25/24);
snapshotSheet.setDefaultColumnWidth(reDefaultColumnWidth);