Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
import com.rebuild.core.support.general.FieldValueHelper;
import com.rebuild.core.support.general.ProtocolFilterParser;
import com.rebuild.core.support.i18n.Language;
import com.rebuild.utils.CommonsUtils;
import com.rebuild.utils.JSONUtils;
import com.rebuild.web.EntityController;
import com.rebuild.web.EntityParam;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
Expand Down Expand Up @@ -137,7 +137,7 @@ private JSON buildResultSearch(Entity searchEntity, String quickFields, String q
return JSONUtils.EMPTY_ARRAY;
}

String like = " like '%" + StringEscapeUtils.escapeSql(q) + "%'";
String like = " like '%" + CommonsUtils.escapeSql(q) + "%'";
searchWhere = StringUtils.join(searchFields.iterator(), like + " or ") + like;
}

Expand Down Expand Up @@ -178,7 +178,7 @@ public JSON searchClassification(@EntityParam Entity entity, HttpServletRequest
}
}

q = StringEscapeUtils.escapeSql(q);
q = CommonsUtils.escapeSql(q);

int openLevel = ClassificationManager.instance.getOpenLevel(fieldMeta);
String sqlWhere = String.format(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
import com.rebuild.core.support.general.FieldValueHelper;
import com.rebuild.core.support.general.ProtocolFilterParser;
import com.rebuild.core.support.i18n.I18nUtils;
import com.rebuild.utils.CommonsUtils;
import com.rebuild.utils.JSONUtils;
import com.rebuild.web.BaseController;
import com.rebuild.web.EntityParam;
import com.rebuild.web.IdParam;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.math.NumberUtils;
import org.springframework.web.bind.annotation.GetMapping;
Expand Down Expand Up @@ -146,7 +146,7 @@ private String buildBaseSql(ID mainid, String relatedExpr, String q, boolean cou
Set<String> searchFields = ParseHelper.buildQuickFields(relatedEntity, null);

if (!searchFields.isEmpty()) {
String like = " like '%" + StringEscapeUtils.escapeSql(q) + "%'";
String like = " like '%" + CommonsUtils.escapeSql(q) + "%'";
String searchWhere = " and ( " + StringUtils.join(searchFields.iterator(), like + " or ") + like + " )";
where += searchWhere;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
import com.rebuild.core.support.general.FieldValueHelper;
import com.rebuild.core.support.i18n.I18nUtils;
import com.rebuild.core.support.i18n.Language;
import com.rebuild.utils.CommonsUtils;
import com.rebuild.utils.JSONUtils;
import com.rebuild.web.BaseController;
import com.rebuild.web.IdParam;
import com.rebuild.web.InvalidParameterException;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.GetMapping;
Expand Down Expand Up @@ -101,7 +101,7 @@ public JSON taskList(HttpServletRequest request) {
// 关键词搜索
String search = getParameter(request, "search");
if (StringUtils.isNotBlank(search)) {
queryWhere += " and taskName like '%" + StringEscapeUtils.escapeSql(search) + "%'";
queryWhere += " and taskName like '%" + CommonsUtils.escapeSql(search) + "%'";
}

// 高级查询
Expand Down Expand Up @@ -374,7 +374,7 @@ public JSON relatedTaskList(@IdParam(name = "related", required = false) ID rela
// 关键词搜索
String search = getParameter(request, "search");
if (StringUtils.isNotBlank(search)) {
queryWhere += " and taskName like '%" + StringEscapeUtils.escapeSql(search) + "%'";
queryWhere += " and taskName like '%" + CommonsUtils.escapeSql(search) + "%'";
}

int pageNo = getIntParameter(request, "pageNo", 1);
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/web/admin/bizuser/role-privileges.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@
<div class="float-right">
<button class="btn btn-secondary btn-space J_new-role" type="button"><i class="icon zmdi zmdi-plus"></i> [[${bundle.L('新建角色')}]]</button>
<div class="btn-group btn-space">
<button class="btn btn-primary J_save" type="button" disabled="disabled"><i class="icon mdi mdi-account-plus"></i> [[${bundle.L('保存')}]]</button>
<button class="btn btn-primary J_save" type="button" disabled="disabled">[[${bundle.L('保存')}]]</button>
<button class="btn btn-primary dropdown-toggle w-auto" type="button" data-toggle="dropdown" disabled="disabled"><i class="icon zmdi zmdi-chevron-down"></i></button>
<div class="dropdown-menu dropdown-menu-primary dropdown-menu-right">
<a class="dropdown-item J_copy-role"><i class="icon mdi mdi-account-multiple-plus"></i> [[${bundle.L('复制角色')}]]</a>
<a class="dropdown-item J_copy-role"><i class="icon zmdi zmdi-copy"></i> [[${bundle.L('复制角色')}]]</a>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/web/admin/bizuser/user-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
<button class="btn btn-secondary" type="button"><i class="icon zmdi zmdi-search"></i></button>
</span>
</div>
<div class="float-left ml-2 mt-1" style="padding-top: 2px">
<label class="custom-control custom-control-sm custom-checkbox custom-control-inline">
<div class="float-left ml-2 pt-1">
<label class="custom-control custom-checkbox custom-control-inline">
<input class="custom-control-input" type="checkbox" id="showAllUsers" />
<span class="custom-control-label">[[${bundle.L('显示全部用户')}]]</span>
</label>
Expand Down
9 changes: 3 additions & 6 deletions src/main/resources/web/assets/css/files.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ See LICENSE and COMMERCIAL in the project root for license information.
.file-list .file-list-item {
background-color: #fff;
border-bottom: 1px solid #e6e6e6;
padding: 10px 20px;
padding: 9px 20px;
display: table;
width: 100%;
cursor: default;
Expand Down Expand Up @@ -199,17 +199,14 @@ See LICENSE and COMMERCIAL in the project root for license information.
font-weight: bold;
}

.aside-2tree li > a > .icon {
.aside-2tree li > a > .icon.flag {
font-size: 12px;
color: #aaa;
margin: 0;
margin-left: 6px;
cursor: help;
}

.aside-2tree li.active > a > .icon {
color: #fff;
}

.file-list-striped .file-list-item:nth-of-type(odd) > div.type .file-icon::before {
border-top-color: #f5f5f5;
border-right-color: #f5f5f5;
Expand Down
48 changes: 42 additions & 6 deletions src/main/resources/web/assets/css/list-page.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ See LICENSE and COMMERCIAL in the project root for license information.
background-color: #fff;
padding: 3px 18px 12px;
margin-bottom: 12px;
border-radius: 3px;
border-radius: 2px;
min-height: 63px;
}

Expand All @@ -32,6 +32,7 @@ See LICENSE and COMMERCIAL in the project root for license information.
display: inline-block;
min-width: 227px;
position: relative;
vertical-align: top;
}

.quick-filter-pane .col-item > div .filter-items > .row {
Expand Down Expand Up @@ -94,11 +95,6 @@ See LICENSE and COMMERCIAL in the project root for license information.
border-color: #bababa;
}

.quick-filter-pane .select2-container,
.quick-filter-pane .col-item.operating {
transform: translateY(-1px);
}

.quick-filter-pane .col-item > div .filter-items .col-sm-5.val {
position: relative;
}
Expand All @@ -111,3 +107,43 @@ See LICENSE and COMMERCIAL in the project root for license information.
position: absolute;
color: #000;
}

.quick-filter-pane .select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field {
min-width: 114px;
}

/* filter tabs */

.quick-filter-tabs {
background-color: #fff;
padding: 0 18px;
margin-bottom: 12px;
border-radius: 2px;
}

.quick-filter-tabs > div {
font-size: 0;
}

.quick-filter-tabs > div .dropdown-item {
display: inline-block;
width: auto;
line-height: 1;
padding: 15px 18px;
font-size: 1rem;
cursor: pointer;
}

.quick-filter-tabs > div .dropdown-item:active {
background-color: #f5f5f5;
color: unset;
}

.quick-filter-tabs > div .dropdown-item.active {
background-color: var(--rb-theme-color);
border-radius: 0;
}

.quick-filter-tabs > div .dropdown-item.active:active {
color: #fff;
}
69 changes: 49 additions & 20 deletions src/main/resources/web/assets/css/rb-page.css
Original file line number Diff line number Diff line change
Expand Up @@ -293,12 +293,12 @@ a.link.inline {

.btn {
min-height: 2.8rem;
min-width: 98px;
min-width: 88px;
}

.btn-group.w-auto > .btn,
.btn.w-auto {
min-width: 36px !important;
min-width: 34px !important;
}

a.btn {
Expand Down Expand Up @@ -779,7 +779,6 @@ body.dialog .main-content {

.dialog-footer .btn {
margin-left: 5px;
min-width: 98px;
}

.dialog-footer > .float-left > .custom-control {
Expand Down Expand Up @@ -2057,6 +2056,36 @@ th.column-fixed {
color: #4285f4;
}

.form-line.hover fieldset legend::before {
font-family: 'Material-Design-Iconic-Font', serif;
font-size: 1.4rem;
content: '\f2f9';
width: 10px;
display: inline-block;
float: left;
margin-right: 3px;
text-align: center;
line-height: 1;
transform: translateY(-1px);
}

.form-line.hover.collapsed fieldset legend::before {
content: '\f2fb';
}

.form-line.v33 {
background-color: #ebebeb;
border-radius: 2px;
height: 38px;
margin-bottom: 11px;
margin-top: 11px;
padding-top: 2px;
}

.form-line.v33 fieldset legend {
background-color: transparent;
}

.form-line-breaked {
height: 0;
font-size: 0;
Expand Down Expand Up @@ -2269,7 +2298,7 @@ th.column-fixed {
text-align: center;
font-size: 1.2rem;
border-radius: 2px;
width: 24px;
width: 22px;
display: none;
}

Expand All @@ -2291,6 +2320,16 @@ th.column-fixed {
padding-right: 10px;
}

.aside-2tree li > a > .icon {
color: #54aeff;
font-size: 16px;
margin-right: 5px;
}

.aside-2tree li.active > a > .icon {
color: rgba(255, 255, 255, 0.8) !important;
}

/* AdvFilter */

.adv-search .dropdown-item div.action a {
Expand Down Expand Up @@ -2486,15 +2525,15 @@ div.dataTables_wrapper div.dataTables_filter .dropdown-menu-advfilter input {

.dataTables_wrapper .paging_sizes {
padding-top: 2px;
padding-left: 9px;
padding-left: 8px;
}

.dataTables_wrapper .paging_sizes select {
.dataTables_wrapper .paging_sizes .form-control {
padding: 4px 6px;
width: 50px;
width: 45px;
}

.dataTables_wrapper .paging_sizes select,
.dataTables_wrapper .paging_sizes .form-control,
.dataTables_wrapper .paging_simple_numbers .page-link {
height: 36px !important;
}
Expand Down Expand Up @@ -3534,11 +3573,6 @@ form {
overflow: hidden;
}

.page-aside.widgets .nav-tabs > li.nav-item a.nav-link {
padding-left: 16px;
padding-right: 16px;
}

.page-aside.widgets .tab-container {
margin-top: 2px;
min-width: 279px;
Expand Down Expand Up @@ -3927,10 +3961,6 @@ a.icon-link > .zmdi {
width: 212px;
}

.btn {
min-width: 88px;
}

/* .page-aside {
width: 200px;
}
Expand Down Expand Up @@ -4738,8 +4768,6 @@ pre.unstyle {
}

.protable .table .col-action {
width: 88px;
min-width: 88px;
padding-right: 0;
text-align: right;
width: 48px;
Expand Down Expand Up @@ -5020,7 +5048,8 @@ pre.unstyle {

.navbar-collapse .nav-item .nav-link {
position: relative;
padding: 0 20px;
padding: 0 20px !important;
max-width: 200px;
}

.navbar-collapse .nav-item.active .nav-link::after {
Expand Down
14 changes: 8 additions & 6 deletions src/main/resources/web/assets/js/aside-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class AsideTree extends React.Component {
}

render() {
return <div className={`aside-2tree ${this.props.hideCollapse && 'hide-collapse'}`}>{this.renderTree(this.props.data || [])}</div>
return <div className={`aside-2tree ${this.props.hideCollapse ? 'hide-collapse' : ''}`}>{this.renderTree(this.props.data || [])}</div>
}

renderTree(items, item) {
Expand All @@ -43,28 +43,30 @@ class AsideTree extends React.Component {
return (
<li className={this.state.activeItem === item.id ? 'active' : ''}>
<span
className={`collapse-icon ${!hasChild && 'no-child'}`}
className={`collapse-icon ${hasChild ? '' : 'no-child'}`}
onClick={() => {
if (hasChild) {
const expandItemsNew = this.state.expandItems
expandItemsNew.toggle(item.id)
this.setState({ expandItems: expandItemsNew })
}
}}>
<i className={`zmdi zmdi-chevron-right ${this.state.expandItems.contains(item.id) && 'open'} `} />
<i className={`zmdi zmdi-chevron-right ${this.state.expandItems.contains(item.id) ? 'open' : ''} `} />
</span>
<a
data-id={item.id}
className={`text-ellipsis ${item.disabled && 'text-disabled'}`}
className={`text-ellipsis ${item.disabled ? 'text-disabled' : ''}`}
title={item.disabled ? $L('已禁用') : null}
onClick={() => {
this.setState({ activeItem: item.id }, () => {
typeof this.props.onItemClick === 'function' && this.props.onItemClick(item)
})
}}>
{this.props.icon && <i className={`icon ${this.props.icon}`} />}
{item.text || item.name}
{item.private === true && <i className="icon zmdi zmdi-lock" title={$L('私有')} />}
{!!item.specUsers && <i className="icon zmdi zmdi-account" title={$L('指定用户')} />}

{item.private === true && <i className="icon flag zmdi zmdi-lock" title={$L('私有')} />}
{!!item.specUsers && <i className="icon flag zmdi zmdi-account" title={$L('指定用户')} />}
</a>
{typeof this.props.extrasAction === 'function' && this.props.extrasAction(item)}
</li>
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/web/assets/js/bizuser/role-privileges.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,10 @@ class CopyRoleTo extends RbModalHandler {
<RbModal title={$L('复制角色')} ref={(c) => (this._dlg = c)} disposeOnHide>
<div className="form">
<div className="form-group row">
<label className="col-sm-3 col-form-label text-sm-right">{$L('复制给哪些角色')}</label>
<label className="col-sm-3 col-form-label text-sm-right">{$L('复制到哪些角色')}</label>
<div className="col-sm-7">
<UserSelector hideDepartment hideUser hideTeam ref={(c) => (this._UserSelector = c)} />
<p className="form-text">{$L('将当前角色权限复制给选择的角色,选择角色的原有权限会被完全覆盖')}</p>
<p className="form-text">{$L('将当前角色权限复制到选择的角色中,选择角色的原有权限会被完全覆盖')}</p>
</div>
</div>
</div>
Expand Down
9 changes: 2 additions & 7 deletions src/main/resources/web/assets/js/file-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,20 +307,15 @@ class RbPreview extends React.Component {

// ~ 共享
const EXPIRES_TIME = [
[5, 5 + $L('分钟')],
[30, 30 + $L('分钟')],
[60, 1 + $L('小时')],
[360, 6 + $L('小时')],
[720, 12 + $L('小时')],
[1440, 1 + $L('天')],
[4320, 3 + $L('天')],
[10080, 7 + $L('天')],
]

class FileShare extends RbModalHandler {
constructor(props) {
super(props)
}

render() {
return (
<RbModal ref={(c) => (this._dlg = c)} title={$L('分享文件')} disposeOnHide={true}>
Expand Down Expand Up @@ -375,7 +370,7 @@ class FileShare extends RbModalHandler {
}

_changeTime = (e) => {
const t = e ? ~~e.target.dataset.time : 5
const t = e ? ~~e.target.dataset.time : EXPIRES_TIME[0][0]
if (this.state.time === t) return
this.setState({ time: t }, () => {
$.get(`/filex/make-share?url=${$encode(this.props.file)}&time=${t}`, (res) => {
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/web/assets/js/files/files-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const FolderTree = {

renderRbcomp(
<AsideTree
icon="mdi mdi-folder"
data={__FolderData}
activeItem={__DEFAULT_ALL}
onItemClick={(item) => {
Expand Down Expand Up @@ -423,7 +424,7 @@ class FilesList4Docs extends FilesList {
return (
<RF>
<span className="fop">
<a title={$L('下载')} className="fs-15" onClick={(e) => $stopEvent(e)} href={`${rb.baseUrl}/filex/download/${item.filePath}?attname=${$fileCutName(item.filePath)}`} target="_blank">
<a title={$L('下载')} className="fs-16" onClick={(e) => $stopEvent(e)} href={`${rb.baseUrl}/filex/download/${item.filePath}?attname=${$fileCutName(item.filePath)}`} target="_blank">
<i className="icon zmdi zmdi-download" />
</a>
{rb.fileSharable && (
Expand Down
12 changes: 12 additions & 0 deletions src/main/resources/web/assets/js/metadata/entity-advanced.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,17 @@ class DlgMode1Option extends RbFormHandler {
</div>
</div>
</div>
<div className="form-group row bosskey-show">
<label className="col-sm-3 col-form-label text-sm-right">{$L('显示顶部“常用查询”')}</label>
<div className="col-sm-9">
<div className="switch-button switch-button-xs">
<input type="checkbox" id="advListFilterTabs" defaultChecked={wpc.extConfig && wpc.extConfig.advListFilterTabs} />
<span>
<label htmlFor="advListFilterTabs" />
</span>
</div>
</div>
</div>
<div className="form-group row">
<label className="col-sm-3 col-form-label text-sm-right">{$L('显示顶部“查询面板”')}</label>
<div className="col-sm-9">
Expand Down Expand Up @@ -281,6 +292,7 @@ class DlgMode1Option extends RbFormHandler {
advListHideFilters: !$val('#advListHideFilters'),
advListHideCharts: !$val('#advListHideCharts'),
advListFilterPane: $val('#advListFilterPane'),
advListFilterTabs: $val('#advListFilterTabs'),
}

if (this.state.advListShowCategory) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/web/assets/js/metadata/field-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const FIELD_TYPES = {
'PICKLIST': [$L('下拉列表'), 'mdi-form-select'],
'CLASSIFICATION': [$L('分类'), 'mdi-form-dropdown'],
'MULTISELECT': [$L('多选'), 'mdi-format-list-checks'],
'TAG': [$L('标签'), 'mdi-tag-outline', true],
'TAG': [$L('标签'), 'mdi-tag-outline'],
'REFERENCE': [$L('引用'), 'mdi-feature-search-outline'],
'N2NREFERENCE': [$L('多引用'), 'mdi-text-box-search-outline'],
'FILE': [$L('附件'), 'mdi-attachment'],
Expand Down
63 changes: 62 additions & 1 deletion src/main/resources/web/assets/js/nav-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,17 @@ $(document).ready(() => {
renderRbcomp(<Share2 title={$L('导航菜单')} list={alist} configName={c ? c[1] : ''} shareTo={_current.shareTo} id={_current.id} />, 'shareTo', function () {
_Share2 = this

const $menu = $(this._$switch).find('.dropdown-menu')

$(`<a class="dropdown-item" ${c ? '' : 'disabled'}>${$L('复制导航菜单')}</a>`)
.prependTo($menu)
.on('click', () => {
if (c) renderRbcomp(<CopyNavTo list={alist} current={c[0]} />)
})

$('<div class="dropdown-divider bosskey-show"></div>').prependTo($menu)
$(`<a class="dropdown-item bosskey-show">${$L('配置顶部菜单')}</a>`)
.appendTo($(this._$switch).find('.dropdown-menu'))
.prependTo($menu)
.on('click', () => {
renderRbcomp(<TopNavSettings list={alist} />)
})
Expand Down Expand Up @@ -425,3 +434,55 @@ class TopNavSettings extends Share2Switch {
$.post('/app/settings/nav-settings/topnav', JSON.stringify(sets), () => this.hide())
}
}

// eslint-disable-next-line no-undef
class CopyNavTo extends Share2Switch {
renderContent() {
return (
<div style={{ margin: '0 15px' }}>
<div className="form-group">
<label className="text-bold">{$L('复制到哪些导航菜单')}</label>
<div ref={(c) => (this._$selected = c)}>
{this.props.list.map((item) => {
return (
<label className="custom-control custom-checkbox custom-control-inline" key={item[0]}>
<input className="custom-control-input" type="checkbox" data-id={item[0]} disabled={item[0] === this.props.current} />
<span className="custom-control-label">
{item[1] || $L('未命名')}
{item[0] === this.props.current && ` [${$L('当前')}]`}
</span>
</label>
)
})}
</div>
<div className="form-text mt-0">{$L('将当前导航菜单配置复制到选择的导航菜单中')}</div>
</div>
<div className="mb-1">
<button className="btn btn-primary" type="button" onClick={() => this.handleConfirm()}>
{$L('确定')}
</button>
</div>
</div>
)
}

handleConfirm() {
const post = {
from: this.props.current,
copyTo: [],
}

$(this._$selected)
.find('input:checked')
.each(function () {
post.copyTo.push($(this).data('id'))
})

console.log(post)

$.post('/app/settings/nav-settings/nav-copyto', JSON.stringify(post), () => {
this.hide()
RbHighbar.success($L('复制完成'))
})
}
}
2 changes: 1 addition & 1 deletion src/main/resources/web/assets/js/rb-advfilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ class ListAdvFilter extends AdvFilter {
</button>
<div className="dropdown-menu dropdown-menu-right">
<a className="dropdown-item" onClick={() => this.handleNew()}>
{$L('保存常用查询')}
{$L('保存到常用查询')}
</a>
</div>
</div>
Expand Down
43 changes: 33 additions & 10 deletions src/main/resources/web/assets/js/rb-datalist.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,20 @@ const AdvFilters = {
})

// ASIDE
if ($('#asideFilters').length > 0) {
if ($('#asideFilters, .quick-filter-tabs').length > 0) {
const $ghost = $('.adv-search .dropdown-menu').clone()
$ghost.removeAttr('class')
$ghost.removeAttr('style')
$ghost.removeAttr('data-ps-id')
$ghost.find('.ps-scrollbar-x-rail, .ps-scrollbar-y-rail').remove()
$ghost.find('.ps-scrollbar-x-rail, .ps-scrollbar-y-rail, .action').remove()
$ghost.find('.dropdown-item').on('click', function () {
$ghost.find('.dropdown-item').removeClass('active')
$(this).addClass('active')
that._effectFilter($(this), 'aside')
})
$ghost.appendTo($('#asideFilters').empty())

$ghost.clone(true).appendTo($('#asideFilters').empty())
$ghost.clone(true).appendTo($('.quick-filter-tabs').empty())
}

if (!$defaultFilter) $defaultFilter = $('.adv-search .dropdown-item:eq(0)')
Expand All @@ -146,6 +148,14 @@ const AdvFilters = {
return false
}
})
$('.quick-filter-tabs .dropdown-item')
.removeClass('active')
.each(function () {
if ($(this).data('id') === current) {
$(this).addClass('active')
return false
}
})
}

if (this.current === '$ALL$') this.current = null
Expand Down Expand Up @@ -634,7 +644,9 @@ const RbListCommon = {
if (wpc.advFilter !== false) AdvFilters.init('.adv-search', entity[0])

// 新建
$('.J_new').on('click', () => RbFormModal.create({ title: $L('新建%s', entity[1]), entity: entity[0], icon: entity[2] }))
$('.J_new')
.attr('disabled', false)
.on('click', () => RbFormModal.create({ title: $L('新建%s', entity[1]), entity: entity[0], icon: entity[2] }))
// 导出
$('.J_export').on('click', () => renderRbcomp(<DataExport listRef={_RbList()} entity={entity[0]} />))
// 批量修改
Expand Down Expand Up @@ -802,8 +814,9 @@ class RbList extends React.Component {

$addResizeHandler(() => {
let mh = $(window).height() - 210 + 5
if ($('.main-content>.nav-tabs-classic').length > 0) mh -= 38 // Has tab
if ($('.main-content .quick-filter-pane').length > 0) mh -= 75 // Has query-pane
if ($('.main-content>.nav-tabs-classic')[0]) mh -= 38 // Has detail-tab
if ($('.main-content .quick-filter-pane')[0]) mh -= 75 // Has query-pane
if ($('.main-content .quick-filter-tabs')[0]) mh -= 55 // Has query-tabs
$scroller.css({ maxHeight: mh })
$scroller.perfectScrollbar('update')
})()
Expand Down Expand Up @@ -890,7 +903,7 @@ class RbList extends React.Component {
this.setState({ rowsData: res.data.data || [], inLoad: false }, () => {
RbList.renderAfter()
this._clearSelected()
$(this._$scroller).scrollTop(0)
$(this._$scroller).scrollTop(0) //.perfectScrollbar('update')
})

if (reload && this._Pagination) {
Expand Down Expand Up @@ -1185,6 +1198,9 @@ class RbListPagination extends React.Component {
<option value="500">500</option>
</select>
</div>
<div className="float-right paging_sizes">
<input className="form-control form-control-sm text-center" title={$L('页码')} placeholder={$L('页码')} onKeyDown={this.setPageNo} />
</div>
<div className="float-right dataTables_paginate paging_simple_numbers">
<ul className="pagination mb-0">
{this.state.pageNo > 1 && (
Expand Down Expand Up @@ -1273,10 +1289,17 @@ class RbListPagination extends React.Component {
})
}

setPageNo = (e) => {
const pn = ~~e.target.value
if (e.keyCode === 13 && pn && pn > 0) {
this.goto(Math.min(pn, this.__pageTotal))
}
}

setPageSize = (e) => {
const s = e.target.value
this.setState({ pageSize: s, pageNo: 1 }, () => {
this.props.$$$parent.setPage(1, s)
const ps = ~~e.target.value
this.setState({ pageSize: ps, pageNo: 1 }, () => {
this.props.$$$parent.setPage(1, ps)
})
}
}
Expand Down
8 changes: 7 additions & 1 deletion src/main/resources/web/assets/js/rb-forms.append.js
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ class BaiduMapModal extends RbModal {
$stopEvent(e, true)
this._suggestUpDown(e.which)
} else if (e.which === 13) {
let $active = $(this._$suggestion).find('.active')
const $active = $(this._$suggestion).find('.active')
if ($active[0] && $active.text()) {
this._suggestSelect({ address: $active.text(), location: $active.data('location') })
}
Expand Down Expand Up @@ -564,6 +564,12 @@ class BaiduMapModal extends RbModal {
$(this._$searchValue).val(item.address)
this._BaiduMap.center(item.location)
this.setState({ suggestion: [] })
this._latlngValue = {
lat: item.location.lat,
lng: item.location.lng,
text: item.address,
}
}
_suggestUpDown(key) {
Expand Down
17 changes: 10 additions & 7 deletions src/main/resources/web/assets/js/rb-forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -2391,7 +2391,7 @@ class RbFormLocation extends RbFormElement {
lnglat={lnglat}
title={$L('选取位置')}
onConfirm={(lnglat) => {
const val = lnglat && lnglat.text ? `${lnglat.text}$$$$${lnglat.lng},${lnglat.lat}` : null
const val = lnglat && lnglat.text ? `${lnglat.text}$$$$${lnglat.lng || 0},${lnglat.lat || 0}` : null
that.handleChange({ target: { value: val } }, true)
}}
/>,
Expand Down Expand Up @@ -2578,31 +2578,34 @@ class RbFormUnsupportted extends RbFormElement {
class RbFormDivider extends React.Component {
constructor(props) {
super(props)
this.state = { collapsed: false }
}

render() {
if (this.props.breaked === true) {
return <div className="form-line-breaked"></div>
}

return (
<div className="form-line hover" ref={(c) => (this._$formLine = c)}>
<div className={`form-line hover -v33 ${this.state.collapsed && 'collapsed'}`} ref={(c) => (this._$formLine = c)}>
<fieldset>
{this.props.label && (
<legend onClick={() => this.toggle()} className="text-bold" title={$L('展开/收起')}>
{this.props.label}
</legend>
)}
<legend onClick={() => this.toggle()} title={$L('展开/收起')}>
{this.props.label || ''}
</legend>
</fieldset>
</div>
)
}

toggle() {
let collapsed = null
let $next = $(this._$formLine)
while (($next = $next.next()).length > 0) {
if ($next.hasClass('form-line') || $next.hasClass('footer')) break
$next.toggleClass('hide')
if (collapsed === null) collapsed = $next.hasClass('hide')
}
this.setState({ collapsed })
}
}

Expand Down
1 change: 0 additions & 1 deletion src/main/resources/web/assets/js/rb-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,6 @@ var $fileCutName = function (fileName) {
* 获取附件文件扩展名
*/
var $fileExtName = function (fileName) {
debugger
fileName = (fileName || '').toLowerCase()
fileName = fileName.split('?')[0]
fileName = fileName.split('.')
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/web/common/shared-file.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:replace="~{/_include/header}" />
<meta http-equiv="refresh" content="1800" />
<meta http-equiv="refresh" content="3600" />
<title>[[${bundle.L('分享文件')}]]</title>
<style>
.preview-modal .preview-header .float-right a:first-child {
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/web/general/detail-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
</div>
</aside>
<div class="main-content container-fluid">
<div class="quick-filter-tabs" th:if="${advListFilterTabs == 'true'}">
<div>
<div class="dropdown-item"><a>[[${bundle.L('全部数据')}]]</a></div>
</div>
</div>
<div class="quick-filter-pane" th:if="${advListFilterPane == 'true'}">
<div class="ph-item rb"></div>
<span></span>
Expand Down
7 changes: 6 additions & 1 deletion src/main/resources/web/general/record-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
</div>
</aside>
<div class="main-content container-fluid">
<div class="quick-filter-tabs" th:if="${advListFilterTabs == 'true'}">
<div>
<div class="dropdown-item"><a>[[${bundle.L('全部数据')}]]</a></div>
</div>
</div>
<div class="quick-filter-pane" th:if="${advListFilterPane == 'true'}">
<div class="ph-item rb"></div>
<span></span>
Expand Down Expand Up @@ -88,7 +93,7 @@
<div class="dataTables_oper">
<button class="btn btn-space btn-secondary J_view" type="button" disabled="disabled"><i class="icon zmdi zmdi-folder"></i> [[${bundle.L('打开')}]]</button>
<button class="btn btn-space btn-secondary J_edit" type="button" disabled="disabled"><i class="icon zmdi zmdi-edit"></i> [[${bundle.L('编辑')}]]</button>
<button class="btn btn-space btn-primary J_new" type="button"><i class="icon zmdi zmdi-plus"></i> [[${bundle.L('新建')}]]</button>
<button class="btn btn-space btn-primary J_new" type="button" disabled="disabled"><i class="icon zmdi zmdi-plus"></i> [[${bundle.L('新建')}]]</button>
<div class="btn-group btn-space J_action">
<button class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">[[${bundle.L('更多')}]] <i class="icon zmdi zmdi-more-vert"></i></button>
<div class="dropdown-menu dropdown-menu-right">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
public class QuickCodeReindexTaskTest extends TestSupport {

@Test
public void testGenerateQuickCode() {
Assertions.assertFalse("NHHSJ".equalsIgnoreCase(QuickCodeReindexTask.generateQuickCode("你 好 hello 世 界")));
Assertions.assertTrue("HW".equalsIgnoreCase(QuickCodeReindexTask.generateQuickCode("hello world ........")));
Assertions.assertTrue("HW".equalsIgnoreCase(QuickCodeReindexTask.generateQuickCode("HelloWorld!")));
Assertions.assertTrue("NHSJ".equalsIgnoreCase(QuickCodeReindexTask.generateQuickCode("你好世界")));
Assertions.assertTrue("NHSJ".equalsIgnoreCase(QuickCodeReindexTask.generateQuickCode("你 好 世 界")));
void testGenerateQuickCode() {
Assertions.assertFalse("NIHAOHELLOSHIJIE".equalsIgnoreCase(QuickCodeReindexTask.generateQuickCode("你 好 hello 世 界")));
Assertions.assertTrue("HELLOWORLD".equalsIgnoreCase(QuickCodeReindexTask.generateQuickCode("hello world ........")));
Assertions.assertTrue("HELLOWORLD".equalsIgnoreCase(QuickCodeReindexTask.generateQuickCode("HelloWorld!")));
Assertions.assertTrue("NIHAOSHIJIE".equalsIgnoreCase(QuickCodeReindexTask.generateQuickCode("你好世界")));
Assertions.assertTrue("NIHAOSHIJIE".equalsIgnoreCase(QuickCodeReindexTask.generateQuickCode("你 好 世 界")));
}

@Test
public void testGenerateQuickCodeEmpty() {
void testGenerateQuickCodeEmpty() {
// Phone, contains `-`
Assertions.assertTrue("".equalsIgnoreCase(QuickCodeReindexTask.generateQuickCode("021-123-123")));
// EMail, contains `@` and `.`
Expand All @@ -43,7 +43,7 @@ public void testGenerateQuickCodeEmpty() {
}

@Test
public void testReindex() {
void testReindex() {
new QuickCodeReindexTask(MetadataHelper.getEntity("User")).run();
}
}