Skip to content

Commit

Permalink
enh: ea showFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
getrebuild committed Jan 9, 2025
1 parent 0d7022d commit 15aaf81
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion @rbv
Submodule @rbv updated from 76cf51 to 9d3513
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ const EasyFilterEval = {
clearTimeout(this.__timer)
this.__timer = null
}
this.__timer = setTimeout(() => this._evalAndEffect(form), 600)
this.__timer = setTimeout(() => this._evalAndEffect(form), 200)
},

_evalAndEffect: function (form) {
Expand Down
33 changes: 21 additions & 12 deletions src/main/resources/web/assets/js/general/rb-view.append.js
Original file line number Diff line number Diff line change
Expand Up @@ -538,20 +538,29 @@ const _EasyAction = window.EasyAction
// eslint-disable-next-line no-unused-vars
const EasyAction4View = {
init(items) {
if (!(_FrontJS && items)) return
if (!(_FrontJS && items) || !items['view']) return
const _View = _FrontJS.View

items['view'] &&
items['view'].forEach((item) => {
item = _EasyAction.fixItem(item)
if (!item) return

item.onClick = () => _EasyAction.handleOp(item, _View.getCurrentId())
item.items &&
item.items.forEach((itemL2) => {
itemL2.onClick = () => _EasyAction.handleOp(itemL2, _View.getCurrentId())
})
_View.addButton(item)
items['view'].forEach((item) => {
item = _EasyAction.fixItem(item, _View.getCurrentId())
if (!item) return

item.onClick = () => _EasyAction.handleOp(item, _View.getCurrentId())
item._eaid = item.id
item.items &&
item.items.forEach((itemL2) => {
itemL2.onClick = () => _EasyAction.handleOp(itemL2, _View.getCurrentId())
itemL2._eaid = itemL2.id
})
_View.addButton(item)
})

// v4.0
_EasyAction.checkShowFilter(items['view'], _View.getCurrentId(), (res) => {
$('.view-action button[data-eaid]').each((i, b) => {
const $this = $(b)
res[$this.data('button-id')] && $this.attr('disabled', false)
})
})
},
}

0 comments on commit 15aaf81

Please sign in to comment.