提交 30008942 编写于 作者: WodahsOrez's avatar WodahsOrez

lxm--表格新建默认值

上级 d3159dbe
......@@ -1609,6 +1609,7 @@ import { FormItemModel } from '@/model/form-detail';
return;
}
const data = response.data;
this.createDefault(data);
data.rowDataState = "create";
_this.items.push(data);
_this.gridItemsModel.push(_this.getGridRowModel());
......@@ -1725,6 +1726,42 @@ import { FormItemModel } from '@/model/form-detail';
});
return isSelected ? "grid-selected-row" : "";
}
/**
* 新建默认值
* @param {*} row 行数据
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public createDefault(row: any){
<#list ctrl.getAllPSDEFormDetails() as formdetail><#t>
<#if formdetail.getCreateDV?? && formdetail.getCreateDV()??><#t>
<#if !(formdetail.getCreateDV() == '')><#t>
if (row.hasOwnProperty('${formdetail.getCodeName()?lower_case}')) {
<#-- 网页请求 -->
<#if formdetail.getCreateDVT() == 'CONTEXT'>
row['${formdetail.getCodeName()?lower_case}'] = this.viewparams['${formdetail.getCreateDV()}'];
<#-- 用户全局对象 -->
<#elseif formdetail.getCreateDVT() == 'SESSION'>
row['${formdetail.getCodeName()?lower_case}'] = this.context['${formdetail.getCreateDV()}'];
<#-- 当前应用数据 -->
<#elseif formdetail.getCreateDVT() == 'APPDATA'>
row['${formdetail.getCodeName()?lower_case}'] = this.context['${formdetail.getCreateDV()}'];
<#-- 当前操作用户(名称) -->
<#elseif formdetail.getCreateDVT() == 'OPERATORNAME'>
row['${formdetail.getCodeName()?lower_case}'] = this.context['srfusername'];
<#-- 当前操作用户(编号) -->
<#elseif formdetail.getCreateDVT() == 'OPERATOR'>
row['${formdetail.getCodeName()?lower_case}'] = this.context['srfuserid'];
<#else>
<#-- 默认值 -->
<#assign datatype=srfjavatype(formdetail.getStdDataType())>
row['${formdetail.getCodeName()?lower_case}'] = <#if datatype=='BigInteger' || datatype=='Integer' || datatype=='Double' || datatype=='Decimal' || datatype=='Float' || datatype=='BigDecimal'>${formdetail.getCreateDV()}<#else>'${formdetail.getCreateDV()}'</#if>;
</#if>
}
</#if>
</#if>
</#list>
}
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册