diff --git a/@rbv b/@rbv index cb281b05e..401838fe3 160000 --- a/@rbv +++ b/@rbv @@ -1 +1 @@ -Subproject commit cb281b05e8599188146deb464eb66e84b0e6ec16 +Subproject commit 401838fe374096d94f70267eacb44f429ef6e8bd diff --git a/src/main/java/com/rebuild/core/configuration/general/FormsBuilder.java b/src/main/java/com/rebuild/core/configuration/general/FormsBuilder.java index 5cf7bd43d..49cab06ac 100644 --- a/src/main/java/com/rebuild/core/configuration/general/FormsBuilder.java +++ b/src/main/java/com/rebuild/core/configuration/general/FormsBuilder.java @@ -296,7 +296,8 @@ else if (viewMode) { // v3.7 model.set("hadSop", true); - model.remove("id"); // Clean form's ID of config + model.set("layoutId", model.getID("id")); + model.remove("id"); return model.toJSON(); } @@ -392,45 +393,51 @@ protected void buildModelElements(JSONArray elements, Entity entity, Record reco // v2.2 高级控制 // v3.8.4 视图下也有效(单字段编辑也算编辑) if (useAdvControl) { - Object displayOnCreate = el.remove("displayOnCreate"); - Object displayOnUpdate = el.remove("displayOnUpdate"); + Object hiddenOnCreate = el.remove("hiddenOnCreate"); + Object hiddenOnUpdate = el.remove("hiddenOnUpdate"); + if (hiddenOnCreate == null) { + Object displayOnCreate39 = el.remove("displayOnCreate"); + Object displayOnUpdate39 = el.remove("displayOnUpdate"); + if (displayOnCreate39 != null && !(Boolean) displayOnCreate39) hiddenOnCreate = true; + if (displayOnUpdate39 != null && !(Boolean) displayOnUpdate39) hiddenOnUpdate = true; + } final Object requiredOnCreate = el.remove("requiredOnCreate"); final Object requiredOnUpdate = el.remove("requiredOnUpdate"); final Object readonlyOnCreate = el.remove("readonlyOnCreate"); final Object readonlyOnUpdate = el.remove("readonlyOnUpdate"); // fix v3.3.4 跟随主记录新建/更新 - boolean isNew2 = isNew; + boolean isNewState = isNew; if (entity.getMainEntity() != null) { ID fromMain = FormsBuilderContextHolder.getMainIdOfDetail(false); - isNew2 = EntityHelper.isUnsavedId(fromMain); + isNewState = EntityHelper.isUnsavedId(fromMain); } // 视图下忽略此选项 if (viewModel) { - displayOnCreate = true; - displayOnUpdate = true; + hiddenOnCreate = false; + hiddenOnUpdate = false; } - // 显示 - if (displayOnCreate != null && !(Boolean) displayOnCreate && isNew2) { + // 隐藏 v4.0 + if (hiddenOnCreate != null && (Boolean) hiddenOnCreate && isNewState) { iter.remove(); continue; } - if (displayOnUpdate != null && !(Boolean) displayOnUpdate && !isNew2) { + if (hiddenOnUpdate != null && (Boolean) hiddenOnUpdate && !isNewState) { iter.remove(); continue; } // 必填 - if (requiredOnCreate != null && (Boolean) requiredOnCreate && isNew2) { + if (requiredOnCreate != null && (Boolean) requiredOnCreate && isNewState) { el.put("nullable", false); } - if (requiredOnUpdate != null && (Boolean) requiredOnUpdate && !isNew2) { + if (requiredOnUpdate != null && (Boolean) requiredOnUpdate && !isNewState) { el.put("nullable", false); } // 只读 v3.6 - if (readonlyOnCreate != null && (Boolean) readonlyOnCreate && isNew2) { + if (readonlyOnCreate != null && (Boolean) readonlyOnCreate && isNewState) { el.put("readonly", true); } - if (readonlyOnUpdate != null && (Boolean) readonlyOnUpdate && !isNew2) { + if (readonlyOnUpdate != null && (Boolean) readonlyOnUpdate && !isNewState) { el.put("readonly", true); } } diff --git a/src/main/java/com/rebuild/core/metadata/impl/Entity2Schema.java b/src/main/java/com/rebuild/core/metadata/impl/Entity2Schema.java index c3f59a4df..b9cf89f53 100644 --- a/src/main/java/com/rebuild/core/metadata/impl/Entity2Schema.java +++ b/src/main/java/com/rebuild/core/metadata/impl/Entity2Schema.java @@ -31,6 +31,9 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; +import java.util.Arrays; +import java.util.List; + /** * 创建实体 * @@ -271,7 +274,9 @@ private Field createBuiltinField(Entity entity, String fieldName, String fieldLa */ private boolean schema2Database(Entity entity) { Dialect dialect = Application.getPersistManagerFactory().getDialect(); - Table table = new Table40(entity, dialect); + List ixs = Arrays.asList( + EntityHelper.QuickCode, EntityHelper.OwningUser, EntityHelper.OwningDept, EntityHelper.CreatedOn, EntityHelper.ModifiedOn); + Table table = new Table40(entity, dialect, ixs); String[] ddls = table.generateDDL(false, false, false); try { diff --git a/src/main/java/com/rebuild/core/metadata/impl/Table40.java b/src/main/java/com/rebuild/core/metadata/impl/Table40.java index 3277444fe..bcd77f64d 100644 --- a/src/main/java/com/rebuild/core/metadata/impl/Table40.java +++ b/src/main/java/com/rebuild/core/metadata/impl/Table40.java @@ -10,8 +10,11 @@ import cn.devezhao.persist4j.Entity; import cn.devezhao.persist4j.Field; import cn.devezhao.persist4j.dialect.Dialect; +import cn.devezhao.persist4j.util.XmlHelper; import cn.devezhao.persist4j.util.support.Table; +import org.dom4j.Element; +import java.util.ArrayList; import java.util.List; /** @@ -23,11 +26,23 @@ public class Table40 extends Table { public Table40(Entity entity, Dialect dialect) { - super(entity, dialect); + this(entity, dialect, null); } - public Table40(Entity entity, Dialect dialect, List indexList) { - super(entity, dialect, indexList); + public Table40(Entity entity, Dialect dialect, List indexFields) { + super(entity, dialect, buildIndexList(indexFields)); + } + + private static List buildIndexList(List indexFields) { + if (indexFields == null || indexFields.isEmpty()) return null; + + List ixs = new ArrayList<>(); + for (String indexField : indexFields) { + Element ix = XmlHelper.createDom4jElement("index"); + ix.addAttribute("field-list", indexField); + ixs.add(ix); + } + return ixs; } @Override diff --git a/src/main/java/com/rebuild/core/service/query/ParseHelper.java b/src/main/java/com/rebuild/core/service/query/ParseHelper.java index 8a8101f23..a8ceebc00 100644 --- a/src/main/java/com/rebuild/core/service/query/ParseHelper.java +++ b/src/main/java/com/rebuild/core/service/query/ParseHelper.java @@ -117,7 +117,7 @@ public class ParseHelper { * @param token * @return */ - protected static String convetOperation(String token) { + public static String convetOperation(String token) { if (EQ.equalsIgnoreCase(token)) { return "="; } else if (NEQ.equalsIgnoreCase(token)) { diff --git a/src/main/java/com/rebuild/core/support/general/QueryParser.java b/src/main/java/com/rebuild/core/support/general/QueryParser.java index cb7055ea3..a057de4b7 100644 --- a/src/main/java/com/rebuild/core/support/general/QueryParser.java +++ b/src/main/java/com/rebuild/core/support/general/QueryParser.java @@ -217,24 +217,28 @@ private void doParseIfNeed() { if (StringUtils.isNotBlank(where)) wheres.add(where); } - final String sqlWhere = wheres.isEmpty() ? "1=1" : StringUtils.join(wheres.iterator(), " and "); - fullSql.append(" where ").append(sqlWhere); + final String whereClause = wheres.isEmpty() ? "1=1" : StringUtils.join(wheres.iterator(), " and "); + fullSql.append(" where ").append(whereClause); // 排序 String sortNode = queryExpr.getString("sort"); - String sortSql = null; + String sortClause = null; if (StringUtils.isNotBlank(sortNode)) { - sortSql = parseSort(sortNode); + sortClause = parseSort(sortNode); } else if (entity.containsField(EntityHelper.ModifiedOn)) { - sortSql = EntityHelper.ModifiedOn + " desc"; + sortClause = EntityHelper.ModifiedOn + " desc"; } else if (entity.containsField(EntityHelper.CreatedOn)) { - sortSql = EntityHelper.CreatedOn + " desc"; + sortClause = EntityHelper.CreatedOn + " desc"; + } + if (StringUtils.isNotBlank(sortClause)) { + fullSql.append(" order by ").append(sortClause); + // v3.9.1 + if (!sortClause.contains(" autoId") && entity.containsField(EntityHelper.AutoId)) fullSql.append(", autoId"); } - if (StringUtils.isNotBlank(sortSql)) fullSql.append(" order by ").append(sortSql); this.sql = fullSql.toString(); - this.countSql = this.buildCountSql(pkName) + sqlWhere; + this.countSql = this.buildCountSql(pkName) + whereClause; int pageNo = NumberUtils.toInt(queryExpr.getString("pageNo"), 1); int pageSize = NumberUtils.toInt(queryExpr.getString("pageSize"), 40); diff --git a/src/main/resources/web/admin/bizuser/role-privileges.html b/src/main/resources/web/admin/bizuser/role-privileges.html index 04d8b4bcf..35bf204c2 100644 --- a/src/main/resources/web/admin/bizuser/role-privileges.html +++ b/src/main/resources/web/admin/bizuser/role-privileges.html @@ -70,22 +70,33 @@ padding: 10px 0 5px; text-align: right; } - .table.table-priv td > a.cp { + .table.table-priv td > a.cp, + .name > span > a { position: absolute; left: 50%; margin-left: 15px; - margin-top: 1px; - font-size: 16px; + margin-top: 2px; + font-size: 15px; color: #999; display: none; } .table.table-priv tr:hover > td > a.cp, - .table.table-priv td > a.cp.active { + .table.table-priv td > a.cp.active, + .name > span > a.active, + .table.table-priv tr:hover .name > span > a { display: inline-block; } .table.table-priv td > a.cp.active, - .table.table-priv td > a.cp:hover { - color: #4285f4; + .table.table-priv td > a.cp:hover, + .name > span > a.active, + .name > span > a:hover { + color: #4285f4 !important; + } + .name > span > a { + font-size: 16px; + left: unset; + margin-left: 10px; + margin-top: -2px; } .nav-tabs li { @@ -99,22 +110,6 @@ font-weight: normal; line-height: 1.2; } - - .name > span > a { - font-size: 18px; - position: absolute; - margin-left: 6px; - margin-top: -3px; - display: none; - } - .name > span > a.active, - .name > span > a:hover { - color: #4285f4 !important; - } - .name > span > a.active, - .table.table-priv tr:hover .name > span > a { - display: inline-block; - } @@ -178,30 +173,30 @@ [[${entity[2]}]] - - + + - + - + - + - + - + diff --git a/src/main/resources/web/admin/metadata/form-design.html b/src/main/resources/web/admin/metadata/form-design.html index 5d6a7951f..ab4b2bc6c 100644 --- a/src/main/resources/web/admin/metadata/form-design.html +++ b/src/main/resources/web/admin/metadata/form-design.html @@ -87,7 +87,7 @@ [[${bundle.L('字段')}]] - [[${bundle.L('显示')}]] + [[${bundle.L('隐藏')}]] [[${bundle.L('必填')}]] @@ -101,13 +101,14 @@ TEMPLATE + + + @@ -152,6 +155,7 @@ + diff --git a/src/main/resources/web/admin/robot/trigger-design.html b/src/main/resources/web/admin/robot/trigger-design.html index 74b8836e2..e6bd69548 100644 --- a/src/main/resources/web/admin/robot/trigger-design.html +++ b/src/main/resources/web/admin/robot/trigger-design.html @@ -129,7 +129,7 @@ -
  • +
  • [[${bundle.L('就执行操作')}]]
    diff --git a/src/main/resources/web/assets/css/approvals.css b/src/main/resources/web/assets/css/approvals.css index de9452ded..8ec0c7eba 100644 --- a/src/main/resources/web/assets/css/approvals.css +++ b/src/main/resources/web/assets/css/approvals.css @@ -68,6 +68,11 @@ See LICENSE and COMMERCIAL in the project root for license information. padding: 4px 20px; } +#config-side .adv-filter-wrap .alert.alert-warning { + padding: 0; + margin-bottom: 20px; +} + #config-side .footer, #config-side .adv-filter-option .btn-footer { position: absolute; diff --git a/src/main/resources/web/assets/css/form-design.css b/src/main/resources/web/assets/css/form-design.css index 0b808623d..5fb40e56f 100644 --- a/src/main/resources/web/assets/css/form-design.css +++ b/src/main/resources/web/assets/css/form-design.css @@ -334,6 +334,24 @@ form.field-attr label > span { .table.table-p .custom-control { padding-left: 1.9377rem; margin-right: 1.385rem; + padding-left: 22px; + margin-right: 12px; +} + +.table.table-p a.easy-control { + font-size: 15px; + color: #999; + display: none; +} + +.table.table-p tr:hover a.easy-control { + display: inline-block; +} + +.table.table-p a.easy-control:hover, +.table.table-p a.easy-control.active { + color: #4285f4; + display: inline-block; } .type-list .dd-handle { diff --git a/src/main/resources/web/assets/css/triggers.css b/src/main/resources/web/assets/css/triggers.css index 84a005878..3e8dc19dc 100644 --- a/src/main/resources/web/assets/css/triggers.css +++ b/src/main/resources/web/assets/css/triggers.css @@ -614,3 +614,19 @@ textarea.formula-code + .fields-vars { border-radius: 3px; margin-top: 10px; } + +.timeline-item.exec::before { + border: 0 none; + background-color: #fff; + font-family: 'Material Design Icons', serif; + content: '\F1936'; + color: #f7b904; + font-size: 20px; + margin-left: -2px; + margin-top: -2px; +} + +.timeline-item:first-child::before { + background-color: #4285f4; + border: 1px solid #fff; +} diff --git a/src/main/resources/web/assets/js/charts/charts.js b/src/main/resources/web/assets/js/charts/charts.js index 9c9cb8690..4ea40f653 100644 --- a/src/main/resources/web/assets/js/charts/charts.js +++ b/src/main/resources/web/assets/js/charts/charts.js @@ -1391,7 +1391,7 @@ class DataList extends BaseChart { } const extconfig = this.state.config.extconfig - extconfig && this.setState({ title: extconfig.title || $L('数据列表') }) + // extconfig && this.setState({ title: extconfig.title || $L('数据列表') }) const listFields = data.fields const listData = data.data @@ -1451,7 +1451,6 @@ class DataList extends BaseChart { if (idx === lastIndex) return null // Last is ID return this.renderCell(c, listFields[idx]) })} - diff --git a/src/main/resources/web/assets/js/general/rb-advfilter.js b/src/main/resources/web/assets/js/general/rb-advfilter.js index 225a3d17c..427e7d651 100644 --- a/src/main/resources/web/assets/js/general/rb-advfilter.js +++ b/src/main/resources/web/assets/js/general/rb-advfilter.js @@ -77,7 +77,7 @@ class AdvFilter extends React.Component { {$L('符合全部')} -