Browse Source

模型: 左树+列表+编辑弹窗

4.0
lip 2 years ago
parent
commit
6e4a29b132
14 changed files with 459 additions and 49 deletions
  1. +16
    -0
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcLt2Worker.java
  2. +1
    -0
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/ModelFactory.java
  3. +0
    -6
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/abshandler/ModelHelper.java
  4. +0
    -2
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclc1/LCLC1DelHandler.java
  5. +0
    -4
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclc1/LCLC1LoadHandler.java
  6. +0
    -2
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclc1/LCLC1SaveHandler.java
  7. +0
    -2
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclc1/LCLC1Service.java
  8. +12
    -0
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclt2/LCLT2Service.java
  9. +0
    -8
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/normal/LCNormalService.java
  10. +0
    -7
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/single/LCSingleService.java
  11. +1
    -1
      smtweb-framework/bpm/src/main/resources/static/template/default/incModel/inc_list_table.ftl
  12. +10
    -9
      smtweb-framework/bpm/src/main/resources/static/template/default/model_card_normal.ftl
  13. +410
    -0
      smtweb-framework/bpm/src/main/resources/static/template/default/model_tree_list_dialog.ftl
  14. +9
    -8
      smtweb-framework/core/src/main/java/cc/smtweb/framework/core/common/SwEnum.java

+ 16
- 0
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/LcLt2Worker.java View File

@@ -0,0 +1,16 @@
package cc.smtweb.system.bpm.web.design.form.model;

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";

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

+ 1
- 0
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/model/ModelFactory.java View File

@@ -27,6 +27,7 @@ public class ModelFactory {
mapWorker.put(SwEnum.ModelType.LC_SINGLE.value, new LcSingleWorker());
mapWorker.put(SwEnum.ModelType.LC_NORMAL.value, new LcNormalWorker());
mapWorker.put(SwEnum.ModelType.LC_LT.value, new LcLtWorker());
mapWorker.put(SwEnum.ModelType.LC_LT_2.value, new LcLt2Worker());
mapWorker.put(SwEnum.ModelType.LC_MS.value, new LcMsWorker());
mapWorker.put(SwEnum.ModelType.LC_LT_MS.value, new LcLtMsWorker());
mapWorker.put(SwEnum.ModelType.LC_LC_1.value, new LcLc1Worker());


+ 0
- 6
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/abshandler/ModelHelper.java View File

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

import cc.smtweb.framework.core.common.SwEnum;
import cc.smtweb.framework.core.common.SwMap;
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.define.PageDataset;
import cc.smtweb.system.bpm.web.design.form.define.PageDatasets;
import cc.smtweb.system.bpm.web.engine.dynPage.DynRetBean;

/**


+ 0
- 2
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclc1/LCLC1DelHandler.java View File

@@ -1,8 +1,6 @@
package cc.smtweb.system.bpm.web.engine.model.listcard.lclc1;

import cc.smtweb.framework.core.common.R;
import cc.smtweb.framework.core.db.impl.DefaultEntity;
import cc.smtweb.system.bpm.web.engine.model.listcard.abshandler.AbsDelHandler;
import cc.smtweb.system.bpm.web.engine.model.listcard.abshandler.ModelDelHandler;

/**


+ 0
- 4
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclc1/LCLC1LoadHandler.java View File

@@ -1,11 +1,7 @@
package cc.smtweb.system.bpm.web.engine.model.listcard.lclc1;

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.system.bpm.web.engine.dynPage.DynRetBean;
import cc.smtweb.system.bpm.web.engine.model.listcard.abshandler.AbsLoadHandler;
import cc.smtweb.system.bpm.web.engine.model.listcard.abshandler.ModelHelper;
import cc.smtweb.system.bpm.web.engine.model.listcard.abshandler.ModelLoadHandler;

/**


+ 0
- 2
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclc1/LCLC1SaveHandler.java View File

@@ -2,8 +2,6 @@ package cc.smtweb.system.bpm.web.engine.model.listcard.lclc1;

import cc.smtweb.framework.core.common.R;
import cc.smtweb.framework.core.db.impl.DefaultEntity;
import cc.smtweb.system.bpm.web.engine.model.listcard.abshandler.AbsSaveHandler;
import cc.smtweb.system.bpm.web.engine.model.listcard.abshandler.ModelHelper;
import cc.smtweb.system.bpm.web.engine.model.listcard.abshandler.ModelSaveHandler;

/**


+ 0
- 2
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclc1/LCLC1Service.java View File

@@ -4,9 +4,7 @@ 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.dynPage.DynPageService;
import cc.smtweb.system.bpm.web.engine.model.listcard.abshandler.ModelDelHandler;
import cc.smtweb.system.bpm.web.engine.model.listcard.abshandler.ModelLoadHandler;
import cc.smtweb.system.bpm.web.engine.model.listcard.abshandler.ModelSaveHandler;


+ 12
- 0
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/lclt2/LCLT2Service.java View File

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

import cc.smtweb.framework.core.annotation.SwService;
import cc.smtweb.system.bpm.web.engine.model.listcard.abshandler.ModelService;

/**
* @Author:lip
* @Date : 2022/8/27 13:54
*/
@SwService
public class LCLT2Service extends ModelService {
}

+ 0
- 8
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/normal/LCNormalService.java View File

@@ -1,15 +1,7 @@
package cc.smtweb.system.bpm.web.engine.model.listcard.normal;

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.session.UserSession;
import cc.smtweb.system.bpm.web.engine.model.listcard.abshandler.ModelSaveHandler;
import cc.smtweb.system.bpm.web.engine.model.listcard.abshandler.ModelDelHandler;
import cc.smtweb.system.bpm.web.engine.model.listcard.abshandler.ModelLoadHandler;
import cc.smtweb.system.bpm.web.engine.model.listcard.abshandler.ModelService;
import cc.smtweb.system.bpm.web.engine.model.listcard.single.LCSingleService;

/**
* @Author:lip


+ 0
- 7
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/single/LCSingleService.java View File

@@ -1,13 +1,6 @@
package cc.smtweb.system.bpm.web.engine.model.listcard.single;

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.dynPage.DynPageService;
import cc.smtweb.system.bpm.web.engine.model.listcard.abshandler.ModelSaveHandler;
import cc.smtweb.system.bpm.web.engine.model.listcard.abshandler.ModelService;

/**


+ 1
- 1
smtweb-framework/bpm/src/main/resources/static/template/default/incModel/inc_list_table.ftl View File

@@ -41,7 +41,7 @@
],
</#if>
"button": [
<#if (tmpl_Type == "model_list_card")>
<#if (tmpl_Type == "model_list_card" || tmpl_Type == "model_tree_list_dialog")>
{
"id": "id${newId()}",
"type": "fx-button",


+ 10
- 9
smtweb-framework/bpm/src/main/resources/static/template/default/model_card_normal.ftl View File

@@ -110,7 +110,6 @@
"name": "s12"
},
"children": [

{
<#list layout.card as group>
"id": "${newId()}",
@@ -160,26 +159,28 @@
</#if>
"props": {
"label": "${field.label}",
"type": "text",
"dataset": "${field.dataset}",
"required": "${field.required}",
"field": "${field.id}",
<#if field.maxlength gt 0>
"maxlength": ${field.maxlength},
"maxlength": ${field.maxlength},
</#if>
"placeholder": "请输入内容",
<#if (param.col gte 2)>
"tips": "${field.desc}",
</#if>
<#if (param.col gte 2)>
"tips": "${field.desc}",
</#if>
"labelWidth": 150,
"readonly": false,
<#if (field.readonly = true)>
"readonly": true,
<#else>
"readonly": false,
</#if>
"affixError": true
},
"events": {}
}
<#if field_has_next>
<#if (param.col lte 1 )>

,{
"id": "id${newId()}",
"type": "fx-placeholder",
@@ -290,4 +291,4 @@
"widgetRef": [${widgetRef}],
"vars": []
}
}
}

+ 410
- 0
smtweb-framework/bpm/src/main/resources/static/template/default/model_tree_list_dialog.ftl View File

@@ -0,0 +1,410 @@
{
<#list layout.list as group>
"form": [
{
"page": {
"id": "${newId()}",
"type": "fx-page",
"props": {
"title": "${title}",
"key": "${newId()}"
}
},
"graph": {
"shape": "panel",
"id": "root_panel",
"type": "fx-split-panel",
"props": {
"horizontal": true,
"shadow": ""
},
"children": [
{
"id": "${newId()}",
"type": "fx-split-panel",
"shape": "panel",
"props": {
"size": "300",
"horizontal": false,
"shadow": ""
},
"children": [
{
"id": "${newId()}",
"type": "fx-split-panel",
"shape": "panel",
"props": {
"size": "",
"horizontal": false,
"name": "left"
},
"children": [
{
"id": "${newId()}",
"type": "fx-form-panel",
"shape": "panel",
"props": {
"size": "",
"colNum": 0,
"paddingTop": 10,
"paddingLeft": 10,
"paddingRight": 10,
"scroll": true
},
"children": [
{
"id": "${newId()}",
"type": "fx-tree",
"props": {
"defaultExpandAll": false,
"expandOnClickNode": false,
"filterShow": true,
"filterPlaceholder": "查询",
"createVirtualRoot": false,
"virtualRootLabel": "顶级虚拟节点",
"dataset": "${group.dataset}"
},
"events": {}
}
]
}
]
},
{
"id": "${newId()}",
"type": "fx-form-panel",
"shape": "panel",
"props": {
"size": "15",
"backgroundColor": "--color-transparent"
},
"children": []
}
]
},
{
"id": "${newId()}",
"type": "fx-form-panel",
"shape": "panel",
"props": {
"size": "16",
"backgroundColor": "--color-transparent"
},
"children": []
},
{
"id": "${newId()}",
"type": "fx-split-panel",
"shape": "panel",
"props": {
"horizontal": false,
"name": "right"
},
"children": [
<#if (group.cfilters?size>0)>
<#include "incModel/inc_list_query.ftl"/>
</#if>
{
"id": "${newId()}",
"type": "fx-form-panel",
"shape": "panel",
"props": {
"size": "50",
"label": "按钮区域",
"colNum": 2,
"alignY": "center",
"paddingLeft": 16,
"paddingRight": 16,
"shadow": ""
},
"children": [
{
"id": "id${newId()}",
"type": "fx-title",
"props": {
"label": "${title}",
"fontSize": 15,
"color": "#313131",
"fontWeight": "bold",
"showPrefix": true,
"prefixWidth": 5,
"prefixHeight": 15,
"prefixColor": "#1E90FF"
}
},
{
"id": "id${newId()}",
"type": "fx-button-group",
"props": {
"showDropdown": false,
"dataset": "${group.dataset}",
"textAlign": "right"
},
"slots": {
"default": [
{
"type": "fx-button",
"props": {
"label": "新增",
"leftIcon": "plus",
"type": "primary",
"action": "button:addCard",
"link": false,
"linkType": "dialog",
"fxLink": "dialog:cardDialog",
"fxLink_text": "${param.cardTitle}"
},
"id": "id${newId()}",
"events": {}
}
],
"dropdown": []
}
}
]
},
<#include "incModel/inc_list_table.ftl"/>
{
"id": "${newId()}",
"type": "fx-form-panel",
"shape": "panel",
"props": {
"size": "16",
"backgroundColor": "transparent"
},
"children": []
}
]
}
]
}
}
<#if (group.sfilters?size>0)>
<#include "incModel/inc_query_sfilters.ftl"/>
</#if>
<#list layout.card as dialog>
,{
"page": {
"id": "id${newId()}",
"type": "fx-dialog",
"props": {
<#if (param.cardTitle == "")>
"title": "编辑卡片",
<#else>
"title": "${param.cardTitle}",
</#if>
"key": "cardDialog",
"fontSize": 16,
"color": "#313131",
"fontWeight": "bold",
"showPrefix": true,
"prefixWidth": 5,
"prefixHeight": 16,
"prefixColor": "#1E90FF"
},
"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
},
"children": [
{
"id": "${newId()}",
"type": "fx-form-panel",
"shape": "panel",
"props": {
"size": "0",
<#if param.col lte 1 || param.col gte 3>
"gridTemplateColumns": "1fr 1fr 1fr",
<#elseif param.col == 2>
"gridTemplateColumns": "1fr 1fr 1fr 1fr",
</#if>
"paddingTop": 15
},
<#assign dfields = dialog.fields>
"children": [
<#list dfields as dfield>
<#if (param.col lte 1)>
{
"id": "id${newId()}",
"type": "fx-placeholder",
"props": {
"label": "占位"
},
"layout": {
"row": 1
}
},
<#elseif (param.col = 2 && ((dfield_index+1) % 2 = 1 ) )>
{
"id": "id${newId()}",
"type": "fx-placeholder",
"props": {
"label": "占位"
},
"layout": {
"row": 1
}
},
</#if>
{
"id": "id${newId()}",
<#if (dfield.readonly = true)>
"type": "fx-text",
"disabled": true,
<#else>
"type": "${dfield.editor}",
</#if>
"props": {
"label": "${dfield.label}",
"dataset": "${dfield.dataset}",
"field": "${dfield.id}",
"required": "${dfield.required}",
<#if dfield.maxlength gt 0>
"maxlength": ${dfield.maxlength},
</#if>
"placeholder": "请输入${dfield.label}",
<#if (param.col gte 2)>
"tips": "${dfield.desc}",
</#if>
"labelWidth": 150,
<#if (dfield.readonly = true)>
"readonly": true,
<#else>
"readonly": false,
</#if>
"affixError": true
},
"events": {}
}
<#if dfield_has_next>
<#if (param.col lte 1 )>
,{
"id": "id${newId()}",
"type": "fx-placeholder",
"props": {
"label": "占位"
},
"layout": {
"row": 1
}
}
</#if>
<#if (param.col = 2 && ((dfield_index+1) % 2 = 0 ) )>
,{
"id": "id${newId()}",
"type": "fx-placeholder",
"props": {
"label": "占位"
},
"layout": {
"row": 1
}
}
</#if>
,
</#if>
</#list>
]
},
{
"id": "${newId()}",
"type": "fx-form-panel",
"shape": "panel",
"props": {},
"children": []
}
]
},
{
"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": "50",
"alignY": "center",
"paddingRight": 20
},
"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:saveCard"
},
"id": "id${newId()}"
},
{
"type": "fx-button",
"props": {
"label": "关闭",
"leftIcon": "close",
"action": "button:closeDialog"
},
"id": "id${newId()}"
}
]
}
}
]
}
]
}
}
</#list>
],
"model": [
<#list datasets as dataset>
<#include "incModel/inc_model.ftl"/><#if dataset_has_next>,</#if>
</#list>
],
"option": {
"widgetRef": [${widgetRef}],
"vars": []
}
</#list>
}

+ 9
- 8
smtweb-framework/core/src/main/java/cc/smtweb/framework/core/common/SwEnum.java View File

@@ -338,14 +338,15 @@ public interface SwEnum {
*/
class ModelType extends StrEnum {
public static ModelType instance = new ModelType();
public static StrEnumBean LC_SINGLE = instance.addEnum("LC_SINGLE", "简单列表(含卡片)");
public static StrEnumBean LC_NORMAL = instance.addEnum("LC_NORMAL", "普通列表(含卡片)");
public static StrEnumBean LC_LT = instance.addEnum("LC_LT", "列表卡片(左树+列表)");
public static StrEnumBean LC_MS = instance.addEnum("LC_MS", "列表卡片(主子表)");
public static StrEnumBean LC_LT_MS = instance.addEnum("LC_LT_MS", "列表卡片(左树+列表+主子表)");
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 FLOW_SINGLE = instance.addEnum("FLOW_SINGLE", "列表卡片(含工作流)");
public static StrEnumBean LC_SINGLE = instance.addEnum("LC_SINGLE", "简单列表(含编辑弹窗)");
public static StrEnumBean LC_NORMAL = instance.addEnum("LC_NORMAL", "普通列表(含编辑卡片)");
public static StrEnumBean LC_LT = instance.addEnum("LC_LT", "左树-列表(含编辑卡片)");
public static StrEnumBean LC_LT_2 = instance.addEnum("LC_LT_2", "左树-列表(含编辑弹窗)");
public static StrEnumBean LC_MS = instance.addEnum("LC_MS", "普通主子列表(含编辑卡片)");
public static StrEnumBean LC_LT_MS = instance.addEnum("LC_LT_MS", "左树-主子列表(含编辑卡片)");
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 FLOW_SINGLE = instance.addEnum("FLOW_SINGLE", "普通工作流列表(含编辑卡片)");
}

// 权限类型


Loading…
Cancel
Save