提交 b8979205 编写于 作者: sq3536's avatar sq3536

表单项宏模板

上级 ca0e2015
......@@ -26,6 +26,7 @@ public class CtrlModel extends BaseModel{
folder=new LabelExt("app");
this.setId(String.format("%1$s-%2$s-%3$s",app.getCodeName(),folder,psControl.getCodeName()));
}
private AppModel app;
......
......@@ -43,7 +43,7 @@ public class HandlebarsEngineAdapter extends AbstractTemplatingEngineAdapter {
// We use this as a simple lookup for valid file name extensions. This adapter will inspect .mustache (built-in) and infer the relevant handlebars filename
private final String[] canCompileFromExtensions = {".handlebars",".hbs",".mustache"};
private boolean infiniteLoops = false;
private boolean infiniteLoops = true;
private boolean prettyPrint = true;
/**
......@@ -71,7 +71,7 @@ public class HandlebarsEngineAdapter extends AbstractTemplatingEngineAdapter {
MapValueResolver.INSTANCE,
// JavaBeanValueResolver.INSTANCE,
BaseModelValueResolver.INSTANCE,
FieldValueResolver.INSTANCE,
//FieldValueResolver.INSTANCE,
MethodValueResolver.INSTANCE)
.build();
......@@ -161,7 +161,7 @@ public class HandlebarsEngineAdapter extends AbstractTemplatingEngineAdapter {
}
}
throw new TemplateNotFoundException(String.join(", ", possibilities));
return new StringTemplateSource(templateFile, "/*未找到模板["+templateFile+"]*/");
}
@Override
......
这里是表单分组子模板 输出{{item.codeName}}-{{item.caption}}
{{#each item.psDEFormDetails as | detail | }}
加载表单分组 {{item.codeName}}-{{item.caption}} 的 第 {{@index}} 个组件 {{detail.detailType}} {{detail.codeName}}
{{>(lookup . 'detail.detailType') item=detail}}
{{/each}}
\ No newline at end of file
这里是表单项的子模板 输出 {{item.codeName}}-{{item.caption}}
{{#if item.psEditor}}
开始加载表单项 {{item.codeName}}--{{item.caption}} 的 编辑器 {{item.psEditor.editorType}}
{{>(lookup . 'item.psEditor.editorType') item=item}}
{{/if}}
\ No newline at end of file
这里是表单分页子模板,输出{{formPage.codeName}}-{{formPage.caption}}
{{#each formPage.psDEFormDetails as | formPageDetail |}}
{{secNo}}.{{@index}}. {{formPageDetail.detailType}} {{formPageDetail.codeName}}
{{>(lookup . 'formPageDetail.detailType') item=formPageDetail}}
{{/each}}
\ No newline at end of file
{{#*inline "FORMPAGE"}}{{>@macro/components/form-page.hbs}}{{/inline}}
{{#*inline "GROUPPANEL"}}{{>@macro/components/form-group.hbs}}{{/inline}}
{{#*inline "FORMITEM"}}{{>@macro/components/form-item.hbs}}{{/inline}}
{{#*inline "TEXTBOX"}}{{>@macro/components/input.hbs}}{{/inline}}
textbox子模板 表单项{{item.codeName}}->编辑器{{item.psEditor.name}}->maxLength {{item.psEditor.maxLength}}
\ No newline at end of file
{{!引用子模板注册器 include}}
{{>@macro/components/include-ctrls.hbs}}
{{ctrl.name}}
{{#each ctrl.psDEFormPages as | ctrlPart | }}
{{@index}}.表单分页{{ctrlPart.codeName}}-{{ctrlPart.caption}}
{{>(lookup . 'ctrlPart.detailType') formPage=ctrlPart secNo=@index}}
{{/each}}
这里是部件所属应用实体的代码名称{{ctrl.appEntity.codeName}}
\ No newline at end of file
{{ctrl.name}}
这里是部件所属应用实体的代码名称{{ctrl.appEntity.codeName}}
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册