Ver a proveniência

模板调整

master
郑根木 há 2 anos
ascendente
cometimento
768c348762
8 ficheiros alterados com 189 adições e 12 eliminações
  1. +2
    -1
      smtweb-framework/sw-framework-core/src/main/java/cc/smtweb/framework/core/common/SwEnum.java
  2. +1
    -1
      smtweb-system/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/util/CodeGenerator.java
  3. +1
    -1
      smtweb-system/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/define/PageDatasetField.java
  4. +1
    -1
      smtweb-system/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/define/PageDatasetFilter.java
  5. +3
    -3
      smtweb-system/sw-system-bpm/src/main/resources/static/template/incModel/inc_model.ftl
  6. +24
    -5
      smtweb-system/sw-system-bpm/src/main/resources/static/template/index.yaml
  7. +116
    -0
      smtweb-system/sw-system-bpm/src/main/resources/static/template/model_card.ftl
  8. +41
    -0
      smtweb-system/sw-system-bpm/src/main/resources/static/template/model_list.ftl

+ 2
- 1
smtweb-framework/sw-framework-core/src/main/java/cc/smtweb/framework/core/common/SwEnum.java Ver ficheiro

@@ -71,6 +71,7 @@ public interface SwEnum {
public static StrEnumBean INPUT = instance.addEnum("text", "文本");
public static StrEnumBean TEXT = instance.addEnum("textarea", "长文本");
public static StrEnumBean NUMBER = instance.addEnum("number", "数字");
public static StrEnumBean SWITCH = instance.addEnum("switch", "布尔型");
public static StrEnumBean DATE = instance.addEnum("date", "日期");
public static StrEnumBean TIME = instance.addEnum("time", "时间");
public static StrEnumBean DATETIME = instance.addEnum("datetime", "日期时间");
@@ -122,7 +123,7 @@ public interface SwEnum {
public static DataTypeBean TEXT = instance.addEnum("text", "大文本", "text", 0, "string", Types.CLOB, "", EditorType.TEXT.value);
public static DataTypeBean INT = instance.addEnum("int", "整型", "int", 0, "int", Types.INTEGER, "0", EditorType.NUMBER.value);
public static DataTypeBean SHORT = instance.addEnum("short", "短整型", "smallint", 0, "short", Types.SMALLINT, "0", EditorType.NUMBER.value);
public static DataTypeBean BOOL = instance.addEnum("bool", "布尔型", "tinyint", 0, "boolean", Types.TINYINT, "0", EditorType.COMBO.value);
public static DataTypeBean BOOL = instance.addEnum("bool", "布尔型", "tinyint", 0, "boolean", Types.TINYINT, "0", EditorType.SWITCH.value);
public static DataTypeBean CURRENCY = instance.addEnum("currency", "金额型", "bigint", 0, "long", Types.BIGINT, "0", EditorType.NUMBER.value);
public static DataTypeBean DATE = instance.addEnum("date", "日期型", "bigint", 0, "long", Types.BIGINT, "0", EditorType.DATE.value);
public static DataTypeBean TIME = instance.addEnum("time", "时间型", "bigint", 0, "long", Types.BIGINT, "0", EditorType.TIME.value);


+ 1
- 1
smtweb-system/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/util/CodeGenerator.java Ver ficheiro

@@ -164,7 +164,7 @@ public class CodeGenerator {

map.put("title", "thisIsATest!");
map.put("newId", new PKGenerator());
CodeGenerator.getInstance().generate(map, "model_simple.ftl", out);
CodeGenerator.getInstance().generate(map, "model_card.ftl", out);
System.out.println(out.getBuffer().toString());
}
}

+ 1
- 1
smtweb-system/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/define/PageDatasetField.java Ver ficheiro

@@ -11,7 +11,7 @@ public class PageDatasetField {
public long table;
public String table_text;
//字段
public String field;
public String field = "";
//有别名取别名,无别名同字段名
public String name;
public String label;


+ 1
- 1
smtweb-system/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/define/PageDatasetFilter.java Ver ficheiro

@@ -13,5 +13,5 @@ public class PageDatasetFilter extends PageDatasetField {
public String linkField;
//type为const时,常量值
public String value;
public boolean required;
public boolean required = false;
}

+ 3
- 3
smtweb-system/sw-system-bpm/src/main/resources/static/template/incModel/inc_model.ftl Ver ficheiro

@@ -18,9 +18,9 @@
"filters": [
<#list dataset.filters as field>
{
"id": "${field.field}",
"field": "${field.field}",
"required": ${field.required},
"id": "${field.id}",
"field": "${field.field!0}",
"required": ${field.required?string ("true","false")},
"type": "input"
}<#if field_has_next>,</#if>
</#list>


+ 24
- 5
smtweb-system/sw-system-bpm/src/main/resources/static/template/index.yaml Ver ficheiro

@@ -1,7 +1,9 @@
model:
-
name: 'model_simple'
label: '简单页面'
name: 'model_list'
label: '简单列表'
# list/card/view
type: 'list'
# 布局
layout:
-
@@ -10,7 +12,24 @@ model:
type: 'list'
hasGroup: false
# 变量
param:
# param:
# -
# name: 'p1'
# type: 'ds'
-
name: 'model_card'
label: '简单卡片'
# list/card/view
type: 'card'
# 布局
layout:
-
name: 'p1'
type: 'ds'
name: 'c1'
label: '客户区'
type: 'card'
hasGroup: false
# 变量
# param:
# -
# name: 'p1'
# type: 'ds'

+ 116
- 0
smtweb-system/sw-system-bpm/src/main/resources/static/template/model_card.ftl Ver ficheiro

@@ -0,0 +1,116 @@
{
"form": [
{
"page": {
"id": "p${newId()}",
"type": "fx-page",
"props": {
"title": "${title}",
"key": "${newId()}"
}
},
"graph": {
"shape": "panel",
"id": "root_panel",
"type": "fx-split-panel",
"props": {
"horizontal": false,
"shadow": "never"
},
"children": [
<#list layout.c1 as group>
<#if (group.type == "list")>
<#if (group.cfilters?size>0)>
<#include "incModel/inc_filter.ftl"/>
</#if>
<#include "incModel/inc_grid_opt.ftl"/>
<#elseif (group.type == "card")>
<#include "incModel/inc_form.ftl"/>
</#if>,
</#list>
{
"id": "${newId()}",
"type": "fx-form-panel",
"shape": "panel",
"props": {
"paddingY": 3,
"paddingX": 10,
"size": 20
},
"children": [
{
"id": "id${newId()}",
"type": "fx-button-group",
"props": {
"menus": [],
"textAlign": "center"
},
"slots": {
"default": [
{
"type": "fx-button",
"props": {
"label": "新增",
"leftIcon": "plus",
"type": "primary",
"action": "button:add"
},
"id": "id${newId()}"
},
{
"type": "fx-button",
"props": {
"label": "保存并新增",
"type": "primary",
"action": "button:saveAndAdd"
},
"id": "id${newId()}"
},
{
"type": "fx-button",
"props": {
"label": "保存",
"leftIcon": "save",
"type": "success",
"action": "button:save"
},
"id": "id${newId()}"
},
{
"type": "fx-button",
"props": {
"label": "删除",
"leftIcon": "delete",
"type": "danger",
"action": "button:remove"
},
"id": "id${newId()}"
},
{
"type": "fx-button",
"props": {
"label": "返回",
"leftIcon": "return",
"action": "button:return"
},
"id": "id${newId()}"
}
]
}
}
]
}
]
}
}
],
"model": [
<#list datasets as dataset>
<#include "incModel/inc_model.ftl"/><#if dataset_has_next>,</#if>
</#list>
],
"option": {
"widgetRef": [${widgetRef}],
"vars": []
}
}

+ 41
- 0
smtweb-system/sw-system-bpm/src/main/resources/static/template/model_list.ftl Ver ficheiro

@@ -0,0 +1,41 @@
{
"form": [
{
"page": {
"id": "p${newId()}",
"type": "fx-page",
"props": {
"title": "${title}",
"key": "${newId()}"
}
},
"graph": {
"shape": "panel",
"id": "root_panel",
"type": "fx-split-panel",
"props": {
"horizontal": false,
"shadow": "never"
},
"children": [
<#list layout.c1 as group>
<#if (group.cfilters?size>0)>
<#include "incModel/inc_filter.ftl"/>
</#if>
<#include "incModel/inc_grid_opt.ftl"/>
<#if group_has_next>,</#if>
</#list>
]
}
}
],
"model": [
<#list datasets as dataset>
<#include "incModel/inc_model.ftl"/><#if dataset_has_next>,</#if>
</#list>
],
"option": {
"widgetRef": [${widgetRef}],
"vars": []
}
}

Carregando…
Cancelar
Guardar