浏览代码

1.修改颜色

main
wangqiang 1 天前
父节点
当前提交
3e62c2e906
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4
    3
      zs-manager/src/main/java/com/ruoyi/zhushi/service/impl/DkRecordServiceImpl.java

+ 4
- 3
zs-manager/src/main/java/com/ruoyi/zhushi/service/impl/DkRecordServiceImpl.java 查看文件

@@ -452,9 +452,10 @@ public class DkRecordServiceImpl implements DkRecordService {
cell = row.createCell(2);
}
Workbook workbook = sheet.getWorkbook();

CellStyle style = workbook.createCellStyle();
style.cloneStyleFrom(cell.getCellStyle()); // 保留原有样式
style.setFillForegroundColor(IndexedColors.RED.getIndex());
style.cloneStyleFrom(cell.getCellStyle()); // 保留原有样式lightcyan
style.setFillForegroundColor(IndexedColors.LIGHT_TURQUOISE.getIndex());
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
cell.setCellStyle(style);
}
@@ -576,7 +577,7 @@ public class DkRecordServiceImpl implements DkRecordService {
Workbook workbook = sheet.getWorkbook();
CellStyle style = workbook.createCellStyle();
style.cloneStyleFrom(cell.getCellStyle()); // 保留原有样式
style.setFillForegroundColor(IndexedColors.RED.getIndex());
style.setFillForegroundColor(IndexedColors.LIGHT_TURQUOISE.getIndex());
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
cell.setCellStyle(style);
}

正在加载...
取消
保存