feat: 提供组件级别的属性

This commit is contained in:
wangyu 2021-09-05 23:19:55 +08:00
parent c2f353cc8a
commit 30f85c01d9
3 changed files with 27 additions and 30 deletions

View File

@ -22,10 +22,35 @@ public @interface FormItem {
*
* @return 结果
*/
FormItemProp[] props() default {};
Prop[] props() default {};
/**
* @return 布局
*/
String layout() default "";
/**
* 表单域属性
*
* @author wangyu
*/
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@interface Prop {
/**
*
*
* @return
*/
String key();
/**
*
*
* @return
*/
String value();
}
}

View File

@ -1,28 +0,0 @@
package com.flyfish.framework.annotations;
import java.lang.annotation.*;
/**
* 表单域属性
*
* @author wangyu
*/
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface FormItemProp {
/**
*
*
* @return
*/
String key();
/**
*
*
* @return
*/
String value();
}

View File

@ -113,7 +113,7 @@ public class BeanProperty {
property.extra.put("component", item.component());
property.layout = item.layout();
if (ArrayUtils.isNotEmpty(item.props())) {
for (FormItemProp prop : item.props()) {
for (FormItem.Prop prop : item.props()) {
property.prop(prop.key(), prop.value());
}
}