提交 21264471 编写于 作者: tony001's avatar tony001

实体工作流动态操作视图逻辑补充 --- fix3

上级 0cdd5713
...@@ -3,13 +3,14 @@ ...@@ -3,13 +3,14 @@
<card class='view-card view-no-caption view-no-toolbar' :disHover="true" :padding="0" :bordered="false"> <card class='view-card view-no-caption view-no-toolbar' :disHover="true" :padding="0" :bordered="false">
<div class="content-container"> <div class="content-container">
<component <component
:is="formName" :is="activeForm.name"
:viewState="viewState" :viewState="viewState"
:viewparams="viewparams" :viewparams="viewparams"
:context="context" :context="context"
:autosave="false" :autosave="false"
:viewtag="viewtag" :viewtag="viewtag"
:showBusyIndicator="true" :showBusyIndicator="true"
:loadAction="activeForm.loadAction"
name="form" name="form"
ref='form'> ref='form'>
</component> </component>
......
<#assign watch_viewparam_block> <#assign watch_viewparam_block>
if(this.viewparams && this.viewparams.actionForm){ if(this.viewparams && this.viewparams.actionForm){
<#noparse>this.formName = `view_wfform_${this.viewparams.actionForm.toLowerCase()}`;</#noparse> this.computeActivedForm(this.viewparams.actionForm);
}else{
this.computeActivedForm();
} }
</#assign> </#assign>
<#assign mounted_block> <#assign mounted_block>
this.viewState.next({ tag: "form", action: "load", data: this.viewparams }); this.viewState.next({ tag: "form", action: "load", data: this.viewparams });
</#assign> </#assign>
<#assign self_content> <#assign self_content>
/** /**
* 显示表单名称 * 当前激活表单
* *
* @memberof ${srfclassname('${view.codeName}')}Base * @memberof ${srfclassname('${view.codeName}')}Base
*/ */
public formName:string = ""; public activeForm:any = {};
/**
* 所有表单
*
* @memberof ${srfclassname('${view.codeName}')}Base
*/
public allForm:any = { public allForm:any = {
<#if view.getAllPSControls?? && view.getAllPSControls()??> <#if view.getAllPSControls?? && view.getAllPSControls()??>
<#list view.getAllPSControls() as singleControl> <#list view.getAllPSControls() as singleControl>
"${singleControl.getName()}":{name:"view_${singleControl.getName()}",loadAction:"<#if singleControl.getGetPSControlAction()?? && singleControl.getGetPSControlAction().getPSAppDEMethod()??>${singleControl.getGetPSControlAction().getPSAppDEMethod().getCodeName()}</#if>"}<#if singleControl_has_next>,</#if> "${singleControl.getCodeName()}":{name:"view_${singleControl.getName()}",loadAction:"<#if singleControl.getGetPSControlAction()?? && singleControl.getGetPSControlAction().getPSAppDEMethod()??>${singleControl.getGetPSControlAction().getPSAppDEMethod().getCodeName()}</#if>"}<#if singleControl_has_next>,</#if>
</#list> </#list>
</#if> </#if>
}; };
/**
* 计算激活表单
*
* @memberof ${srfclassname('${view.codeName}')}Base
*/
public computeActivedForm(inputForm?:string){
if(!inputForm){
this.activeForm = this.allForm;
}
if(this.allForm && Object.keys(this.allForm).length >0){
Object.keys(this.allForm).forEach((name:string) =>{
if(Object.is(name,inputForm)){
this.activeForm = this.allForm[name];
}
})
}
}
/** /**
* 确认 * 确认
* *
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册