Compare commits

...

3 Commits

Author SHA1 Message Date
mpaster 2c35309a66
Pre Merge pull request !436 from mpaster/cherry-pick-1759037399 2026-01-06 05:54:33 +00:00
RuoYi e942847b89 修复Excel自定义格式样式污染问题 2026-01-06 13:54:27 +08:00
mpaster 697d1f0d77 支持菜单修改时图标可置空。 2025-09-28 05:30:32 +00:00
3 changed files with 18 additions and 3 deletions

View File

@ -1003,7 +1003,7 @@ public class ExcelUtil<T>
String separator = attr.separator();
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));
}
else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value))
@ -1033,6 +1033,21 @@ public class ExcelUtil<T>
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
*

View File

@ -149,7 +149,7 @@
<if test="visible != null">visible = #{visible},</if>
<if test="status != null">status = #{status},</if>
<if test="perms !=null">perms = #{perms},</if>
<if test="icon !=null and icon != ''">icon = #{icon},</if>
icon = #{icon},
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()

View File

@ -139,7 +139,7 @@
@show="$refs['iconSelect'].reset()"
>
<IconSelect ref="iconSelect" @selected="selected" :active-icon="form.icon" />
<el-input slot="reference" v-model="form.icon" placeholder="点击选择图标" readonly>
<el-input slot="reference" v-model="form.icon" placeholder="点击选择图标" clearable>
<svg-icon
v-if="form.icon"
slot="prefix"