四零语境后端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
913 B

1 month ago
  1. <#include "../utils.ftl">
  2. <#if col.isShow == 'Y' && poHasCheck(col)>
  3. validateRules: [
  4. <#if col.fieldName != 'id'>
  5. <#assign subFieldValidType = col.fieldValidType!''>
  6. <#-- 非空校验 -->
  7. <#if col.nullable == 'N' || subFieldValidType == '*'>
  8. { required: true, message: '${'$'}{title}不能为空' },
  9. <#elseif subFieldValidType!=''>
  10. { required: false},
  11. </#if>
  12. <#-- 其他情况下,只要有值就被认为是正则校验 -->
  13. <#if subFieldValidType?length gt 0>
  14. <#assign subMessage = '格式不正确'>
  15. <#if subFieldValidType == 'only' >
  16. <#assign subMessage = '不能重复'>
  17. </#if>
  18. { pattern: "${subFieldValidType}", message: "${'$'}{title}${subMessage}" }
  19. <#t>
  20. </#if>
  21. </#if>
  22. ],
  23. </#if>