Fix 3.2.4 (#607)

* fix: 小数字段-格式

* enh: trim meta-name

* fix: value of bslider

* fix: file copy

* fix: useValueOfVarRecord

---------

Co-authored-by: RB <getrebuild@sina.com>
This commit is contained in:
devezhao 2023-04-11 19:56:01 +08:00 committed by GitHub
parent adc3adc646
commit 67943bfb9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 38 additions and 20 deletions

View file

@ -10,7 +10,7 @@
</parent>
<groupId>com.rebuild</groupId>
<artifactId>rebuild</artifactId>
<version>3.2.3</version>
<version>3.2.4</version>
<name>rebuild</name>
<description>Building your business-systems freely!</description>
<!-- UNCOMMENT USE TOMCAT -->

View file

@ -67,11 +67,11 @@ public class Application implements ApplicationListener<ApplicationStartedEvent>
/**
* Rebuild Version
*/
public static final String VER = "3.2.3";
public static final String VER = "3.2.4";
/**
* Rebuild Build [MAJOR]{1}[MINOR]{2}[PATCH]{2}[BUILD]{2}
*/
public static final int BUILD = 3020308;
public static final int BUILD = 3020409;
static {
// Driver for DB

View file

@ -56,6 +56,9 @@ public class Entity2Schema extends Field2Schema {
* @return Returns 实体名称
*/
public String createEntity(String entityName, String entityLabel, String comments, String mainEntity, boolean haveNameField, boolean haveSeriesField) {
entityName = StringUtils.trim(entityName);
entityLabel = StringUtils.trim(entityLabel);
if (!License.isCommercial() && MetadataHelper.getEntities().length >= 100) {
throw new NeedRbvException("实体数量超出免费版限制");
}

View file

@ -98,6 +98,9 @@ public class Field2Schema extends SetUser {
* @return
*/
public String createField(Entity entity, String fieldLabel, String fieldName, DisplayType type, String comments, String refEntity, JSON extConfig) {
fieldLabel = StringUtils.trim(fieldLabel);
fieldName = StringUtils.trim(fieldName);
if (StringUtils.length(fieldName) < 4) fieldName = toPinyinName(fieldLabel);
for (int i = 0; i < 6; i++) {

View file

@ -36,6 +36,7 @@ import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.math.NumberUtils;
import org.springframework.util.Assert;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
@ -401,7 +402,7 @@ public class AdvFilterParser extends SetUser {
for (String s : value.split("\\|")) {
maskValue += ObjectUtils.toLong(s);
}
value = maskValue + "";
value = String.valueOf(maskValue);
}
}
@ -659,6 +660,8 @@ public class AdvFilterParser extends SetUser {
if (v instanceof Date) {
v = CalendarUtils.getUTCDateFormat().format(v);
} else if (v instanceof BigDecimal) {
v = String.valueOf(((BigDecimal) v).doubleValue());
} else {
v = String.valueOf(v);
}

View file

@ -13,7 +13,14 @@ import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import java.io.*;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileFilter;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.Reader;
import java.io.Writer;
import java.nio.file.Files;
/**
@ -99,17 +106,10 @@ public class CompressUtils {
* @param source
* @param dest
* @throws IOException
* @see FileUtils#copyFile(File, File) Bad on unix!
* @see IOUtils#copyLarge(Reader, Writer)
*/
public static void copy(File source, File dest) throws IOException {
FileReader fr = new FileReader(source);
FileWriter fw = new FileWriter(dest);
try {
IOUtils.copyLarge(fr, fw);
} finally {
IOUtils.closeQuietly(fr);
IOUtils.closeQuietly(fw);
}
FileUtils.copyFile(source, dest);
}
}

View file

@ -190,7 +190,7 @@
<div th:if="${fieldType == 'IMAGE' or fieldType == 'FILE'}" class="form-group row J_for-IMAGE J_for-FILE">
<label class="col-md-12 col-xl-3 col-lg-4 col-form-label text-lg-right">[[${bundle.L('允许上传数量')}]]</label>
<div class="col-md-12 col-xl-6 col-lg-8 pt-1 pb-1">
<input class="bslider border-0" id="uploadNumber" type="text" data-slider-min="0" data-slider-max="9" data-slider-value="[0,9]" data-slider-step="1" />
<input class="bslider form-control" id="uploadNumber" type="text" data-slider-min="0" data-slider-max="9" data-slider-value="[0,9]" data-slider-step="1" />
<div class="form-text J_minmax" th:utext="${bundle.L('最少上传 **0** 个,最多上传 **9** 个')}"></div>
</div>
</div>

View file

@ -250,3 +250,13 @@ select.underline-sm {
select.underline-sm:focus {
border-color: #4285f4;
}
.bslider.form-control {
border: 0 none;
padding: 0;
max-height: 24px;
}
.form-text.J_minmax > b {
color: #222;
}

View file

@ -90,6 +90,7 @@ $(document).ready(function () {
}
const extConfigNew = { ...extConfig, ...__gExtConfig }
// 不同类型的配置
$(`.J_for-${dt} .form-control, .J_for-${dt} .custom-control-input`).each(function () {
const k = $(this).attr('id')
@ -141,7 +142,7 @@ $(document).ready(function () {
})
extConfigNew['tagList'] = items
}
// 小数
// 小数-货币
if (dt === 'DECIMAL' && extConfigNew['decimalType'] === '¥') {
extConfigNew['decimalType'] = $val('.J_decimalTypeFlag') || '¥'
}
@ -248,10 +249,8 @@ $(document).ready(function () {
_handleNumber(extConfig.calcFormula)
if (dt === 'DECIMAL') {
if (extConfig.decimalType === '%') {
// 百分比
} else if (!extConfig.decimalType || extConfig.decimalType === 0) {
// 数字
if (!extConfig.decimalType || extConfig.decimalType === 0 || extConfig.decimalType === '0' || extConfig.decimalType === '%') {
// 数字百分比
} else {
$('input[name="decimalType"]:eq(2)').attr('checked', true)
$('.J_decimalTypeFlag').val(extConfig.decimalType)