提交 ca851148 编写于 作者: KK's avatar KK

动态操作视图

上级 30462884
<#ibizinclude>
../@MACRO/DEFAULT.less.ftl
</#ibizinclude>
\ No newline at end of file
<#assign view_content>
<div class='view-card view-no-caption view-no-toolbar' >
<div class="content-container">
<component
:is="activeForm.name"
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:autosave="false"
:viewtag="viewtag"
:showBusyIndicator="activeForm.showBusyIndicator"
:updateAction="activeForm.updateAction"
:removeAction="activeForm.removeAction"
:loaddraftAction="activeForm.loaddraftAction"
:loadAction="activeForm.loadAction"
:createAction="activeForm.createAction"
:WFSubmitAction="activeForm.WFSubmitAction"
:WFStartAction="activeForm.WFStartAction"
name="form"
ref='form'>
</component>
</div>
<div class="option-view-btnbox">
<ion-button class="option-btn medium" color="medium" @click="back">返回</ion-button>
<ion-button class="option-btn success" @click="save">保存</ion-button>
</div>
</div>
</#assign>
<#ibizinclude>
../@MACRO/VIEW_LAYOUT_BASE.ftl
</#ibizinclude>
\ No newline at end of file
CTRLTYPE=VIEWLAYOUTPANEL#APPDEMOBWFDYNAACTIONVIEW
\ No newline at end of file
<#assign mounted_block>
this.viewState.next({ tag: "form", action: "autoload", data: {srfkey:this.context.${appde.getCodeName()?lower_case}} });
</#assign>
<#assign self_content>
/**
* 当前激活表单
*
* @memberof ${srfclassname('${view.codeName}')}Base
*/
public activeForm:any = {};
/**
* 所有表单
*
* @memberof ${srfclassname('${view.codeName}')}Base
*/
/**
* 所有表单数据
*
* @memberof ${srfclassname('${view.codeName}')}Base
*/
public allForm: any = {
<#if view.getAllPSControls?? && view.getAllPSControls()??>
<#list view.getAllPSControls() as singleControl>
<#if singleControl.getControlType?? && singleControl.getControlType()?? && singleControl.getControlType() != "TOOLBAR">
"${singleControl.getName()}":{name:"view_${singleControl.getName()}",autosave:"${singleControl.isEnableAutoSave()?c}",showBusyIndicator:"${singleControl.isShowBusyIndicator()?c}",updateAction:"<#if singleControl.getUpdatePSControlAction()?? && singleControl.getUpdatePSControlAction().getPSAppDEMethod()??>${singleControl.getUpdatePSControlAction().getPSAppDEMethod().getCodeName()}</#if>",removeAction:"<#if singleControl.getRemovePSControlAction()?? && singleControl.getRemovePSControlAction().getPSAppDEMethod()??>${singleControl.getRemovePSControlAction().getPSAppDEMethod().getCodeName()}</#if>",loaddraftAction:"<#if singleControl.getGetDraftPSControlAction()?? && singleControl.getGetDraftPSControlAction().getPSAppDEMethod()??>${singleControl.getGetDraftPSControlAction().getPSAppDEMethod().getCodeName()}</#if>",loadAction:"<#if singleControl.getGetPSControlAction()?? && singleControl.getGetPSControlAction().getPSAppDEMethod()??>${singleControl.getGetPSControlAction().getPSAppDEMethod().getCodeName()}</#if>",createAction:"<#if singleControl.getCreatePSControlAction()?? && singleControl.getCreatePSControlAction().getPSAppDEMethod()??>${singleControl.getCreatePSControlAction().getPSAppDEMethod().getCodeName()}</#if>",WFSubmitAction:"<#if singleControl.getWFSubmitPSControlAction()?? && singleControl.getWFSubmitPSControlAction().getPSAppDEMethod()??>${singleControl.getWFSubmitPSControlAction().getPSAppDEMethod().getCodeName()}</#if>",WFStartAction:"<#if singleControl.getWFStartPSControlAction()?? && singleControl.getWFStartPSControlAction().getPSAppDEMethod()??>${singleControl.getWFStartPSControlAction().getPSAppDEMethod().getCodeName()}</#if>"}<#if singleControl_has_next>,</#if>
</#if>
</#list>
</#if>
};
/**
* 计算激活表单
*
* @memberof ${srfclassname('${view.codeName}')}Base
*/
public computeActivedForm(inputForm:any){
if(!inputForm){
this.activeForm = this.allForm && Object.values(this.allForm)[0];
return;
}
if(this.allForm && Object.keys(this.allForm).length >0){
Object.keys(this.allForm).forEach((name:string) =>{
if(Object.is(name,<#noparse>`wfform_${inputForm.toLowerCase()}`</#noparse>)){
this.activeForm = this.allForm[name];
}
})
}
}
/**
* 确认
*
* @memberof ${srfclassname('${view.codeName}')}Base
*/
public onClickOk(){
let xData:any = this.$refs.form;
if(xData){
let preFormData:any = xData.getData();
let nextFormData:any = xData.transformData(preFormData);
Object.assign(preFormData,nextFormData);
this.$store.commit('viewaction/setViewDataChange', { viewtag: this.viewtag, viewdatachange: false });
this.$emit('viewdataschange', [preFormData]);
this.$emit('close', null);
}
}
/**
* 取消
*
* @memberof ${srfclassname('${view.codeName}')}Base
*/
public onClickCancel(){
this.$emit('close', null);
}
</#assign>
<#ibizinclude>
../@MACRO/VIEW-BASE.vue.ftl
</#ibizinclude>
\ No newline at end of file
${P.getLayoutCode().code}
\ No newline at end of file
<#ibizinclude>
../@MACRO/VIEW.vue.ftl
</#ibizinclude>
\ No newline at end of file
VIEWTYPE=DEMOBWFDYNAACTIONVIEW
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册