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

规则调整

上级 48d9c5da
......@@ -329,37 +329,35 @@ import schema from 'async-validator';
return falg;
}
rule[name].forEach((item:any) => {
let dataValue = item.deName?this.data[this.service.getItemNameByDeName(item.deName)]:"";
if(!falg.isPast){
return falg;
}
// 常规规则
if(item.type == 'SIMPLE'){
falg.isPast = this.$verify.checkFieldSimpleRule(this.data[this.service.getItemNameByDeName(item.deName)],item.condOP,item.paramValue,item.ruleInfo,item.paramType,{},item.isKeyCond);
falg.infoMessage = item.ruleInfo;
falg.isPast = !this.$verify.checkFieldSimpleRule(dataValue,item.condOP,item.paramValue,item.ruleInfo,item.paramType,{},item.isKeyCond);
}
// 数值范围
if(item.type == 'VALUERANGE2'){
falg.isPast = !this.$verify.checkFieldValueRangeRule(this.data[this.service.getItemNameByDeName(item.deName)],item.minValue,item.isIncludeMinValue,item.maxValue,item.isIncludeMaxValue,item.ruleInfo,item.isKeyCond);
falg.infoMessage = item.ruleInfo;
falg.isPast = !this.$verify.checkFieldValueRangeRule(dataValue,item.minValue,item.isIncludeMinValue,item.maxValue,item.isIncludeMaxValue,item.ruleInfo,item.isKeyCond);
}
// 正则式
if (item.type == "REGEX") {
falg.isPast = !this.$verify.checkFieldRegExRule(this.data[this.service.getItemNameByDeName(item.deName)],item.RegExCode,item.ruleInfo,item.isKeyCond);
falg.infoMessage = item.ruleInfo;
falg.isPast = !this.$verify.checkFieldRegExRule(dataValue,item.regExCode,item.ruleInfo,item.isKeyCond);
}
// 长度
if (item.type == "STRINGLENGTH") {
falg.isPast = !this.$verify.checkFieldStringLengthRule(this.data[this.service.getItemNameByDeName(item.deName)],item.minValue,item.isIncludeMinValue,item.maxValue,item.isIncludeMaxValue,item.ruleInfo,item.isKeyCond);
falg.infoMessage = item.ruleInfo;
falg.isPast = !this.$verify.checkFieldStringLengthRule(dataValue,item.minValue,item.isIncludeMinValue,item.maxValue,item.isIncludeMaxValue,item.ruleInfo,item.isKeyCond);
}
// 系统值规则
if(item.type == "SYSVALUERULE") {
falg.isPast = !this.$verify.checkFieldSysValueRule(this.data[this.service.getItemNameByDeName(item.deName)],item.sysRule.RegExCode,item.ruleInfo,item.isKeyCond);
falg.isPast = !this.$verify.checkFieldSysValueRule(dataValue,item.sysRule.regExCode,item.ruleInfo,item.isKeyCond);
}
// 分组
if(item.type == 'GROUP'){
falg = this.verifyDeRules('group',item)
}
falg.infoMessage = item.ruleInfo;
});
return falg;
}
......
......@@ -45,7 +45,7 @@ ${navParam.getKey()}:<#if navParam.isRawValue()?? && navParam.isRawValue() == tr
isNotMode:${condItem.isNotMode()?c},
</#if>
<#if condItem.getRegExCode?? && condItem.getRegExCode()??>
RegExCode:/${condItem.getRegExCode()}/,
regExCode:/${condItem.getRegExCode()}/,
</#if>
<#if condItem.getMaxValue?? && condItem.getMaxValue()??>
maxValue:${condItem.getMaxValue()?c},
......@@ -67,7 +67,9 @@ ${navParam.getKey()}:<#if navParam.isRawValue()?? && navParam.isRawValue() == tr
sysRule:{
ruleType:"<#if valRule.getRuleType?? && valRule.getRuleType()??>${valRule.getRuleType()}</#if>",
ruleInfo:"<#if valRule.getRuleInfo?? && valRule.getRuleInfo()??>${valRule.getRuleInfo()}</#if>",
<#if valRule.getRegExCode?? && valRule.getRegExCode()??>regExCode:/${valRule.getRegExCode()}/,</#if>
<#if valRule.getRegExCode?? && valRule.getRegExCode()??>
regExCode:/${valRule.getRegExCode()}/,
</#if>
},
</#if>
<#if condItem.getCondType?? && condItem.getCondType()?? && condItem.getCondType() == 'GROUP'>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册