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

表单值规则常规规则修复

上级 82f72cac
...@@ -389,27 +389,6 @@ import ${srfclassname('${_appde.getCodeName()}')}Service from '@/service/${srffi ...@@ -389,27 +389,6 @@ import ${srfclassname('${_appde.getCodeName()}')}Service from '@/service/${srffi
return {context:tempContext,data:requestData}; return {context:tempContext,data:requestData};
} }
/**
* 通过属性名称获取表单项名称
*
* @param name 实体属性名称
* @memberof ${srfclassname('${ctrl.codeName}')}Service
*/
public getItemNameByDeName(name:string) :string{
let itemName = name;
let mode: any = this.getMode();
if (!mode && mode.getDataItems instanceof Function) {
return name;
}
let formItemItems: any[] = mode.getDataItems();
formItemItems.forEach((item:any)=>{
if(item.prop === name){
itemName = item.name;
}
});
return itemName.trim();
}
<#ibizinclude> <#ibizinclude>
./SERVICE_BOTTOM.ts.ftl ./SERVICE_BOTTOM.ts.ftl
</#ibizinclude> </#ibizinclude>
\ No newline at end of file
...@@ -341,10 +341,10 @@ import schema from 'async-validator'; ...@@ -341,10 +341,10 @@ import schema from 'async-validator';
} }
} }
rule[name].forEach((item:any) => { rule[name].forEach((item:any) => {
let dataValue = item.deName?this.data[this.service.getItemNameByDeName(item.deName)]:""; let dataValue = this.data[name];
// 常规规则 // 常规规则
if(item.type == 'SIMPLE'){ if(item.type == 'SIMPLE'){
startOp(!this.$verify.checkFieldSimpleRule(dataValue,item.condOP,item.paramValue,item.ruleInfo,item.paramType,{},item.isKeyCond)); startOp(!this.$verify.checkFieldSimpleRule(dataValue,item.condOP,item.paramValue,item.ruleInfo,item.paramType,this.data,item.isKeyCond));
falg.infoMessage = item.ruleInfo; falg.infoMessage = item.ruleInfo;
} }
// 数值范围 // 数值范围
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册