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

表单新增属性值规则

上级 ca9f4020
......@@ -262,6 +262,7 @@ import schema from 'async-validator';
<#if ctrl.getPSDEFormItemVRs()??>
<#list ctrl.getPSDEFormItemVRs() as fideValueRule>
<#if fideValueRule.getPSDEFormItemName() == formdetail.getName()>
<#-- 系统值规则 -->
<#if fideValueRule.getPSSysValueRule()??>
<#assign valueRule = fideValueRule.getPSSysValueRule()/>
<#if valueRule.getRuleType?? && valueRule.getRuleType()??>
......@@ -272,6 +273,12 @@ import schema from 'async-validator';
</#if>
</#if>
</#if>
<#-- 属性值规则 -->
<#if fideValueRule.getPSDEFValueRule?? && fideValueRule.getPSDEFValueRule()??>
<#assign deRule = fideValueRule.getPSDEFValueRule()/>
{validator:(rule:any, value:any)=>{return this.verifyDeRules("${fideValueRule.getPSDEFormItemName()}")},message: '<#if deRule.getRuleInfo?? && deRule.getRuleInfo()??>${deRule.getRuleInfo()}</#if>', trigger: 'change' },
{validator:(rule:any, value:any)=>{return this.verifyDeRules("${fideValueRule.getPSDEFormItemName()}")},message: '<#if deRule.getRuleInfo?? && deRule.getRuleInfo()??>${deRule.getRuleInfo()}</#if>', trigger: 'blur' },
</#if>
</#if>
</#list>
</#if>
......@@ -280,6 +287,40 @@ import schema from 'async-validator';
</#list>
}
/**
* 属性值规则
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public deRules:any = {
<#if ctrl.getPSDEFormItemVRs?? && ctrl.getPSDEFormItemVRs()??>
<#list ctrl.getPSDEFormItemVRs() as fideValueRule>
<#if fideValueRule.getPSDEFValueRule?? && fideValueRule.getPSDEFValueRule()??>
<#assign deRule = fideValueRule.getPSDEFValueRule()/>
<#if fideValueRule.getPSDEFormItemName?? && fideValueRule.getPSDEFormItemName()??>
${fideValueRule.getPSDEFormItemName()}:[],
</#if>
</#if>
</#list>
</#if>
};
/**
* 校验属性值规则
*
* @public
* @param {{ name: string }} { name }
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public verifyDeRules(name:string) :boolean{
let falg :boolean= false;
if(!this.deRules[name]){
return falg;
}
return falg;
}
/**
* 详情模型集合
*
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册