feat: 处理只读状态

This commit is contained in:
wangyu 2021-09-21 22:58:41 +08:00
parent 3ee6de5bcd
commit 45abcfab4d
3 changed files with 10 additions and 1 deletions

View File

@ -22,6 +22,13 @@ public @interface PropertyGroup {
*/
String code();
/**
* 图标
*
* @return 结果
*/
String icon() default "info-circle";
/**
* 是否默认
* 指定为true默认将未指定分组的项归到该类

View File

@ -96,7 +96,7 @@ public class BeanController {
// 设置分组信息
if (clazz.isAnnotationPresent(PropertyGroups.class)) {
PropertyGroups groups = clazz.getAnnotation(PropertyGroups.class);
info.setGroups(Arrays.stream(groups.value()).map(group -> new BeanPropertyGroup(group.name(), group.code()))
info.setGroups(Arrays.stream(groups.value()).map(group -> new BeanPropertyGroup(group.name(), group.code(), group.icon()))
.collect(Collectors.toList()));
// 尝试补全分组
Arrays.stream(groups.value()).filter(PropertyGroup::initial).findFirst()

View File

@ -17,4 +17,6 @@ public class BeanPropertyGroup {
private String name;
private String code;
private String icon;
}