better: listMode use main-entity

This commit is contained in:
devezhao 2022-02-13 19:34:15 +08:00
parent 19bf5ed52e
commit 8a8e06c3f1
3 changed files with 11 additions and 2 deletions

View file

@ -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;
}

View file

@ -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

View file

@ -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">