From f2af04347d7e7ea721826df611623afdfef90213 Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Wed, 21 Aug 2024 13:51:25 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E9=AA=8C=E8=AF=81=E5=A2=9E=E5=8A=A0=E6=9C=80=E5=B0=8F?= =?UTF-8?q?=E4=BD=8D=E6=95=B0=E5=AD=97=E7=AC=A6=E4=B8=B2=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/LR_Content/plugin/custmerform/lr-formrender.js | 2 +- .../Views/LR_Content/script/lr-validator-helper.js | 9 +++++++++ .../Views/LR_Content/script/lr-validator.js | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/custmerform/lr-formrender.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/custmerform/lr-formrender.js index 0fc925c5e..22c9018d7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/custmerform/lr-formrender.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/custmerform/lr-formrender.js @@ -150,7 +150,7 @@ } } var r = { code: true, msg: '' }; - if (checkexpession == 'LenNum' || checkexpession == 'LenNumOrNull' || checkexpession == 'LenStr' || checkexpession == 'LenStrOrNull') { + if (checkexpession == 'LenNum' || checkexpession == 'LenNumOrNull' || checkexpession == 'LenStr' || checkexpession == 'LenStrOrNull' || checkexpession == 'MinLenStr') { var len = $this.attr("length"); r = checkfn(value, len); } else { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-validator-helper.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-validator-helper.js index eef668139..40305ce00 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-validator-helper.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-validator-helper.js @@ -202,6 +202,15 @@ res.msg = '必须小于等于' + n + '位字符或空'; } return res; + }, + isMinLenStr: function (obj, n) {//验证是否大于等于n位数的字符串 nchar + var res = { code: true, msg: '' }; + obj = $.trim(obj); + if (!learun.validator.isNotNull(obj).code || obj.length < n) { + res.code = false; + res.msg = '必须大于等于' + n + '位字符'; + } + return res; } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-validator.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-validator.js index 42737faf6..c18554fb1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-validator.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-validator.js @@ -88,7 +88,7 @@ // value = $this.val(); //} var r = { code: true, msg: '' }; - if (checkexpession == 'LenNum' || checkexpession == 'LenNumOrNull' || checkexpession == 'LenStr' || checkexpession == 'LenStrOrNull') { + if (checkexpession == 'LenNum' || checkexpession == 'LenNumOrNull' || checkexpession == 'LenStr' || checkexpession == 'LenStrOrNull' || checkexpession == 'MinLenStr') { var len = $this.attr("length"); r = checkfn(value, len); } else {