diff --git a/erupt-annotation/pom.xml b/erupt-annotation/pom.xml
index 14a856c0f..94f343ecb 100644
--- a/erupt-annotation/pom.xml
+++ b/erupt-annotation/pom.xml
@@ -11,7 +11,7 @@
xyz.erupt
erupt
- 1.12.2
+ 1.12.3
../pom.xml
\ No newline at end of file
diff --git a/erupt-annotation/src/main/java/xyz/erupt/annotation/constant/AnnotationConst.java b/erupt-annotation/src/main/java/xyz/erupt/annotation/constant/AnnotationConst.java
index eab2af72a..022335595 100644
--- a/erupt-annotation/src/main/java/xyz/erupt/annotation/constant/AnnotationConst.java
+++ b/erupt-annotation/src/main/java/xyz/erupt/annotation/constant/AnnotationConst.java
@@ -12,6 +12,8 @@ public class AnnotationConst {
public static final String LABEL = "name";
+ public static final String REMARK = "remark";
+
public static final String PID = "pid";
public static final String EMPTY_STR = "";
diff --git a/erupt-annotation/src/main/java/xyz/erupt/annotation/fun/CodeEditHintHandler.java b/erupt-annotation/src/main/java/xyz/erupt/annotation/fun/CodeEditHintHandler.java
new file mode 100644
index 000000000..bcbf700f3
--- /dev/null
+++ b/erupt-annotation/src/main/java/xyz/erupt/annotation/fun/CodeEditHintHandler.java
@@ -0,0 +1,14 @@
+package xyz.erupt.annotation.fun;
+
+import java.util.List;
+
+/**
+ * @author YuePeng
+ * date 2023/8/24 20:26
+ */
+public interface CodeEditHintHandler {
+
+ //fetch hint list
+ List hint(String[] params);
+
+}
diff --git a/erupt-annotation/src/main/java/xyz/erupt/annotation/sub_erupt/Layout.java b/erupt-annotation/src/main/java/xyz/erupt/annotation/sub_erupt/Layout.java
index 9c6aab502..3c20ca357 100644
--- a/erupt-annotation/src/main/java/xyz/erupt/annotation/sub_erupt/Layout.java
+++ b/erupt-annotation/src/main/java/xyz/erupt/annotation/sub_erupt/Layout.java
@@ -11,10 +11,30 @@
//表格右侧列固定数量
int tableRightFixed() default 0;
+ //分页方式
+ PagingType pagingType() default PagingType.BACKEND;
+
+ //分页大小
+ int pageSize() default 10;
+
+ //可选分页数
+ int[] pageSizes() default {10, 20, 30, 50, 100, 300, 500};
+
enum FormSize {
- DEFAULT, //默认
- FULL_LINE //整行
+ //默认
+ DEFAULT,
+ //整行
+ FULL_LINE
+ }
+
+ enum PagingType {
+ //后端分页
+ BACKEND,
+ //前端分页
+ FRONT,
+ //不分页,最多显示:pageSizes[pageSizes.length - 1] * 10 条
+ NONE
}
}
diff --git a/erupt-annotation/src/main/java/xyz/erupt/annotation/sub_field/Edit.java b/erupt-annotation/src/main/java/xyz/erupt/annotation/sub_field/Edit.java
index 7d159b0c0..382c7b948 100644
--- a/erupt-annotation/src/main/java/xyz/erupt/annotation/sub_field/Edit.java
+++ b/erupt-annotation/src/main/java/xyz/erupt/annotation/sub_field/Edit.java
@@ -96,7 +96,7 @@
@Match("#item.type().toString()=='REFERENCE_TABLE'")
ReferenceTableType referenceTableType() default @ReferenceTableType;
- @Match("#item.type().toString()=='CHECKBOX'")
+ @Transient
CheckboxType checkboxType() default @CheckboxType;
@Match("#item.type().toString()=='CODE_EDITOR'")
diff --git a/erupt-annotation/src/main/java/xyz/erupt/annotation/sub_field/sub_edit/AttachmentType.java b/erupt-annotation/src/main/java/xyz/erupt/annotation/sub_field/sub_edit/AttachmentType.java
index b43e6f55e..804f2ab0e 100644
--- a/erupt-annotation/src/main/java/xyz/erupt/annotation/sub_field/sub_edit/AttachmentType.java
+++ b/erupt-annotation/src/main/java/xyz/erupt/annotation/sub_field/sub_edit/AttachmentType.java
@@ -13,6 +13,7 @@
@Comment("附件大小限制,单位KB")
long size() default -1;
+ @Transient
@Comment("定义独享存储空间,便于文件查找")
String path() default "";
diff --git a/erupt-annotation/src/main/java/xyz/erupt/annotation/sub_field/sub_edit/CheckboxType.java b/erupt-annotation/src/main/java/xyz/erupt/annotation/sub_field/sub_edit/CheckboxType.java
index a10e2a4d2..608468c87 100644
--- a/erupt-annotation/src/main/java/xyz/erupt/annotation/sub_field/sub_edit/CheckboxType.java
+++ b/erupt-annotation/src/main/java/xyz/erupt/annotation/sub_field/sub_edit/CheckboxType.java
@@ -11,4 +11,7 @@
@Comment("展示列")
String label() default AnnotationConst.LABEL;
+ @Comment("描述列")
+ String remark() default AnnotationConst.EMPTY_STR;
+
}
diff --git a/erupt-annotation/src/main/java/xyz/erupt/annotation/sub_field/sub_edit/CodeEditorType.java b/erupt-annotation/src/main/java/xyz/erupt/annotation/sub_field/sub_edit/CodeEditorType.java
index ef1729413..033ddc55f 100644
--- a/erupt-annotation/src/main/java/xyz/erupt/annotation/sub_field/sub_edit/CodeEditorType.java
+++ b/erupt-annotation/src/main/java/xyz/erupt/annotation/sub_field/sub_edit/CodeEditorType.java
@@ -1,6 +1,9 @@
package xyz.erupt.annotation.sub_field.sub_edit;
import xyz.erupt.annotation.config.Comment;
+import xyz.erupt.annotation.fun.CodeEditHintHandler;
+
+import java.beans.Transient;
/**
* @author YuePeng
@@ -14,4 +17,18 @@
@Comment("编辑器高度")
int height() default 300;
+ @Deprecated
+ @Comment("提示触发字符")
+ String[] triggerCharacters() default "$";
+
+ @Deprecated
+ @Comment("代码提示处理类参数")
+ @Transient
+ String[] hintParams() default {};
+
+ @Deprecated
+ @Comment("代码提示处理类")
+ @Transient
+ Class hint() default CodeEditHintHandler.class;
+
}
diff --git a/erupt-annotation/src/main/java/xyz/erupt/annotation/sub_field/sub_edit/HtmlEditorType.java b/erupt-annotation/src/main/java/xyz/erupt/annotation/sub_field/sub_edit/HtmlEditorType.java
index f5b77b9db..0dd9758e2 100644
--- a/erupt-annotation/src/main/java/xyz/erupt/annotation/sub_field/sub_edit/HtmlEditorType.java
+++ b/erupt-annotation/src/main/java/xyz/erupt/annotation/sub_field/sub_edit/HtmlEditorType.java
@@ -2,6 +2,8 @@
import xyz.erupt.annotation.config.Comment;
+import java.beans.Transient;
+
/**
* @author YuePeng
* date 2020-02-15
@@ -11,6 +13,7 @@
@Comment("富文本编辑器类型")
Type value();
+ @Transient
@Comment("定义独享存储空间,便于文件查找")
String path() default "";
diff --git a/erupt-cloud/erupt-cloud-common/pom.xml b/erupt-cloud/erupt-cloud-common/pom.xml
index f5113a361..ad327206b 100644
--- a/erupt-cloud/erupt-cloud-common/pom.xml
+++ b/erupt-cloud/erupt-cloud-common/pom.xml
@@ -9,7 +9,7 @@
xyz.erupt
erupt
- 1.12.2
+ 1.12.3
../../pom.xml
diff --git a/erupt-cloud/erupt-cloud-node-jpa/pom.xml b/erupt-cloud/erupt-cloud-node-jpa/pom.xml
index 3dbf18533..9564921aa 100644
--- a/erupt-cloud/erupt-cloud-node-jpa/pom.xml
+++ b/erupt-cloud/erupt-cloud-node-jpa/pom.xml
@@ -9,7 +9,7 @@
xyz.erupt
erupt
- 1.12.2
+ 1.12.3
../../pom.xml
diff --git a/erupt-cloud/erupt-cloud-node/pom.xml b/erupt-cloud/erupt-cloud-node/pom.xml
index 8bcbdce3f..a92f0e217 100644
--- a/erupt-cloud/erupt-cloud-node/pom.xml
+++ b/erupt-cloud/erupt-cloud-node/pom.xml
@@ -9,7 +9,7 @@
xyz.erupt
erupt
- 1.12.2
+ 1.12.3
../../pom.xml
diff --git a/erupt-cloud/erupt-cloud-node/src/main/java/xyz/erupt/cloud/node/config/EruptNodeProp.java b/erupt-cloud/erupt-cloud-node/src/main/java/xyz/erupt/cloud/node/config/EruptNodeProp.java
index 81d2e050a..993f9e6ad 100644
--- a/erupt-cloud/erupt-cloud-node/src/main/java/xyz/erupt/cloud/node/config/EruptNodeProp.java
+++ b/erupt-cloud/erupt-cloud-node/src/main/java/xyz/erupt/cloud/node/config/EruptNodeProp.java
@@ -20,6 +20,9 @@ public class EruptNodeProp {
//是否开启NODE节点注册
private boolean enableRegister = true;
+ //是否开启附件上传代理,开启后上传能力全部交予server端实现【server端请求node端获取附件上传要求】
+// private boolean attachmentProxy = true;
+
//接入应用名称,推荐填写当前 Java 项目名称
private String nodeName;
diff --git a/erupt-cloud/erupt-cloud-server/pom.xml b/erupt-cloud/erupt-cloud-server/pom.xml
index f29ad64d0..1766177ac 100644
--- a/erupt-cloud/erupt-cloud-server/pom.xml
+++ b/erupt-cloud/erupt-cloud-server/pom.xml
@@ -9,7 +9,7 @@
xyz.erupt
erupt
- 1.12.2
+ 1.12.3
../../pom.xml
diff --git a/erupt-core/pom.xml b/erupt-core/pom.xml
index 921c8c46b..75cdc3f02 100644
--- a/erupt-core/pom.xml
+++ b/erupt-core/pom.xml
@@ -10,7 +10,7 @@
xyz.erupt
erupt
- 1.12.2
+ 1.12.3
../pom.xml
diff --git a/erupt-core/src/main/java/xyz/erupt/core/controller/EruptComponentController.java b/erupt-core/src/main/java/xyz/erupt/core/controller/EruptComponentController.java
index 535feb7e4..05a3fd035 100644
--- a/erupt-core/src/main/java/xyz/erupt/core/controller/EruptComponentController.java
+++ b/erupt-core/src/main/java/xyz/erupt/core/controller/EruptComponentController.java
@@ -3,6 +3,7 @@
import org.springframework.web.bind.annotation.*;
import xyz.erupt.annotation.fun.VLModel;
import xyz.erupt.annotation.sub_field.sub_edit.AutoCompleteType;
+import xyz.erupt.annotation.sub_field.sub_edit.CodeEditorType;
import xyz.erupt.core.annotation.EruptRouter;
import xyz.erupt.core.constant.EruptRestPath;
import xyz.erupt.core.exception.EruptApiErrorTip;
@@ -62,7 +63,7 @@ public List findChoiceItem(@PathVariable("erupt") String eruptName,
return EruptUtil.getChoiceList(eruptModel, fieldModel.getEruptField().edit().choiceType());
}
- //Gets the TAGS component list data
+ //Gets the TAGS component data
@GetMapping("/tags-item/{erupt}/{field}")
@EruptRouter(authIndex = 2, verifyType = EruptRouter.VerifyType.ERUPT)
public List findTagsItem(@PathVariable("erupt") String eruptName,
@@ -71,4 +72,14 @@ public List findTagsItem(@PathVariable("erupt") String eruptName,
return EruptUtil.getTagList(fieldModel.getEruptField().edit().tagsType());
}
+ //Gets the CodeEdit component hint data
+ @GetMapping("/code-edit-hints/{erupt}/{field}")
+ @EruptRouter(authIndex = 2, verifyType = EruptRouter.VerifyType.ERUPT)
+ public List codeEditHints(@PathVariable("erupt") String eruptName,
+ @PathVariable("field") String field) {
+ EruptFieldModel fieldModel = EruptCoreService.getErupt(eruptName).getEruptFieldMap().get(field);
+ CodeEditorType codeEditType = fieldModel.getEruptField().edit().codeEditType();
+ return EruptSpringUtil.getBean(codeEditType.hint()).hint(codeEditType.hintParams());
+ }
+
}
diff --git a/erupt-core/src/main/java/xyz/erupt/core/controller/EruptDataController.java b/erupt-core/src/main/java/xyz/erupt/core/controller/EruptDataController.java
index 22b534dc8..10cd36e33 100644
--- a/erupt-core/src/main/java/xyz/erupt/core/controller/EruptDataController.java
+++ b/erupt-core/src/main/java/xyz/erupt/core/controller/EruptDataController.java
@@ -1 +1 @@
-package xyz.erupt.core.controller;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*;
import xyz.erupt.annotation.config.QueryExpression;
import xyz.erupt.annotation.constant.AnnotationConst;
import xyz.erupt.annotation.fun.OperationHandler;
import xyz.erupt.annotation.fun.PowerObject;
import xyz.erupt.annotation.model.Row;
import xyz.erupt.annotation.query.Condition;
import xyz.erupt.annotation.sub_erupt.Filter;
import xyz.erupt.annotation.sub_erupt.RowOperation;
import xyz.erupt.annotation.sub_erupt.Tree;
import xyz.erupt.annotation.sub_field.Edit;
import xyz.erupt.annotation.sub_field.sub_edit.CheckboxType;
import xyz.erupt.annotation.sub_field.sub_edit.ReferenceTableType;
import xyz.erupt.annotation.sub_field.sub_edit.ReferenceTreeType;
import xyz.erupt.core.annotation.EruptRecordOperate;
import xyz.erupt.core.annotation.EruptRouter;
import xyz.erupt.core.config.GsonFactory;
import xyz.erupt.core.constant.EruptConst;
import xyz.erupt.core.constant.EruptRestPath;
import xyz.erupt.core.exception.EruptNoLegalPowerException;
import xyz.erupt.core.i18n.I18nTranslate;
import xyz.erupt.core.invoke.DataProcessorManager;
import xyz.erupt.core.invoke.DataProxyInvoke;
import xyz.erupt.core.invoke.ExprInvoke;
import xyz.erupt.core.naming.EruptRowOperationNaming;
import xyz.erupt.core.query.Column;
import xyz.erupt.core.query.EruptQuery;
import xyz.erupt.core.service.EruptCoreService;
import xyz.erupt.core.service.EruptService;
import xyz.erupt.core.service.PreEruptDataService;
import xyz.erupt.core.util.EruptSpringUtil;
import xyz.erupt.core.util.EruptUtil;
import xyz.erupt.core.util.Erupts;
import xyz.erupt.core.util.TypeUtil;
import xyz.erupt.core.view.*;
import java.io.Serializable;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author YuePeng
* date 9/28/18.
*/
@RestController
@RequestMapping(EruptRestPath.ERUPT_DATA)
@RequiredArgsConstructor
@Slf4j
public class EruptDataController {
private final EruptService eruptService;
private final PreEruptDataService preEruptDataService;
private final Gson gson = GsonFactory.getGson();
@PostMapping({"/table/{erupt}"})
@EruptRouter(authIndex = 2, verifyType = EruptRouter.VerifyType.ERUPT)
public Page getEruptData(@PathVariable("erupt") String eruptName, @RequestBody TableQueryVo tableQueryVo) {
return eruptService.getEruptData(EruptCoreService.getErupt(eruptName), tableQueryVo, null);
}
@GetMapping("/tree/{erupt}")
@EruptRouter(authIndex = 2, verifyType = EruptRouter.VerifyType.ERUPT)
public Collection getEruptTreeData(@PathVariable("erupt") String eruptName) {
EruptModel eruptModel = EruptCoreService.getErupt(eruptName);
Erupts.powerLegal(eruptModel, PowerObject::isQuery);
Tree tree = eruptModel.getErupt().tree();
return preEruptDataService.geneTree(eruptModel, tree.id(), tree.label(), tree.pid(), tree.rootPid(), EruptQuery.builder().build());
}
//获取初始化数据
@GetMapping("/init-value/{erupt}")
@EruptRouter(authIndex = 2, verifyType = EruptRouter.VerifyType.ERUPT)
public Map initEruptValue(@PathVariable("erupt") String eruptName) throws IllegalAccessException, InstantiationException {
EruptModel eruptModel = EruptCoreService.getErupt(eruptName);
Object obj = eruptModel.getClazz().newInstance();
DataProxyInvoke.invoke(eruptModel, (dataProxy -> dataProxy.addBehavior(obj)));
return EruptUtil.generateEruptDataMap(eruptModel, obj);
}
@GetMapping("/{erupt}/{id}")
@EruptRouter(authIndex = 1, verifyType = EruptRouter.VerifyType.ERUPT)
public Map getEruptDataById(@PathVariable("erupt") String eruptName, @PathVariable("id") String id) {
EruptModel eruptModel = EruptCoreService.getErupt(eruptName);
Erupts.powerLegal(eruptModel, powerObject -> powerObject.isEdit() || powerObject.isViewDetails());
eruptService.verifyIdPermissions(eruptModel, id);
Object data = DataProcessorManager.getEruptDataProcessor(eruptModel.getClazz())
.findDataById(eruptModel, EruptUtil.toEruptId(eruptModel, id));
DataProxyInvoke.invoke(eruptModel, (dataProxy -> dataProxy.editBehavior(data)));
return EruptUtil.generateEruptDataMap(eruptModel, data);
}
public static final String OPERATOR_PATH_STR = "/operator";
@PostMapping("/{erupt}" + OPERATOR_PATH_STR + "/{code}")
@EruptRouter(authIndex = 1, verifyType = EruptRouter.VerifyType.ERUPT)
@EruptRecordOperate(value = "", dynamicConfig = EruptRowOperationNaming.class)
public EruptApiModel execEruptOperator(@PathVariable("erupt") String eruptName, @PathVariable("code") String code,
@RequestBody JsonObject body) {
EruptModel eruptModel = EruptCoreService.getErupt(eruptName);
RowOperation rowOperation = Arrays.stream(eruptModel.getErupt().rowOperation()).filter(it -> code.equals(it.code())).findFirst().orElseThrow(EruptNoLegalPowerException::new);
Erupts.powerLegal(ExprInvoke.getExpr(rowOperation.show()));
if (rowOperation.eruptClass() != void.class) {
EruptModel erupt = EruptCoreService.getErupt(rowOperation.eruptClass().getSimpleName());
EruptApiModel eruptApiModel = EruptUtil.validateEruptValue(erupt, body.getAsJsonObject("param"));
if (eruptApiModel.getStatus() == EruptApiModel.Status.ERROR) return eruptApiModel;
}
if (rowOperation.operationHandler().isInterface()) {
return EruptApiModel.errorApi("Please implement the 'OperationHandler' interface for " + rowOperation.title());
}
OperationHandler