mirror of
https://github.com/getrebuild/rebuild.git
synced 2024-11-10 17:04:33 +08:00
better: listMode use main-entity
This commit is contained in:
parent
19bf5ed52e
commit
8a8e06c3f1
3 changed files with 11 additions and 2 deletions
|
@ -99,6 +99,10 @@ public class MetaEntityController extends BaseController {
|
|||
// 扩展配置
|
||||
mv.getModel().put("entityExtConfig", easyEntity.getExtraAttrs(true));
|
||||
|
||||
boolean isDetail = easyEntity.getRawMeta().getMainEntity() != null;
|
||||
boolean isBizz = MetadataHelper.isBizzEntity(easyEntity.getRawMeta());
|
||||
mv.getModel().put("useListMode", !(isDetail || isBizz));
|
||||
|
||||
return mv;
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,12 @@ public class GeneralListController extends EntityController {
|
|||
String listPage = listEntity.getMainEntity() != null ? "/general/detail-list" : "/general/record-list";
|
||||
Integer listMode = getIntParameter(request, "forceListMode");
|
||||
if (listMode == null) {
|
||||
listMode = ObjectUtils.toInt(easyEntity.getExtraAttr(EasyEntityConfigProps.ADV_LIST_MODE), 1);
|
||||
if (listEntity.getMainEntity() == null) {
|
||||
listMode = ObjectUtils.toInt(easyEntity.getExtraAttr(EasyEntityConfigProps.ADV_LIST_MODE), 1);
|
||||
} else {
|
||||
listMode = ObjectUtils.toInt(EasyMetaFactory.valueOf(
|
||||
listEntity.getMainEntity()).getExtraAttr(EasyEntityConfigProps.ADV_LIST_MODE), 1);
|
||||
}
|
||||
}
|
||||
if (listMode == 2) {
|
||||
listPage = "/general/record-list-2"; // Mode2
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
<div class="page-head-title">[[${bundle.L('高级配置')}]]</div>
|
||||
</div>
|
||||
<div class="main-content container-fluid pt-1">
|
||||
<div class="card">
|
||||
<div th:if="${useListMode}" class="card">
|
||||
<div class="card-header">[[${bundle.L('列表模式')}]] <sup class="rbv"></sup></div>
|
||||
<div class="card-body mode-select">
|
||||
<div class="row">
|
||||
|
|
Loading…
Reference in a new issue