diff --git a/src/main/java/neatlogic/framework/form/dao/mapper/FormMapper.xml b/src/main/java/neatlogic/framework/form/dao/mapper/FormMapper.xml
index 1272bc12685a6f7682b33fcb5530ed14d35687ab..8beea1a55a687d6a1ca4984a245bbd20009f1877 100644
--- a/src/main/java/neatlogic/framework/form/dao/mapper/FormMapper.xml
+++ b/src/main/java/neatlogic/framework/form/dao/mapper/FormMapper.xml
@@ -291,6 +291,7 @@ along with this program. If not, see .-->
SELECT a.`form_uuid` AS formUuid,
a.`formversion_uuid` as formversionUuid,
a.`uuid`,
+ a.`key`,
a.`label`,
a.`type`,
a.`handler`,
@@ -307,6 +308,7 @@ along with this program. If not, see .-->
a.`form_uuid` AS formUuid,
a.`formversion_uuid` as formversionUuid,
a.`uuid`,
+ a.`key`,
a.`label`,
a.`type`,
a.`handler`,
@@ -326,6 +328,7 @@ along with this program. If not, see .-->
b.`form_uuid` AS formUuid,
b.`formversion_uuid` AS formversionUuid,
b.`uuid`,
+ b.`key`,
b.`label`,
b.`type`,
b.`handler`,
@@ -408,6 +411,7 @@ along with this program. If not, see .-->
a.`form_uuid` AS formUuid,
a.`handler`,
a.`attribute_label` AS attributeLabel,
+ a.`attribute_key` AS attributeKey,
a.`attribute_uuid` AS attributeUuid,
a.`data`
FROM `form_attribute_data` a
@@ -422,6 +426,7 @@ along with this program. If not, see .-->
`form_uuid` AS formUuid,
`handler`,
`attribute_label` AS attributeLabel,
+ `attribute_key` AS attributeKey,
`attribute_uuid` AS attributeUuid,
`data`
FROM `form_attribute_data`
@@ -543,6 +548,7 @@ along with this program. If not, see .-->
INSERT INTO `form_attribute` (`form_uuid`,
`formversion_uuid`,
`uuid`,
+ `key`,
`label`,
`type`,
`handler`,
@@ -551,6 +557,7 @@ along with this program. If not, see .-->
VALUES (#{formUuid},
#{formVersionUuid},
#{uuid},
+ #{key},
#{label},
#{type},
#{handler},
@@ -586,12 +593,14 @@ along with this program. If not, see .-->
`form_uuid`,
`handler`,
`attribute_label`,
+ `attribute_key`,
`attribute_uuid`,
`data`)
VALUES (#{id},
#{formUuid},
#{handler},
#{attributeLabel},
+ #{attributeKey},
#{attributeUuid},
#{data,typeHandler=CompressHandler})
ON DUPLICATE KEY
@@ -603,6 +612,7 @@ along with this program. If not, see .-->
`form_uuid`,
`handler`,
`attribute_label`,
+ `attribute_key`,
`attribute_uuid`,
`data`)
VALUES
@@ -611,6 +621,7 @@ along with this program. If not, see .-->
#{item.formUuid},
#{item.handler},
#{item.attributeLabel},
+ #{item.attributeKey},
#{item.attributeUuid},
#{item.data,typeHandler=CompressHandler})
@@ -624,6 +635,7 @@ along with this program. If not, see .-->
`handler`,
`tag`,
`attribute_label`,
+ `attribute_key`,
`attribute_uuid`,
`data`)
VALUES (#{id},
@@ -631,6 +643,7 @@ along with this program. If not, see .-->
#{handler},
#{tag},
#{attributeLabel},
+ #{attributeKey},
#{attributeUuid},
#{data,typeHandler=CompressHandler})
ON DUPLICATE KEY
@@ -643,6 +656,7 @@ along with this program. If not, see .-->
`handler`,
`tag`,
`attribute_label`,
+ `attribute_key`,
`attribute_uuid`,
`data`)
VALUES
@@ -652,6 +666,7 @@ along with this program. If not, see .-->
#{item.handler},
#{item.tag},
#{item.attributeLabel},
+ #{item.attributeKey},
#{item.attributeUuid},
#{item.data,typeHandler=CompressHandler})
diff --git a/src/main/java/neatlogic/framework/form/dto/AttributeDataVo.java b/src/main/java/neatlogic/framework/form/dto/AttributeDataVo.java
index 54e19b4aa09629233ef801b45f8c36dcc7bfed30..47116b881fe08c7117b68155dd6e613ec74194b3 100644
--- a/src/main/java/neatlogic/framework/form/dto/AttributeDataVo.java
+++ b/src/main/java/neatlogic/framework/form/dto/AttributeDataVo.java
@@ -33,6 +33,7 @@ public class AttributeDataVo implements Comparable, Serializabl
private String formUuid;
private String tag;
private String attributeUuid;
+ private String attributeKey;
private String attributeLabel;
private String handler;
@JSONField(serialize = false)
@@ -67,6 +68,14 @@ public class AttributeDataVo implements Comparable, Serializabl
this.attributeUuid = attributeUuid;
}
+ public String getAttributeKey() {
+ return attributeKey;
+ }
+
+ public void setAttributeKey(String attributeKey) {
+ this.attributeKey = attributeKey;
+ }
+
public String getAttributeLabel() {
return attributeLabel;
}
diff --git a/src/main/java/neatlogic/framework/form/dto/AttributeExtendedDataVo.java b/src/main/java/neatlogic/framework/form/dto/AttributeExtendedDataVo.java
index 03a384bb5a8fecc330e4b697a3b0ccecab6ccbe0..aed35619e2de98fd2dd6dc3e336c2ee9fcd9d3e5 100644
--- a/src/main/java/neatlogic/framework/form/dto/AttributeExtendedDataVo.java
+++ b/src/main/java/neatlogic/framework/form/dto/AttributeExtendedDataVo.java
@@ -20,6 +20,7 @@ public class AttributeExtendedDataVo extends AttributeDataVo{
public AttributeExtendedDataVo(AttributeDataVo attributeDataVo, Object extendedData) {
this.setAttributeUuid(attributeDataVo.getAttributeUuid());
+ this.setAttributeKey(attributeDataVo.getAttributeKey());
this.setAttributeLabel(attributeDataVo.getAttributeLabel());
this.setHandler(attributeDataVo.getHandler());
this.extendedData = extendedData;
diff --git a/src/main/java/neatlogic/framework/form/dto/FormAttributeVo.java b/src/main/java/neatlogic/framework/form/dto/FormAttributeVo.java
index 1f8ef93725c09a5e2c90a7ca452fccf1a1df5e7a..e469e2f31ab20efa2bde181aa4c156f6badf01d3 100644
--- a/src/main/java/neatlogic/framework/form/dto/FormAttributeVo.java
+++ b/src/main/java/neatlogic/framework/form/dto/FormAttributeVo.java
@@ -96,11 +96,12 @@ public class FormAttributeVo implements Serializable {
this.formVersionUuid = formVersionUuid;
}
- public FormAttributeVo(String formUuid, String formVersionUuid, String uuid, String label, String type,
+ public FormAttributeVo(String formUuid, String formVersionUuid, String uuid, String key, String label, String type,
String handler, boolean isRequired, JSONObject config, String data) {
this.uuid = uuid;
this.formUuid = formUuid;
this.formVersionUuid = formVersionUuid;
+ this.key = key;
this.label = label;
this.type = type;
this.handler = handler;
diff --git a/src/main/java/neatlogic/framework/form/dto/FormVersionVo.java b/src/main/java/neatlogic/framework/form/dto/FormVersionVo.java
index 02a0b0e1367436cd43d03ff44b806ad9fcd1ba68..723f36b71f66fb541b0321a536d52bc3c317f818 100644
--- a/src/main/java/neatlogic/framework/form/dto/FormVersionVo.java
+++ b/src/main/java/neatlogic/framework/form/dto/FormVersionVo.java
@@ -221,7 +221,7 @@ public class FormVersionVo extends BaseEditorVo {
JSONObject controllerObj = controllerList.getJSONObject(i);
JSONObject config = controllerObj.getJSONObject("config");
if (MapUtils.isNotEmpty(config)) {
- formAttributeList.add(new FormAttributeVo(this.getFormUuid(), this.getUuid(), controllerObj.getString("uuid"), controllerObj.getString("label"), controllerObj.getString("type"), controllerObj.getString("handler"), config.getBooleanValue("isRequired"), config, config.getString("defaultValueList")));
+ formAttributeList.add(new FormAttributeVo(this.getFormUuid(), this.getUuid(), controllerObj.getString("uuid"), null, controllerObj.getString("label"), controllerObj.getString("type"), controllerObj.getString("handler"), config.getBooleanValue("isRequired"), config, config.getString("defaultValueList")));
}
}
}
@@ -235,12 +235,13 @@ public class FormVersionVo extends BaseEditorVo {
JSONObject config = componentObj.getJSONObject("config");
if (MapUtils.isNotEmpty(config)) {
String uuid = componentObj.getString("uuid");
+ String key = componentObj.getString("key");
String label = componentObj.getString("label");
String type = componentObj.getString("type");
String handler = componentObj.getString("handler");
boolean isRequired = config.getBooleanValue("isRequired");
String defaultValue = config.getString("defaultValue");
- return new FormAttributeVo(this.getFormUuid(), this.getUuid(), uuid, label, type, handler, isRequired, config, defaultValue);
+ return new FormAttributeVo(this.getFormUuid(), this.getUuid(), uuid, key, label, type, handler, isRequired, config, defaultValue);
}
return null;
}
diff --git a/src/main/java/neatlogic/framework/util/FormUtil.java b/src/main/java/neatlogic/framework/util/FormUtil.java
index d84344a70c0486b1714701bb8e1e723c4f488e3e..cb1d08315273e0898e8d15caeeb6c86fcedcce5d 100644
--- a/src/main/java/neatlogic/framework/util/FormUtil.java
+++ b/src/main/java/neatlogic/framework/util/FormUtil.java
@@ -501,6 +501,8 @@ public class FormUtil {
formAttributeVo.setHandler(handler);
String label = componentObj.getString("label");
formAttributeVo.setLabel(label);
+ String key = componentObj.getString("key");
+ formAttributeVo.setKey(key);
String type = componentObj.getString("type");
formAttributeVo.setType(type);
JSONObject config = componentObj.getJSONObject("config");
diff --git a/src/main/resources/neatlogic/resources/framework/changelog/2024-06-04/neatlogic_tenant.sql b/src/main/resources/neatlogic/resources/framework/changelog/2024-06-04/neatlogic_tenant.sql
new file mode 100644
index 0000000000000000000000000000000000000000..288163fe14a68e6cb528688893e78cecb0617ad2
--- /dev/null
+++ b/src/main/resources/neatlogic/resources/framework/changelog/2024-06-04/neatlogic_tenant.sql
@@ -0,0 +1,6 @@
+ALTER TABLE `form_attribute`
+ ADD COLUMN `key` VARCHAR(100) NOT NULL COMMENT '属性英文名' AFTER `uuid`;
+ALTER TABLE `form_attribute_data`
+ ADD COLUMN `attribute_key` VARCHAR(100) NOT NULL COMMENT '属性英文名' AFTER `attribute_label`;
+ALTER TABLE `form_extend_attribute_data`
+ ADD COLUMN `attribute_key` VARCHAR(100) NOT NULL COMMENT '属性英文名' AFTER `attribute_label`;
\ No newline at end of file
diff --git a/src/main/resources/neatlogic/resources/framework/changelog/2024-06-04/version.json b/src/main/resources/neatlogic/resources/framework/changelog/2024-06-04/version.json
new file mode 100644
index 0000000000000000000000000000000000000000..5fc265f5de5c1867570a09f4c4804d522fbcad8c
--- /dev/null
+++ b/src/main/resources/neatlogic/resources/framework/changelog/2024-06-04/version.json
@@ -0,0 +1,10 @@
+{
+ "content":[
+ {
+ "type":"新增功能",
+ "detail":[
+ {"msg":"1.表单所有组件增加【英文名】属性"}
+ ]
+ }
+ ]
+}
diff --git a/src/main/resources/neatlogic/resources/framework/sqlscript/ddl.sql b/src/main/resources/neatlogic/resources/framework/sqlscript/ddl.sql
index 7dce884c99cfd40ab598f3e51dfa33fb605a5896..1bbf2fdcabf800f5b23223e6dc4a18e463ea34d3 100644
--- a/src/main/resources/neatlogic/resources/framework/sqlscript/ddl.sql
+++ b/src/main/resources/neatlogic/resources/framework/sqlscript/ddl.sql
@@ -262,6 +262,7 @@ CREATE TABLE IF NOT EXISTS `form_attribute` (
`form_uuid` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '表单uuid',
`formversion_uuid` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '表单版本uuid',
`uuid` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '属性uuid',
+ `key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '属性英文名',
`label` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '属性名',
`type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '属性类型,系统属性不允许修改',
`handler` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '属性处理器',
@@ -278,6 +279,7 @@ CREATE TABLE IF NOT EXISTS `form_attribute_data` (
`form_uuid` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '表单uuid',
`handler` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '类型',
`attribute_label` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '属性名',
+ `attribute_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '属性英文名',
`attribute_uuid` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '属性uuid',
`data` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '属性值,json格式',
PRIMARY KEY (`id`) USING BTREE
@@ -338,6 +340,7 @@ CREATE TABLE IF NOT EXISTS `form_extend_attribute_data` (
`handler` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '类型',
`tag` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '标签',
`attribute_label` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '属性名',
+ `attribute_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '属性英文名',
`attribute_uuid` char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '属性uuid',
`data` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '属性值,json格式',
PRIMARY KEY (`id`) USING BTREE