Quellcode durchsuchen

模型:单独列表handler

4.0
郑根木 vor 2 Jahren
Ursprung
Commit
a7be5a2de7
2 geänderte Dateien mit 51 neuen und 0 gelöschten Zeilen
  1. +3
    -0
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/dynPage/DynPageListHandler.java
  2. +48
    -0
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/abshandler/ModelListHandler.java

+ 3
- 0
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/dynPage/DynPageListHandler.java Datei anzeigen

@@ -28,6 +28,9 @@ public class DynPageListHandler extends AbstractListHandler {
//对应的数据集定义
protected PageDataset pageDataSet;

public DynPageListHandler() {
}

public DynPageListHandler(long pageId, SwMap filter, PageDataset pageDataSet) {
this.pageId = pageId;
this.filter = filter;


+ 48
- 0
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/abshandler/ModelListHandler.java Datei anzeigen

@@ -0,0 +1,48 @@
package cc.smtweb.system.bpm.web.engine.model.listcard.abshandler;

import cc.smtweb.framework.core.common.R;
import cc.smtweb.framework.core.common.SwMap;
import cc.smtweb.framework.core.exception.BizException;
import cc.smtweb.framework.core.session.UserSession;
import cc.smtweb.system.bpm.web.design.form.ModelForm;
import cc.smtweb.system.bpm.web.design.form.ModelFormHelper;
import cc.smtweb.system.bpm.web.design.form.define.PageDataset;
import cc.smtweb.system.bpm.web.design.form.define.PageDatasets;
import cc.smtweb.system.bpm.web.engine.dynPage.DynPageListHandler;
import cc.smtweb.system.bpm.web.engine.dynPage.DynRetBean;

/**
* Created by Akmm at 2022-09-15 15:01
* 列表类服务handler
*/
public class ModelListHandler extends DynPageListHandler {
protected String dsName;
private ModelListHandler(long pageId, SwMap filter, PageDataset pageDataSet) {
super(pageId, filter, pageDataSet);
}

public ModelListHandler(String dsName) {
this.dsName = dsName;
}

@Override
public void init(SwMap params, UserSession us) {
super.init(params, us);
String pId = params.readString("pageId");
ModelForm form = ModelFormHelper.getFromCache(pId);
if (form == null) throw new BizException("没有找到页面定义数据(" + pageId + ")!");
pageId = form.getId();
PageDatasets datasets = form.getDatasets();
if (datasets == null || datasets.list == null) throw new BizException("没有找到页面定义的数据集数据(" + pageId + ")!");

filter = params.readMap("filter");
pageDataSet = datasets.findByName(dsName);
}

@Override
public R data() {
DynRetBean bean = DynRetBean.createList(buildListData());
return R.success(bean);
}

}

Laden…
Abbrechen
Speichern