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

属性值规则

上级 df20d6e8
...@@ -323,13 +323,13 @@ import schema from 'async-validator'; ...@@ -323,13 +323,13 @@ import schema from 'async-validator';
* @param {{ name: string }} { name } * @param {{ name: string }} { name }
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @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:""}; let falg = {isPast:true,infoMessage:""};
if(!this.deRules[name]){ if(!rule[name]){
return falg; return falg;
} }
this.deRules[name].forEach((item:any) => { rule[name].forEach((item:any) => {
if(item.type == 'SIMPLE' && this.data[name] != item.paramValue){ if(item.type == 'SIMPLE' && this.data[item.deName] != item.paramValue){
falg.isPast = false; falg.isPast = false;
falg.infoMessage = item.ruleInfo; falg.infoMessage = item.ruleInfo;
} }
...@@ -343,7 +343,9 @@ import schema from 'async-validator'; ...@@ -343,7 +343,9 @@ import schema from 'async-validator';
falg.isPast = false; falg.isPast = false;
falg.infoMessage = item.ruleInfo; falg.infoMessage = item.ruleInfo;
} }
}
if(item.type == 'GROUP'){
this.verifyDeRules('group',item)
} }
}); });
return falg; return falg;
......
...@@ -30,36 +30,39 @@ ${navParam.getKey()}:<#if navParam.isRawValue()?? && navParam.isRawValue() == tr ...@@ -30,36 +30,39 @@ ${navParam.getKey()}:<#if navParam.isRawValue()?? && navParam.isRawValue() == tr
<#-- 属性值规则 --> <#-- 属性值规则 -->
<#macro getDeRule condItem> <#macro getDeRule condItem>
{ {
type:"<#if condItem.getCondType?? && condItem.getCondType()??>${condItem.getCondType()}</#if>", type:"<#if condItem.getCondType?? && condItem.getCondType()??>${condItem.getCondType()}</#if>",
<#if condItem.getParamValue?? && condItem.getParamValue()??> <#if condItem.getParamValue?? && condItem.getParamValue()??>
paramValue:"${condItem.getParamValue()}", paramValue:"${condItem.getParamValue()}",
</#if> </#if>
<#if condItem.getParamType?? && condItem.getParamType()??> <#if condItem.getParamType?? && condItem.getParamType()??>
paramType:"${condItem.getParamType()}", paramType:"${condItem.getParamType()}",
</#if> </#if>
<#if condItem.isNotMode?? && condItem.isNotMode()??> <#if condItem.isNotMode?? && condItem.isNotMode()??>
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},
</#if> </#if>
<#if condItem.getMinValue?? && condItem.getMinValue()??> <#if condItem.getMinValue?? && condItem.getMinValue()??>
minValue:${condItem.getMinValue()?c}, minValue:${condItem.getMinValue()?c},
</#if> </#if>
condOP:"<#if condItem.getCondOp?? && condItem.getCondOp()??>${condItem.getCondOp()}</#if>", <#if condItem.getDEFName?? && condItem.getDEFName()??>
ruleInfo:"<#if condItem.getRuleInfo?? && condItem.getRuleInfo()??>${condItem.getRuleInfo()}</#if>", deName:${condItem.getDEFName()},
group:[ </#if>
<#if condItem.getCondType?? && condItem.getCondType()?? && condItem.getCondType() == 'GROUP'> condOP:"<#if condItem.getCondOp?? && condItem.getCondOp()??>${condItem.getCondOp()}</#if>",
<#if condItem.getPSDEFVRConditions?? && condItem.getPSDEFVRConditions()??> ruleInfo:"<#if condItem.getRuleInfo?? && condItem.getRuleInfo()??>${condItem.getRuleInfo()}</#if>",
<#list condItem.getPSDEFVRConditions() as group_item> group:[
<@getDeRule group_item /> <#if condItem.getCondType?? && condItem.getCondType()?? && condItem.getCondType() == 'GROUP'>
</#list> <#if condItem.getPSDEFVRConditions?? && condItem.getPSDEFVRConditions()??>
</#if> <#list condItem.getPSDEFVRConditions() as group_item>
</#if> <@getDeRule group_item />
] </#list>
}, </#if>
</#if>
]
},
</#macro> </#macro>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册