Browse Source

优化: 新增afterLoadBean钩子

master
FLYPHT 2 years ago
parent
commit
02d2543192
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/dynPage/DynPageLoadHandler.java

+ 5
- 2
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/dynPage/DynPageLoadHandler.java View File

@@ -31,7 +31,6 @@ public class DynPageLoadHandler extends AbstractDynPageHandler {
listHandler.init(params, us);
return listHandler;
}

//新增操作,初始化定义的数据集
public R add() {
//返回的数据,以dataset.name为key,查出的结果(bean或list)为value
@@ -65,6 +64,8 @@ public class DynPageLoadHandler extends AbstractDynPageHandler {

//新增初始化 - bean
protected void afterAddBean(PageDataset dataset, SwMap bean){}
//加载之后
protected void afterLoadBean(PageDataset dataset, SwMap bean){}
//新增初始化 - list
protected void afterAddList(PageDataset dataset, SwListData bean){}

@@ -94,7 +95,9 @@ public class DynPageLoadHandler extends AbstractDynPageHandler {
} else if (SwEnum.DatasetType.TREE.value.equals(pageDataSet.type)) {//树类
bean = DynRetBean.createList(SwListData.create(getTreeWorker(filter, pageDataSet).buildData(), 0));
} else {//列表类
bean = DynRetBean.createBean(provider.loadData(filter, pageDataSet));
SwMap data = provider.loadData(filter, pageDataSet);
afterLoadBean(pageDataSet,data);
bean = DynRetBean.createBean(data);
}

return R.success(bean);


Loading…
Cancel
Save