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

zpc --- 补充更新默认值

上级 20b3a22a
......@@ -416,6 +416,9 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
if(Object.is(action,'loadDraft')){
this.createDefault();
}
if(Object.is(action,'load')){
this.updateDefault();
}
this.$nextTick(function () {
this.ignorefieldvaluechange = false;
})
......@@ -1404,6 +1407,40 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
</#list>
}
/**
* 更新默认值
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public updateDefault(){
<#list ctrl.getAllPSDEFormDetails() as formdetail><#t>
<#if formdetail.getUpdateDV?? && formdetail.getUpdateDV()??><#t>
<#if !(formdetail.getUpdateDVT() == '')><#t>
if (this.data.hasOwnProperty('${formdetail.getCodeName()?lower_case}') && !this.data.${formdetail.getCodeName()?lower_case}) {
<#-- 网页请求 -->
<#if formdetail.getUpdateDVT() == 'CONTEXT'>
this.data['${formdetail.getCodeName()?lower_case}'] = this.viewparams['${formdetail.getUpdateDV()}'];
<#-- 用户全局对象 -->
<#elseif formdetail.getUpdateDVT() == 'SESSION'>
this.data['${formdetail.getCodeName()?lower_case}'] = this.context['${formdetail.getUpdateDV()}'];
<#-- 当前应用数据 -->
<#elseif formdetail.getUpdateDVT() == 'APPDATA'>
this.data['${formdetail.getCodeName()?lower_case}'] = this.context['${formdetail.getUpdateDV()}'];
<#-- 当前操作用户(名称) -->
<#elseif formdetail.getUpdateDVT() == 'OPERATORNAME'>
this.data['${formdetail.getCodeName()?lower_case}'] = this.context['srfusername'];
<#-- 当前操作用户(编号) -->
<#elseif formdetail.getUpdateDVT() == 'OPERATOR'>
this.data['${formdetail.getCodeName()?lower_case}'] = this.context['srfuserid'];
<#else>
<#-- 默认值 -->
this.data['${formdetail.getCodeName()?lower_case}'] = '${formdetail.getUpdateDV()}';
</#if>
}
</#if>
</#if>
</#list>
}
<#-- 搜索表单:Begin -->
<#if ctrl.getControlType() == 'SEARCHFORM'>
<#if ctrl.getSearchButtonStyle() == 'DEFAULT'>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册