be: options of field

This commit is contained in:
RB 2025-08-11 15:55:49 +08:00
parent 91ff6550a6
commit 1693f3afb5
3 changed files with 13 additions and 7 deletions

View file

@ -48,12 +48,10 @@ public class MultiSelectManager extends PickListManager {
* @return
*/
public String[] getLabels(long maskValue, Field field) {
if (maskValue <= 0) {
return new String[0];
}
if (maskValue <= 0) return new String[0];
List<String> labels = new ArrayList<>();
ConfigBean[] entries = getPickListRaw(field, false);
ConfigBean[] entries = getPickListRaw(field, true);
for (ConfigBean e : entries) {
long m = e.get("mask", Long.class);
if ((maskValue & m) != 0) {

View file

@ -225,7 +225,7 @@ public class DataListWrapper {
// @see MultiSelectManager#getLabels
List<Object> colorLabels = new ArrayList<>();
ConfigBean[] entries = MultiSelectManager.instance.getPickListRaw(field, false);
ConfigBean[] entries = MultiSelectManager.instance.getPickListRaw(field, true);
for (ConfigBean e : entries) {
long m = e.get("mask", Long.class);
if (((long) originValue & m) != 0) {

View file

@ -2083,7 +2083,10 @@ class RbFormPickList extends RbFormElement {
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._htmlid = `${props.field}-${$random()}-`
}
@ -2910,7 +2913,12 @@ class RbFormMultiSelect extends RbFormElement {
super(props)
this._htmlid = `${props.field}-${$random()}_`
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() {