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

属性值规则

上级 df20d6e8
......@@ -323,13 +323,13 @@ import schema from 'async-validator';
* @param {{ name: string }} { name }
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public verifyDeRules(name:string) :{isPast:boolean,infoMessage:string}{
public verifyDeRules(name:string,rule:any = this.deRules) :{isPast:boolean,infoMessage:string}{
let falg = {isPast:true,infoMessage:""};
if(!this.deRules[name]){
if(!rule[name]){
return falg;
}
this.deRules[name].forEach((item:any) => {
if(item.type == 'SIMPLE' && this.data[name] != item.paramValue){
rule[name].forEach((item:any) => {
if(item.type == 'SIMPLE' && this.data[item.deName] != item.paramValue){
falg.isPast = false;
falg.infoMessage = item.ruleInfo;
}
......@@ -343,7 +343,9 @@ import schema from 'async-validator';
falg.isPast = false;
falg.infoMessage = item.ruleInfo;
}
}
if(item.type == 'GROUP'){
this.verifyDeRules('group',item)
}
});
return falg;
......
......@@ -30,36 +30,39 @@ ${navParam.getKey()}:<#if navParam.isRawValue()?? && navParam.isRawValue() == tr
<#-- 属性值规则 -->
<#macro getDeRule 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>",
ruleInfo:"<#if condItem.getRuleInfo?? && condItem.getRuleInfo()??>${condItem.getRuleInfo()}</#if>",
group:[
<#if condItem.getCondType?? && condItem.getCondType()?? && condItem.getCondType() == '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>",
<#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()},
</#if>
condOP:"<#if condItem.getCondOp?? && condItem.getCondOp()??>${condItem.getCondOp()}</#if>",
ruleInfo:"<#if condItem.getRuleInfo?? && condItem.getRuleInfo()??>${condItem.getRuleInfo()}</#if>",
group:[
<#if condItem.getCondType?? && condItem.getCondType()?? && condItem.getCondType() == '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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册