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

值规则

上级 5161db9b
......@@ -5,7 +5,7 @@
<#if item.render??>
${item.render.code}
<#else>
<app-form-item 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 :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()>
<#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>
......
......@@ -1272,29 +1272,6 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
</#if>
</#if>
/**
* 值规则校验
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public checkRule(name:string,event:string){
let erro_text :any = "";
let checkValue = this.data[name];
this.rules[name].forEach((item:any)=>{
if(item.hasOwnProperty('pattern') && item.trigger == event && checkValue){
let pattern: any = item.pattern;
if(!pattern.test(checkValue)){
erro_text = item.message;
}
}
if(item.hasOwnProperty('required') && item.trigger == event){
if(item.required && !checkValue){
erro_text = item.message;
}
}
});
this.detailsModel[name].error = erro_text;
}
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
......
<app-mob-input class="app-form-item-input" @blur="()=>{this.checkRule('${editor.name}','blur')}" @change="($event)=>{this.data.${editor.name} = $event;this.checkRule('${editor.name}','change')}" :type="'text'" :value="data.${editor.name}" :disabled="detailsModel.${editor.name}.disabled" <#if editor.getPlaceHolder()??> placeholder="${editor.getPlaceHolder()}"</#if>></app-mob-input>
\ No newline at end of file
<app-mob-input class="app-form-item-input" @change="($event)=>this.data.${editor.name} = $event" :type="'text'" :value="data.${editor.name}" :disabled="detailsModel.${editor.name}.disabled" <#if editor.getPlaceHolder()??> placeholder="${editor.getPlaceHolder()}"</#if>></app-mob-input>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册