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

值规则校验

上级 bd8cf860
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<#if item.render??> <#if item.render??>
${item.render.code} ${item.render.code}
<#else> <#else>
<app-form-item :checkValue="this.data.${item.name}" v-show="detailsModel.${item.name}.visible" name='${item.name}' :itemRules="this.rules.${item.name}" class='<#if item.getPSSysCss?? && item.getPSSysCss()??>${item.getPSSysCss().getCssName()}</#if>'<#if item.getLabelPSSysCss?? && item.getLabelPSSysCss()??> labelStyle="${item.getLabelPSSysCss().getCssName()}"</#if> :caption="<#if langbase??>$t('${langbase}.details.${item.name}')<#else>'${item.getCaption()}'</#if>" uiStyle="${item.getDetailStyle()}" :labelWidth="${item.getLabelWidth()?c}" :isShowCaption="${item.isShowCaption()?c}" :error="detailsModel.${item.name}.error" :isEmptyCaption="${item.isEmptyCaption()?c}" labelPos="${item.getLabelPos()}"> <app-form-item ref="${item.name}rules" :checkValue="this.data.${item.name}" v-show="detailsModel.${item.name}.visible" name='${item.name}' :itemRules="this.rules.${item.name}" class='<#if item.getPSSysCss?? && item.getPSSysCss()??>${item.getPSSysCss().getCssName()}</#if>'<#if item.getLabelPSSysCss?? && item.getLabelPSSysCss()??> labelStyle="${item.getLabelPSSysCss().getCssName()}"</#if> :caption="<#if langbase??>$t('${langbase}.details.${item.name}')<#else>'${item.getCaption()}'</#if>" uiStyle="${item.getDetailStyle()}" :labelWidth="${item.getLabelWidth()?c}" :isShowCaption="${item.isShowCaption()?c}" :error="detailsModel.${item.name}.error" :isEmptyCaption="${item.isEmptyCaption()?c}" labelPos="${item.getLabelPos()}">
<#if item.isCompositeItem()> <#if item.isCompositeItem()>
<#assign formitems=item.getPSDEFormItems()> <#assign formitems=item.getPSDEFormItems()>
<app-range-editor v-model="data.${item.name}" :activeData="data" :disabled="detailsModel.${item.name}.disabled" name="${item.name}" editorType="${item.getEditorType()}" format="${item.getEditorParam("TIMEFMT","")}" :refFormItem="[<#list formitems as formitem><#if formitem_index gt 0>,</#if>'${formitem.name}'</#list>]" @formitemvaluechange="onFormItemValueChange" style="${item.getEditorCssStyle()}"></app-range-editor> <app-range-editor v-model="data.${item.name}" :activeData="data" :disabled="detailsModel.${item.name}.disabled" name="${item.name}" editorType="${item.getEditorType()}" format="${item.getEditorParam("TIMEFMT","")}" :refFormItem="[<#list formitems as formitem><#if formitem_index gt 0>,</#if>'${formitem.name}'</#list>]" @formitemvaluechange="onFormItemValueChange" style="${item.getEditorCssStyle()}"></app-range-editor>
......
...@@ -473,12 +473,23 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; ...@@ -473,12 +473,23 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
protected formValidateStatus(): boolean { protected formValidateStatus(): boolean {
const form: any = this.$refs.${ctrl.name}; <#-- const form: any = this.$refs.${ctrl.name};
let validatestate: boolean = true; let validatestate: boolean = true;
<#-- form.validate((valid: boolean) => { form.validate((valid: boolean) => {
validatestate = valid ? true : false; validatestate = valid ? true : false;
}); --> }); -->
return validatestate return this.cheackRules();
}
public cheackRules() :boolean{
let refArr = [<#list ctrl.getAllPSDEFormDetails() as formdetail><#if formdetail.getDetailType?? && formdetail.getDetailType() == 'FORMITEM'>"${formdetail.getName()}rules"</#if></#list>];
let falg = true ;
refArr.forEach((item:any) => {
if(this.$refs[item] && (this.$refs[item] as any).checkRule && !(this.$refs[item] as any).checkRule()){
falg = false;
}
});
return falg;
} }
/** /**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册