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

适配表单数据对象方式新建、更新默认值

上级 39bc88a5
......@@ -31,6 +31,14 @@ import ${srfclassname('${_appde.getCodeName()}')}Service from '@/service/${srffi
</#if>
</#list>
/**
* 远端数据
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Service
*/
private remoteCopyData:any = {};
/**
* 处理数据
*
......@@ -287,6 +295,7 @@ import ${srfclassname('${_appde.getCodeName()}')}Service from '@/service/${srffi
result = this.appEntityService.Get(Context,Data, isloading);
}
result.then((response) => {
this.setRemoteCopyData(response);
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
......@@ -323,6 +332,7 @@ import ${srfclassname('${_appde.getCodeName()}')}Service from '@/service/${srffi
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
this.setRemoteCopyData(response);
<#if ctrl.getControlType() != 'SEARCHFORM'>
response.data.${appde.getKeyPSAppDEField().getCodeName()?lower_case} = PrimaryKey;
</#if>
......@@ -459,7 +469,26 @@ import ${srfclassname('${_appde.getCodeName()}')}Service from '@/service/${srffi
return item;
}
/**
* 设置远端数据
*
* @param result 远端请求结果
* @memberof ${srfclassname('${ctrl.codeName}')}Service
*/
public setRemoteCopyData(result:any){
if (result && result.status === 200) {
this.remoteCopyData = Util.deepCopy(result.data);
}
}
/**
* 获取远端数据
*
* @memberof ${srfclassname('${ctrl.codeName}')}Service
*/
public getRemoteCopyData(){
return this.remoteCopyData;
}
<#ibizinclude>
./SERVICE_BOTTOM.ts.ftl
</#ibizinclude>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册