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

代码格式

上级 07c6cfb4
......@@ -304,12 +304,13 @@ import schema from 'async-validator';
<#if fideValueRule.getCheckMode?? && fideValueRule.getCheckMode()?? && fideValueRule.getCheckMode() != 2 && fideValueRule.getPSDEFValueRule?? && fideValueRule.getPSDEFValueRule()??>
<#assign deRule = fideValueRule.getPSDEFValueRule()/>
<#if fideValueRule.getPSDEFormItemName?? && fideValueRule.getPSDEFormItemName()??>
${fideValueRule.getPSDEFormItemName()}:[
${fideValueRule.getPSDEFormItemName()}:[
<#if deRule.getPSDEFVRGroupCondition?? && deRule.getPSDEFVRGroupCondition()?? && deRule.getPSDEFVRGroupCondition().getPSDEFVRConditions?? && deRule.getPSDEFVRGroupCondition().getPSDEFVRConditions()??>
<#list deRule.getPSDEFVRGroupCondition().getPSDEFVRConditions() as condItem>
<@getDeRule condItem />
</#list>
</#if>],
</#if>
],
</#if>
</#if>
</#list>
......@@ -329,14 +330,17 @@ import schema from 'async-validator';
return falg;
}
rule[name].forEach((item:any) => {
// 常规规则
if(item.type == 'SIMPLE' && this.data[this.service.getItemNameByDeName(item.deName)] != item.paramValue){
falg.isPast = false;
falg.infoMessage = item.ruleInfo;
}
// 正则式
if(item.type == 'REGEX' && (item.isNotMode? item.RegExCode.test(this.data[name]) : !item.RegExCode.test(this.data[name]))){
falg.isPast = false;
falg.infoMessage = item.ruleInfo;
}
// 长度
if(item.type == 'STRINGLENGTH' ){
let valueLength :number = this.data[name]?this.data[name].length:0;
if(item.isNotMode? valueLength > item.minValue && valueLength < item.maxValue : !(valueLength > item.minValue && valueLength < item.maxValue)){
......@@ -344,6 +348,7 @@ import schema from 'async-validator';
falg.infoMessage = item.ruleInfo;
}
}
// 分组
if(item.type == 'GROUP'){
falg = this.verifyDeRules('group',item)
}
......
......@@ -30,47 +30,47 @@ ${navParam.getKey()}:<#if navParam.isRawValue()?? && navParam.isRawValue() == tr
<#-- 属性值规则 -->
<#macro getDeRule condItem>
{
type:"<#if condItem.getCondType?? && condItem.getCondType()??>${condItem.getCondType()}</#if>",
condOP:"<#if condItem.getCondOp?? && condItem.getCondOp()??>${condItem.getCondOp()}</#if>",
ruleInfo:"<#if condItem.getRuleInfo?? && condItem.getRuleInfo()??>${condItem.getRuleInfo()}</#if>",
isKeyCond:<#if condItem.isKeyCond?? && condItem.isKeyCond()??>${condItem.isKeyCond()?c}</#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>
<#if condItem.getDEFName?? && condItem.getDEFName()??>
deName:"${condItem.getDEFName()?lower_case}",
</#if>
<#if condItem.isIncludeMaxValue?? && condItem.isIncludeMaxValue()??>
isIncludeMaxValue:${condItem.isIncludeMaxValue()?c},
</#if>
<#if condItem.isIncludeMinValue?? && condItem.isIncludeMinValue()??>
isIncludeMinValue:${condItem.isIncludeMinValue()?c},
</#if>
<#if condItem.getCondType?? && condItem.getCondType()?? && condItem.getCondType() == 'GROUP'>
group:[
<#if condItem.getPSDEFVRConditions?? && condItem.getPSDEFVRConditions()??>
<#list condItem.getPSDEFVRConditions() as group_item>
<@getDeRule group_item />
</#list>
</#if>
]
</#if>
},
{
type:"<#if condItem.getCondType?? && condItem.getCondType()??>${condItem.getCondType()}</#if>",
condOP:"<#if condItem.getCondOp?? && condItem.getCondOp()??>${condItem.getCondOp()}</#if>",
ruleInfo:"<#if condItem.getRuleInfo?? && condItem.getRuleInfo()??>${condItem.getRuleInfo()}</#if>",
isKeyCond:<#if condItem.isKeyCond?? && condItem.isKeyCond()??>${condItem.isKeyCond()?c}</#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>
<#if condItem.getDEFName?? && condItem.getDEFName()??>
deName:"${condItem.getDEFName()?lower_case}",
</#if>
<#if condItem.isIncludeMaxValue?? && condItem.isIncludeMaxValue()??>
isIncludeMaxValue:${condItem.isIncludeMaxValue()?c},
</#if>
<#if condItem.isIncludeMinValue?? && condItem.isIncludeMinValue()??>
isIncludeMinValue:${condItem.isIncludeMinValue()?c},
</#if>
<#if condItem.getCondType?? && condItem.getCondType()?? && condItem.getCondType() == 'GROUP'>
group:[
<#if condItem.getPSDEFVRConditions?? && condItem.getPSDEFVRConditions()??>
<#list condItem.getPSDEFVRConditions() as group_item>
<@getDeRule group_item />
</#list>
</#if>
]
</#if>
},
</#macro>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册