From 27745838738521ced4591d2799c78e3c5d3ceff7 Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Mon, 23 Oct 2023 16:47:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=8A=A8=E6=80=81=E8=BA=AB=E4=BB=BD?= =?UTF-8?q?=E8=AF=81=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/validate.js | 21 +++++++ src/views/components/resiForm.vue | 95 ++++++++++++++++++++++++++----- 2 files changed, 102 insertions(+), 14 deletions(-) diff --git a/src/utils/validate.js b/src/utils/validate.js index 1d750147d..2597d49bf 100644 --- a/src/utils/validate.js +++ b/src/utils/validate.js @@ -49,3 +49,24 @@ export function isPassport(s) { return reg.test(s); } +/** + * 港澳身份证 + * @param {*} s + */ +export function isHKPassport(s) { + return /^([A-Z]\d{6,10}(\(\w{1}\))?)$/.test(s);; +} +/** + * 台湾身份证 + * @param {*} s + */ +export function isTwPassport(s) { + return /^\d{8}|^[a-zA-Z0-9]{10}|^\d{18}$/.test(s);; +} +/** + * 军官证 + * @param {*} s + */ +export function isSoldier(s) { + return /^[\u4E00-\u9FA5](字第)([0-9a-zA-Z]{4,8})(号?)$/.test(s);; +} diff --git a/src/views/components/resiForm.vue b/src/views/components/resiForm.vue index 01c70abe9..6a4a9296f 100644 --- a/src/views/components/resiForm.vue +++ b/src/views/components/resiForm.vue @@ -128,8 +128,10 @@ :placeholder="`请选择${item.label}`" size="small" clearable - class="u-item-width-normal"> - + @@ -401,7 +403,7 @@