You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
希望添加导入导出枚举类支持
我们有时候需要某个字段是枚举类型的,例如数据库存的是1 而真实的含义可能是正常,当我导入导出的时候 需要的是真实的含义。
如果目前我们可以这样来操作:
用户可以自定义一个枚举接口,那么所有的需要导入导出的枚举字段实现该接口
再自定一个这个枚举类型的转换器
最后在我们需要导出的时候,将导出的类字段上指名这个转换器
这样在我们导出的时候就可以直接用了
但是
这并不通用,这意味着我每个枚举字段都需要指名
@ExcelProperty(converter = IEnumConverter.class)或者手动注册转换器registerConverter(new IEnumConverter())而且我看了
CustomSheetWriteHandler如果我们可以新增这个特性,那么我们可以对枚举类型的字段导入导出做一个下拉框限制:解决方案(需要提pr)
ConverterKeyBuild#buildKey方法,让枚举字段可以映射到转换器:IEnumConverter注册到DefaultConverterLoader中All reactions