mirror of
https://github.com/getrebuild/rebuild.git
synced 2024-09-20 07:25:54 +08:00
Fix 3.2 beta4 (#573)
* onFieldValueChange * fix: 明细记录保存/转换 * search fields * better * tip:pc h5 * 3.2.0 * lang --------- Co-authored-by: RB <getrebuild@sina.com>
This commit is contained in:
parent
56637476aa
commit
b4734d8192
2
@rbv
2
@rbv
|
@ -1 +1 @@
|
|||
Subproject commit 93f1043465f41136664eda4fb943f91c5fc7ba1b
|
||||
Subproject commit a20284c14a2621a08dc0b94194198e80aa4c1b40
|
2
pom.xml
2
pom.xml
|
@ -10,7 +10,7 @@
|
|||
</parent>
|
||||
<groupId>com.rebuild</groupId>
|
||||
<artifactId>rebuild</artifactId>
|
||||
<version>3.2.0-beta3</version>
|
||||
<version>3.2.0</version>
|
||||
<name>rebuild</name>
|
||||
<description>Building your business-systems freely!</description>
|
||||
<!-- UNCOMMENT USE TOMCAT -->
|
||||
|
|
|
@ -67,11 +67,11 @@ public class Application implements ApplicationListener<ApplicationStartedEvent>
|
|||
/**
|
||||
* Rebuild Version
|
||||
*/
|
||||
public static final String VER = "3.2.0-beta3";
|
||||
public static final String VER = "3.2.0";
|
||||
/**
|
||||
* Rebuild Build [MAJOR]{1}[MINOR]{2}[PATCH]{2}[BUILD]{2}
|
||||
*/
|
||||
public static final int BUILD = 3020003;
|
||||
public static final int BUILD = 3020004;
|
||||
|
||||
static {
|
||||
// Driver for DB
|
||||
|
|
|
@ -536,10 +536,14 @@ public class GeneralEntityService extends ObservableService implements EntitySer
|
|||
if (action == BizzPermission.CREATE) {
|
||||
// 验证审批状态
|
||||
// 仅验证新建明细(相当于更新主记录)
|
||||
if (mainEntity != null && MetadataHelper.hasApprovalField(record.getEntity())) {
|
||||
if (mainEntity != null && MetadataHelper.hasApprovalField(mainEntity)) {
|
||||
Field dtmField = MetadataHelper.getDetailToMainField(entity);
|
||||
ApprovalState state = ApprovalHelper.getApprovalState(record.getID(dtmField.getName()));
|
||||
ID dtmFieldValue = record.getID(dtmField.getName());
|
||||
if (dtmFieldValue == null) {
|
||||
throw new DataSpecificationException(Language.L("%s 不允许为空", EasyMetaFactory.getLabel(dtmField)));
|
||||
}
|
||||
|
||||
ApprovalState state = ApprovalHelper.getApprovalState(dtmFieldValue);
|
||||
if (state == ApprovalState.APPROVED || state == ApprovalState.PROCESSING) {
|
||||
throw new DataSpecificationException(state == ApprovalState.APPROVED
|
||||
? Language.L("主记录已完成审批,不能添加明细")
|
||||
|
|
|
@ -30,7 +30,12 @@ import com.rebuild.core.service.query.FilterRecordChecker;
|
|||
import com.rebuild.core.support.SetUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 转换记录
|
||||
|
|
|
@ -165,7 +165,6 @@ public class TransformConfigController extends BaseController {
|
|||
fields.add(easyField.toJSON());
|
||||
} else if (!MetadataHelper.isCommonsField(field)) {
|
||||
if (easyField.getDisplayType() == DisplayType.SERIES) continue;
|
||||
if (entity.getMainEntity() != null && MetadataHelper.getDetailToMainField(entity).equals(field)) continue;
|
||||
|
||||
// v2.10 非可创建字段也支持
|
||||
fields.add(MetaFormatter.buildRichField(easyField));
|
||||
|
|
|
@ -2519,5 +2519,7 @@
|
|||
"设置列显示":"设置列显示",
|
||||
"添加过多的统计列可能会影响列表加载速度":"添加过多的统计列可能会影响列表加载速度",
|
||||
"统计列":"统计列",
|
||||
"保存将覆盖你现有的列显示。继续吗?":"保存将覆盖你现有的列显示。继续吗?"
|
||||
"保存将覆盖你现有的列显示。继续吗?":"保存将覆盖你现有的列显示。继续吗?",
|
||||
"是否切换到 PC 网页版?":"是否切换到 PC 网页版?",
|
||||
"筛选字段":"筛选字段"
|
||||
}
|
|
@ -1840,6 +1840,7 @@ th.column-fixed {
|
|||
|
||||
.sortable-box-title {
|
||||
margin-top: 9px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.sortable-swap {
|
||||
|
@ -2501,7 +2502,7 @@ div.dataTables_wrapper div.dataTables_filter .dropdown-menu-advfilter input {
|
|||
|
||||
.dataTables_wrapper .paging_sizes select {
|
||||
padding: 4px 6px;
|
||||
width: 54px;
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
.dataTables_wrapper .paging_sizes select,
|
||||
|
@ -2509,6 +2510,13 @@ div.dataTables_wrapper div.dataTables_filter .dropdown-menu-advfilter input {
|
|||
height: 36px !important;
|
||||
}
|
||||
|
||||
.dataTables_wrapper .paging_simple_numbers .page-link {
|
||||
padding-left: 0.466rem;
|
||||
padding-right: 0.466rem;
|
||||
min-width: 32px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.must-center {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
|
|
|
@ -354,6 +354,7 @@ function _renderRepeatFields(entity) {
|
|||
})
|
||||
}
|
||||
|
||||
const _MAX_SHOWS = 10000
|
||||
// ~ 导入详情
|
||||
class ImportsTraceViewer extends RbAlert {
|
||||
renderContent() {
|
||||
|
@ -436,7 +437,9 @@ class ImportsTraceViewer extends RbAlert {
|
|||
this.showData()
|
||||
|
||||
// refresh
|
||||
if (import_inprogress === true && res.data.length < 2000) this._timer = setTimeout(() => this.load(), 1500)
|
||||
if (import_inprogress === true && res.data.length < _MAX_SHOWS) {
|
||||
this._timer = setTimeout(() => this.load(), 2000)
|
||||
}
|
||||
} else {
|
||||
RbHighbar.error(res.error_msg)
|
||||
}
|
||||
|
@ -445,7 +448,7 @@ class ImportsTraceViewer extends RbAlert {
|
|||
|
||||
showData() {
|
||||
this._showPage = (this._showPage || 0) + 1
|
||||
const p = this._datas.slice(0, this._showPage * 200)
|
||||
const p = this._datas.slice(0, this._showPage * 500)
|
||||
this.setState({ data: p, hasMore: this._datas.length > p.length })
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,8 @@ $(document).ready(() => {
|
|||
|
||||
let use = dash_list[0] // default
|
||||
if (dash_list.length > 1) {
|
||||
const dset = $.cookie('AppHome.Dash') || $storage.get('DashDefault')
|
||||
let dset = d
|
||||
if (!d) $.cookie('AppHome.Dash') || $storage.get('DashDefault')
|
||||
if (dset) {
|
||||
for (let i = 0; i < res.data.length; i++) {
|
||||
if (res.data[i][0] === dset) {
|
||||
|
|
|
@ -104,6 +104,26 @@ $(document).ready(() => {
|
|||
saveFn()
|
||||
}
|
||||
})
|
||||
|
||||
// 搜索字段
|
||||
$('.sortable-box-title .search-btn').on('click', function () {
|
||||
const $s = $(`<div class="search-input"><input type="text" placeholder="${$L('筛选字段')}" /></div>`).appendTo($(this).parent())
|
||||
const $input = $s.find('input').on('input', (e) => {
|
||||
$setTimeout(() => {
|
||||
const q = $.trim(e.target.value).toLowerCase()
|
||||
$('.unset-list .dd-item').each(function () {
|
||||
const $item = $(this)
|
||||
if (!q || $item.text().toLowerCase().includes(q)) {
|
||||
$item.removeClass('hide')
|
||||
} else {
|
||||
$item.addClass('hide')
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
setTimeout(() => $input[0].focus(), 20)
|
||||
})
|
||||
})
|
||||
|
||||
const refreshConfigStar = function () {
|
||||
|
|
|
@ -15,11 +15,11 @@ $(document).ready(() => {
|
|||
$('.h5-mobile img').attr('src', `${rb.baseUrl}/commons/barcode/render-qr?t=${$encode($('.h5-mobile a').attr('href'))}`)
|
||||
|
||||
if ($.browser.mobile) {
|
||||
setTimeout(() => {
|
||||
$(`<div class="bg-info"><i class="icon zmdi zmdi-smartphone-iphone"></i><p>${$L('点击切换到手机版访问')}</p></div>`)
|
||||
.appendTo('.announcement-wrapper')
|
||||
.on('click', () => (location.href = $('.h5-mobile>a').attr('href')))
|
||||
}, 500)
|
||||
setTimeout(function () {
|
||||
// $('.h5-mobile').dropdown('dispose') ???
|
||||
const $a = $('.h5-mobile>a')
|
||||
$a.parent().html('<a href="' + $a.attr('href') + '">' + $a.html() + '</a>')
|
||||
}, 200)
|
||||
}
|
||||
|
||||
$.get('/user/live-wallpaper', (res) => {
|
||||
|
|
|
@ -532,6 +532,11 @@ class RbForm extends React.Component {
|
|||
if (this._onFieldValueChange_calls) {
|
||||
this._onFieldValueChange_calls.forEach((c) => c({ name: field, value: value }))
|
||||
}
|
||||
|
||||
if (window.FrontJS) {
|
||||
const ret = window.FrontJS.Form._trigger('fieldValueChange', [`${this.props.entity}.${field}`, value, this.props.id || null])
|
||||
if (ret === false) return false
|
||||
}
|
||||
}
|
||||
|
||||
// 获取字段组件
|
||||
|
|
|
@ -20,6 +20,22 @@
|
|||
.mdi.mdi-sort-alphabetical-ascending.desc::before {
|
||||
content: '\F05BF';
|
||||
}
|
||||
.sortable-box-title .search-input {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: -5px;
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
}
|
||||
.sortable-box-title .search-input > input {
|
||||
border: 0 none;
|
||||
border-bottom: 1px solid #d5d8de;
|
||||
width: 100%;
|
||||
padding: 4px;
|
||||
appearance: none;
|
||||
outline: 0 none;
|
||||
background-color: transparent;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="dialog">
|
||||
|
@ -33,7 +49,10 @@
|
|||
<i class="zmdi zmdi-swap"></i>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<h5 class="sortable-box-title">[[${bundle.L('未显示')}]]</h5>
|
||||
<h5 class="sortable-box-title">
|
||||
[[${bundle.L('未显示')}]]
|
||||
<a class="search-btn" th:title="${bundle.L('筛选字段')}"><i class="zmdi zmdi-search"></i></a>
|
||||
</h5>
|
||||
<div class="sortable-box h380 rb-scroller">
|
||||
<ol class="dd-list unset-list"></ol>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue