From afee0d6ba1b9dacccf957216f2da449befa3b934 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期六, 17 二月 2024 16:38:57 +0800
Subject: [PATCH] #
---
zy-asrs-framework/src/main/java/com/zy/asrs/framework/generators/BetterGenerator.java | 21 ++++++++++++++-------
zy-asrs-framework/src/main/resources/templates/react/Sql.txt | 2 +-
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/zy-asrs-framework/src/main/java/com/zy/asrs/framework/generators/BetterGenerator.java b/zy-asrs-framework/src/main/java/com/zy/asrs/framework/generators/BetterGenerator.java
index d92e88d..96f3baf 100644
--- a/zy-asrs-framework/src/main/java/com/zy/asrs/framework/generators/BetterGenerator.java
+++ b/zy-asrs-framework/src/main/java/com/zy/asrs/framework/generators/BetterGenerator.java
@@ -859,15 +859,18 @@
private String createFormEditColumns() {
StringBuilder sb = new StringBuilder();
int times = 0;
+ boolean has = false;boolean init = false;
for (Column column : columns) {
if (column.isPrimaryKey()
|| column.getHumpName().equals("deleted")
|| column.getHumpName().equals("hostId")
+ || column.getHumpName().equals("memo")
) {
continue;
}
if (times%2 == 0) {
sb.append(" <ProForm.Group>\n");
+ has = true;init=true;
}
String itemType = "ProFormText";
@@ -946,20 +949,24 @@
// 鍏宠仈琛�
if (!Cools.isEmpty(column.getForeignKey())) {
- sb.append(" showSearch\n")
- .append(" debounceTime={300}\n")
- .append(" request={async ({ keyWords }) => {\n")
- .append(" const resp = await Http.doPostForm('api/").append(GeneratorUtils.firstCharConvert(column.getForeignKey())).append("/query', { condition: keyWords });\n")
- .append(" }}\n");
+ sb.append(" showSearch\n")
+ .append(" debounceTime={300}\n")
+ .append(" request={async ({ keyWords }) => {\n")
+ .append(" const resp = await Http.doPostForm('api/").append(GeneratorUtils.firstCharConvert(column.getForeignKey())).append("/query', { condition: keyWords });\n")
+ .append(" }}\n");
}
- sb.append(" />\n");
+ sb.append(" />\n");
- if (times%2 == 0) {
+ if (times%2 != 0) {
sb.append(" </ProForm.Group>\n");
+ has = false;
}
times++;
}
+ if (init && has) {
+ sb.append(" </ProForm.Group>\n");
+ }
return sb.toString();
}
diff --git a/zy-asrs-framework/src/main/resources/templates/react/Sql.txt b/zy-asrs-framework/src/main/resources/templates/react/Sql.txt
index 2a2374b..ed34366 100644
--- a/zy-asrs-framework/src/main/resources/templates/react/Sql.txt
+++ b/zy-asrs-framework/src/main/resources/templates/react/Sql.txt
@@ -1,6 +1,6 @@
-- save @{SIMPLEENTITYNAME} record
-- mysql
-insert into `sys_menu` ( `name`, `parent_id`, `route`, `type`, `sort`, `host_id`, `status`) values ( '@{SIMPLEENTITYNAME}绠$悊', '0', '/@{TABLEDESC}/@{SIMPLEENTITYNAME}', '0' , '0', '1' , '1');
+insert into `sys_menu` ( `name`, `parent_id`, `route`, `type`, `sort`, `host_id`, `status`) values ( '@{TABLEDESC}绠$悊', '0', '/@{ITEMNAME}/@{SIMPLEENTITYNAME}', '0' , '0', '1' , '1');
insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '鏌ヨ@{TABLEDESC}', '', '1', '@{ITEMNAME}:@{SIMPLEENTITYNAME}:list', '0', '1', '1');
insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '娣诲姞@{TABLEDESC}', '', '1', '@{ITEMNAME}:@{SIMPLEENTITYNAME}:save', '1', '1', '1');
--
Gitblit v1.9.1