提交 579d42e4 编写于 作者: zcdtk's avatar zcdtk

表单及表单项调整

表单值规则校验,表单项输出模式
上级 d42d3736
......@@ -5,10 +5,35 @@
<#if item.render??>
${item.render.code}
<#else>
<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()}">
<app-form-item
name='${item.name}'
class='<#if item.getPSSysCss?? && item.getPSSysCss()??>${item.getPSSysCss().getCssName()}</#if>'
<#if item.getLabelPSSysCss?? && item.getLabelPSSysCss()??>
labelStyle="${item.getLabelPSSysCss().getCssName()}"
</#if>
uiStyle="${item.getDetailStyle()}"
labelPos="${item.getLabelPos()}"
ref="${item.name}_item"
:itemValue="this.data.${item.name}"
v-show="detailsModel.${item.name}.visible"
:itemRules="this.rules.${item.name}"
:caption="<#if langbase??>$t('${langbase}.details.${item.name}')<#else>'${item.getCaption()}'</#if>"
:labelWidth="${item.getLabelWidth()?c}"
:isShowCaption="${item.isShowCaption()?c}"
:error="detailsModel.${item.name}.error"
:isEmptyCaption="${item.isEmptyCaption()?c}">
<#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>
<app-range-editor
name="${item.name}"
editorType="${item.getEditorType()}"
format="${item.getEditorParam("TIMEFMT","")}"
style="${item.getEditorCssStyle()}"
v-model="data.${item.name}"
:activeData="data"
:disabled="detailsModel.${item.name}.disabled"
:refFormItem="[<#list formitems as formitem><#if formitem_index gt 0>,</#if>'${formitem.name}'</#list>]"
@formitemvaluechange="onFormItemValueChange"/>
<#else>
${P.getEditorCode(item, "EDITOR.vue").code}
</#if>
......
......@@ -482,19 +482,10 @@ import { toastController, alertController } from '@ionic/core';
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected formValidateStatus(): boolean {
<#-- const form: any = this.$refs.${ctrl.name};
let validatestate: boolean = true;
form.validate((valid: boolean) => {
validatestate = valid ? true : false;
}); -->
return this.cheackRules();
}
public cheackRules() :boolean{
let refArr: Array<string> = [<#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()){
const refArr: Array<string> = [<#list ctrl.getPSDEFormItems() as formItem><#if formItem.getEditorType?? && formItem.getEditorType() != 'HIDDEN'>'${formItem.getName()}_item', </#if></#list>];
let falg = true;
refArr.forEach((item: any) => {
if (this.$refs[item] && (this.$refs[item] as any).validateRules && !(this.$refs[item] as any).validateRules()) {
falg = false;
}
});
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册