@@ -275,7 +275,7 @@ public class ModelFormHelper { | |||||
PageDatasets datasets = form.getDatasets(); | PageDatasets datasets = form.getDatasets(); | ||||
if (datasets == null || datasets.list == null) return ""; | if (datasets == null || datasets.list == null) return ""; | ||||
String service = form.getService(); | 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(); | service = ModelFormCache.getInstance().get(form.getParent()).getService(); | ||||
} | } | ||||
SwMap ret = new SwMap(); | SwMap ret = new SwMap(); | ||||
@@ -388,6 +388,9 @@ public class ModelFormHelper { | |||||
if (StringUtils.isNotEmpty(eventPath)) { | if (StringUtils.isNotEmpty(eventPath)) { | ||||
opts.put(KEY_EVENT_PATH, eventPath + "." + bean.getName()); | 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) { | public static String getCodePath(ModelForm bean) { | ||||
@@ -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.SwEnum; | ||||
import cc.smtweb.framework.core.common.SwMap; | import cc.smtweb.framework.core.common.SwMap; | ||||
import cc.smtweb.framework.core.db.DbEngine; | 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.CommUtil; | ||||
import cc.smtweb.framework.core.util.JsonUtil; | import cc.smtweb.framework.core.util.JsonUtil; | ||||
import cc.smtweb.framework.core.util.StringUtil; | import cc.smtweb.framework.core.util.StringUtil; | ||||
import cc.smtweb.system.bpm.web.design.form.ModelForm; | 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.ModelFormCache; | ||||
import cc.smtweb.system.bpm.web.design.form.ModelFormHelper; | import cc.smtweb.system.bpm.web.design.form.ModelFormHelper; | ||||
import org.apache.commons.lang3.StringUtils; | |||||
import java.util.List; | import java.util.List; | ||||
import java.util.Set; | import java.util.Set; | ||||
@@ -41,7 +43,7 @@ public class BaseModelWorker { | |||||
} | } | ||||
//保存页面 | |||||
//保存页面,备用 | |||||
protected void savePage(ModelForm bean) { | protected void savePage(ModelForm bean) { | ||||
} | } | ||||
@@ -73,6 +75,13 @@ public class BaseModelWorker { | |||||
* @param bean | * @param bean | ||||
*/ | */ | ||||
public void buildSaveModel(ModelForm 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; | |||||
} | } | ||||
} | } |
@@ -18,6 +18,7 @@ import java.util.Set; | |||||
* Created by Akmm at 2022-08-14 12:17 | * Created by Akmm at 2022-08-14 12:17 | ||||
*/ | */ | ||||
public class LcSinlgeWorker extends BaseModelWorker { | public class LcSinlgeWorker extends BaseModelWorker { | ||||
private final static String tmpl = "model_list_card"; | |||||
@Override | @Override | ||||
protected void saveModule(ModelForm bean, List<ModelForm> listFormChild) { | 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; | |||||
} | |||||
} | } |