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

规则调整

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