mirror of
https://github.com/getrebuild/rebuild.git
synced 2025-09-10 00:33:34 +08:00
be: options of field
This commit is contained in:
parent
91ff6550a6
commit
1693f3afb5
3 changed files with 13 additions and 7 deletions
|
@ -48,12 +48,10 @@ public class MultiSelectManager extends PickListManager {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String[] getLabels(long maskValue, Field field) {
|
public String[] getLabels(long maskValue, Field field) {
|
||||||
if (maskValue <= 0) {
|
if (maskValue <= 0) return new String[0];
|
||||||
return new String[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
List<String> labels = new ArrayList<>();
|
List<String> labels = new ArrayList<>();
|
||||||
ConfigBean[] entries = getPickListRaw(field, false);
|
ConfigBean[] entries = getPickListRaw(field, true);
|
||||||
for (ConfigBean e : entries) {
|
for (ConfigBean e : entries) {
|
||||||
long m = e.get("mask", Long.class);
|
long m = e.get("mask", Long.class);
|
||||||
if ((maskValue & m) != 0) {
|
if ((maskValue & m) != 0) {
|
||||||
|
|
|
@ -225,7 +225,7 @@ public class DataListWrapper {
|
||||||
// @see MultiSelectManager#getLabels
|
// @see MultiSelectManager#getLabels
|
||||||
|
|
||||||
List<Object> colorLabels = new ArrayList<>();
|
List<Object> colorLabels = new ArrayList<>();
|
||||||
ConfigBean[] entries = MultiSelectManager.instance.getPickListRaw(field, false);
|
ConfigBean[] entries = MultiSelectManager.instance.getPickListRaw(field, true);
|
||||||
for (ConfigBean e : entries) {
|
for (ConfigBean e : entries) {
|
||||||
long m = e.get("mask", Long.class);
|
long m = e.get("mask", Long.class);
|
||||||
if (((long) originValue & m) != 0) {
|
if (((long) originValue & m) != 0) {
|
||||||
|
|
|
@ -2083,7 +2083,10 @@ class RbFormPickList extends RbFormElement {
|
||||||
options.push({ id: props.value, text: '[DELETED]' })
|
options.push({ id: props.value, text: '[DELETED]' })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this._options = options
|
this._options = options.filter((item) => {
|
||||||
|
return item.hide !== true || (props.value && item.id === props.value)
|
||||||
|
})
|
||||||
|
|
||||||
this._isShowRadio39 = props.showStyle === '10'
|
this._isShowRadio39 = props.showStyle === '10'
|
||||||
this._htmlid = `${props.field}-${$random()}-`
|
this._htmlid = `${props.field}-${$random()}-`
|
||||||
}
|
}
|
||||||
|
@ -2910,7 +2913,12 @@ class RbFormMultiSelect extends RbFormElement {
|
||||||
super(props)
|
super(props)
|
||||||
this._htmlid = `${props.field}-${$random()}_`
|
this._htmlid = `${props.field}-${$random()}_`
|
||||||
this._isShowSelect41 = props.showStyle === '10'
|
this._isShowSelect41 = props.showStyle === '10'
|
||||||
this._options = props.options || []
|
this._options = (props.options || []).filter((item) => {
|
||||||
|
if (props.value && props.value.id) {
|
||||||
|
if ((props.value.id & item.mask) !== 0) return true
|
||||||
|
}
|
||||||
|
return item.hide !== true
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
renderElement() {
|
renderElement() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue