feat: 增加上传组件链接
This commit is contained in:
parent
a31e7f6f68
commit
dfab218c77
@ -6,6 +6,7 @@ import com.flyfish.framework.annotations.*;
|
|||||||
import com.flyfish.framework.domain.base.Qo;
|
import com.flyfish.framework.domain.base.Qo;
|
||||||
import com.flyfish.framework.domain.base.Vo;
|
import com.flyfish.framework.domain.base.Vo;
|
||||||
import com.flyfish.framework.utils.DataUtils;
|
import com.flyfish.framework.utils.DataUtils;
|
||||||
|
import com.flyfish.framework.utils.ReflectionUtils;
|
||||||
import com.flyfish.framework.utils.StringFormats;
|
import com.flyfish.framework.utils.StringFormats;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.val;
|
import lombok.val;
|
||||||
@ -121,6 +122,10 @@ public class BeanProperty {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case LIST:
|
case LIST:
|
||||||
|
// 是附件,展现附件列表
|
||||||
|
ReflectionUtils.getGenericType(descriptor.getPropertyType())
|
||||||
|
.filter(property::isAttachment)
|
||||||
|
.ifPresent(item -> property.prop("attachment", true));
|
||||||
if (null != field) {
|
if (null != field) {
|
||||||
if (field.isAnnotationPresent(SubBean.class)) {
|
if (field.isAnnotationPresent(SubBean.class)) {
|
||||||
// 尝试获取泛型参数,存在时,赋值子表单
|
// 尝试获取泛型参数,存在时,赋值子表单
|
||||||
@ -142,7 +147,7 @@ public class BeanProperty {
|
|||||||
// 当存在db-ref时,解析为动态数据源
|
// 当存在db-ref时,解析为动态数据源
|
||||||
Optional<String> optional = processDbRef(clazz);
|
Optional<String> optional = processDbRef(clazz);
|
||||||
if (optional.isPresent()) {
|
if (optional.isPresent()) {
|
||||||
if ("Attachment".equals(descriptor.getPropertyType().getSimpleName())) {
|
if (property.isAttachment(descriptor.getPropertyType())) {
|
||||||
property.prop("attachment", true);
|
property.prop("attachment", true);
|
||||||
} else {
|
} else {
|
||||||
property.prop("uri", optional.get());
|
property.prop("uri", optional.get());
|
||||||
@ -256,4 +261,8 @@ public class BeanProperty {
|
|||||||
props.put(key, value);
|
props.put(key, value);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isAttachment(Class<?> clazz) {
|
||||||
|
return "Attachment".equals(clazz.getSimpleName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user