Fix 3.7 beta4 (#774)

* Update @rbv

* beta4

* style

* lang

* Update QueryHelper.java
This commit is contained in:
REBUILD 企业管理系统 2024-06-24 21:34:48 +08:00 committed by GitHub
parent 423ed96126
commit bfc1e6c566
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 98 additions and 47 deletions

2
@rbv

@ -1 +1 @@
Subproject commit 036ee5c7436fe11eba8f8717e25414d82a017941
Subproject commit c2f072f6ed0ee3c576c81d96e51ef8b147b29be7

View file

@ -10,7 +10,7 @@
</parent>
<groupId>com.rebuild</groupId>
<artifactId>rebuild</artifactId>
<version>3.7.0-beta3</version>
<version>3.7.0-beta4</version>
<name>rebuild</name>
<description>Building your business-systems freely!</description>
<url>https://getrebuild.com/</url>

View file

@ -75,11 +75,11 @@ public class Application implements ApplicationListener<ApplicationStartedEvent>
/**
* Rebuild Version
*/
public static final String VER = "3.7.0-beta3";
public static final String VER = "3.7.0-beta4";
/**
* Rebuild Build [MAJOR]{1}[MINOR]{2}[PATCH]{2}[BUILD]{2}
*/
public static final int BUILD = 3070003;
public static final int BUILD = 3070004;
static {
// Driver for DB

View file

@ -105,7 +105,7 @@ public abstract class BaseConfigurationService extends InternalPersistService {
if (!cfgRecord.hasValue("shareTo")) return cfgRecord;
if (cfgRecord.getPrimary() != null) {
Object createBy = QueryHelper.queryField(cfgRecord.getPrimary(), EntityHelper.CreatedBy);
Object createBy = QueryHelper.queryFieldValue(cfgRecord.getPrimary(), EntityHelper.CreatedBy);
if (UserService.ADMIN_USER.equals(createBy)) return cfgRecord;
}

View file

@ -698,7 +698,7 @@ public class ApprovalStepService extends BaseService {
String approvalStepNode = record.getString(EntityHelper.ApprovalStepNode);
ID approvalId = record.getID(EntityHelper.ApprovalId);
if (approvalStepNode != null && approvalId == null) {
approvalId = (ID) QueryHelper.queryField(record.getPrimary(), EntityHelper.ApprovalId);
approvalId = (ID) QueryHelper.queryFieldValue(record.getPrimary(), EntityHelper.ApprovalId);
}
if (approvalId == null || approvalStepNode == null) {

View file

@ -41,6 +41,11 @@ public class IndexChart extends ChartData {
index.put("label2", num.getLabel());
}
return JSONUtils.toJSONObject("index", index);
JSONObject renderOption = config.getJSONObject("option");
if (renderOption == null) renderOption = new JSONObject();
return JSONUtils.toJSONObject(
new String[]{"index", "_renderOption"},
new Object[]{index, renderOption});
}
}

View file

@ -73,7 +73,7 @@ public class ProjectCommentService extends BaseTaskService {
final String msgContent = Language.L("@%s 在任务中提到了你", record.getEditor()) + " \n> " + content;
ID related = record.getID("taskId");
if (related == null) related = (ID) QueryHelper.queryField(record.getPrimary(), "taskId");
if (related == null) related = (ID) QueryHelper.queryFieldValue(record.getPrimary(), "taskId");
ID[] atUsers = FeedsHelper.findMentions(content);
int send = 0;

View file

@ -11,6 +11,7 @@ import cn.devezhao.persist4j.Entity;
import cn.devezhao.persist4j.Field;
import cn.devezhao.persist4j.Query;
import cn.devezhao.persist4j.Record;
import cn.devezhao.persist4j.dialect.FieldType;
import cn.devezhao.persist4j.engine.ID;
import com.alibaba.fastjson.JSONObject;
import com.rebuild.core.Application;
@ -189,16 +190,18 @@ public class QueryHelper {
/**
* @param queryFields
* @param queryValue
* @param forceQueryName
* @return
*/
public static ID queryId(Field[] queryFields, String queryValue) {
public static ID queryIdValue(Field[] queryFields, String queryValue, boolean forceQueryName) {
Entity entity = queryFields[0].getOwnEntity();
StringBuilder sql = new StringBuilder(
String.format("select %s from %s where ", entity.getPrimaryField().getName(), entity.getName()));
for (Field qf : queryFields) {
sql.append(
String.format("%s = '%s' or ", qf.getName(), CommonsUtils.escapeSql(queryValue)));
String qfName = qf.getName();
if (forceQueryName && qf.getType() == FieldType.REFERENCE) qfName = "&" + qfName;
sql.append(String.format("%s = '%s' or ", qfName, CommonsUtils.escapeSql(queryValue)));
}
sql = new StringBuilder(sql.substring(0, sql.length() - 4));
@ -211,7 +214,7 @@ public class QueryHelper {
* @param fieldName
* @return
*/
public static Object queryField(ID recordId, String fieldName) {
public static Object queryFieldValue(ID recordId, String fieldName) {
Object[] o = Application.getQueryFactory().uniqueNoFilter(recordId, fieldName);
return o == null || o[0] == null ? null : o[0];
}

View file

@ -18,7 +18,6 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.rebuild.core.Application;
import com.rebuild.core.BootEnvironmentPostProcessor;
import com.rebuild.core.metadata.EntityHelper;
import com.rebuild.core.metadata.MetadataHelper;
import com.rebuild.core.metadata.easymeta.DisplayType;
@ -36,7 +35,7 @@ import com.rebuild.core.service.trigger.ActionType;
import com.rebuild.core.service.trigger.TriggerAction;
import com.rebuild.core.service.trigger.TriggerException;
import com.rebuild.core.service.trigger.TriggerResult;
import com.rebuild.core.support.ConfigurationItem;
import com.rebuild.core.support.CommandArgs;
import com.rebuild.core.support.general.FieldValueHelper;
import com.rebuild.utils.CommonsUtils;
import lombok.extern.slf4j.Slf4j;
@ -62,10 +61,8 @@ public class FieldAggregation extends TriggerAction {
/**
* 最大触发链深度
* @see ConfigurationItem#TriggerMaxDepth
*/
public static final int MAX_TRIGGER_DEPTH = ObjectUtils.toInt(
BootEnvironmentPostProcessor.getProperty(ConfigurationItem.TriggerMaxDepth.name(), "256"));
protected static final int MAX_TRIGGER_DEPTH = CommandArgs.getInt(CommandArgs._TriggerMaxDepth, 256);
// 此触发器可能产生连锁反应
// 如触发器 A 调用 B B 又调用了 C ... 以此类推此处记录其深度

View file

@ -27,15 +27,15 @@ public class CommandArgs {
public static final String _UniPush = "_UniPush";
public static final String _UseDbFullText = "_UseDbFullText";
public static final String _SmsDistributor = "_SmsDistributor";
public static final String _EmailDistributor = "_EmailDistributor";
public static final String _StartEntityTypeCode = "_StartEntityTypeCode";
public static final String _UseFrontJSAnywhere = "_UseFrontJSAnywhere";
public static final String _TriggerMaxDepth = "_TriggerMaxDepth";
/**
* @param name
* @return default false
* @return default `false`
*/
public static boolean getBoolean(String name) {
return BooleanUtils.toBoolean(System.getProperty(name));
@ -43,12 +43,22 @@ public class CommandArgs {
/**
* @param name
* @return default -1
* @return default `-1`
*/
public static int getInt(String name) {
return ObjectUtils.toInt(System.getProperty(name), -1);
}
/**
* @param name
* @param defaultValue
* @return
*/
public static int getInt(String name, int defaultValue) {
int s = getInt(name);
return s == -1 ? defaultValue : s;
}
/**
* @param name
* @return

View file

@ -121,7 +121,6 @@ public enum ConfigurationItem {
RedisDatabase(0), // Redis DB
MobileUrl, // 移动端地址
RbStoreUrl, // 在线仓库地址
TriggerMaxDepth, // 触发器最大执行深度
SecurityEnhanced(false), // 安全增强
TrustedAllUrl(false), // 可信外部地址
LibreofficeBin, // Libreoffice 命令
@ -141,7 +140,6 @@ public enum ConfigurationItem {
|| RedisDatabase.name().equalsIgnoreCase(name)
|| MobileUrl.name().equalsIgnoreCase(name)
|| RbStoreUrl.name().equalsIgnoreCase(name)
|| TriggerMaxDepth.name().equalsIgnoreCase(name)
|| SecurityEnhanced.name().equalsIgnoreCase(name)
|| TrustedAllUrl.name().equalsIgnoreCase(name)
|| LibreofficeBin.name().equalsIgnoreCase(name)

View file

@ -3135,5 +3135,22 @@
"基本":"基本",
"纸张大小":"纸张大小",
"请选择一条记录":"请选择一条记录",
"文字":"文字"
"文字":"文字",
"已禁用的":"已禁用的",
"目标匹配字段":"目标匹配字段",
"编辑源码":"编辑源码",
"是否需要切换到 PC 版访问?":"是否需要切换到 PC 版访问?",
"可用用户":"可用用户",
"选择目标匹配字段":"选择目标匹配字段",
"当维度为日期时可用":"当维度为日期时可用",
"未激活的":"未激活的",
"源匹配字段":"源匹配字段",
"目标匹配字段已添加":"目标匹配字段已添加",
"显示增长率":"显示增长率",
"邮件内容":"邮件内容",
"是否需要切换到手机版访问?":"是否需要切换到手机版访问?",
"请选择源匹配字段":"请选择源匹配字段",
"请选择目标匹配字段":"请选择目标匹配字段",
"选择源匹配字段":"选择源匹配字段",
"源匹配字段已添加":"源匹配字段已添加"
}

View file

@ -141,21 +141,29 @@ See LICENSE and COMMERCIAL in the project root for license information.
margin-left: 5px;
margin-top: 3px;
font-size: 1.55rem;
}
.chart.index > .data-item span {
font-size: 1.15rem;
margin-left: 2px;
color: red;
}
.chart.index > .data-item span.ge::before,
.chart.index > .data-item span.le::before {
font-family: 'Material Design Icons', serif;
content: '\F0737';
font-size: 1.25rem;
color: red;
}
.chart.index > .data-item span.le {
color: green !important;
}
.chart.index > .data-item .with strong::before {
font-family: 'Material Design Icons', serif;
.chart.index > .data-item span.le::before {
content: '\F072E';
font-size: 0.9rem;
}
.chart.index > .data-item .with strong.ge {
color: red !important;
}
.chart.index > .data-item .with strong.ge::before {
content: '\F005E';
color: green !important;
}
.grid-stack-item.fullscreen .chart.index > .data-item p {

View file

@ -50,6 +50,8 @@ html.mourning-mode {
html,
body {
min-width: 360px;
/*min-width: 1001px;*/
/*overflow: auto !important;*/
}
a,
@ -78,8 +80,6 @@ code {
}
.dropdown-menu {
box-shadow: 0 3px 0.3077rem rgba(0, 0, 0, 0.1);
box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2);
box-shadow: 0 0 6px 0 rgba(0, 0, 0, 0.1), 0 10px 12px 0 rgba(170, 182, 206, 0.36);
border-width: 0;
border-radius: 0;
@ -228,7 +228,6 @@ code {
.badge.badge-light,
.badge.badge-secondary {
line-height: 1.277rem;
line-height: 1.1586rem;
}
@ -1373,7 +1372,6 @@ a.link.link-icon::after {
top: 4px;
font-size: 1.25rem;
padding: 5px;
display: inline-block;
z-index: 1;
display: none;
}
@ -1798,7 +1796,6 @@ th.column-fixed {
content: '';
pointer-events: none;
transform: translateX(100%);
box-shadow: inset 10px 0 8px -8px rgba(0, 0, 0, 0.15);
box-shadow: inset 5px 0 4px -4px rgba(0, 0, 0, 0.15);
/*width: 20px;*/
/* fix: Safari */
@ -1825,7 +1822,6 @@ th.column-fixed {
.column-fixed.col-action::after {
right: auto !important;
left: -48px !important;
box-shadow: inset -10px 0 8px -8px rgb(0 0 0 / 15%) !important;
box-shadow: inset -5px 0 4px -4px rgb(0 0 0 / 15%) !important;
}
@ -4634,7 +4630,6 @@ pre.unstyle {
}
.bg-market {
background-image: linear-gradient(135deg, #2973d7 0%, #26acb9 100%);
background-image: linear-gradient(45deg, rgb(0, 84, 70), rgb(57, 0, 63), rgb(89, 0, 0)), linear-gradient(45deg, rgb(0, 122, 101), rgb(127, 14, 127), rgb(255, 137, 131));
}
@ -4962,7 +4957,6 @@ pre.unstyle {
/* nav v2.10 */
.rb-left-sidebar .sidebar-elements > li ul {
background-color: #f5f5f5;
background-color: #eee;
padding: 6px 0;
}

View file

@ -211,18 +211,30 @@ class ChartIndex extends BaseChart {
}
renderChart(data) {
const showGrowthRate = data._renderOption && data._renderOption.showGrowthRate
const color = __PREVIEW ? this.props.config.option.useColor : this.props.config.color
const style2 = { color: color || null }
let clazz2, rate2
if (data.index.label2) {
const N1 = this._num(data.index.data)
const N2 = this._num(data.index.data2)
clazz2 = N1 >= N2 ? 'ge' : 'le'
rate2 = (((N1 - N2) * 1.0) / N2) * 100
rate2 = `${Math.abs(rate2).toFixed(2)}%`
}
const chartdata = (
<div className="chart index" ref={(c) => (this._$chart = c)}>
<div className="data-item must-center text-truncate w-auto">
<p style={style2}>{data.index.label || this.label}</p>
<strong style={style2}>{data.index.data}</strong>
<strong style={style2}>
{data.index.data}
{clazz2 && <span className={clazz2}>{showGrowthRate ? rate2 : null}</span>}
</strong>
{data.index.label2 && (
<div className="with">
<p>{data.index.label2}</p>
<strong className={this._num(data.index.data2) >= this._num(data.index.data) && 'ge'}>{data.index.data2}</strong>
<strong>{data.index.data2}</strong>
</div>
)}
</div>
@ -402,6 +414,7 @@ const shortNumber = function (num) {
else return num
}
// 千分位
const formatThousands = function (num, flag) {
let n = num
if (Math.abs(~~n) > 1000) {

View file

@ -1534,7 +1534,7 @@ class RbFormDateTime extends RbFormElement {
startView: startView,
pickerPosition: this._getAutoPosition(),
minuteStep: window.__LAB_MINUTESTEP || 5,
// todayBtn: true,
todayBtn: true,
})
.on('changeDate', function () {
const val = $(this).val()

View file

@ -150,7 +150,13 @@
<div class="hide J_opt-LINE J_opt-BAR J_opt-BAR2 J_opt-BAR3">
<label class="custom-control custom-control-sm custom-checkbox">
<input class="custom-control-input" type="checkbox" data-name="dateContinuous" />
<span class="custom-control-label">[[${bundle.L('尝试显示连续日期')}]]</span>
<span class="custom-control-label">[[${bundle.L('尝试显示连续日期')}]] <i class="zmdi zmdi-help zicon" th:title="${bundle.L('当维度为日期时可用')}"></i></span>
</label>
</div>
<div class="hide J_opt-INDEX">
<label class="custom-control custom-control-sm custom-checkbox">
<input class="custom-control-input" type="checkbox" data-name="showGrowthRate" />
<span class="custom-control-label">[[${bundle.L('显示增长率')}]] <i class="zmdi zmdi-help zicon" th:title="${bundle.L('有多个数值时可用')}"></i></span>
</label>
</div>
<div class="hide J_opt-INDEX">