提交 cc1f4e20 编写于 作者: RedPig97's avatar RedPig97

update: 表单项值格式化优化

上级 7857df76
......@@ -326,8 +326,8 @@ import { Environment } from '@/environments/environment';
<#list ctrl.getAllPSDEFormDetails() as formdetail>
<#if formdetail.getDetailType?? && formdetail.getDetailType() == 'FORMITEM' && formdetail.getEditorType() != "HIDDEN" && formdetail.isCompositeItem?? && !formdetail.isCompositeItem()>
${formdetail.getName()}: [
{ required: this.detailsModel.${formdetail.getName()}.required, type: '<#assign datatype=srfjavatype(formdetail.getStdDataType())><#if datatype=='BigInteger' || datatype=='Integer' || datatype=='Double' || datatype=='Decimal' || datatype=='Float' || datatype=='BigDecimal'>number<#else>string</#if>', message: '${formdetail.getCaption()} 值不能为空', trigger: 'change' },
{ required: this.detailsModel.${formdetail.getName()}.required, type: '<#assign datatype=srfjavatype(formdetail.getStdDataType())><#if datatype=='BigInteger' || datatype=='Integer' || datatype=='Double' || datatype=='Decimal' || datatype=='Float' || datatype=='BigDecimal'>number<#else>string</#if>', message: '${formdetail.getCaption()} 值不能为空', trigger: 'blur' },
{ required: this.detailsModel.${formdetail.getName()}.required, type: '<#assign datatype=srfjavatype(formdetail.getStdDataType())><#if datatype=='BigInteger' || datatype=='Integer' || datatype=='Double' || datatype=='Decimal' || datatype=='Float' || datatype=='BigDecimal'>number<#else>string</#if>', message: `<#if formdetail.getPSDEGridColumn()?? && formdetail.getPSDEGridColumn().getCapPSLanguageRes()??><#noparse>${</#noparse>this.$t('${formdetail.getPSDEGridColumn().getCapPSLanguageRes().getLanResTag()}', '${formdetail.getPSDEGridColumn().getCaption()}')<#noparse>}</#noparse><#noparse>${</#noparse>this.$t('app.commonWords.valueNotEmpty')<#noparse>}</#noparse><#else><#noparse>${</#noparse>this.$t('app.commonWords.valueNotEmpty')<#noparse>}</#noparse></#if>`, trigger: 'change' },
{ required: this.detailsModel.${formdetail.getName()}.required, type: '<#assign datatype=srfjavatype(formdetail.getStdDataType())><#if datatype=='BigInteger' || datatype=='Integer' || datatype=='Double' || datatype=='Decimal' || datatype=='Float' || datatype=='BigDecimal'>number<#else>string</#if>', message: `<#if formdetail.getPSDEGridColumn()?? && formdetail.getPSDEGridColumn().getCapPSLanguageRes()??><#noparse>${</#noparse>this.$t('${formdetail.getPSDEGridColumn().getCapPSLanguageRes().getLanResTag()}', '${formdetail.getPSDEGridColumn().getCaption()}')<#noparse>}</#noparse><#noparse>${</#noparse>this.$t('app.commonWords.valueNotEmpty')<#noparse>}</#noparse><#else><#noparse>${</#noparse>this.$t('app.commonWords.valueNotEmpty')<#noparse>}</#noparse></#if>`, trigger: 'blur' },
<#if formdetail.getEditorType?? && formdetail.getEditorType()?? && formdetail.isAllowEmpty?? && formdetail.isAllowEmpty()??>
<#if formdetail.getEditorType() == 'CHECKBOX' && !formdetail.isAllowEmpty()>
{ validator: (rule:any, value:any, callback:any) => {
......@@ -349,7 +349,7 @@ import { Environment } from '@/environments/environment';
<#if valueRule.getRuleType() == "REG">
{ <#if valueRule.getRegExCode?? && valueRule.getRegExCode()??>pattern: /${valueRule.getRegExCode()}/</#if><#if valueRule.getRuleInfo?? && valueRule.getRuleInfo()??>, message: '${valueRule.getRuleInfo()}'</#if>, trigger: 'change' },
<#elseif valueRule.getRuleType() == "SCRIPT">
{ <#if valueRule.getScriptCode?? && valueRule.getScriptCode()??>validator: (rule:any, value:any, callback:any) => { if (value === '' || value === null || value === undefined) { rule.message = '${formdetail.getCaption()} 值不能为空'; return false; } ${valueRule.getScriptCode()} }</#if><#if valueRule.getRuleInfo?? && valueRule.getRuleInfo()??>, message: '${valueRule.getRuleInfo()}'</#if>, trigger: 'change' },
{ <#if valueRule.getScriptCode?? && valueRule.getScriptCode()??>validator: (rule:any, value:any, callback:any) => { if (value === '' || value === null || value === undefined) { rule.message = `<#if formdetail.getPSDEGridColumn()?? && formdetail.getPSDEGridColumn().getCapPSLanguageRes()??><#noparse>${</#noparse>this.$t('${formdetail.getPSDEGridColumn().getCapPSLanguageRes().getLanResTag()}', '${formdetail.getPSDEGridColumn().getCaption()}')<#noparse>}</#noparse><#noparse>${</#noparse>this.$t('app.commonWords.valueNotEmpty')<#noparse>}</#noparse><#else><#noparse>${</#noparse>this.$t('app.commonWords.valueNotEmpty')<#noparse>}</#noparse></#if>`; return false; } ${valueRule.getScriptCode()} }</#if><#if valueRule.getRuleInfo?? && valueRule.getRuleInfo()??>, message: '${valueRule.getRuleInfo()}'</#if>, trigger: 'change' },
</#if>
</#if>
</#if>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册