From d7fe8ae3888c8e2b1eea3c1e3769be0d42a21cc9 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期一, 16 十月 2023 09:03:47 +0800
Subject: [PATCH] Merge branch '1.0.3' of http://139.186.142.91:10010/r/productDev/dmMes into 1.0.3
---
minipro_standard/util/utils.js | 35 ++++++++++++++++++++++++++++++++++-
1 files changed, 34 insertions(+), 1 deletions(-)
diff --git a/minipro_standard/util/utils.js b/minipro_standard/util/utils.js
index db2d308..95f672f 100644
--- a/minipro_standard/util/utils.js
+++ b/minipro_standard/util/utils.js
@@ -42,4 +42,37 @@
return [year, Sign, month , Sign, day, ' ', hour , ':', minute, ':', '00' ].join('');
}
-export { gsdate, setTime, setTimeO }
+/***
+ * phoneRegular: 鎵嬫満鍙烽獙璇�
+ * mailboxRegular: 閭楠岃瘉
+ * positiveInteger: 姝f暣鏁�
+ * decimal: 灏忔暟锛堝彧鏀寔鍥涗綅灏忔暟锛�
+ * positiveIntegerDecimal: 姝f暣鏁板皬鏁帮紙鏈�澶氬洓浣嶅皬鏁帮級
+ * number锛氭暟瀛楁渶澶氫繚鐣欏洓浣嶅皬鏁�
+ */
+const REGULAR = {
+ phoneRegular: /^1[3456789]\d{9}$/,
+ mailboxRegular: /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
+ positiveInteger: /^[0-9]*[1-9][0-9]*$/,
+ decimal: /^0$|^[1-9]\d{0,15}$|^[1-9]\d{0,15}\.{1}\d{1,4}$|^0\.{1}\d{1,4}$/g,
+ positiveIntegerDecimal: /^([1-9][0-9]*|0)(\.[0-9]?[1-9][1-9][1-9])?$/,
+ number: /^\d+(?:\.\d{1,4})?$/
+}
+
+/***
+ *
+ * @param type 鏂囦欢绫诲瀷
+ */
+function judgmentType (type) {
+ let arr = ['jpg', 'jpeg', 'png']
+ // arr.includes(type)
+ let open = false
+ arr.forEach(item => {
+ if (type === item) {
+ open = true
+ }
+ })
+ return open;
+}
+
+export { gsdate, setTime, setTimeO, REGULAR, judgmentType }
--
Gitblit v1.9.3