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

调整表格主信息保存

上级 1e422b99
...@@ -27,6 +27,15 @@ ...@@ -27,6 +27,15 @@
<#if dataitem.getPSDEField()??> <#if dataitem.getPSDEField()??>
prop: '${dataitem.getPSDEField().getCodeName()?lower_case}', prop: '${dataitem.getPSDEField().getCodeName()?lower_case}',
dataType: '${dataitem.getPSDEField().getDataType()}', dataType: '${dataitem.getPSDEField().getDataType()}',
</#if>
<#if ctrl.getPSDEGridEditItems()??>
<#list ctrl.getPSDEGridEditItems() as editItem>
<#if editItem.getName() == dataitem.getName()>
<#if editItem.isEditable()>
isEditable:${editItem.isEditable()?c}
</#if>
</#if>
</#list>
</#if> </#if>
}, },
</#list> </#list>
......
...@@ -361,7 +361,7 @@ import ${srfclassname('${aggAppDataEntity.getCodeName()}')}Service from '@/servi ...@@ -361,7 +361,7 @@ import ${srfclassname('${aggAppDataEntity.getCodeName()}')}Service from '@/servi
* @param {*} [data={}] * @param {*} [data={}]
* @param {boolean} [isloading] * @param {boolean} [isloading]
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof MainService * @memberof ${srfclassname('${ctrl.codeName}')}Service
*/ */
@Errorlog @Errorlog
public frontLogic(action:string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> { public frontLogic(action:string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
...@@ -383,6 +383,42 @@ import ${srfclassname('${aggAppDataEntity.getCodeName()}')}Service from '@/servi ...@@ -383,6 +383,42 @@ import ${srfclassname('${aggAppDataEntity.getCodeName()}')}Service from '@/servi
}) })
} }
/**
* 处理请求数据
*
* @param action 行为
* @param data 数据
* @memberof ${srfclassname('${ctrl.codeName}')}Service
*/
public handleRequestData(action: string,context:any ={},data: any = {},isMerge:boolean = false){
let model: any = this.getMode();
if (!model && model.getDataItems instanceof Function) {
return data;
}
let dataItems: any[] = model.getDataItems();
let requestData:any = {};
if(isMerge && (data && data.viewparams)){
Object.assign(requestData,data.viewparams);
}
dataItems.forEach((item:any) =>{
if(item && item.dataType && Object.is(item.dataType,'FONTKEY')){
if(item && item.prop && item.name ){
requestData[item.prop] = context[item.name];
}
}else{
if(item && item.isEditable && item.prop && item.name && (data[item.name] || Object.is(data[item.name],0)) ){
requestData[item.prop] = data[item.name];
}
}
});
let tempContext:any = JSON.parse(JSON.stringify(context));
if(tempContext && tempContext.srfsessionid){
tempContext.srfsessionkey = tempContext.srfsessionid;
delete tempContext.srfsessionid;
}
return {context:tempContext,data:requestData};
}
<#ibizinclude> <#ibizinclude>
../@MACRO/SERVICE/SERVICE_BOTTOM.ts.ftl ../@MACRO/SERVICE/SERVICE_BOTTOM.ts.ftl
</#ibizinclude> </#ibizinclude>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册