Sfoglia il codice sorgente

增加:LC_SINGLE模型根据模板生成页面

4.0
郑根木 2 anni fa
parent
commit
d2fcac6845
3 ha cambiato i file con 20 aggiunte e 2 eliminazioni
  1. +4
    -1
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/ModelFormHelper.java
  2. +10
    -1
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/BaseModelWorker.java
  3. +6
    -0
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcSinlgeWorker.java

+ 4
- 1
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/ModelFormHelper.java Vedi File

@@ -275,7 +275,7 @@ public class ModelFormHelper {
PageDatasets datasets = form.getDatasets();
if (datasets == null || datasets.list == null) return "";
String service = form.getService();
if (StringUtils.isEmpty(service) && form.getParent() > 0) {
if (StringUtils.isEmpty(service) && form.getParent() > 0L) {
service = ModelFormCache.getInstance().get(form.getParent()).getService();
}
SwMap ret = new SwMap();
@@ -388,6 +388,9 @@ public class ModelFormHelper {
if (StringUtils.isNotEmpty(eventPath)) {
opts.put(KEY_EVENT_PATH, eventPath + "." + bean.getName());
}
SwMap formOpts = bean.getOpts();
opts.put(OPT_CONFIG, formOpts.get(OPT_CONFIG));
opts.put(OPT_PAGE_TYPE, formOpts.readString(OPT_PAGE_TYPE));
}

public static String getCodePath(ModelForm bean) {


+ 10
- 1
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/BaseModelWorker.java Vedi File

@@ -3,12 +3,14 @@ package cc.smtweb.system.bpm.web.design.form.model;
import cc.smtweb.framework.core.common.SwEnum;
import cc.smtweb.framework.core.common.SwMap;
import cc.smtweb.framework.core.db.DbEngine;
import cc.smtweb.framework.core.exception.SwException;
import cc.smtweb.framework.core.util.CommUtil;
import cc.smtweb.framework.core.util.JsonUtil;
import cc.smtweb.framework.core.util.StringUtil;
import cc.smtweb.system.bpm.web.design.form.ModelForm;
import cc.smtweb.system.bpm.web.design.form.ModelFormCache;
import cc.smtweb.system.bpm.web.design.form.ModelFormHelper;
import org.apache.commons.lang3.StringUtils;

import java.util.List;
import java.util.Set;
@@ -41,7 +43,7 @@ public class BaseModelWorker {

}

//保存页面
//保存页面,备用
protected void savePage(ModelForm bean) {

}
@@ -73,6 +75,13 @@ public class BaseModelWorker {
* @param bean
*/
public void buildSaveModel(ModelForm bean) {
String tmplId = getTmplId(bean);
if (StringUtils.isEmpty(tmplId)) throw new SwException("此类型页面没有找到对应的模板文件!");
ModelFormHelper.buildSaveModelByTmpl(bean, tmplId);
}

//获取模板名
protected String getTmplId(ModelForm bean) {
return null;
}
}

+ 6
- 0
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcSinlgeWorker.java Vedi File

@@ -18,6 +18,7 @@ import java.util.Set;
* Created by Akmm at 2022-08-14 12:17
*/
public class LcSinlgeWorker extends BaseModelWorker {
private final static String tmpl = "model_list_card";

@Override
protected void saveModule(ModelForm bean, List<ModelForm> listFormChild) {
@@ -50,4 +51,9 @@ public class LcSinlgeWorker extends BaseModelWorker {
}
}
}

@Override
protected String getTmplId(ModelForm bean) {
return tmpl;
}
}

Caricamento…
Annulla
Salva