mirror of
https://github.com/getrebuild/rebuild.git
synced 2025-09-08 07:36:52 +08:00
Add color field support to calendar view options
This commit is contained in:
parent
5d6e41d990
commit
7ecaf9163e
5 changed files with 32 additions and 5 deletions
2
@rbv
2
@rbv
|
@ -1 +1 @@
|
|||
Subproject commit 377a71875dbd5892196b059148dcde6cd7a1694c
|
||||
Subproject commit 5ca000c9c6846f855ba1aeddbd6e68b62132d8ff
|
|
@ -509,9 +509,13 @@ public class DataListManager extends BaseLayoutManager {
|
|||
if (StringUtils.isBlank(titleField) || !entity.containsField(titleField)) {
|
||||
titleField = entity.getNameField().getName();
|
||||
}
|
||||
String colorField = easyEntity.getExtraAttr(EasyEntityConfigProps.ADVLIST_MODE4_FIELDOFCOLOR);
|
||||
if (StringUtils.isBlank(colorField) || !entity.containsField(colorField)) {
|
||||
colorField = null;
|
||||
}
|
||||
|
||||
return JSONUtils.toJSONObject(
|
||||
new String[]{"startField", "endField", "titleField"},
|
||||
new Object[]{startField, endField, titleField});
|
||||
new String[]{"startField", "endField", "titleField", "colorField"},
|
||||
new Object[]{startField, endField, titleField, colorField});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -133,4 +133,8 @@ public class EasyEntityConfigProps {
|
|||
* 日历显示
|
||||
*/
|
||||
public static final String ADVLIST_MODE4_FIELDOFTITLE = "mode4FieldOfTitle";
|
||||
/**
|
||||
* 日历显示颜色
|
||||
*/
|
||||
public static final String ADVLIST_MODE4_FIELDOFCOLOR = "mode4FieldOfColor";
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="bosskey-show">
|
||||
<div class="bosskey-show--">
|
||||
<div class="row ph">
|
||||
<div class="col-12 p-0">
|
||||
<div class="block block4">
|
||||
|
|
|
@ -614,8 +614,22 @@ class DlgMode4Option extends RbFormHandler {
|
|||
)
|
||||
})}
|
||||
</select>
|
||||
<label className="form-text">{$L('内容')}</label>
|
||||
</div>
|
||||
<div className="col">
|
||||
<select className="form-control form-control-sm" ref={(c) => (this._$fieldOfColor = c)}>
|
||||
{this.state.fields &&
|
||||
this.state.fields.map((item) => {
|
||||
if (!['PICKLIST'].includes(item.type)) return null
|
||||
return (
|
||||
<option key={item.name} value={item.name}>
|
||||
{item.label}
|
||||
</option>
|
||||
)
|
||||
})}
|
||||
</select>
|
||||
<label className="form-text">{$L('颜色')}</label>
|
||||
</div>
|
||||
<div className="col"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -652,6 +666,10 @@ class DlgMode4Option extends RbFormHandler {
|
|||
.select2({ placeholder: $L('默认') })
|
||||
.val(conf.mode4FieldOfTitle || null)
|
||||
.trigger('change')
|
||||
$(this._$fieldOfColor)
|
||||
.select2({ placeholder: $L('无') })
|
||||
.val(conf.mode4FieldOfColor || null)
|
||||
.trigger('change')
|
||||
})
|
||||
})
|
||||
}
|
||||
|
@ -661,6 +679,7 @@ class DlgMode4Option extends RbFormHandler {
|
|||
o.mode4FieldOfStart = $val(this._$fieldOfStart)
|
||||
o.mode4FieldOfEnd = $val(this._$fieldOfEnd)
|
||||
o.mode4FieldOfTitle = $val(this._$fieldOfTitle)
|
||||
o.mode4FieldOfColor = $val(this._$fieldOfColor)
|
||||
|
||||
this.disabled(true)
|
||||
modeSave(o, () => {
|
||||
|
|
Loading…
Add table
Reference in a new issue