xianniu-ui 0.8.49 → 0.8.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xianniu-ui",
3
- "version": "0.8.49",
3
+ "version": "0.8.51",
4
4
  "private": false,
5
5
  "main": "lib/xianniu-ui.umd.min.js",
6
6
  "scripts": {
@@ -120,7 +120,7 @@ export default {
120
120
  const res = this.findParent(_value, this.flattenResult).map(
121
121
  (item) => item.cityCode
122
122
  );
123
- console.log('123',res);
123
+ console.log("123", res);
124
124
  return res;
125
125
  }
126
126
  },
@@ -212,14 +212,15 @@ export default {
212
212
  return data.map((item) => {
213
213
  item.level = level;
214
214
  const child = item.subCitys;
215
- if (level >= 2 && this.dataLevel === 2) {
215
+
216
+ // 根据dataLevel判断是否删除subCitys
217
+ if (level >= this.dataLevel) {
216
218
  delete item.subCitys;
217
- }
218
- if (child && child.length) {
219
+ } else if (child && child.length) {
220
+ // 递归调用子节点
219
221
  recursive(child, level);
220
- } else {
221
- delete item.subCitys;
222
222
  }
223
+
223
224
  return item;
224
225
  });
225
226
  };
package/src/utils/reg.js CHANGED
@@ -1,9 +1,8 @@
1
1
 
2
2
  const Reg = {
3
- checkPhone: /^1(3|4|5|6|7|8|9)\d{9}$/, // 校验手机号
3
+ checkPhone: /^1\d{10}$/, // 校验手机号
4
4
  checkPwd: /^[0-9A-Za-z]{8,20}$/, // 8-20位的字母和数字
5
5
  checkNumber: /^[+-]?(0|([1-9]\d*))(?:\.\d{1,2})?$/g, // 校验数字类型
6
- checkTel: /[0-9-()()]{7,18}/,//座机号码
7
6
  checkEmail: /\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/,// 邮箱
8
7
  checkFullName: /^[\u4E00-\u9FA5A-Za-z0-9_]+$/, //中文、英文、数字包括下划线
9
8
  positiveInteger: /^[1-9]\d*$/, // 正整数
@@ -11,8 +10,12 @@ const Reg = {
11
10
  text: /^[a-z\d\u4E00-\u9FA5]+$/i, // 不含特殊字符和标点
12
11
  getCity: /.+?(省|市|自治区|自治州|县|区)/g, //获取地址中的省市区[省,市,区]
13
12
  Tel: /^[0-9-]{7,18}$/, // 座机号
14
- telAndPhone: /^[0-9-]{7,18}$/ || /^[0-9]{7,18}$/ || /^1\d{10}$/, // 校验手机号、座机号 010-88888888 01088888888
15
- oneDecimal: /(^[0-9]{1,20}$)|(^[0-9]{1,20}[.][0-9]{1}$)/ // 1位小数
13
+ telAndPhone: /^(?:\+?1[3-9]\d{9})$|^(?:\+?\d{1,3}[-\s]?\(?\d{1,4}\)?[-\s]?\d{6,8})$|^\d{8}$/, // 校验手机号、座机号 010-88888888 01088888888
14
+ oneDecimal: /(^[0-9]{1,20}$)|(^[0-9]{1,20}[.][0-9]{1}$)/, // 1位小数
15
+ /**
16
+ * 校验有效联系方式,手机号或座机号(包括港澳台,国际号码)
17
+ */
18
+ checkTel: /^(?:\+?1[3-9]\d{9})$|^(?:\+?\d{1,3}[-\s]?\(?\d{1,4}\)?[-\s]?\d{6,8})$|^\d{8}$/
16
19
  }
17
20
 
18
21
  export default Reg