From df9e14e3a864c507c51d6a4166f562218d0ff3bb Mon Sep 17 00:00:00 2001 From: superDragon Date: Wed, 30 Sep 2020 10:55:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=9B=B4=E6=96=B0=E8=BD=A6=E7=89=8C?= =?UTF-8?q?=E5=8F=B7,=E8=BA=AB=E4=BB=BD=E8=AF=81=E5=8F=B7=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/common.js | 10 ++++ src/views/userInfo.vue | 112 ++++++++++++++++++++++++++++++----------- 3 files changed, 95 insertions(+), 29 deletions(-) create mode 100644 src/common.js diff --git a/package.json b/package.json index abd61c4..b7210a4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "collection", "productName": "廉情信息报告表", - "version": "1.1.4", + "version": "1.1.5", "private": true, "scripts": { "dev": "vue-cli-service electron:serve", diff --git a/src/common.js b/src/common.js new file mode 100644 index 0000000..d74c2f9 --- /dev/null +++ b/src/common.js @@ -0,0 +1,10 @@ +// 身份证号、车主身份证号 + +export const isIdentityCard = function(str) { + return /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(str); +} + +// 车牌号 +export const isLicensePlate = function(str) { + return /^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/.test(str); +} \ No newline at end of file diff --git a/src/views/userInfo.vue b/src/views/userInfo.vue index 0632a29..3d45bb6 100644 --- a/src/views/userInfo.vue +++ b/src/views/userInfo.vue @@ -1,5 +1,5 @@