diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/ModelForm.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/ModelForm.java index 6777a7b..b0523e2 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/ModelForm.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/ModelForm.java @@ -150,7 +150,7 @@ public class ModelForm extends DefaultEntity { } public void setContent(String mfContent) { - put("mf_content", mfContent); + put("mf_content", mfContent == null ? "{}" :mfContent.replaceAll("\\s*", "")); } public String getOption() { diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/ModelFormHelper.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/ModelFormHelper.java index 880cb6b..3aa649d 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/ModelFormHelper.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/ModelFormHelper.java @@ -432,14 +432,25 @@ public class ModelFormHelper { } /** - * 根据向导生成model * * @param form * @param tmplId */ public static void buildSaveModelByTmpl(ModelForm form, String tmplId) { + buildSaveModelByTmplExt(form, new SwMap(), tmplId); + } + + /** + * 根据向导生成model + * + * @param form + * @param tmplId + * @param modelExt 额外的属性配置 + */ + public static void buildSaveModelByTmplExt(ModelForm form,SwMap modelExt, String tmplId) { PageDatasets datasets = form.getDatasets(); SwMap tmplModel = JsonUtil.parse(form.getTmpl(), SwMap.class); + tmplModel.putAll(modelExt); tmplModel.put("title", form.getTitle()); tmplModel.put("name", form.getName()); tmplModel.put("datasets", JsonUtil.bean2MapList(form.getDatasets().list)); diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/EmptyWorker.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/EmptyWorker.java index b3852e8..89bc4e3 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/EmptyWorker.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/EmptyWorker.java @@ -16,6 +16,7 @@ import java.util.List; /** * @Author:lip * @Date : 2022/9/14 11:27 + * 自定义模型-生成一个空白页面 */ public class EmptyWorker extends BaseModelWorker{ private final static String template = "model_empty"; diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcLc1Worker.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcLc1Worker.java index 2db2e0d..08bdacf 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcLc1Worker.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcLc1Worker.java @@ -5,6 +5,7 @@ import cc.smtweb.system.bpm.web.design.form.ModelForm; /** * @Author:lip * @Date : 2022/9/1 16:05 + * 左列表-右列表(含编辑弹窗、左列表可编辑) */ public class LcLc1Worker extends LcSingleWorker { private final static String tmpl = "model_list_list_1"; diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcLc2Worker.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcLc2Worker.java index 073f5df..3d13c0a 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcLc2Worker.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcLc2Worker.java @@ -5,6 +5,7 @@ import cc.smtweb.system.bpm.web.design.form.ModelForm; /** * @Author:lip * @Date : 2022/9/1 16:05 + * 左列表-右列表(含编辑弹窗、左列表不可编辑) */ public class LcLc2Worker extends LcSingleWorker { private final static String tmpl = "model_list_list_2"; diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcLt2Worker.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcLt2Worker.java index 89f1032..fe3c577 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcLt2Worker.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcLt2Worker.java @@ -5,6 +5,7 @@ import cc.smtweb.system.bpm.web.design.form.ModelForm; /** * @Author:lip * @Date : 2022/9/13 10:06 + * 左树-列表(含编辑弹窗) */ public class LcLt2Worker extends LcSingleWorker { private final static String template = "model_tree_list_dialog"; diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcLtMsWorker.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcLtMsWorker.java index a4afb4d..9dfab6b 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcLtMsWorker.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcLtMsWorker.java @@ -7,6 +7,7 @@ import cc.smtweb.system.bpm.web.design.form.ModelForm; /** * @Author:lip * @Date : 2022/8/28 22:57 + * 左树-主子列表(含编辑卡片) */ public class LcLtMsWorker extends LcMsWorker { private final static String templateList = "model_tree_list"; diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcLtWorker.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcLtWorker.java index 88078bb..98b1366 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcLtWorker.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcLtWorker.java @@ -7,6 +7,7 @@ import cc.smtweb.system.bpm.web.design.form.ModelForm; /** * @Author:lip * @Date : 2022/8/26 10:20 + * 左树-列表(含编辑卡片) */ public class LcLtWorker extends LcNormalWorker { private final static String templateList = "model_tree_list"; diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcMsWorker.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcMsWorker.java index 8130a51..1224aad 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcMsWorker.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcMsWorker.java @@ -1,8 +1,12 @@ 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.exception.SwException; import cc.smtweb.framework.core.util.StringUtil; import cc.smtweb.system.bpm.web.design.form.ModelForm; +import cc.smtweb.system.bpm.web.design.form.ModelFormHelper; +import org.apache.commons.lang3.StringUtils; /** * @Author:lip @@ -22,4 +26,21 @@ public class LcMsWorker extends LcNormalWorker { } return super.getTmplId(bean); } + + /** + * 根据模型生成页面 + * + * @param bean + */ + public void buildSaveModel(ModelForm bean) { + String tmplId = getTmplId(bean); + if (StringUtils.isEmpty(tmplId)) throw new SwException("此类型页面没有找到对应的模板文件!"); + SwMap model = new SwMap(); + SwMap opts = bean.getOpts(); + SwMap cfg = opts.readMap(ModelFormHelper.OPT_CONFIG); + // + model.put("subIndSave",cfg.readMap("props").readBool("subIndSave")); + + ModelFormHelper.buildSaveModelByTmplExt(bean, model, tmplId); + } } diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcNormalWorker.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcNormalWorker.java index 7b13537..f06a3d6 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcNormalWorker.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcNormalWorker.java @@ -15,6 +15,7 @@ import java.util.List; /** * @Author:lip * @Date : 2022/8/26 10:20 + * 普通列表(含编辑卡片) */ public class LcNormalWorker extends BaseModelWorker { private final static String templateList = "model_list_normal"; diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcSingleWorker.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcSingleWorker.java index d34b193..95e7b02 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcSingleWorker.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcSingleWorker.java @@ -13,6 +13,7 @@ import java.util.List; /** * Created by Akmm at 2022-08-14 12:17 + * 简单列表(含编辑弹窗) */ public class LcSingleWorker extends BaseModelWorker { private final static String tmpl = "model_list_card"; diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/ModelFactory.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/ModelFactory.java index 8ccfc5f..9d52656 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/ModelFactory.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/ModelFactory.java @@ -5,7 +5,7 @@ import cc.smtweb.framework.core.common.SwEnum; import cc.smtweb.framework.core.exception.SwException; 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.model.flow.FlowSingleWorker; +import cc.smtweb.system.bpm.web.design.form.model.flow.*; import org.apache.commons.lang3.StringUtils; import java.util.HashMap; @@ -33,6 +33,11 @@ public class ModelFactory { mapWorker.put(SwEnum.ModelType.LC_LC_1.value, new LcLc1Worker()); mapWorker.put(SwEnum.ModelType.LC_LC_2.value, new LcLc2Worker()); mapWorker.put(SwEnum.ModelType.FLOW_SINGLE.value, new FlowSingleWorker()); + mapWorker.put(SwEnum.ModelType.FLOW_LC_LC_1.value, new FlowLcLc1Worker()); + mapWorker.put(SwEnum.ModelType.FLOW_LC_LC_2.value, new FlowLcLc2Worker()); + mapWorker.put(SwEnum.ModelType.FLOW_LC_LT.value, new FlowLcLtWorker()); + mapWorker.put(SwEnum.ModelType.FLOW_LC_MS.value, new FlowLcMsWorker()); + mapWorker.put(SwEnum.ModelType.FLOW_LT_MS.value, new FlowLtMsWorker()); mapWorker.put(SwEnum.ModelType.EMPTY.value, new EmptyWorker()); } diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/flow/FlowLcLc1Worker.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/flow/FlowLcLc1Worker.java new file mode 100644 index 0000000..13ffc5d --- /dev/null +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/flow/FlowLcLc1Worker.java @@ -0,0 +1,27 @@ +package cc.smtweb.system.bpm.web.design.form.model.flow; + +import cc.smtweb.framework.core.common.SwEnum; +import cc.smtweb.framework.core.util.StringUtil; +import cc.smtweb.system.bpm.web.design.form.ModelForm; +import cc.smtweb.system.bpm.web.design.form.model.LcNormalWorker; + +/** + * @Author:lip + * @Date : 2022/9/15 16:49 + * 左列表-右列表(含编辑卡片、工作流、左列表可编辑) + */ +public class FlowLcLc1Worker extends LcNormalWorker { + private final static String templateList = "model_list_flow_ll1"; + private final static String templateCard = "model_card_flow_ll"; + + @Override + protected String getTmplId(ModelForm bean) { + if (bean.getName().endsWith(StringUtil.upFirst(SwEnum.PageType.LIST.value))) { + return templateList; + } + if (bean.getName().endsWith(StringUtil.upFirst(SwEnum.PageType.CARD.value))) { + return templateCard; + } + return super.getTmplId(bean); + } +} diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/flow/FlowLcLc2Worker.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/flow/FlowLcLc2Worker.java new file mode 100644 index 0000000..4a789d2 --- /dev/null +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/flow/FlowLcLc2Worker.java @@ -0,0 +1,27 @@ +package cc.smtweb.system.bpm.web.design.form.model.flow; + +import cc.smtweb.framework.core.common.SwEnum; +import cc.smtweb.framework.core.util.StringUtil; +import cc.smtweb.system.bpm.web.design.form.ModelForm; +import cc.smtweb.system.bpm.web.design.form.model.LcNormalWorker; + +/** + * @Author:lip + * @Date : 2022/9/15 16:49 + * 左列表-右列表(含编辑卡片、工作流、左列表不可编辑) + */ +public class FlowLcLc2Worker extends LcNormalWorker { + private final static String templateList = "model_list_flow_ll2"; + private final static String templateCard = "model_card_flow_ll"; + + @Override + protected String getTmplId(ModelForm bean) { + if (bean.getName().endsWith(StringUtil.upFirst(SwEnum.PageType.LIST.value))) { + return templateList; + } + if (bean.getName().endsWith(StringUtil.upFirst(SwEnum.PageType.CARD.value))) { + return templateCard; + } + return super.getTmplId(bean); + } +} diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/flow/FlowLcLtWorker.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/flow/FlowLcLtWorker.java new file mode 100644 index 0000000..94654f2 --- /dev/null +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/flow/FlowLcLtWorker.java @@ -0,0 +1,27 @@ +package cc.smtweb.system.bpm.web.design.form.model.flow; + +import cc.smtweb.framework.core.common.SwEnum; +import cc.smtweb.framework.core.util.StringUtil; +import cc.smtweb.system.bpm.web.design.form.ModelForm; +import cc.smtweb.system.bpm.web.design.form.model.LcNormalWorker; + +/** + * @Author:lip + * @Date : 2022/9/15 16:45 + * 左树-列表(含编辑卡片、工作流) + */ +public class FlowLcLtWorker extends LcNormalWorker { + private final static String templateList = "model_tree_list"; + private final static String templateCard = "model_card_flow"; + + @Override + protected String getTmplId(ModelForm bean) { + if (bean.getName().endsWith(StringUtil.upFirst(SwEnum.PageType.LIST.value))) { + return templateList; + } + if (bean.getName().endsWith(StringUtil.upFirst(SwEnum.PageType.CARD.value))) { + return templateCard; + } + return super.getTmplId(bean); + } +} diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/flow/FlowLcMsWorker.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/flow/FlowLcMsWorker.java new file mode 100644 index 0000000..9bc1b65 --- /dev/null +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/flow/FlowLcMsWorker.java @@ -0,0 +1,27 @@ +package cc.smtweb.system.bpm.web.design.form.model.flow; + +import cc.smtweb.framework.core.common.SwEnum; +import cc.smtweb.framework.core.util.StringUtil; +import cc.smtweb.system.bpm.web.design.form.ModelForm; +import cc.smtweb.system.bpm.web.design.form.model.LcMsWorker; + +/** + * @Author:lip + * @Date : 2022/9/15 16:49 + * 普通主子列表(含编辑卡片、工作流) + */ +public class FlowLcMsWorker extends LcMsWorker { + private final static String templateList = "model_list_normal"; + private final static String templateCard = "model_card_flow_lms"; + + @Override + protected String getTmplId(ModelForm bean) { + if (bean.getName().endsWith(StringUtil.upFirst(SwEnum.PageType.LIST.value))) { + return templateList; + } + if (bean.getName().endsWith(StringUtil.upFirst(SwEnum.PageType.CARD.value))) { + return templateCard; + } + return super.getTmplId(bean); + } +} diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/flow/FlowLtMsWorker.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/flow/FlowLtMsWorker.java new file mode 100644 index 0000000..1109d45 --- /dev/null +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/flow/FlowLtMsWorker.java @@ -0,0 +1,27 @@ +package cc.smtweb.system.bpm.web.design.form.model.flow; + +import cc.smtweb.framework.core.common.SwEnum; +import cc.smtweb.framework.core.util.StringUtil; +import cc.smtweb.system.bpm.web.design.form.ModelForm; +import cc.smtweb.system.bpm.web.design.form.model.LcMsWorker; + +/** + * @Author:lip + * @Date : 2022/9/15 16:49 + * 左树-主子列表(含编辑卡片、工作流) + */ +public class FlowLtMsWorker extends LcMsWorker { + private final static String templateList = "model_tree_list"; + private final static String templateCard = "model_card_flow_lms"; + + @Override + protected String getTmplId(ModelForm bean) { + if (bean.getName().endsWith(StringUtil.upFirst(SwEnum.PageType.LIST.value))) { + return templateList; + } + if (bean.getName().endsWith(StringUtil.upFirst(SwEnum.PageType.CARD.value))) { + return templateCard; + } + return super.getTmplId(bean); + } +} diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/flow/FlowSingleWorker.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/flow/FlowSingleWorker.java index b7eb073..165d11c 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/flow/FlowSingleWorker.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/flow/FlowSingleWorker.java @@ -17,7 +17,7 @@ import java.util.List; /** * @Author: tanghp * @Date: 2022-08-26 9:48 - * @Desc: 列表卡片(含工作流) + * @Desc: 普通列表(含编辑卡片、工作流) */ public class FlowSingleWorker extends BaseModelWorker { private final static String listTmpl = "model_list_flow"; diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/common/FlowModelListHandler.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/common/FlowModelListHandler.java index 1a5d63e..14ced1b 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/common/FlowModelListHandler.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/common/FlowModelListHandler.java @@ -1,12 +1,10 @@ package cc.smtweb.system.bpm.web.engine.model.common; -import cc.smtweb.framework.core.common.SwMap; import cc.smtweb.framework.core.db.EntityHelper; import cc.smtweb.framework.core.mvc.service.SqlNamedPara; import cc.smtweb.framework.core.mvc.service.SqlPara; import cc.smtweb.system.bpm.web.design.form.define.PageDataset; import cc.smtweb.system.bpm.web.engine.dynPage.DynPageHelper; -import cc.smtweb.system.bpm.web.engine.dynPage.DynPageListHandler; import cc.smtweb.system.bpm.web.engine.dynPage.IBuildSqlListener; import cc.smtweb.system.bpm.web.engine.flow.entity.ProcInst; diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/common/FlowModelLoadHandler.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/common/FlowModelLoadHandler.java index 294cf15..6781d32 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/common/FlowModelLoadHandler.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/common/FlowModelLoadHandler.java @@ -1,5 +1,6 @@ package cc.smtweb.system.bpm.web.engine.model.common; +import cc.smtweb.framework.core.common.SwConsts; import cc.smtweb.framework.core.common.SwMap; import cc.smtweb.framework.core.db.impl.DefaultEntity; import cc.smtweb.framework.core.mvc.service.SwListData; @@ -33,6 +34,7 @@ public class FlowModelLoadHandler extends ModelLoadHand //过滤条件 long id = params.readLong("id"); + if (id <= 0) id = filter.readLong(SwConsts.NAME_ID); long taskId = params.readLong("taskId"); PageDataset cardDataset = findCardDataset(ModelHelper.DATASET_NAME_CARD); diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/common/FlowModelSaveHandler.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/common/FlowModelSaveHandler.java index 4d0d5b2..0f4334b 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/common/FlowModelSaveHandler.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/common/FlowModelSaveHandler.java @@ -15,6 +15,13 @@ import cc.smtweb.system.bpm.web.engine.flow.FlowListener; * 带流程的简单卡片之保存 */ public class FlowModelSaveHandler extends ModelSaveHandler implements FlowListener { + public FlowModelSaveHandler() { + } + + public FlowModelSaveHandler(String cardDsName) { + super(cardDsName); + } + protected FlowInstance flowInstance; @Override protected void readFromPage(SwMap pageData, SwMap filter) { diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/common/FlowModelService.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/common/FlowModelService.java index 8b1770d..b9760c8 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/common/FlowModelService.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/common/FlowModelService.java @@ -4,7 +4,6 @@ import cc.smtweb.framework.core.annotation.SwBody; import cc.smtweb.framework.core.annotation.SwService; import cc.smtweb.framework.core.common.R; import cc.smtweb.framework.core.common.SwMap; -import cc.smtweb.framework.core.db.impl.DefaultEntity; import cc.smtweb.framework.core.mvc.service.AbstractHandler; import cc.smtweb.framework.core.mvc.service.IWorker; import cc.smtweb.framework.core.session.UserSession; @@ -24,9 +23,9 @@ public class FlowModelService extends LCSingleService { case TYPE_MODEL_LIST: return new FlowModelListHandler(); case TYPE_MODEL_LOAD: - return new FlowModelLoadHandler(); + return new FlowModelLoadHandler<>(); case TYPE_MODEL_SAVE: - return new FlowModelSaveHandler(); + return new FlowModelSaveHandler<>(); case TYPE_MODEL_DEL: return new FlowModelDelHandler(); } diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/common/ModelDetail.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/common/ModelDetail.java index 2582ee8..86f83e6 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/common/ModelDetail.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/common/ModelDetail.java @@ -109,16 +109,18 @@ public class ModelDetail { if (table == null) throw new BizException("没有找到待保存的表定义:" + pageDataset.name); SwMap details = pageData.readMap(pageDataset.name); if (details == null) throw new BizException("没有找到待保存的表数据:" + pageDataset.name); - EntityDao dao = DbEngine.getInstance().findDao(table.getTableName()); + EntityDao dao = DbEngine.getInstance().findDao(table.getName()); List> inserted = details.readListMap("inserted"); if(!CommUtil.isEmpty(inserted)){ inserted.forEach((row)-> { T bean = dao.createBean(); bean.init(); bean.getData().putAll(row); + bean.setEntityId(DbEngine.getInstance().nextId()); if(consumer!=null){ consumer.accept(true,bean); } + insertList.add(bean); }); } List> updated = details.readListMap("updated"); @@ -130,6 +132,7 @@ public class ModelDetail { if(consumer!=null){ consumer.accept(false,bean); } + updateList.add(bean); }); } Set deleted = details.readLongSet("deleted"); @@ -141,7 +144,7 @@ public class ModelDetail { public void batchSave(PageDataset pageDataset) { ModelTable table = ModelTableCache.getInstance().get(pageDataset.masterTable); if (table == null) throw new BizException("没有找到待保存的表定义:" + pageDataset.name); - EntityDao dao = DbEngine.getInstance().findDao(table.getTableName()); + EntityDao dao = DbEngine.getInstance().findDao(table.getName()); batchSave(dao); } } diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/common/ModelLoadHandler.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/common/ModelLoadHandler.java index f5a27b1..e9405c7 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/common/ModelLoadHandler.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/common/ModelLoadHandler.java @@ -66,7 +66,9 @@ public class ModelLoadHandler extends AbstractDynPageHa //从数据库加载bean,并设到返回值 protected void load(SwMap ret, SwMap filter) { PageDataset cardDataset = findCardDataset(cardDsName); - bean = provider.loadBean(cardDataset, filter.readLong(SwConsts.NAME_ID)); + long id = params.readLong(SwConsts.NAME_ID); + if (id <= 0) id = filter.readLong(SwConsts.NAME_ID); + bean = provider.loadBean(cardDataset, id); ret.put(cardDsName, DynRetBean.createBean(bean)); } diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/lclc1/FlowLcLc1Service.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/lclc1/FlowLcLc1Service.java new file mode 100644 index 0000000..b8c3c16 --- /dev/null +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/lclc1/FlowLcLc1Service.java @@ -0,0 +1,92 @@ +package cc.smtweb.system.bpm.web.engine.model.flow.listcard.lclc1; + +import cc.smtweb.framework.core.annotation.SwBody; +import cc.smtweb.framework.core.annotation.SwService; +import cc.smtweb.framework.core.common.R; +import cc.smtweb.framework.core.common.SwMap; +import cc.smtweb.framework.core.mvc.service.AbstractHandler; +import cc.smtweb.framework.core.session.UserSession; +import cc.smtweb.system.bpm.web.engine.model.common.*; +import cc.smtweb.system.bpm.web.engine.model.listcard.lclc1.LCLC1Service; + +/** + * @Author:lip + * @Date : 2022/9/16 18:53 + * 模型:FLOW_LC_LC_1 服务类 + */ +@SwService +public class FlowLcLc1Service extends FlowModelService { + private LCLC1Service worker = new LCLC1Service(); + + @Override + protected AbstractHandler createHandler(String type) { + switch (type) { + case TYPE_MODEL_LIST: + case TYPE_MODEL_LOAD: + case TYPE_MODEL_SAVE: + case TYPE_MODEL_DEL: + return super.createHandler(type); + } + return worker.createHandler(type); + } + + /** + * 左列表保存 + * @param params + * @param us + * @return + */ + public R modelLSave(@SwBody SwMap params, UserSession us) { + return worker.modelLSave(params,us); + } + + /** + * 左表编辑 + * @param params + * @param us + * @return + */ + public R modelLLoad(@SwBody SwMap params, UserSession us) { + return worker.modelLLoad(params,us); + } + + /** + * 左表新增初始化 + * @param params + * @param us + * @return + */ + public R modelLAdd(@SwBody SwMap params, UserSession us) { + return worker.modelLAdd(params,us); + } + + /** + * 左表删除 + * @param params + * @param us + * @return + */ + public R modelLDel(@SwBody SwMap params, UserSession us) { + return worker.modelLDel(params,us); + } + + /** + * 加载左表列表数据 + * @param params + * @param us + * @return + */ + public R modelLList(@SwBody SwMap params, UserSession us) { + return worker.modelLList(params,us); + } + + /** + * 加载左表列表总记录数及合计栏 + * @param params + * @param us + * @return + */ + public R modelLListTotal(@SwBody SwMap params, UserSession us) { + return worker.modelLListTotal(params,us); + } +} diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/lclc2/FlowLcLc2Service.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/lclc2/FlowLcLc2Service.java new file mode 100644 index 0000000..ebcb8d9 --- /dev/null +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/lclc2/FlowLcLc2Service.java @@ -0,0 +1,13 @@ +package cc.smtweb.system.bpm.web.engine.model.flow.listcard.lclc2; + +import cc.smtweb.framework.core.annotation.SwService; +import cc.smtweb.system.bpm.web.engine.model.flow.listcard.lclc1.FlowLcLc1Service; + +/** + * @Author:lip + * @Date : 2022/9/16 19:01 + * 模型:FLOW_LC_LC_2 服务类 + */ +@SwService +public class FlowLcLc2Service extends FlowLcLc1Service { +} diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/lclt/FlowLcLtService.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/lclt/FlowLcLtService.java new file mode 100644 index 0000000..c703cae --- /dev/null +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/lclt/FlowLcLtService.java @@ -0,0 +1,13 @@ +package cc.smtweb.system.bpm.web.engine.model.flow.listcard.lclt; + +import cc.smtweb.framework.core.annotation.SwService; +import cc.smtweb.system.bpm.web.engine.model.common.FlowModelService; + +/** + * @Author:lip + * @Date : 2022/9/16 18:41 + * 模型:FLOW_LC_LT 服务类 + */ +@SwService +public class FlowLcLtService extends FlowModelService { +} diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/lcltms/FlowLcLtMs.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/lcltms/FlowLcLtMs.java new file mode 100644 index 0000000..5814ab6 --- /dev/null +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/lcltms/FlowLcLtMs.java @@ -0,0 +1,13 @@ +package cc.smtweb.system.bpm.web.engine.model.flow.listcard.lcltms; + +import cc.smtweb.framework.core.annotation.SwService; +import cc.smtweb.system.bpm.web.engine.model.flow.listcard.lcms.FlowLcMsService; + +/** + * @Author:lip + * @Date : 2022/9/17 21:20 + * 模型:FLOW_LT_MS 服务类 + */ +@SwService +public class FlowLcLtMs extends FlowLcMsService { +} diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/lcms/FlowLcMsDelHandler.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/lcms/FlowLcMsDelHandler.java new file mode 100644 index 0000000..acc1017 --- /dev/null +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/lcms/FlowLcMsDelHandler.java @@ -0,0 +1,47 @@ +package cc.smtweb.system.bpm.web.engine.model.flow.listcard.lcms; + +import cc.smtweb.framework.core.db.DbEngine; +import cc.smtweb.framework.core.db.EntityDao; +import cc.smtweb.framework.core.db.cache.ModelTableCache; +import cc.smtweb.framework.core.db.vo.ModelTable; +import cc.smtweb.system.bpm.web.design.form.define.PageDataset; +import cc.smtweb.system.bpm.web.engine.model.common.FlowModelDelHandler; +import cc.smtweb.system.bpm.web.engine.model.listcard.lcms.LCMsConfig; + +/** + * @Author:lip + * @Date : 2022/9/16 19:45 + * 主子表模型删除处理类 + */ +public class FlowLcMsDelHandler extends FlowModelDelHandler { + @Override + protected void checkDel(PageDataset pageDataSet, long id) { + super.checkDel(pageDataSet, id); + // 子表删除校验 + } + + @Override + protected void localDel(long id, ModelTable table) { + super.localDel(id, table); + // 获取主子表模型配置 + LCMsConfig.Config config = new LCMsConfig.Config(form); + // 子表删除 + batchDelDetail(config.getSubTableId(),config.getSubFKField(),id); + } + + /** + * 批量删除明细 供子类调用 + * @param tableId 表定义ID + * @param fk 关联字段 + * @param id 主表ID + */ + protected void batchDelDetail(long tableId, String fk, long id) { + if (tableId <= 0L) return; + ModelTable table = ModelTableCache.getInstance().get(tableId); + if (table == null) return; + EntityDao dao = DbEngine.getInstance().findDao(table.getName()); + if (dao != null) { + dao.deleteEntity(String.format(" where %s = ? ", fk), id); + } + } +} diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/lcms/FlowLcMsSaveHandler.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/lcms/FlowLcMsSaveHandler.java new file mode 100644 index 0000000..bb92958 --- /dev/null +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/lcms/FlowLcMsSaveHandler.java @@ -0,0 +1,75 @@ +package cc.smtweb.system.bpm.web.engine.model.flow.listcard.lcms; + +import cc.smtweb.framework.core.common.SwMap; +import cc.smtweb.framework.core.db.DbEngine; +import cc.smtweb.framework.core.db.impl.DefaultEntity; +import cc.smtweb.system.bpm.web.design.form.define.PageDataset; +import cc.smtweb.system.bpm.web.engine.model.common.FlowModelSaveHandler; +import cc.smtweb.system.bpm.web.engine.model.common.ModelDetail; +import cc.smtweb.system.bpm.web.engine.model.listcard.lcms.LCMsConfig; + +import java.util.function.BiConsumer; + +/** + * @Author:lip + * @Date : 2022/9/16 19:25 + * 主子表模型保存处理类 + */ +public class FlowLcMsSaveHandler extends FlowModelSaveHandler { + + // 子表明细 + protected ModelDetail subDetail; + + @Override + public void readFromPage(SwMap pageData, SwMap filter) { + super.readFromPage(pageData, filter); + LCMsConfig.Config config = new LCMsConfig.Config(form); + // 读取子表 + subDetail = readDetailFromPage(LCMsConfig.dsSList,pageData,filter,(isNew,item) -> { + if(isNew){ + item.setEntityId(DbEngine.getInstance().nextId()); + item.put(config.getSubFKField(),bean.getEntityId()); + } + }); + } + + @Override + protected void checkValid() { + super.checkValid(); + // 校验子表明细 + } + + @Override + public void doSave() { + super.doSave(); + // 保存子表 + saveDetail(LCMsConfig.dsSList,subDetail); + } + + /** + * 读取明细 供子类调用 + * @param dsName 数据集名称 + * @param pageData 数据对象 + * @param filter 数据集的filter参数 + * @param afterReadBean 读取明细之后的接口 + * @return + * @param + */ + protected ModelDetail readDetailFromPage(String dsName, SwMap pageData, SwMap filter, BiConsumer afterReadBean) { + ModelDetail modelDetail = new ModelDetail<>(); + PageDataset pageDataset = findDataset(dsName); + modelDetail.readFromMap(pageDataset,pageData,afterReadBean); + return modelDetail; + } + + /** + * 保存明细 供子类调用 + * @param dsName + * @param modelDetail + * @param + */ + protected void saveDetail(String dsName, ModelDetail modelDetail){ + PageDataset pageDataset = findDataset(dsName); + modelDetail.batchSave(pageDataset); + } +} diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/lcms/FlowLcMsService.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/lcms/FlowLcMsService.java new file mode 100644 index 0000000..5b495f5 --- /dev/null +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/lcms/FlowLcMsService.java @@ -0,0 +1,93 @@ +package cc.smtweb.system.bpm.web.engine.model.flow.listcard.lcms; + +import cc.smtweb.framework.core.annotation.SwBody; +import cc.smtweb.framework.core.annotation.SwService; +import cc.smtweb.framework.core.common.R; +import cc.smtweb.framework.core.common.SwMap; +import cc.smtweb.framework.core.mvc.service.AbstractHandler; +import cc.smtweb.framework.core.session.UserSession; +import cc.smtweb.system.bpm.web.engine.model.common.FlowModelService; +import cc.smtweb.system.bpm.web.engine.model.listcard.lcms.LCMsService; + +/** + * @Author:lip + * @Date : 2022/9/16 18:53 + * 模型:FLOW_LT_MS 服务类 + */ +@SwService +public class FlowLcMsService extends FlowModelService { + private LCMsService worker = new LCMsService(); + + protected AbstractHandler createHandler(String type) { + switch (type) { + case TYPE_MODEL_LIST: + case TYPE_MODEL_LOAD: + return super.createHandler(type); + case TYPE_MODEL_SAVE: + return new FlowLcMsSaveHandler(); + case TYPE_MODEL_DEL: + return new FlowLcMsDelHandler(); + } + return worker.createHandler(type); + } + + /** + * 子表单独保存 + * @param params + * @param us + * @return + */ + public R modelSubSave(@SwBody SwMap params, UserSession us) { + return worker.modelSubSave(params,us); + } + + /** + * 子表编辑 + * @param params + * @param us + * @return + */ + public R modelSubLoad(@SwBody SwMap params, UserSession us) { + return worker.modelSubLoad(params,us); + } + + /** + * 子表新增初始化 + * @param params + * @param us + * @return + */ + public R modelSubAdd(@SwBody SwMap params, UserSession us) { + return worker.modelSubAdd(params,us); + } + + /** + * 子表单独删除 + * @param params + * @param us + * @return + */ + public R modelSubDel(@SwBody SwMap params, UserSession us) { + return worker.modelSubDel(params,us); + } + + /** + * 子表列表数据 + * @param params + * @param us + * @return + */ + public R modelSubList(@SwBody SwMap params, UserSession us) { + return worker.modelSubList(params,us); + } + + /** + * 列子表表总记录数及合计栏 + * @param params + * @param us + * @return + */ + public R modelSubListTotal(@SwBody SwMap params, UserSession us) { + return worker.modelSubListTotal(params,us); + } +} diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/ModelUtils.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/ModelUtils.java deleted file mode 100644 index 53337e6..0000000 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/ModelUtils.java +++ /dev/null @@ -1,25 +0,0 @@ -package cc.smtweb.system.bpm.web.engine.model.listcard; - -import cc.smtweb.framework.core.common.SwMap; -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.DynRetBean; -import org.springframework.util.Assert; - -/** - * @Author:lip - * @Date : 2022/9/2 15:22 - */ -public class ModelUtils { - public static SwMap buildRetData(String dsName, SwMap data) { - SwMap mapRet = new SwMap(); - mapRet.put(dsName, DynRetBean.createBean(data)); - return mapRet; - } - - public static PageDataset findPageDatasetByName(PageDatasets dataSets, String dsName) { - PageDataset pageDataset = dataSets.findByName(dsName); - Assert.notNull(pageDataset, "未获取到数据集:" + dsName); - return pageDataset; - } -} diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclc1/LCLC1Config.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclc1/LCLC1Config.java index 726deb7..c624066 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclc1/LCLC1Config.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclc1/LCLC1Config.java @@ -5,8 +5,12 @@ package cc.smtweb.system.bpm.web.engine.model.listcard.lclc1; * @Date : 2022/9/2 12:00 */ public class LCLC1Config { + // 左列表数据集 public static final String dsLList = "lList"; + // 左表编辑数据集 public static final String dsLCard = "lCard"; + // 右表(主表)列表数据集 public static final String dsRList = "list"; + // 右表(主表)编辑数据集 public static final String dsRCard = "card"; } diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclc1/LCLC1Service.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclc1/LCLC1Service.java index 712423f..4647412 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclc1/LCLC1Service.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclc1/LCLC1Service.java @@ -4,7 +4,6 @@ import cc.smtweb.framework.core.annotation.SwBody; import cc.smtweb.framework.core.annotation.SwService; import cc.smtweb.framework.core.common.R; import cc.smtweb.framework.core.common.SwMap; -import cc.smtweb.framework.core.db.impl.DefaultEntity; import cc.smtweb.framework.core.mvc.service.AbstractHandler; import cc.smtweb.framework.core.session.UserSession; import cc.smtweb.system.bpm.web.engine.model.common.*; @@ -12,6 +11,7 @@ import cc.smtweb.system.bpm.web.engine.model.common.*; /** * @Author:lip * @Date : 2022/9/2 11:34 + * 模型LC_LC_1(左列表-右列表(含编辑弹窗、左列表可编辑)) 服务类 */ @SwService public class LCLC1Service extends ModelService { @@ -21,44 +21,76 @@ public class LCLC1Service extends ModelService { public final static String TYPE_MODEL_LEFT_DEL = "modelLDel"; @Override - protected AbstractHandler createHandler(String type) { + public AbstractHandler createHandler(String type) { switch (type) { case TYPE_MODEL_LEFT_LIST: return new ModelListHandler(LCLC1Config.dsLList); case TYPE_MODEL_LEFT_LOAD: - return new ModelLoadHandler(LCLC1Config.dsLCard); + return new ModelLoadHandler<>(LCLC1Config.dsLCard); case TYPE_MODEL_LEFT_SAVE: - return new ModelSaveHandler(LCLC1Config.dsLCard); + return new ModelSaveHandler<>(LCLC1Config.dsLCard); case TYPE_MODEL_LEFT_DEL: return new ModelDelHandler(LCLC1Config.dsLCard); } return super.createHandler(type); } - //左表保存 + + /** + * 左表保存 + * @param params + * @param us + * @return + */ public R modelLSave(@SwBody SwMap params, UserSession us) { return pageHandler(params, us, TYPE_MODEL_LEFT_SAVE, handler -> ((ModelSaveHandler) handler).save()); } - //左表读取 + /** + * 左表编辑 + * @param params + * @param us + * @return + */ public R modelLLoad(@SwBody SwMap params, UserSession us) { return pageHandler(params, us, TYPE_MODEL_LEFT_LOAD, handler -> ((ModelLoadHandler) handler).load()); } - //左表读取 + /** + * 左表新增初始化 + * @param params + * @param us + * @return + */ public R modelLAdd(@SwBody SwMap params, UserSession us) { return pageHandler(params, us, TYPE_MODEL_LEFT_LOAD, handler -> ((ModelLoadHandler) handler).add()); } - //左表删除 + /** + * 左表删除 + * @param params + * @param us + * @return + */ public R modelLDel(@SwBody SwMap params, UserSession us) { return pageHandler(params, us, TYPE_MODEL_LEFT_DEL, handler -> ((ModelDelHandler) handler).del()); } - //左表列表数据 + + /** + * 左表列表数据 + * @param params + * @param us + * @return + */ public R modelLList(@SwBody SwMap params, UserSession us) { return pageHandler(params, us, TYPE_MODEL_LEFT_LIST, handler -> ((ModelListHandler) handler).data()); } - //左表列表总记录数及合计栏 + /** + * 左表列表总记录数及合计栏 + * @param params + * @param us + * @return + */ public R modelLListTotal(@SwBody SwMap params, UserSession us) { return pageHandler(params, us, TYPE_MODEL_LEFT_LIST, handler -> ((ModelListHandler) handler).getTotal()); } diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclc2/LCLC2Service.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclc2/LCLC2Service.java index e04d00f..ca4b59b 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclc2/LCLC2Service.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclc2/LCLC2Service.java @@ -6,6 +6,7 @@ import cc.smtweb.system.bpm.web.engine.model.listcard.lclc1.LCLC1Service; /** * @Author:lip * @Date : 2022/9/13 15:28 + * 模型LC_LC_2(左列表-右列表(含编辑弹窗、左列表不可编辑)) 服务类 */ @SwService public class LCLC2Service extends LCLC1Service { diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclt/LCLTService.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclt/LCLTService.java index 008a0da..61b8e0d 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclt/LCLTService.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclt/LCLTService.java @@ -6,6 +6,7 @@ import cc.smtweb.system.bpm.web.engine.model.listcard.normal.LCNormalService; /** * @Author:lip * @Date : 2022/9/13 15:30 + * 模型LC_LT(左树-列表(含编辑卡片)) 服务类 */ @SwService public class LCLTService extends LCNormalService { diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclt2/LCLT2Service.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclt2/LCLT2Service.java index b12165c..b35ad16 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclt2/LCLT2Service.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclt2/LCLT2Service.java @@ -6,6 +6,7 @@ import cc.smtweb.system.bpm.web.engine.model.common.ModelService; /** * @Author:lip * @Date : 2022/8/27 13:54 + * 模型LC_LT_2(左树-列表(含编辑弹窗)) 服务类 */ @SwService public class LCLT2Service extends ModelService { diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lcltms/LCLtMsService.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lcltms/LCLtMsService.java index ea03a24..dfd97dc 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lcltms/LCLtMsService.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lcltms/LCLtMsService.java @@ -6,6 +6,7 @@ import cc.smtweb.system.bpm.web.engine.model.listcard.lcms.LCMsService; /** * @Author:lip * @Date : 2022/9/13 15:32 + * 模型LC_LT_MS(左树-主子列表(含编辑卡片)) 服务类 */ @SwService public class LCLtMsService extends LCMsService { diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lcms/LCMsConfig.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lcms/LCMsConfig.java index 5122617..ce4535c 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lcms/LCMsConfig.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lcms/LCMsConfig.java @@ -19,7 +19,7 @@ public class LCMsConfig { //卡片子表卡片数据集 public static final String dsSCard = "cardSub"; // 模型的配置信息类 - static class Config{ + public static class Config{ private final ModelForm modelForm; public Config(ModelForm modelForm) { diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lcms/LCMsDelHandler.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lcms/LCMsDelHandler.java index e7398ad..fa37865 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lcms/LCMsDelHandler.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lcms/LCMsDelHandler.java @@ -38,7 +38,7 @@ public class LCMsDelHandler extends ModelDelHandler { if(tableId<=0L)return; ModelTable table = ModelTableCache.getInstance().get(tableId); if(table == null) return; - EntityDao dao =DbEngine.getInstance().findDao(table.getTableName()); + EntityDao dao =DbEngine.getInstance().findDao(table.getName()); if(dao!=null){ dao.deleteEntity(String.format(" where %s = ? ",fk),id); } diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lcms/LCMsSaveHandler.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lcms/LCMsSaveHandler.java index 9a81338..446e14c 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lcms/LCMsSaveHandler.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lcms/LCMsSaveHandler.java @@ -15,11 +15,18 @@ import java.util.function.BiConsumer; * 主子表保存handler */ public class LCMsSaveHandler extends ModelSaveHandler { + public LCMsSaveHandler() { + } + + public LCMsSaveHandler(String cardDsName) { + super(cardDsName); + } + // 子表明细 protected ModelDetail subDetail; @Override - protected void readFromPage(SwMap pageData, SwMap filter) { + public void readFromPage(SwMap pageData, SwMap filter) { super.readFromPage(pageData, filter); LCMsConfig.Config config = new LCMsConfig.Config(form); // 读取子表 @@ -38,7 +45,7 @@ public class LCMsSaveHandler extends ModelSaveHandler(); + return new LCMsLoadHandler<>(); case TYPE_MODEL_SAVE: - return new LCMsSaveHandler(); + return new LCMsSaveHandler<>(); case TYPE_MODEL_DEL: return new LCMsDelHandler(); case TYPE_MODEL_SUB_LIST: return new ModelListHandler(LCMsConfig.dsSList); case TYPE_MODEL_SUB_LOAD: - return new ModelLoadHandler(LCMsConfig.dsSCard); + return new ModelLoadHandler<>(LCMsConfig.dsSCard); case TYPE_MODEL_SUB_SAVE: - return new ModelSaveHandler(LCMsConfig.dsSCard); + return new ModelSaveHandler<>(LCMsConfig.dsSCard); case TYPE_MODEL_SUB_DEL: return new ModelDelHandler(LCMsConfig.dsSCard); } return super.createHandler(type); } - //子表单独保存 + + /** + * 子表单独保存 + * @param params + * @param us + * @return + */ public R modelSubSave(@SwBody SwMap params, UserSession us) { return pageHandler(params, us, TYPE_MODEL_SUB_SAVE, handler -> ((ModelSaveHandler) handler).save()); } - //子表读取 + /** + * 子表编辑 + * @param params + * @param us + * @return + */ public R modelSubLoad(@SwBody SwMap params, UserSession us) { return pageHandler(params, us, TYPE_MODEL_SUB_LOAD, handler -> ((ModelLoadHandler) handler).load()); } - //子表新增初始化 + /** + * 子表新增初始化 + * @param params + * @param us + * @return + */ public R modelSubAdd(@SwBody SwMap params, UserSession us) { return pageHandler(params, us, TYPE_MODEL_SUB_LOAD, handler -> ((ModelLoadHandler) handler).add()); } - //子表删除 + /** + * 子表单独删除 + * @param params + * @param us + * @return + */ public R modelSubDel(@SwBody SwMap params, UserSession us) { return pageHandler(params, us, TYPE_MODEL_SUB_DEL, handler -> ((ModelDelHandler) handler).del()); } - //子表列表数据 + /** + * 子表列表数据 + * @param params + * @param us + * @return + */ public R modelSubList(@SwBody SwMap params, UserSession us) { return pageHandler(params, us, TYPE_MODEL_SUB_LIST, handler -> ((ModelListHandler) handler).data()); } - //列子表表总记录数及合计栏 + /** + * 列子表表总记录数及合计栏 + * @param params + * @param us + * @return + */ public R modelSubListTotal(@SwBody SwMap params, UserSession us) { return pageHandler(params, us, TYPE_MODEL_SUB_LIST, handler -> ((ModelListHandler) handler).getTotal()); } diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/normal/LCNormalService.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/normal/LCNormalService.java index 6a2bf01..d4a8e68 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/normal/LCNormalService.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/normal/LCNormalService.java @@ -6,6 +6,7 @@ import cc.smtweb.system.bpm.web.engine.model.common.ModelService; /** * @Author:lip * @Date : 2022/8/27 13:54 + * 模型LC_NORMAL(普通列表(含编辑卡片)) 服务类 */ @SwService public class LCNormalService extends ModelService { diff --git a/smtweb-framework/bpm/src/main/resources/static/template/default/incModel/inc_card_fields_only.ftl b/smtweb-framework/bpm/src/main/resources/static/template/default/incModel/inc_card_fields_only.ftl new file mode 100644 index 0000000..9529067 --- /dev/null +++ b/smtweb-framework/bpm/src/main/resources/static/template/default/incModel/inc_card_fields_only.ftl @@ -0,0 +1,97 @@ +<#--group当前分组--> +<#--colNum卡片列数--> +<#assign field = group.fields> +{ + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "0", + <#if colNum lte 1> + "gridTemplateColumns": "1fr 2fr", + <#elseif colNum gte 2> + "gridTemplateColumns": "1fr 1fr 1fr", + + "paddingTop": 32 + }, + "children": [ + <#list group.fields as fields> + { + "id": "id${newId()}", + <#if (fields.readonly = true)> + "type": "fx-text", + <#else> + "type": "${fields.editor}", + + "props": { + "label": "${fields.label}", + "dataset": "${fields.dataset}", + "required": "${fields.required}", + "field": "${fields.id}", + <#if fields.maxlength gt 0> + "maxlength": ${fields.maxlength}, + + <#if fields.lookup??> + "lookup": { + <#list fields.lookup as k, v> + "${k}": "${v}" <#if k_has_next>, + + }, + + "placeholder": "请输入内容", + <#if (colNum = 2)> + "tips": "${fields.desc}", + + "labelWidth": 100, + <#if (fields.readonly = true)> + "readonly": true, + <#else> + "readonly": false, + + "affixError": true + }, + "events": {} + } + <#if fields_has_next> + <#if (colNum lte 1 )> + <#if (fields.desc != "")> + ,{ + "id": "${newId()}", + "type": "fx-label", + "props": { + "label": "${fields.desc}", + "labelWidth": 0, + "affixError": true, + "labelAlign": "left" + } + } + <#else> + ,{ + "id": "id${newId()}", + "type": "fx-placeholder", + "props": { + "label": "占位" + }, + "layout": { + "row": 1 + } + } + + + <#if (colNum = 2 && ((fields_index+1) % 2 = 0 ) )> + ,{ + "id": "id${newId()}", + "type": "fx-placeholder", + "props": { + "label": "占位" + }, + "layout": { + "row": 1 + } + } + + , + + + ] +} diff --git a/smtweb-framework/bpm/src/main/resources/static/template/default/incModel/inc_card_flow_body_b.ftl b/smtweb-framework/bpm/src/main/resources/static/template/default/incModel/inc_card_flow_body_b.ftl new file mode 100644 index 0000000..c63d49b --- /dev/null +++ b/smtweb-framework/bpm/src/main/resources/static/template/default/incModel/inc_card_flow_body_b.ftl @@ -0,0 +1,534 @@ +<#--这里放主数据集内容--> +<#list layout.flow as group> +<#--流程数据集--> + ,{ + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "16", + "backgroundColor": "--color-transparent" + }, + "children": [] + }, + <#include "incModel/inc_card_fields_only.ftl"/> + + ,{ + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": {}, + "children": [] + } + ] + }, + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "16", + "backgroundColor": "--color-transparent" + }, + "children": [] + }, + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "56", + "alignY": "center", + "alignX": "center" + }, + "children": [ + { + "id": "${newId()}", + "type": "fx-button-group", + "props": { + "menus": [] + }, + "slots": { + "default": [ + { + "id": "${newId()}", + "type": "fx-button", + "props": { + "name": "button:new", + "label": "新增", + "type": "primary", + "action": "button:addCard" + }, + "vars": { + "$ref": "$ref" + } + }, + { + "type": "fx-button", + "props": { + "name": "button:save-and-new", + "label": "保存并新增", + "type": "primary", + "action": "button:saveAddCard", + "linkType": "curr" + }, + "id": "${newId()}", + "vars": { + "$ref": "$ref" + } + }, + { + "type": "fx-button", + "props": { + "name": "button:save", + "label": "保存", + "type": "success", + "action": "button:saveCard" + }, + "id": "${newId()}", + "vars": { + "$ref": "$ref" + } + }, + { + "type": "fx-button", + "props": { + "name": "button:submit", + "label": "提交", + "type": "primary", + "action": "button:submit" + }, + "id": "${newId()}", + "vars": { + "$ref": "$ref" + } + }, + { + "type": "fx-button", + "props": { + "name": "button:retake", + "label": "取回", + "action": "button:retake" + }, + "id": "${newId()}", + "vars": { + "$ref": "$ref" + } + }, + { + "type": "fx-button", + "props": { + "name": "button:reject", + "label": "驳回", + "type": "warning", + "action": "button:reject" + }, + "id": "${newId()}", + "vars": { + "$ref": "$ref" + } + }, + { + "type": "fx-button", + "props": { + "name": "button:disuse", + "label": "作废", + "type": "danger", + "action": "button:disuse" + }, + "id": "${newId()}", + "vars": { + "$ref": "$ref" + } + }, + { + "type": "fx-button", + "props": { + "name": "button:interrupt", + "label": "终止", + "type": "danger", + "action": "button:interrupt" + }, + "id": "${newId()}", + "vars": { + "$ref": "$ref" + } + }, + { + "type": "fx-button", + "props": { + "name": "button:delete", + "label": "删除", + "type": "danger", + "action": "button:delCard" + }, + "id": "${newId()}", + "vars": { + "$ref": "$ref" + } + }, + { + "id": "${newId()}", + "type": "fx-button", + "props": { + "name": "button:return", + "label": "返回", + "size": "default", + "action": "button:backList" + }, + "events": {}, + "vars": { + "$ref": "$ref" + } + } + ] + } + } + ] + }, + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "16", + "backgroundColor": "--color-transparent" + }, + "children": [] + } + ] + } + }, + { + "page": { + "id": "${newId()}", + "type": "fx-dialog", + "props": { + "title": "审批意见", + "key": "dlgOpt", + "width": "450px", + "height": "260px", + "showPrefix": true + }, + "events": {} + }, + "graph": { + "shape": "panel", + "id": "${newId()}", + "type": "fx-split-panel", + "props": { + "horizontal": false, + "shadow": "never" + }, + "children": [ + { + "id": "${newId()}", + "type": "fx-split-panel", + "shape": "panel", + "props": { + "horizontal": false + }, + "children": [ + { + "shape": "panel", + "id": "${newId()}", + "type": "fx-form-panel", + "props": { + "name": "dlgOptForm", + "colNum": 1, + "paddingTop": 24, + "size": "0" + }, + "children": [ + { + "id": "${newId()}", + "type": "fx-select", + "props": { + "name":"flowSelCommentRef", + "label": "备选意见", + "clearable": true, + "labelWidth": 100, + "affixError": true, + "dataset": "dlgOpt", + "field": "selComment", + "size": "default" + }, + "events": { + "on-change": "onSelCommentChange" + }, + "vars": { + "$ref": "$ref" + } + }, + { + "id": "${newId()}", + "type": "fx-textarea", + "props": { + "label": "处理意见", + "maxlength": 200, + "placeholder": "请输入内容", + "labelWidth": 100, + "affixError": true, + "size": "default", + "dataset": "dlgOpt", + "field": "comment", + "rows": 4 + }, + "events": {} + } + ] + }, + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": {}, + "children": [] + } + ] + }, + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "0" + }, + "children": [ + { + "id": "${newId()}", + "type": "fx-divider", + "props": { + "label": "", + "contentPosition": "center", + "direction": "horizontal" + } + } + ] + }, + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "50", + "alignX": "end", + "alignY": "center", + "paddingRight": 10 + }, + "children": [ + { + "id": "${newId()}", + "type": "fx-button-group", + "props": { + "showDropdown": false + }, + "slots": { + "default": [ + { + "type": "fx-button", + "props": { + "label": "确认", + "leftIcon": "correct", + "type": "primary", + "action": "button:dlgDynConfirm", + "linkType": "" + }, + "id": "${newId()}", + "events": {} + }, + { + "type": "fx-button", + "props": { + "label": "取消", + "leftIcon": "error", + "action": "button:closeDialog" + }, + "id": "${newId()}", + "events": {} + } + ], + "dropdown": [] + } + } + ] + } + ] + } + }, + { + "page": { + "id": "${newId()}", + "type": "fx-dialog", + "props": { + "title": "驳回", + "key": "dlgReject", + "width": "450px", + "height": "300px", + "showPrefix": true + }, + "events": {} + }, + "graph": { + "shape": "panel", + "id": "${newId()}", + "type": "fx-split-panel", + "props": { + "horizontal": false, + "shadow": "never" + }, + "children": [ + { + "id": "${newId()}", + "type": "fx-split-panel", + "shape": "panel", + "props": { + "horizontal": false + }, + "children": [ + { + "shape": "panel", + "id": "${newId()}", + "type": "fx-form-panel", + "props": { + "name": "dlgOptForm", + "colNum": 1, + "paddingTop": 24, + "size": "0" + }, + "children": [ + { + "id": "${newId()}", + "type": "fx-select", + "props": { + "name":"flowToTaskRef", + "label": "驳回到", + "clearable": true, + "labelWidth": 100, + "affixError": true, + "size": "default", + "multiple": true, + "dataset": "dlgOpt", + "field": "toTaskId" + }, + "events": {}, + "vars": { + "$ref": "$ref" + } + }, + { + "id": "${newId()}", + "type": "fx-select", + "props": { + "name":"flowSelCommentRef", + "label": "备选意见", + "clearable": true, + "labelWidth": 100, + "affixError": true, + "dataset": "dlgOpt", + "field": "selComment", + "size": "default" + }, + "events": { + "on-change": "onSelCommentChange" + }, + "vars": { + "$ref": "$ref" + } + }, + { + "id": "${newId()}", + "type": "fx-textarea", + "props": { + "label": "处理意见", + "maxlength": 200, + "placeholder": "请输入内容", + "labelWidth": 100, + "affixError": true, + "size": "default", + "dataset": "dlgOpt", + "field": "comment", + "rows": 4 + }, + "events": {} + } + ] + }, + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": {}, + "children": [] + } + ] + }, + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "0" + }, + "children": [ + { + "id": "${newId()}", + "type": "fx-divider", + "props": { + "label": "", + "contentPosition": "center", + "direction": "horizontal" + } + } + ] + }, + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "50", + "alignX": "end", + "alignY": "center", + "paddingRight": 10 + }, + "children": [ + { + "id": "${newId()}", + "type": "fx-button-group", + "props": { + "showDropdown": false + }, + "slots": { + "default": [ + { + "type": "fx-button", + "props": { + "label": "确认", + "leftIcon": "correct", + "type": "primary", + "action": "button:dlgDynConfirm", + "linkType": "" + }, + "id": "${newId()}", + "events": {} + }, + { + "type": "fx-button", + "props": { + "label": "取消", + "leftIcon": "error", + "action": "button:closeDialog" + }, + "id": "${newId()}", + "events": {} + } + ], + "dropdown": [] + } + } + ] + } + ] + } + } diff --git a/smtweb-framework/bpm/src/main/resources/static/template/default/incModel/inc_card_flow_body_h.ftl b/smtweb-framework/bpm/src/main/resources/static/template/default/incModel/inc_card_flow_body_h.ftl new file mode 100644 index 0000000..7bab257 --- /dev/null +++ b/smtweb-framework/bpm/src/main/resources/static/template/default/incModel/inc_card_flow_body_h.ftl @@ -0,0 +1,131 @@ +{ + "version": 6, + "form": [ + { + "page": { + "id": "id${newId()}", + "type": "fx-page", + "props": { + "title": "编辑", + "key": "${newId()}", + "tipsExpand": false + } + }, + "graph": { + "shape": "panel", + "id": "root_panel", + "type": "fx-split-panel", + "props": { + "horizontal": false, + "shadow": "", + "scroll": false, + "size": "", + "name": "s0" + }, + "children": [ + { + "id": "${newId()}", + "type": "fx-split-panel", + "shape": "panel", + "props": { + "size": "56", + "horizontal": true, + "scroll": false, + "name": "s11" + }, + "children": [ + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "alignY": "center", + "size": "200", + "paddingLeft": 16 + }, + "children": [ + { + "id": "${newId()}", + "type": "fx-title", + "props": { + "label": "${title}", + "showPrefix": true + } + } + ] + }, + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": {}, + "children": [] + }, + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "alignY": "center", + "size": "75" + }, + "children": [ + { + "id": "${newId()}", + "type": "fx-title", + "props": { + "label": "单据状态:", + "fontWeight": "bold", + "color": "#F56C6C", + "showPrefix": false + } + } + ] + }, + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "alignY": "center", + "size": "200", + "colNum": 1 + }, + "children": [ + { + "id": "${newId()}", + "type": "fx-select", + "props": { + "name":"flowTaskRef", + "label": "当前任务", + "clearable": true, + "labelWidth": 100, + "affixError": false, + "size": "default", + "hideLabel": true, + "dataset": "flow", + "field": "selTaskId" + }, + "events": { + "on-change": "onTaskChange" + }, + "vars": { + "$ref": "$ref" + } + } + ] + } + ] + }, + { + "id": "${newId()}", + "type": "fx-split-panel", + "shape": "panel", + "props": { + "size": "", + "horizontal": false, + "scroll": true, + "name": "s12" + }, + "children": [ + <#--这里放主数据集内容--> diff --git a/smtweb-framework/bpm/src/main/resources/static/template/default/incModel/inc_list_dialog.ftl b/smtweb-framework/bpm/src/main/resources/static/template/default/incModel/inc_list_dialog.ftl index 758ad72..b48748e 100644 --- a/smtweb-framework/bpm/src/main/resources/static/template/default/incModel/inc_list_dialog.ftl +++ b/smtweb-framework/bpm/src/main/resources/static/template/default/incModel/inc_list_dialog.ftl @@ -22,7 +22,14 @@ "type": "${dfield.editor}", "dataset": "${dfield.dataset}", "field": "${dfield.id}", - "required": "${field.required}", + "required": "${dfield.required}", + <#if dfield.lookup??> + "lookup": { + <#list dfield.lookup as k, v> + "${k}": "${v}" <#if k_has_next>, + + }, + <#if dfield.maxlength gt 0> "maxlength": ${dfield.maxlength}, diff --git a/smtweb-framework/bpm/src/main/resources/static/template/default/model_card_flow_ll.ftl b/smtweb-framework/bpm/src/main/resources/static/template/default/model_card_flow_ll.ftl new file mode 100644 index 0000000..328d8fd --- /dev/null +++ b/smtweb-framework/bpm/src/main/resources/static/template/default/model_card_flow_ll.ftl @@ -0,0 +1,27 @@ +<#include "incModel/inc_card_flow_body_h.ftl"/> +<#assign colNum = param.rCardCol> +<#list layout.rCard as group> + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "16", + "backgroundColor": "--color-transparent" + }, + "children": [] + }, + <#include "incModel/inc_card_fields_only.ftl"/> + +<#include "incModel/inc_card_flow_body_b.ftl"/> +], + "model": [ + <#list datasets as dataset> + <#include "incModel/inc_model.ftl"/><#if dataset_has_next>, + + ], + "option": { + "widgetRef": [${widgetRef}], + "vars": [] + } +} diff --git a/smtweb-framework/bpm/src/main/resources/static/template/default/model_card_flow_lms.ftl b/smtweb-framework/bpm/src/main/resources/static/template/default/model_card_flow_lms.ftl new file mode 100644 index 0000000..6665d71 --- /dev/null +++ b/smtweb-framework/bpm/src/main/resources/static/template/default/model_card_flow_lms.ftl @@ -0,0 +1,301 @@ +<#include "incModel/inc_card_flow_body_h.ftl"/> +<#list layout.cardMaster as group> + <#assign colNum = param.rCardCol> + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "16", + "backgroundColor": "--color-transparent" + }, + "children": [] + }, + <#include "incModel/inc_card_fields_only.ftl"/> + +,{ + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "16", + "backgroundColor": "--color-transparent" + }, + "children": [] +}, +{ + "id": "${newId()}", + "type": "fx-split-panel", + "shape": "panel", + "props": { + "size": "56", + "horizontal": true + }, + "children": [ + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "", + "label": "", + "colNum": 2, + "alignY": "center", + "paddingLeft": 16, + "shadow": "" + }, + "children": [ + { + "id": "id${newId()}", + "type": "fx-title", + "props": { + "label": "子表列表配置", + "fontSize": 16, + "color": "#01070D", + "fontWeight": "bold", + "showPrefix": false, + "prefixWidth": 5, + "prefixHeight": 24, + "prefixColor": "#1E90FF" + } + } + ] + }, + { + "id": "id${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "alignX": "right", + "size": "150", + "alignY": "center", + "paddingRight": 16 + }, + "children": [ + { + "id": "id${newId()}", + "type": "fx-button", + "props": { + "label": "新增", + "type": "primary", + "action": "button:addRow", + "size": "default", + "linkType": "dialog", + "leftIcon": "plus", + "fxLink": "dialog:cardSubDialog", + "fxLink_text": "子表编辑卡片", + "preAction": "", + "dataset": "${layout.listSub[0].dataset}" + }, + "events": {} + } + ] + } + ] +}, +{ + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "400", + "label": "子表列表", + "colNum": 0, + "paddingLeft": 16, + "paddingRight": 16, + "shadow": "", + "paddingTop": 0 + }, + "children": [ + { + "id": "id${newId()}", + "type": "fx-table", + "props": { + "label": "子表表格", + "border": true, + "stripe": true, + "showHeader": true, + "fit": true, + "dataset": "${layout.listSub[0].dataset}", + "actionWidth": 150 + }, + "slots": { + "default": [ + <#list layout.listSub[0].fields as field> + { + "id": "id${newId()}", + "type": "fx-table-column", + "props": { + "field": "${field.id}", + "label": "${field.label}" + } + } + <#if field_has_next>, + + ], + "button": [ + { + "id": "id${newId()}", + "type": "fx-button", + "props": { + "label": "编辑", + "type": "text", + "leftIcon": "edit", + "action": "button:loadRow", + "dataset": "${layout.listSub[0].dataset}", + "linkType": "dialog", + "fxLink": "dialog:cardSubDialog", + "fxLink_text": "子表编辑卡片" + } + }, + { + "id": "id${newId()}", + "type": "fx-button", + "props": { + "label": "删除", + "type": "text", + "leftIcon": "delete-themes", + "action": "button:delRow", + "dataset": "${layout.listSub[0].dataset}", + "preAction": "", + "link": true, + "confirm": "" + } + } + ] + }, + "events": {} + } + ] +} +<#include "incModel/inc_card_flow_body_b.ftl"/> +<#--子表编辑弹窗--> +<#list layout.listSub as group> + ,{ + "page": { + "id": "id${newId()}", + "type": "fx-dialog", + "props": { + <#if (param.cardSubTitle == "")> + "title": "子表编辑卡片", + <#else> + "title": "${param.cardSubTitle}", + + "key": "cardSubDialog", + "closeOnClickModal": false + }, + "events": {} + }, + "graph": { + "shape": "panel", + "id": "root_panel", + "type": "fx-split-panel", + "props": { + "horizontal": false, + "shadow": "never" + }, + "children": [ + { + "id": "${newId()}", + "type": "fx-split-panel", + "shape": "panel", + "props": { + "horizontal": false, + "scroll": true, + "backgroundColor": "--color-white" + }, + "children": [ + <#assign colNum = param.subCol> + <#include "incModel/inc_card_fields_only.ftl"/> + ] + }, + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "0" + }, + "children": [ + { + "id": "id${newId()}", + "type": "fx-divider", + "props": { + "label": "", + "contentPosition": "center", + "direction": "horizontal" + } + } + ] + }, + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "56", + "paddingRight": 10, + "alignY": "center" + }, + "children": [ + { + "id": "id${newId()}", + "type": "fx-button-group", + "props": { + "menus": [], + "textAlign": "right" + }, + "slots": { + "default": [ + { + "type": "fx-button", + "props": { + "label": "保存", + "leftIcon": "save", + "type": "success", + "action": "button:saveRow", + "dataset": "${group.dataset}" + }, + "id": "id${newId()}" + }, + { + "type": "fx-button", + "props": { + "label": "保存行并新增", + "type": "primary", + "action": "button:saveAddRow", + "dataset": "${group.dataset}" + }, + "id": "${newId()}", + "events": {} + }, + { + "type": "fx-button", + "props": { + "label": "关闭", + "leftIcon": "close", + "type": "", + "action": "button:closeDialog" + }, + "id": "id${newId()}" + } + ] + } + } + ] + } + ] + } + } + +], + "model": [ + <#list datasets as dataset> + <#include "incModel/inc_model.ftl"/><#if dataset_has_next>, + + ], + "option": { + "widgetRef": [${widgetRef}], + "vars": [] + } +} diff --git a/smtweb-framework/bpm/src/main/resources/static/template/default/model_card_ms.ftl b/smtweb-framework/bpm/src/main/resources/static/template/default/model_card_ms.ftl index 79fa180..b4de32d 100644 --- a/smtweb-framework/bpm/src/main/resources/static/template/default/model_card_ms.ftl +++ b/smtweb-framework/bpm/src/main/resources/static/template/default/model_card_ms.ftl @@ -77,10 +77,21 @@ "label": "${field.label}", "dataset": "${field.dataset}", "required": "${field.required}", + <#if field.lookup??> + "lookup": { + <#list field.lookup as k, v> + "${k}": "${v}" <#if k_has_next>, + + }, + "field": "${field.id}", "placeholder": "请输入内容", "labelWidth": 150, - "readonly": "${field.readonly}", + <#if (field.readonly = true)> + "readonly": true, + <#else> + "readonly": false, + "affixError": true }, "events": {} @@ -213,7 +224,7 @@ "props": { "label": "新增", "type": "primary", - "action": "button:addRow", + "action": "button:addSubRow", "size": "default", "linkType": "dialog", "leftIcon": "plus", @@ -276,7 +287,7 @@ "label": "编辑", "type": "text", "leftIcon": "edit", - "action": "button:loadRow", + "action": "button:loadSubRow", "dataset": "${layout.listSub[0].dataset}", "linkType": "dialog", "fxLink": "dialog:cardSubDialog", @@ -290,7 +301,7 @@ "label": "删除", "type": "text", "leftIcon": "delete-themes", - "action": "button:delRow", + "action": "button:delSubRow", "dataset": "${layout.listSub[0].dataset}", "preAction": "", "link": true, @@ -391,7 +402,12 @@ ] } }, - <#list layout.listSub as assist_dialog> + <#if (subIndSave = true || subIndSave = "true")> + <#assign datasetSub = layout.cardSub> + <#else> + <#assign datasetSub = layout.listSub> + + <#list datasetSub as assist_dialog> { "page": { "id": "id${newId()}", @@ -475,7 +491,7 @@ "label": "保存", "leftIcon": "save", "type": "success", - "action": "button:saveRow", + "action": "button:saveSubRow", "dataset": "${assist_dialog.dataset}" }, "id": "id${newId()}" diff --git a/smtweb-framework/bpm/src/main/resources/static/template/default/model_card_normal.ftl b/smtweb-framework/bpm/src/main/resources/static/template/default/model_card_normal.ftl index a49b262..e4cc8b2 100644 --- a/smtweb-framework/bpm/src/main/resources/static/template/default/model_card_normal.ftl +++ b/smtweb-framework/bpm/src/main/resources/static/template/default/model_card_normal.ftl @@ -162,6 +162,13 @@ "dataset": "${field.dataset}", "required": "${field.required}", "field": "${field.id}", + <#if field.lookup??> + "lookup": { + <#list field.lookup as k, v> + "${k}": "${v}" <#if k_has_next>, + + }, + <#if field.maxlength gt 0> "maxlength": ${field.maxlength}, diff --git a/smtweb-framework/bpm/src/main/resources/static/template/default/model_list_flow_ll1.ftl b/smtweb-framework/bpm/src/main/resources/static/template/default/model_list_flow_ll1.ftl new file mode 100644 index 0000000..87e10f0 --- /dev/null +++ b/smtweb-framework/bpm/src/main/resources/static/template/default/model_list_flow_ll1.ftl @@ -0,0 +1,633 @@ +{ + "version": 6, + "form": [ + { + "page": { + "id": "id${newId()}", + "type": "fx-page", + "props": { + "title": "${title}", + "key": "${newId()}" + } + }, + "graph": { + "shape": "panel", + "id": "root_panel", + "type": "fx-split-panel", + "props": { + "shadow": "" + }, + "children": [ + { + "shape": "panel", + "id": "root_panel", + "type": "fx-split-panel", + "props": { + "horizontal": true, + "shadow": "" + }, + "children": [ + <#list layout.lList as assist> + { + "id": "${newId()}", + "type": "fx-split-panel", + "shape": "panel", + "props": { + "horizontal": false, + "size": "420" + }, + "children": [ + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "56", + "alignY": "center", + "paddingLeft": 16, + "colNum": 2, + "gridTemplateColumns": "", + "paddingRight": 16 + }, + "children": [ + { + "id": "id${newId()}", + "type": "fx-title", + "props": { + "label": "${param.lListTitle}" + } + }, + { + "id": "id${newId()}", + "type": "fx-button-group", + "props": { + "menus": [], + "textAlign": "right", + "dataset": "${assist.dataset}" + }, + "slots": { + "default": [ + { + "type": "fx-button", + "props": { + "label": "新增", + "leftIcon": "plus", + "type": "primary", + "action": "button:addCard", + "linkType": "dialog", + "link": false, + "fxLink": "dialog:lCardDialog", + "fxLink_text": "${param.lCardTitle}" + }, + "id": "id${newId()}" + } + ] + } + } + ] + }, + { + "id":"${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "0" + }, + "children": [ + { + "id": "id${newId()}", + "type": "fx-divider", + "props": { + "label": "", + "contentPosition": "center", + "direction": "horizontal" + } + } + ] + }, + <#if (assist.cfilters?size>0)> + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "alignY": "center", + "size": "50", + "gridTemplateColumns": "1fr 50px", + "paddingLeft": 16, + "paddingRight": 16 + }, + "children": [ + <#list assist.cfilters as cfilters> + { + "id": "id${newId()}", + "type": "${cfilters.editor}", + "props": { + "label": "${cfilters.label}", + "maxlength": 50, + "placeholder": "请输入${cfilters.label}", + "labelWidth": 150, + "affixError": false, + "hideLabel": true, + "leftIcon": "", + "dataset": "${cfilters.dataset}", + "field": "${cfilters.id}" + }, + "events": {} + }, + + { + "id": "id${newId()}", + "type": "fx-button-group", + "props": { + "menus": [], + "textAlign": "right", + "dataset": "${assist.dataset}" + }, + "slots": { + "default": [ + { + "type": "fx-button", + "props": { + "label": "查询", + "leftIcon": "", + "action": "button:loadList", + "link": false, + "type": "primary" + }, + "id": "id${newId()}" + } + ] + } + } + ] + }, + + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "", + "colNum": 0, + "paddingLeft": 16, + "paddingRight": 16 + }, + "children": [ + { + "id": "id${newId()}", + "type": "fx-table", + "props": { + "label": "${param.lListTitle}", + "border": true, + "stripe": true, + "showHeader": false, + "fit": true, + "hideOp": false, + "hideNo": true, + "dataset": "${assist.dataset}", + "hidePagination": true, + "name":"leftTb" + }, + "slots": { + "button": [ + { + "type": "fx-button", + "props": { + "label": "编辑", + "type": "primary", + "leftIcon": "edit", + "action": "button:editCard", + "linkType": "dialog", + "dataset": "${assist.dataset}", + "fxLink": "dialog:lCardDialog", + "fxLink_text": "${param.lCardTitle}", + "link": true + }, + "id": "id${newId()}" + }, + { + "type": "fx-button", + "props": { + "label": "删除", + "type": "primary", + "leftIcon": "delete", + "action": "button:delCard", + "link": true, + "text": false, + "dataset": "${assist.dataset}", + "confirm": "" + }, + "id": "id${newId()}" + } + ], + "default": [ + <#list assist.fields as field> + { + "id": "id${newId()}", + "type": "fx-table-column", + "props": { + "field": "${field.id}", + "label": "${field.label}" + } + }<#if field_has_next>, + + ] + }, + "events": {}, + "vars": { + "$ref": "$ref" + } + } + ] + } + ] + }, + + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "16", + "backgroundColor": "--color-transparent" + }, + "children": [] + }, + <#list layout.rList as main> + { + "id": "${newId()}", + "type": "fx-split-panel", + "shape": "panel", + "props": { + "horizontal": false + }, + "children": [ + <#if (main.cfilters?size>0)> + { + "shape": "panel", + "id": "form_panel", + "type": "fx-form-panel", + "props": { + "colNum": 3, + "label": "查询条件", + "paddingLeft": 16, + "paddingRight": 16, + "size": "56", + "alignY": "center" + }, + "children": [ + <#list main.cfilters as cfilters> + { + "id": "id${newId()}", + "type": "${cfilters.editor}", + "props": { + "label": "${cfilters.label}", + "maxlength": 50, + "placeholder": "请输入${cfilters.label}", + "labelWidth": 100, + "affixError": false + }, + "events": {} + }, + + { + "id": "id${newId()}", + "type": "fx-button-group", + "props": { + "menus": [], + "dataset": "${main.dataset}" + }, + "slots": { + "default": [ + { + "type": "fx-button", + "props": { + "label": "重置", + "leftIcon": "clear", + "action": "button:reset" + }, + "id": "id${newId()}" + }, + { + "type": "fx-button", + "props": { + "label": "查询", + "leftIcon": "search", + "type": "primary", + "action": "button:loadList", + "linkType": "" + }, + "id": "id${newId()}" + } + <#if (main.sfilters?size>0)> + ,{ + "id": "id${newId()}", + "type": "fx-button", + "props": { + "label": "高级筛选", + "leftIcon": "hamburger-button", + "action": "button:link", + "link": true, + "linkType": "drawer", + "fxLink": "dialog:rQueryDialog" + } + } + + ] + } + } + ] + }, + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "label": "间隔", + "size": "16", + "backgroundColor": "--color-transparent" + }, + "children": [] + }, + + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "label": "${param.rListTitle}", + "size": "50", + "colNum": 2, + "alignY": "center", + "paddingLeft": 16, + "paddingRight": 16 + }, + "children": [ + { + "id": "id${newId()}", + "type": "fx-title", + "props": { + "label": "${param.rListTitle}" + } + }, + { + "id": "id${newId()}", + "type": "fx-button-group", + "props": { + "menus": [], + "textAlign": "right", + "dataset": "${main.dataset}" + }, + "slots": { + "default": [ + { + "type": "fx-button", + "props": { + "label": "新增", + "leftIcon": "plus", + "type": "primary", + "action": "button:addCard", + "link": false, + "linkType": "curr", + <#if name?has_content && name?ends_with("List")> + "fxLink": "bpm.${name?replace("List","Card")}", + <#else> + "fxLink": "", + + "fxLink_text": "编辑卡片", + "preAction": "" + }, + "id": "id${newId()}" + } + ] + } + } + ] + }, + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "label": "表格区", + "colNum": 0, + "paddingLeft": 16, + "paddingRight": 16 + }, + "children": [ + { + "id": "id${newId()}", + "type": "fx-table", + "props": { + "label": "表格", + "border": true, + "stripe": true, + "showHeader": true, + "fit": true, + "dataset": "${main.dataset}" + }, + "slots": { + "button": [ + { + "type": "fx-button", + "props": { + "label": "编辑", + "type": "primary", + "leftIcon": "edit", + "action": "button:editCard", + "link": false, + "linkType": "curr", + <#if name?has_content && name?ends_with("List")> + "fxLink": "bpm.${name?replace("List","Card")}", + <#else> + "fxLink": "", + + "fxLink_text": "编辑卡片" + }, + "id": "id${newId()}" + }, + { + "type": "fx-button", + "props": { + "label": "删除", + "type": "danger", + "leftIcon": "delete", + "action": "button:delCard", + "link": false, + "text": true, + "preAction": "" + }, + "id": "id${newId()}" + } + ], + "default": [ + <#list main.fields as field> + { + "id": "id${newId()}", + "type": "fx-table-column", + "props": { + "field": "${field.id}", + "label": "${field.label}" + } + }<#if field_has_next>, + + ] + }, + "events": {} + } + ] + } + ] + } + + ] + }, + { + "shape": "panel", + "id": "fx-form-panel", + "type": "fx-split-panel", + "props": { + "shadow": "", + "size": 24 + }, + "children": [] + } + ] + } + }, + <#list layout.lCard as lDialog> + { + "page": { + "id": "id${newId()}", + "type": "fx-dialog", + "props": { + <#if (param.lCardTitle == "")> + "title": "左表卡片", + <#else> + "title": "${param.lCardTitle}", + + "key": "lCardDialog", + "closeOnClickModal": false + }, + "events": {} + }, + "graph": { + "shape": "panel", + "id": "root_panel", + "type": "fx-split-panel", + "props": { + "horizontal": false, + "shadow": "never" + }, + "children": [ + { + "id": "${newId()}", + "type": "fx-split-panel", + "shape": "panel", + "props": { + "horizontal": false, + "scroll": true, + "backgroundColor": "--color-white" + }, + "children": [ + <#assign dfields = lDialog.fields> + <#assign col = param.lCardCol> + <#include "incModel/inc_list_dialog.ftl"/> + ] + }, + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "0" + }, + "children": [ + { + "id": "id${newId()}", + "type": "fx-divider", + "props": { + "label": "", + "contentPosition": "center", + "direction": "horizontal" + } + } + ] + }, + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "56", + "paddingRight": 10, + "alignY": "center" + }, + "children": [ + { + "id": "id${newId()}", + "type": "fx-button-group", + "props": { + "menus": [], + "textAlign": "right", + "dataset": "${lDialog.dataset}" + }, + "slots": { + "default": [ + { + "type": "fx-button", + "props": { + "label": "保存", + "leftIcon": "save", + "type": "success", + "action": "button:saveCard" + }, + "id": "id${newId()}" + }, + { + "type": "fx-button", + "props": { + "label": "关闭", + "leftIcon": "close", + "type": "", + "action": "button:closeDialog" + }, + "id": "id${newId()}" + } + ] + } + } + ] + } + ] + } + } + + <#list layout.lList as lQDialog> + <#assign group = lQDialog > + <#assign dialogKey = "lQueryDialog"> + <#assign dialogTitle = "左列表高级筛选"> + <#if (group.sfilters?size>0)> + ,<#include "incModel/inc_query_sfilters.ftl"/> + + + <#list layout.rList as rQDialog> + <#assign group = rQDialog > + <#assign dialogKey = "rQueryDialog"> + <#assign dialogTitle = "右列表高级筛选"> + <#if (group.sfilters?size>0)> + ,<#include "incModel/inc_query_sfilters.ftl"/> + + + ], + "model": [ + <#list datasets as dataset> + <#include "incModel/inc_model.ftl"/><#if dataset_has_next>, + + ], + "option": { + "widgetRef": [${widgetRef}], + "vars": [] + } +} diff --git a/smtweb-framework/bpm/src/main/resources/static/template/default/model_list_flow_ll2.ftl b/smtweb-framework/bpm/src/main/resources/static/template/default/model_list_flow_ll2.ftl new file mode 100644 index 0000000..1c2bc57 --- /dev/null +++ b/smtweb-framework/bpm/src/main/resources/static/template/default/model_list_flow_ll2.ftl @@ -0,0 +1,468 @@ +{ + "version": 6, + "form": [ + { + "page": { + "id": "id${newId()}", + "type": "fx-page", + "props": { + "title": "${title}", + "key": "${newId()}" + } + }, + "graph": { + "shape": "panel", + "id": "root_panel", + "type": "fx-split-panel", + "props": { + "shadow": "" + }, + "children": [ + { + "shape": "panel", + "id": "root_panel", + "type": "fx-split-panel", + "props": { + "horizontal": true, + "shadow": "" + }, + "children": [ +<#list layout.lList as assist> + { + "id": "${newId()}", + "type": "fx-split-panel", + "shape": "panel", + "props": { + "horizontal": false, + "size": "420" + }, + "children": [ + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "56", + "alignY": "center", + "paddingLeft": 16, + "colNum": 2, + "gridTemplateColumns": "", + "paddingRight": 16 + }, + "children": [ + { + "id": "id${newId()}", + "type": "fx-title", + "props": { + "label": "${param.lListTitle}" + } + } + ] + }, + { + "id":"${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "0" + }, + "children": [ + { + "id": "id${newId()}", + "type": "fx-divider", + "props": { + "label": "", + "contentPosition": "center", + "direction": "horizontal" + } + } + ] + }, + <#if (assist.cfilters?size>0)> + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "alignY": "center", + "size": "50", + "gridTemplateColumns": "1fr 50px", + "paddingLeft": 16, + "paddingRight": 16 + }, + "children": [ + <#list assist.cfilters as cfilters> + { + "id": "id${newId()}", + "type": "${cfilters.editor}", + "props": { + "label": "${cfilters.label}", + "maxlength": 50, + "placeholder": "请输入${cfilters.label}", + "labelWidth": 150, + "affixError": false, + "hideLabel": true, + "leftIcon": "", + "dataset": "${cfilters.dataset}", + "field": "${cfilters.id}" + }, + "events": {} + }, + + { + "id": "id${newId()}", + "type": "fx-button-group", + "props": { + "menus": [], + "textAlign": "right", + "dataset": "${assist.dataset}" + }, + "slots": { + "default": [ + { + "type": "fx-button", + "props": { + "label": "查询", + "leftIcon": "", + "action": "button:loadList", + "link": false, + "type": "primary" + }, + "id": "id${newId()}" + } + ] + } + } + ] + }, + + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "", + "colNum": 0, + "paddingLeft": 16, + "paddingRight": 16 + }, + "children": [ + { + "id": "id${newId()}", + "type": "fx-table", + "props": { + "label": "${param.lListTitle}", + "border": true, + "stripe": true, + "showHeader": false, + "fit": true, + "hideOp": false, + "hideNo": true, + "dataset": "${assist.dataset}", + "hidePagination": true, + "name":"leftTb" + }, + "slots": { + "button": [], + "default": [ + <#list assist.fields as field> + { + "id": "id${newId()}", + "type": "fx-table-column", + "props": { + "field": "${field.id}", + "label": "${field.label}" + } + }<#if field_has_next>, + + ] + }, + "events": {}, + "vars": { + "$ref": "$ref" + } + } + ] + } + ] + }, + + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "16", + "backgroundColor": "--color-transparent" + }, + "children": [] + }, +<#list layout.rList as main> + { + "id": "${newId()}", + "type": "fx-split-panel", + "shape": "panel", + "props": { + "horizontal": false + }, + "children": [ + <#if (main.cfilters?size>0)> + { + "shape": "panel", + "id": "form_panel", + "type": "fx-form-panel", + "props": { + "colNum": 3, + "label": "查询条件", + "size": "56", + "paddingLeft": 16, + "paddingRight": 16, + "alignY": "center" + }, + "children": [ + <#list main.cfilters as cfilters> + { + "id": "id${newId()}", + "type": "${cfilters.editor}", + "props": { + "label": "${cfilters.label}", + "maxlength": 50, + "placeholder": "请输入${cfilters.label}", + "labelWidth": 100, + "affixError": false, + "hideLabel": true + }, + "events": {} + }, + + { + "id": "id${newId()}", + "type": "fx-button-group", + "props": { + "menus": [], + "dataset": "${main.dataset}" + }, + "slots": { + "default": [ + { + "type": "fx-button", + "props": { + "label": "重置", + "leftIcon": "clear", + "action": "button:reset" + }, + "id": "id${newId()}" + }, + { + "type": "fx-button", + "props": { + "label": "查询", + "leftIcon": "search", + "type": "primary", + "action": "button:loadList", + "linkType": "" + }, + "id": "id${newId()}" + } + <#if (main.sfilters?size>0)> + ,{ + "id": "id${newId()}", + "type": "fx-button", + "props": { + "label": "高级筛选", + "leftIcon": "hamburger-button", + "action": "button:link", + "link": true, + "linkType": "drawer", + "fxLink": "dialog:rQueryDialog" + } + } + + ] + } + } + ] + }, + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "size": "16", + "backgroundColor": "--color-transparent" + }, + "children": [] + }, + + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "label": "${param.rListTitle}", + "size": "50", + "colNum": 2, + "alignY": "center", + "paddingLeft": 16, + "paddingRight": 16 + }, + "children": [ + { + "id": "id${newId()}", + "type": "fx-title", + "props": { + "label": "${param.rListTitle}" + } + }, + { + "id": "id${newId()}", + "type": "fx-button-group", + "props": { + "menus": [], + "textAlign": "right", + "dataset": "${main.dataset}" + }, + "slots": { + "default": [ + { + "type": "fx-button", + "props": { + "label": "新增", + "leftIcon": "plus", + "type": "primary", + "action": "button:addCard", + "link": false, + "linkType": "curr", + <#if name?has_content && name?ends_with("List")> + "fxLink": "bpm.${name?replace("List","Card")}", + <#else> + "fxLink": "", + + "fxLink_text": "编辑卡片", + "preAction": "" + }, + "id": "id${newId()}" + } + ] + } + } + ] + }, + { + "id": "${newId()}", + "type": "fx-form-panel", + "shape": "panel", + "props": { + "label": "表格区", + "colNum": 0, + "paddingLeft": 16, + "paddingRight": 16 + }, + "children": [ + { + "id": "id${newId()}", + "type": "fx-table", + "props": { + "label": "表格", + "border": true, + "stripe": true, + "showHeader": true, + "fit": true, + "dataset": "${main.dataset}" + }, + "slots": { + "button": [ + { + "type": "fx-button", + "props": { + "label": "编辑", + "type": "primary", + "leftIcon": "edit", + "action": "button:editCard", + "link": false, + "linkType": "curr", + <#if name?has_content && name?ends_with("List")> + "fxLink": "bpm.${name?replace("List","Card")}", + <#else> + "fxLink": "", + + "fxLink_text": "编辑卡片" + }, + "id": "id${newId()}" + }, + { + "type": "fx-button", + "props": { + "label": "删除", + "type": "danger", + "leftIcon": "delete", + "action": "button:delCard", + "link": false, + "text": true, + "preAction": "" + }, + "id": "id${newId()}" + } + ], + "default": [ + <#list main.fields as field> + { + "id": "id${newId()}", + "type": "fx-table-column", + "props": { + "field": "${field.id}", + "label": "${field.label}" + } + }<#if field_has_next>, + + ] + }, + "events": {} + } + ] + } + ] + } + + ] + }, + { + "shape": "panel", + "id": "fx-form-panel", + "type": "fx-split-panel", + "props": { + "shadow": "", + "size": 24 + }, + "children": [] + } + ] + } + } +<#list layout.lList as lQDialog> + <#assign group = lQDialog > + <#assign dialogKey = "lQueryDialog"> + <#assign dialogTitle = "左列表高级筛选"> + <#if (group.sfilters?size>0)> + ,<#include "incModel/inc_query_sfilters.ftl"/> + + +<#list layout.rList as rQDialog> + <#assign group = rQDialog > + <#assign dialogKey = "rQueryDialog"> + <#assign dialogTitle = "右列表高级筛选"> + <#if (group.sfilters?size>0)> + ,<#include "incModel/inc_query_sfilters.ftl"/> + + + ], + "model": [ +<#list datasets as dataset> + <#include "incModel/inc_model.ftl"/><#if dataset_has_next>, + + ], + "option": { + "widgetRef": [${widgetRef}], + "vars": [] + } +} diff --git a/smtweb-framework/core/src/main/java/cc/smtweb/framework/core/common/SwEnum.java b/smtweb-framework/core/src/main/java/cc/smtweb/framework/core/common/SwEnum.java index 4363ff4..8e6185d 100644 --- a/smtweb-framework/core/src/main/java/cc/smtweb/framework/core/common/SwEnum.java +++ b/smtweb-framework/core/src/main/java/cc/smtweb/framework/core/common/SwEnum.java @@ -347,7 +347,12 @@ public interface SwEnum { public static StrEnumBean LC_LC_1 = instance.addEnum("LC_LC_1", "左列表-右列表(含编辑弹窗、左列表可编辑)"); public static StrEnumBean LC_LC_2 = instance.addEnum("LC_LC_2", "左列表-右列表(含编辑弹窗、左列表不可编辑)"); public static StrEnumBean EMPTY = instance.addEnum("EMPTY", "自定义模型"); - public static StrEnumBean FLOW_SINGLE = instance.addEnum("FLOW_SINGLE", "普通工作流列表(含编辑卡片)"); + public static StrEnumBean FLOW_SINGLE = instance.addEnum("FLOW_SINGLE", "普通列表(含编辑卡片、工作流)"); + public static StrEnumBean FLOW_LC_LT = instance.addEnum("FLOW_LC_LT", "左树-列表(含编辑卡片、工作流)"); + public static StrEnumBean FLOW_LC_LC_1 = instance.addEnum("FLOW_LC_LC_1", "左列表-右列表(含编辑卡片、工作流、左列表可编辑)"); + public static StrEnumBean FLOW_LC_LC_2 = instance.addEnum("FLOW_LC_LC_2", "左列表-右列表(含编辑卡片、工作流、左列表不可编辑)"); + public static StrEnumBean FLOW_LC_MS = instance.addEnum("FLOW_LC_MS", "普通主子列表(含编辑卡片、工作流)"); + public static StrEnumBean FLOW_LT_MS = instance.addEnum("FLOW_LT_MS", "左树-主子列表(含编辑卡片、工作流)"); } // 权限类型