提交 e1af0162 编写于 作者: KK's avatar KK

还原属性值规则

上级 93d1549e
...@@ -273,12 +273,6 @@ import schema from 'async-validator'; ...@@ -273,12 +273,6 @@ import schema from 'async-validator';
</#if> </#if>
</#if> </#if>
</#if> </#if>
<#-- 属性值规则 -->
<#if fideValueRule.getPSDEFValueRule?? && fideValueRule.getPSDEFValueRule()??>
<#assign deRule = fideValueRule.getPSDEFValueRule()/>
{validator:(rule:any, value:any)=>{return this.verifyDeRules("${fideValueRule.getPSDEFormItemName()}")},message: '<#if deRule.getRuleInfo?? && deRule.getRuleInfo()??>${deRule.getRuleInfo()}</#if>', trigger: 'change' },
{validator:(rule:any, value:any)=>{return this.verifyDeRules("${fideValueRule.getPSDEFormItemName()}")},message: '<#if deRule.getRuleInfo?? && deRule.getRuleInfo()??>${deRule.getRuleInfo()}</#if>', trigger: 'blur' },
</#if>
</#if> </#if>
</#list> </#list>
</#if> </#if>
...@@ -287,64 +281,6 @@ import schema from 'async-validator'; ...@@ -287,64 +281,6 @@ import schema from 'async-validator';
</#list> </#list>
} }
/**
* 属性值规则
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public deRules:any = {
<#if ctrl.getPSDEFormItemVRs?? && ctrl.getPSDEFormItemVRs()??>
<#list ctrl.getPSDEFormItemVRs() as fideValueRule>
<#if fideValueRule.getPSDEFValueRule?? && fideValueRule.getPSDEFValueRule()??>
<#assign deRule = fideValueRule.getPSDEFValueRule()/>
<#if fideValueRule.getPSDEFormItemName?? && fideValueRule.getPSDEFormItemName()??>
${fideValueRule.getPSDEFormItemName()}:[
<#if deRule.getPSDEFVRGroupCondition?? && deRule.getPSDEFVRGroupCondition()?? && deRule.getPSDEFVRGroupCondition().getPSDEFVRConditions?? && deRule.getPSDEFVRGroupCondition().getPSDEFVRConditions()??>
<#list deRule.getPSDEFVRGroupCondition().getPSDEFVRConditions() as condItem>
{
type:"<#if condItem.getCondType?? && condItem.getCondType()??>${condItem.getCondType()}</#if>",
<#if condItem.getParamValue?? && condItem.getParamValue()??>paramValue:"${condItem.getParamValue()}",</#if>
<#if condItem.getParamType?? && condItem.getParamType()??>paramType:"${condItem.getParamType()}",</#if>
<#if condItem.isNotMode?? && condItem.isNotMode()??>isNotMode:${condItem.isNotMode()?c},</#if>
<#if condItem.getRegExCode?? && condItem.getRegExCode()??>RegExCode:/${condItem.getRegExCode()}/,</#if>
<#if condItem.getMaxValue?? && condItem.getMaxValue()??>maxValue:${condItem.getMaxValue()?c},</#if>
<#if condItem.getMinValue?? && condItem.getMinValue()??>minValue:${condItem.getMinValue()?c},</#if>
condOP:"<#if condItem.getCondOP?? && condItem.getCondOP()??>${condItem.getCondOP()}</#if>",
},
</#list>
</#if>],
</#if>
</#if>
</#list>
</#if>
};
/**
* 校验属性值规则
*
* @public
* @param {{ name: string }} { name }
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public verifyDeRules(name:string) :boolean{
let falg :boolean= true;
if(!this.deRules[name]){
return falg;
}
this.deRules[name].forEach((item:any) => {
if(item.type == 'SIMPLE' && this.data[name] != item.paramValue){
falg = false;
}
if(item.type == 'REGEX' && (item.isNotMode? item.RegExCode.test(this.data[name]) : !item.RegExCode.test(this.data[name]))){
falg = false;
}
if(item.type == 'STRINGLENGTH' && (item.isNotMode? this.data[name].length > item.minValue && this.data[name].length < item.maxValue : !(this.data[name].length > item.minValue && this.data[name].length < item.maxValue))){
falg = false;
}
});
return falg;
}
/** /**
* 详情模型集合 * 详情模型集合
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册