From 3ba41811345057893c259122299b951b65595a19 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Mon, 13 May 2024 17:32:50 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=90=8E=E7=AB=AF-?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E6=89=A9=E5=B1=95=E5=B1=9E=E6=80=A7=E9=85=8D?= =?UTF-8?q?=E7=BD=AEformExtendConfig=E6=94=BE=E5=9C=A8=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E9=85=8D=E7=BD=AEformConfig=E5=86=85=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1155818207019008]后端-表单扩展属性配置formExtendConfig放在表单配置formConfig内部 http://192.168.0.96:8090/demo/rdm.html#/task-detail/939050947543040/939050947543050/1155818207019008 --- .../framework/form/dto/FormVersionVo.java | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/main/java/neatlogic/framework/form/dto/FormVersionVo.java b/src/main/java/neatlogic/framework/form/dto/FormVersionVo.java index 7d151f0a2..02a0b0e13 100644 --- a/src/main/java/neatlogic/framework/form/dto/FormVersionVo.java +++ b/src/main/java/neatlogic/framework/form/dto/FormVersionVo.java @@ -19,6 +19,7 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.annotation.JSONField; import neatlogic.framework.common.dto.BaseEditorVo; +import neatlogic.framework.util.UuidUtil; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; @@ -34,6 +35,7 @@ public class FormVersionVo extends BaseEditorVo { private Integer isActive; private JSONObject formConfig; private String sceneUuid; + @JSONField(serialize = false) private List formExtendAttributeList; @JSONField(serialize = false) private List formAttributeList; @@ -275,6 +277,42 @@ public class FormVersionVo extends BaseEditorVo { } public List getFormExtendAttributeList() { + if (formExtendAttributeList == null) { + if (MapUtils.isNotEmpty(getFormConfig())) { + JSONObject formExtendConfig = this.formConfig.getJSONObject("formExtendConfig"); + if (MapUtils.isNotEmpty(formExtendConfig)) { + JSONArray attributeArray = formExtendConfig.getJSONArray("attributeList"); + if (CollectionUtils.isNotEmpty(attributeArray)) { + formExtendAttributeList = new ArrayList<>(); + for (int i = 0; i < attributeArray.size(); i++) { + JSONObject attributeObj = attributeArray.getJSONObject(i); + if (MapUtils.isEmpty(attributeObj)) { + continue; + } + String parentUuid = attributeObj.getString("parentUuid"); + String tag = attributeObj.getString("tag"); + String key = attributeObj.getString("key"); + String label = attributeObj.getString("label"); + String type = attributeObj.getString("type"); + String handler = attributeObj.getString("handler"); + JSONObject config = attributeObj.getJSONObject("config"); + FormAttributeVo formAttributeVo = new FormAttributeVo(); + formAttributeVo.setFormUuid(formUuid); + formAttributeVo.setFormVersionUuid(uuid); + formAttributeVo.setParentUuid(parentUuid); + formAttributeVo.setTag(tag); + formAttributeVo.setKey(key); + formAttributeVo.setUuid(UuidUtil.getCustomUUID(parentUuid + "#" + tag + "#" + key)); + formAttributeVo.setLabel(label); + formAttributeVo.setType(type); + formAttributeVo.setHandler(handler); + formAttributeVo.setConfig(config); + formExtendAttributeList.add(formAttributeVo); + } + } + } + } + } return formExtendAttributeList; } -- Gitee