Compare commits
3 Commits
53261c5ce0
...
d7eef05716
| Author | SHA1 | Date |
|---|---|---|
|
|
d7eef05716 | |
|
|
e942847b89 | |
|
|
a394fdb84a |
|
|
@ -1003,7 +1003,7 @@ public class ExcelUtil<T>
|
||||||
String separator = attr.separator();
|
String separator = attr.separator();
|
||||||
if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value))
|
if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value))
|
||||||
{
|
{
|
||||||
cell.getCellStyle().setDataFormat(this.wb.getCreationHelper().createDataFormat().getFormat(dateFormat));
|
cell.setCellStyle(createCellStyle(cell.getCellStyle(), dateFormat));
|
||||||
cell.setCellValue(parseDateToStr(dateFormat, value));
|
cell.setCellValue(parseDateToStr(dateFormat, value));
|
||||||
}
|
}
|
||||||
else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value))
|
else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value))
|
||||||
|
|
@ -1033,6 +1033,21 @@ public class ExcelUtil<T>
|
||||||
return cell;
|
return cell;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用自定义格式,同时避免样式污染
|
||||||
|
*
|
||||||
|
* @param cellStyle 从此样式复制
|
||||||
|
* @param format 格式匹配的字符串
|
||||||
|
* @return 格式化后CellStyle对象
|
||||||
|
*/
|
||||||
|
private CellStyle createCellStyle(CellStyle cellStyle, String format)
|
||||||
|
{
|
||||||
|
CellStyle style = wb.createCellStyle();
|
||||||
|
style.cloneStyleFrom(cellStyle);
|
||||||
|
style.setDataFormat(wb.getCreationHelper().createDataFormat().getFormat(format));
|
||||||
|
return style;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置 POI XSSFSheet 单元格提示或选择框
|
* 设置 POI XSSFSheet 单元格提示或选择框
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@riophae/vue-treeselect": "0.4.0",
|
"@riophae/vue-treeselect": "0.4.0",
|
||||||
"axios": "0.28.1",
|
"axios": "0.30.2",
|
||||||
"clipboard": "2.0.8",
|
"clipboard": "2.0.8",
|
||||||
"core-js": "3.37.1",
|
"core-js": "3.37.1",
|
||||||
"echarts": "5.4.0",
|
"echarts": "5.4.0",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue