easy3wui 1.5.37-beta1 → 1.5.37

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.
@@ -278,12 +278,13 @@ var formItemStyle = {
278
278
  marginBottom: 6
279
279
  };
280
280
  // 手机号区号及正则表 当有国家区号相同时后加区号在原本的区号基础上加 '+序号'
281
- var arrMobileAssociation = [{ label: '中国', value: '+86', pattern: /^1[34578]\d{9}$/ }, { label: '香港', value: '+852', pattern: /^\d+$/ }, { label: '台湾', value: '+886', pattern: /^\d+$/ }, { label: '澳门', value: '+853', pattern: /^\d+$/ },
281
+ var arrMobileAssociationDefault = [{ label: '中国', value: '+86', pattern: /^1[34578]\d{9}$/ }, { label: '香港', value: '+852', pattern: /^\d+$/ }, { label: '台湾', value: '+886', pattern: /^\d+$/ }, { label: '澳门', value: '+853', pattern: /^\d+$/ },
282
282
  // { label: '香港', value: '+852', pattern: /^([5|6|9])\d{7}$/ },
283
283
  // { label: '台湾', value: '+886', pattern: /^[0][9]\d{8}$/ },
284
284
  // { label: '澳门', value: '+853', pattern: /^6\d{7}$/ },
285
285
  { label: '美国', value: '+1', pattern: /^\d+$/ }, { label: '德国', value: '+49', pattern: /^\d+$/ }, { label: '法国', value: '+33', pattern: /^\d+$/ }, { label: '英国', value: '+34', pattern: /^\d+$/ }, { label: '日本', value: '+81', pattern: /^\d+$/ }, { label: '韩国', value: '+82', pattern: /^\d+$/ }, { label: '澳大利亚', value: '+61', pattern: /^\d+$/ }, { label: '加拿大', value: '+1+0', pattern: /^\d+$/ }, { label: '印度', value: '+91', pattern: /^\d+$/ }, { label: '俄罗斯', value: '+7', pattern: /^\d+$/ }];
286
- var objMobileRegular = {
286
+ // 号码正则
287
+ var objMobileRegularDefault = {
287
288
  '+86': /^1[34578]\d{9}$/,
288
289
  '+852': /^\d+$/,
289
290
  '+886': /^\d+$/,
@@ -542,12 +543,9 @@ var Easy3wFormPage = function (_Component) {
542
543
  addRules = [{ max: maxLength, message: '\u5F55\u5165\u6587\u5B57\u957F\u5EA6\u4E0D\u80FD\u8D85\u8FC7' + maxLength, transform: _this.touchTransform }].concat(addRules);
543
544
  }
544
545
  } else if (fieldType === 'mobile') {
545
- var mobileAddonBefore = form.getFieldValue('mobileAddonBefore');
546
- // console.log('mobileAddonBefore', mobileAddonBefore, objMobileRegular[mobileAddonBefore]);
547
- // objMobileRegular[mobileAddonBefore]
548
- addRules = [{ pattern: objMobileRegular[mobileAddonBefore], message: '手机格式错误!' }].concat(addRules);
546
+ var e3wMobileNation = form.getFieldValue(fieldId + 'AddonBefore');
547
+ addRules = [{ pattern: _comonConfig.objMobileRegular ? _comonConfig.objMobileRegular[e3wMobileNation] : objMobileRegularDefault[e3wMobileNation], message: '手机格式错误!' }].concat(addRules);
549
548
  }
550
-
551
549
  var decoratorObj = {
552
550
  rules: [{ required: required, message: requiredMessage || '\u8BF7\u586B\u5199' + label }].concat(addRules)
553
551
  };
@@ -1158,7 +1156,7 @@ var Easy3wFormPage = function (_Component) {
1158
1156
 
1159
1157
  var addonBeforeCmptPros = item.addonBeforeCmptPros || {};
1160
1158
  addonBeforeCmptPros = (0, _extends3['default'])({ allowClear: false, style: { minWidth: '90px' } }, addonBeforeCmptPros);
1161
- var itemArea = _this.selectHandler({ cmptPros: (0, _extends3['default'])({ optionLst: arrMobileAssociation }, addonBeforeCmptPros) });
1159
+ var itemArea = _this.selectHandler({ cmptPros: (0, _extends3['default'])({ optionLst: _comonConfig.arrMobileAssociation || arrMobileAssociationDefault }, addonBeforeCmptPros) });
1162
1160
 
1163
1161
  var decoratorObj = {
1164
1162
  rules: [{ required: required, message: '请填写区号' }],
@@ -1171,17 +1169,18 @@ var Easy3wFormPage = function (_Component) {
1171
1169
  }
1172
1170
  }, cmptPros));
1173
1171
  }, _this.onBlurMobile = function (e, fieldId) {
1174
- var mobileAreaCode = _this.props.form.getFieldValue(fieldId + 'AddonBefore');
1175
- if (e && e.target && e.target.value && mobileAreaCode) {
1172
+ var e3wMobileNation = _this.props.form.getFieldValue(fieldId + 'AddonBefore');
1173
+ var pattern = _comonConfig.objMobileRegular ? _comonConfig.objMobileRegular[e3wMobileNation] : objMobileRegularDefault[e3wMobileNation];
1174
+ if (e && e.target && e.target.value && e3wMobileNation && pattern.test(e.target.value)) {
1176
1175
  var xhr = new XMLHttpRequest();
1177
1176
  xhr.onreadystatechange = function () {
1178
1177
  if (xhr.readyState === 4 && xhr.status === 200) {
1179
1178
  // 请求成功,处理响应数据
1180
1179
  }
1181
1180
  };
1182
- var data = JSON.stringify({ e3wMobile: e.target.value, e3wMobileNation: mobileAreaCode });
1183
- xhr.open("POST", _comonConfig.easy3w4fMobileLibUpdateUrl, true); // 异步请求
1184
- xhr.setRequestHeader("Content-Type", "application/json"); // 设置请求头
1181
+ var data = JSON.stringify({ e3wMobile: e.target.value, e3wMobileNation: e3wMobileNation });
1182
+ xhr.open('POST', _comonConfig.easy3w4fMobileLibUpdateUrl, true); // 异步请求
1183
+ xhr.setRequestHeader('Content-Type', 'application/json'); // 设置请求头
1185
1184
  xhr.send(data); // 发送请求
1186
1185
  }
1187
1186
  }, _this.selectHandler = function (item) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy3wui",
3
- "version": "1.5.37-beta1",
3
+ "version": "1.5.37",
4
4
  "description": "easy3wui components for react",
5
5
  "keywords": [
6
6
  "react",