@kmkf-fe-packages/basic-components 0.6.3-alpha.58 → 0.6.3-alpha.59

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/dist/index.esm.js CHANGED
@@ -354,53 +354,6 @@ function _regeneratorRuntime() {
354
354
  }
355
355
  }, exports;
356
356
  }
357
- function _wrapRegExp() {
358
- _wrapRegExp = function (re, groups) {
359
- return new BabelRegExp(re, void 0, groups);
360
- };
361
- var _super = RegExp.prototype,
362
- _groups = new WeakMap();
363
- function BabelRegExp(re, flags, groups) {
364
- var _this = new RegExp(re, flags);
365
- return _groups.set(_this, groups || _groups.get(re)), _setPrototypeOf(_this, BabelRegExp.prototype);
366
- }
367
- function buildGroups(result, re) {
368
- var g = _groups.get(re);
369
- return Object.keys(g).reduce(function (groups, name) {
370
- var i = g[name];
371
- if ("number" == typeof i) groups[name] = result[i];else {
372
- for (var k = 0; void 0 === result[i[k]] && k + 1 < i.length;) k++;
373
- groups[name] = result[i[k]];
374
- }
375
- return groups;
376
- }, Object.create(null));
377
- }
378
- return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (str) {
379
- var result = _super.exec.call(this, str);
380
- if (result) {
381
- result.groups = buildGroups(result, this);
382
- var indices = result.indices;
383
- indices && (indices.groups = buildGroups(indices, this));
384
- }
385
- return result;
386
- }, BabelRegExp.prototype[Symbol.replace] = function (str, substitution) {
387
- if ("string" == typeof substitution) {
388
- var groups = _groups.get(this);
389
- return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) {
390
- var group = groups[name];
391
- return "$" + (Array.isArray(group) ? group.join("$") : group);
392
- }));
393
- }
394
- if ("function" == typeof substitution) {
395
- var _this = this;
396
- return _super[Symbol.replace].call(this, str, function () {
397
- var args = arguments;
398
- return "object" != typeof args[args.length - 1] && (args = [].slice.call(args)).push(buildGroups(args, _this)), substitution.apply(this, args);
399
- });
400
- }
401
- return _super[Symbol.replace].call(this, str, substitution);
402
- }, _wrapRegExp.apply(this, arguments);
403
- }
404
357
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
405
358
  try {
406
359
  var info = gen[key](arg);
@@ -445,29 +398,6 @@ function _defineProperty(obj, key, value) {
445
398
  }
446
399
  return obj;
447
400
  }
448
- function _inherits(subClass, superClass) {
449
- if (typeof superClass !== "function" && superClass !== null) {
450
- throw new TypeError("Super expression must either be null or a function");
451
- }
452
- subClass.prototype = Object.create(superClass && superClass.prototype, {
453
- constructor: {
454
- value: subClass,
455
- writable: true,
456
- configurable: true
457
- }
458
- });
459
- Object.defineProperty(subClass, "prototype", {
460
- writable: false
461
- });
462
- if (superClass) _setPrototypeOf(subClass, superClass);
463
- }
464
- function _setPrototypeOf(o, p) {
465
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
466
- o.__proto__ = p;
467
- return o;
468
- };
469
- return _setPrototypeOf(o, p);
470
- }
471
401
  function _objectWithoutPropertiesLoose(source, excluded) {
472
402
  if (source == null) return {};
473
403
  var target = {};
@@ -3129,71 +3059,47 @@ var ParseLogistics = function ParseLogistics(props) {
3129
3059
  _useState2 = _slicedToArray(_useState, 2),
3130
3060
  value = _useState2[0],
3131
3061
  setValue = _useState2[1];
3132
- var handleIdentify = function handleIdentify() {
3133
- var data = parseLogisticsInfo(value);
3134
- // console.log(data);
3135
- onChange === null || onChange === void 0 ? void 0 : onChange(data);
3136
- };
3137
- var parseLogisticsInfo = function parseLogisticsInfo(str) {
3138
- var info = {};
3139
- var regex1 = /*#__PURE__*/_wrapRegExp(/^([^省]+\u7701)?([^市]+\u5E02)?([^区]+\u533A)?(.*)?\s*\u59D3\u540D[:|:](.+)?\s*\u7535\u8BDD[:|:](.+)/, {
3140
- province: 1,
3141
- city: 2,
3142
- district: 3,
3143
- address: 4,
3144
- name: 5,
3145
- phone: 6
3146
- });
3147
- var regex2 = /*#__PURE__*/_wrapRegExp(/^\u6536\u8D27\u4EBA[:|:]\s*([^,]+),?\s*\u624B\u673A\u53F7\u7801[:|:]\s*([^,]+),?\s*\u6240\u5728\u5730\u533A[:|:]\s*([^省]+\u7701)?([^市]+\u5E02)?([^区]+\u533A)?(.+)/, {
3148
- name: 1,
3149
- phone: 2,
3150
- province: 3,
3151
- city: 4,
3152
- district: 5,
3153
- address: 6
3154
- });
3155
- var match1 = str.match(regex1);
3156
- if (match1) {
3157
- var _match1$groups, _match1$groups$provin, _match1$groups2, _match1$groups2$city, _match1$groups3, _match1$groups3$distr, _match1$groups4, _match1$groups4$addre, _match1$groups5, _match1$groups5$name, _match1$groups6, _match1$groups6$phone;
3158
- info.province = ((_match1$groups = match1.groups) === null || _match1$groups === void 0 ? void 0 : (_match1$groups$provin = _match1$groups.province) === null || _match1$groups$provin === void 0 ? void 0 : _match1$groups$provin.trim()) || '';
3159
- info.city = ((_match1$groups2 = match1.groups) === null || _match1$groups2 === void 0 ? void 0 : (_match1$groups2$city = _match1$groups2.city) === null || _match1$groups2$city === void 0 ? void 0 : _match1$groups2$city.trim()) || '';
3160
- info.district = ((_match1$groups3 = match1.groups) === null || _match1$groups3 === void 0 ? void 0 : (_match1$groups3$distr = _match1$groups3.district) === null || _match1$groups3$distr === void 0 ? void 0 : _match1$groups3$distr.trim()) || '';
3161
- info.address = ((_match1$groups4 = match1.groups) === null || _match1$groups4 === void 0 ? void 0 : (_match1$groups4$addre = _match1$groups4.address) === null || _match1$groups4$addre === void 0 ? void 0 : _match1$groups4$addre.trim()) || '';
3162
- info.name = ((_match1$groups5 = match1.groups) === null || _match1$groups5 === void 0 ? void 0 : (_match1$groups5$name = _match1$groups5.name) === null || _match1$groups5$name === void 0 ? void 0 : _match1$groups5$name.trim()) || '';
3163
- info.phone = ((_match1$groups6 = match1.groups) === null || _match1$groups6 === void 0 ? void 0 : (_match1$groups6$phone = _match1$groups6.phone) === null || _match1$groups6$phone === void 0 ? void 0 : _match1$groups6$phone.trim()) || '';
3164
- return info;
3165
- }
3166
- var match2 = str.match(regex2);
3167
- if (match2) {
3168
- var _match2$groups, _match2$groups$provin, _match2$groups2, _match2$groups2$city, _match2$groups3, _match2$groups3$distr, _match2$groups4, _match2$groups4$addre, _match2$groups5, _match2$groups5$name, _match2$groups6, _match2$groups6$phone;
3169
- info.province = ((_match2$groups = match2.groups) === null || _match2$groups === void 0 ? void 0 : (_match2$groups$provin = _match2$groups.province) === null || _match2$groups$provin === void 0 ? void 0 : _match2$groups$provin.trim()) || '';
3170
- info.city = ((_match2$groups2 = match2.groups) === null || _match2$groups2 === void 0 ? void 0 : (_match2$groups2$city = _match2$groups2.city) === null || _match2$groups2$city === void 0 ? void 0 : _match2$groups2$city.trim()) || '';
3171
- info.district = ((_match2$groups3 = match2.groups) === null || _match2$groups3 === void 0 ? void 0 : (_match2$groups3$distr = _match2$groups3.district) === null || _match2$groups3$distr === void 0 ? void 0 : _match2$groups3$distr.trim()) || '';
3172
- info.address = ((_match2$groups4 = match2.groups) === null || _match2$groups4 === void 0 ? void 0 : (_match2$groups4$addre = _match2$groups4.address) === null || _match2$groups4$addre === void 0 ? void 0 : _match2$groups4$addre.trim()) || '';
3173
- info.name = ((_match2$groups5 = match2.groups) === null || _match2$groups5 === void 0 ? void 0 : (_match2$groups5$name = _match2$groups5.name) === null || _match2$groups5$name === void 0 ? void 0 : _match2$groups5$name.trim()) || '';
3174
- info.phone = ((_match2$groups6 = match2.groups) === null || _match2$groups6 === void 0 ? void 0 : (_match2$groups6$phone = _match2$groups6.phone) === null || _match2$groups6$phone === void 0 ? void 0 : _match2$groups6$phone.trim()) || '';
3175
- return info;
3176
- }
3177
- // const match3 = str.match(regex3);
3178
- // if (match3) {
3179
- // info.province = match3.groups?.province?.trim() || '';
3180
- // info.city = match3.groups?.city?.trim() || '';
3181
- // info.district = match3.groups?.district?.trim() || '';
3182
- // info.address = match3.groups?.address?.trim() || '';
3183
- // info.name = match3.groups?.name?.trim() || '';
3184
- // info.phone = match3.groups?.phone?.trim() || '';
3185
- // return info;
3186
- // }
3187
- return info;
3188
- };
3062
+ var handleIdentify = /*#__PURE__*/function () {
3063
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
3064
+ var _yield$request, data;
3065
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
3066
+ while (1) switch (_context.prev = _context.next) {
3067
+ case 0:
3068
+ if (value) {
3069
+ _context.next = 2;
3070
+ break;
3071
+ }
3072
+ return _context.abrupt("return");
3073
+ case 2:
3074
+ _context.next = 4;
3075
+ return extendRequest('/qy/logistics/addressAnalysis', {
3076
+ method: 'post',
3077
+ data: {
3078
+ fullAddress: value
3079
+ }
3080
+ });
3081
+ case 4:
3082
+ _yield$request = _context.sent;
3083
+ data = _yield$request.data;
3084
+ onChange === null || onChange === void 0 ? void 0 : onChange(data);
3085
+ case 7:
3086
+ case "end":
3087
+ return _context.stop();
3088
+ }
3089
+ }, _callee);
3090
+ }));
3091
+ return function handleIdentify() {
3092
+ return _ref.apply(this, arguments);
3093
+ };
3094
+ }();
3189
3095
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TextArea$1, {
3190
- placeholder: "\u6536\u8D27\u4EBA: xxx\u3000\u624B\u673A\u53F7\u7801: xxxxx\u3000\u6240\u5728\u5730\u533A: xx\u7701xx\u5E02xx\u533A\u3000\u8BE6\u7EC6\u5730\u5740: xxx",
3191
- rows: 5,
3096
+ placeholder: "\u590D\u5236\u7269\u6D41\u4FE1\u606F\uFF0C\u70B9\u51FB\u667A\u80FD\u8BC6\u522B",
3097
+ rows: 3,
3192
3098
  value: value,
3193
3099
  onChange: function onChange(e) {
3194
3100
  return setValue(e.target.value);
3195
3101
  }
3196
- }), /*#__PURE__*/React.createElement(Button, {
3102
+ }), /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Button, {
3197
3103
  size: "small",
3198
3104
  type: "primary",
3199
3105
  onClick: handleIdentify
@@ -3202,7 +3108,7 @@ var ParseLogistics = function ParseLogistics(props) {
3202
3108
  onClick: function onClick() {
3203
3109
  return setValue('');
3204
3110
  }
3205
- }, "\u6E05\u7A7A"));
3111
+ }, "\u6E05\u7A7A")));
3206
3112
  };
3207
3113
 
3208
3114
  var Item = Form.Item;
@@ -3302,7 +3208,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
3302
3208
  })) === null || _find2 === void 0 ? void 0 : (_find2$config = _find2.config) === null || _find2$config === void 0 ? void 0 : _find2$config.showSenderMobile;
3303
3209
  }, [value === null || value === void 0 ? void 0 : value.interceptType, typeOptions, value === null || value === void 0 ? void 0 : value.interceptCompany]);
3304
3210
  //判断是否能修改物流信息
3305
- var canEdit = useMemo(function () {
3211
+ var isEdit = useMemo(function () {
3306
3212
  var company = expressInterceptData.find(function (item) {
3307
3213
  return item.value === initCompany;
3308
3214
  });
@@ -3334,7 +3240,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
3334
3240
  };
3335
3241
  var handleParseLogistics = function handleParseLogistics(val) {
3336
3242
  var params = _objectSpread2(_objectSpread2({}, value), {}, {
3337
- interceptDetail: val === null || val === void 0 ? void 0 : val.address,
3243
+ interceptDetail: val === null || val === void 0 ? void 0 : val.addressDetail,
3338
3244
  interceptReceiverName: val === null || val === void 0 ? void 0 : val.name,
3339
3245
  interceptReceiverMobile: val === null || val === void 0 ? void 0 : val.phone
3340
3246
  });
@@ -3348,7 +3254,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
3348
3254
  required: required,
3349
3255
  key: 'logistics'
3350
3256
  }, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Select, {
3351
- disabled: disabled || canEdit,
3257
+ disabled: disabled || isEdit,
3352
3258
  placeholder: "\u7269\u6D41\u516C\u53F8",
3353
3259
  style: {
3354
3260
  width: '150px'
@@ -3363,7 +3269,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
3363
3269
  return option.label.includes(input);
3364
3270
  }
3365
3271
  }), /*#__PURE__*/React.createElement(Input, {
3366
- disabled: disabled || canEdit,
3272
+ disabled: disabled || isEdit,
3367
3273
  placeholder: "\u7269\u6D41\u5355\u53F7",
3368
3274
  onChange: function onChange(e) {
3369
3275
  return changeHandle(e.target.value, 'interceptCode');
@@ -3374,7 +3280,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
3374
3280
  required: required,
3375
3281
  key: 'interceptType'
3376
3282
  }, /*#__PURE__*/React.createElement(Select, {
3377
- disabled: disabled || canEdit,
3283
+ disabled: disabled || isEdit,
3378
3284
  style: {
3379
3285
  width: '200px'
3380
3286
  },
@@ -3395,7 +3301,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
3395
3301
  hidden: !showSenderMobile
3396
3302
  }, /*#__PURE__*/React.createElement(Input, {
3397
3303
  value: value === null || value === void 0 ? void 0 : value.interceptSenderMobile,
3398
- disabled: disabled || canEdit,
3304
+ disabled: disabled || isEdit,
3399
3305
  placeholder: "\u53D1\u4EF6\u4EBA\u624B\u673A\u53F7",
3400
3306
  onChange: function onChange(e) {
3401
3307
  return changeHandle(e.target.value, 'interceptSenderMobile');
@@ -3405,7 +3311,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
3405
3311
  required: true,
3406
3312
  key: 'newAddress',
3407
3313
  hidden: !showNewAddress
3408
- }, /*#__PURE__*/React.createElement(ParseLogistics, {
3314
+ }, !(disabled || isEdit) && /*#__PURE__*/React.createElement(ParseLogistics, {
3409
3315
  onChange: handleParseLogistics
3410
3316
  }), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Province, {
3411
3317
  value: value === null || value === void 0 ? void 0 : value.interceptAddress,
@@ -3413,24 +3319,24 @@ var LogisticsInterception = function LogisticsInterception(props) {
3413
3319
  return changeHandle(val, 'interceptAddress');
3414
3320
  },
3415
3321
  options: [],
3416
- disabled: disabled || canEdit
3322
+ disabled: disabled || isEdit
3417
3323
  }), /*#__PURE__*/React.createElement(Input, {
3418
3324
  value: value === null || value === void 0 ? void 0 : value.interceptDetail,
3419
- disabled: disabled || canEdit,
3325
+ disabled: disabled || isEdit,
3420
3326
  placeholder: "\u8BE6\u7EC6\u5730\u5740",
3421
3327
  onChange: function onChange(e) {
3422
3328
  return changeHandle(e.target.value, 'interceptDetail');
3423
3329
  }
3424
3330
  })), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Input, {
3425
3331
  value: value === null || value === void 0 ? void 0 : value.interceptReceiverName,
3426
- disabled: disabled || canEdit,
3332
+ disabled: disabled || isEdit,
3427
3333
  placeholder: "\u6536\u4EF6\u4EBA\u59D3\u540D",
3428
3334
  onChange: function onChange(e) {
3429
3335
  return changeHandle(e.target.value, 'interceptReceiverName');
3430
3336
  }
3431
3337
  }), /*#__PURE__*/React.createElement(Input, {
3432
3338
  value: value === null || value === void 0 ? void 0 : value.interceptReceiverMobile,
3433
- disabled: disabled || canEdit,
3339
+ disabled: disabled || isEdit,
3434
3340
  placeholder: "\u6536\u4EF6\u4EBA\u7535\u8BDD",
3435
3341
  onChange: function onChange(e) {
3436
3342
  return changeHandle(e.target.value, 'interceptReceiverMobile');
@@ -3454,7 +3360,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
3454
3360
  return option.label.includes(input);
3455
3361
  }
3456
3362
  }), (value === null || value === void 0 ? void 0 : value.interceptLogisticsStatus) === 'OTHER' && /*#__PURE__*/React.createElement(Input, {
3457
- disabled: disabled || !canEdit,
3363
+ disabled: disabled || !isEdit,
3458
3364
  style: {
3459
3365
  width: '200px'
3460
3366
  },
package/dist/index.js CHANGED
@@ -364,53 +364,6 @@ function _regeneratorRuntime() {
364
364
  }
365
365
  }, exports;
366
366
  }
367
- function _wrapRegExp() {
368
- _wrapRegExp = function (re, groups) {
369
- return new BabelRegExp(re, void 0, groups);
370
- };
371
- var _super = RegExp.prototype,
372
- _groups = new WeakMap();
373
- function BabelRegExp(re, flags, groups) {
374
- var _this = new RegExp(re, flags);
375
- return _groups.set(_this, groups || _groups.get(re)), _setPrototypeOf(_this, BabelRegExp.prototype);
376
- }
377
- function buildGroups(result, re) {
378
- var g = _groups.get(re);
379
- return Object.keys(g).reduce(function (groups, name) {
380
- var i = g[name];
381
- if ("number" == typeof i) groups[name] = result[i];else {
382
- for (var k = 0; void 0 === result[i[k]] && k + 1 < i.length;) k++;
383
- groups[name] = result[i[k]];
384
- }
385
- return groups;
386
- }, Object.create(null));
387
- }
388
- return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (str) {
389
- var result = _super.exec.call(this, str);
390
- if (result) {
391
- result.groups = buildGroups(result, this);
392
- var indices = result.indices;
393
- indices && (indices.groups = buildGroups(indices, this));
394
- }
395
- return result;
396
- }, BabelRegExp.prototype[Symbol.replace] = function (str, substitution) {
397
- if ("string" == typeof substitution) {
398
- var groups = _groups.get(this);
399
- return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) {
400
- var group = groups[name];
401
- return "$" + (Array.isArray(group) ? group.join("$") : group);
402
- }));
403
- }
404
- if ("function" == typeof substitution) {
405
- var _this = this;
406
- return _super[Symbol.replace].call(this, str, function () {
407
- var args = arguments;
408
- return "object" != typeof args[args.length - 1] && (args = [].slice.call(args)).push(buildGroups(args, _this)), substitution.apply(this, args);
409
- });
410
- }
411
- return _super[Symbol.replace].call(this, str, substitution);
412
- }, _wrapRegExp.apply(this, arguments);
413
- }
414
367
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
415
368
  try {
416
369
  var info = gen[key](arg);
@@ -455,29 +408,6 @@ function _defineProperty(obj, key, value) {
455
408
  }
456
409
  return obj;
457
410
  }
458
- function _inherits(subClass, superClass) {
459
- if (typeof superClass !== "function" && superClass !== null) {
460
- throw new TypeError("Super expression must either be null or a function");
461
- }
462
- subClass.prototype = Object.create(superClass && superClass.prototype, {
463
- constructor: {
464
- value: subClass,
465
- writable: true,
466
- configurable: true
467
- }
468
- });
469
- Object.defineProperty(subClass, "prototype", {
470
- writable: false
471
- });
472
- if (superClass) _setPrototypeOf(subClass, superClass);
473
- }
474
- function _setPrototypeOf(o, p) {
475
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
476
- o.__proto__ = p;
477
- return o;
478
- };
479
- return _setPrototypeOf(o, p);
480
- }
481
411
  function _objectWithoutPropertiesLoose(source, excluded) {
482
412
  if (source == null) return {};
483
413
  var target = {};
@@ -3139,71 +3069,47 @@ var ParseLogistics = function ParseLogistics(props) {
3139
3069
  _useState2 = _slicedToArray(_useState, 2),
3140
3070
  value = _useState2[0],
3141
3071
  setValue = _useState2[1];
3142
- var handleIdentify = function handleIdentify() {
3143
- var data = parseLogisticsInfo(value);
3144
- // console.log(data);
3145
- onChange === null || onChange === void 0 ? void 0 : onChange(data);
3146
- };
3147
- var parseLogisticsInfo = function parseLogisticsInfo(str) {
3148
- var info = {};
3149
- var regex1 = /*#__PURE__*/_wrapRegExp(/^([^省]+\u7701)?([^市]+\u5E02)?([^区]+\u533A)?(.*)?\s*\u59D3\u540D[:|:](.+)?\s*\u7535\u8BDD[:|:](.+)/, {
3150
- province: 1,
3151
- city: 2,
3152
- district: 3,
3153
- address: 4,
3154
- name: 5,
3155
- phone: 6
3156
- });
3157
- var regex2 = /*#__PURE__*/_wrapRegExp(/^\u6536\u8D27\u4EBA[:|:]\s*([^,]+),?\s*\u624B\u673A\u53F7\u7801[:|:]\s*([^,]+),?\s*\u6240\u5728\u5730\u533A[:|:]\s*([^省]+\u7701)?([^市]+\u5E02)?([^区]+\u533A)?(.+)/, {
3158
- name: 1,
3159
- phone: 2,
3160
- province: 3,
3161
- city: 4,
3162
- district: 5,
3163
- address: 6
3164
- });
3165
- var match1 = str.match(regex1);
3166
- if (match1) {
3167
- var _match1$groups, _match1$groups$provin, _match1$groups2, _match1$groups2$city, _match1$groups3, _match1$groups3$distr, _match1$groups4, _match1$groups4$addre, _match1$groups5, _match1$groups5$name, _match1$groups6, _match1$groups6$phone;
3168
- info.province = ((_match1$groups = match1.groups) === null || _match1$groups === void 0 ? void 0 : (_match1$groups$provin = _match1$groups.province) === null || _match1$groups$provin === void 0 ? void 0 : _match1$groups$provin.trim()) || '';
3169
- info.city = ((_match1$groups2 = match1.groups) === null || _match1$groups2 === void 0 ? void 0 : (_match1$groups2$city = _match1$groups2.city) === null || _match1$groups2$city === void 0 ? void 0 : _match1$groups2$city.trim()) || '';
3170
- info.district = ((_match1$groups3 = match1.groups) === null || _match1$groups3 === void 0 ? void 0 : (_match1$groups3$distr = _match1$groups3.district) === null || _match1$groups3$distr === void 0 ? void 0 : _match1$groups3$distr.trim()) || '';
3171
- info.address = ((_match1$groups4 = match1.groups) === null || _match1$groups4 === void 0 ? void 0 : (_match1$groups4$addre = _match1$groups4.address) === null || _match1$groups4$addre === void 0 ? void 0 : _match1$groups4$addre.trim()) || '';
3172
- info.name = ((_match1$groups5 = match1.groups) === null || _match1$groups5 === void 0 ? void 0 : (_match1$groups5$name = _match1$groups5.name) === null || _match1$groups5$name === void 0 ? void 0 : _match1$groups5$name.trim()) || '';
3173
- info.phone = ((_match1$groups6 = match1.groups) === null || _match1$groups6 === void 0 ? void 0 : (_match1$groups6$phone = _match1$groups6.phone) === null || _match1$groups6$phone === void 0 ? void 0 : _match1$groups6$phone.trim()) || '';
3174
- return info;
3175
- }
3176
- var match2 = str.match(regex2);
3177
- if (match2) {
3178
- var _match2$groups, _match2$groups$provin, _match2$groups2, _match2$groups2$city, _match2$groups3, _match2$groups3$distr, _match2$groups4, _match2$groups4$addre, _match2$groups5, _match2$groups5$name, _match2$groups6, _match2$groups6$phone;
3179
- info.province = ((_match2$groups = match2.groups) === null || _match2$groups === void 0 ? void 0 : (_match2$groups$provin = _match2$groups.province) === null || _match2$groups$provin === void 0 ? void 0 : _match2$groups$provin.trim()) || '';
3180
- info.city = ((_match2$groups2 = match2.groups) === null || _match2$groups2 === void 0 ? void 0 : (_match2$groups2$city = _match2$groups2.city) === null || _match2$groups2$city === void 0 ? void 0 : _match2$groups2$city.trim()) || '';
3181
- info.district = ((_match2$groups3 = match2.groups) === null || _match2$groups3 === void 0 ? void 0 : (_match2$groups3$distr = _match2$groups3.district) === null || _match2$groups3$distr === void 0 ? void 0 : _match2$groups3$distr.trim()) || '';
3182
- info.address = ((_match2$groups4 = match2.groups) === null || _match2$groups4 === void 0 ? void 0 : (_match2$groups4$addre = _match2$groups4.address) === null || _match2$groups4$addre === void 0 ? void 0 : _match2$groups4$addre.trim()) || '';
3183
- info.name = ((_match2$groups5 = match2.groups) === null || _match2$groups5 === void 0 ? void 0 : (_match2$groups5$name = _match2$groups5.name) === null || _match2$groups5$name === void 0 ? void 0 : _match2$groups5$name.trim()) || '';
3184
- info.phone = ((_match2$groups6 = match2.groups) === null || _match2$groups6 === void 0 ? void 0 : (_match2$groups6$phone = _match2$groups6.phone) === null || _match2$groups6$phone === void 0 ? void 0 : _match2$groups6$phone.trim()) || '';
3185
- return info;
3186
- }
3187
- // const match3 = str.match(regex3);
3188
- // if (match3) {
3189
- // info.province = match3.groups?.province?.trim() || '';
3190
- // info.city = match3.groups?.city?.trim() || '';
3191
- // info.district = match3.groups?.district?.trim() || '';
3192
- // info.address = match3.groups?.address?.trim() || '';
3193
- // info.name = match3.groups?.name?.trim() || '';
3194
- // info.phone = match3.groups?.phone?.trim() || '';
3195
- // return info;
3196
- // }
3197
- return info;
3198
- };
3072
+ var handleIdentify = /*#__PURE__*/function () {
3073
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
3074
+ var _yield$request, data;
3075
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
3076
+ while (1) switch (_context.prev = _context.next) {
3077
+ case 0:
3078
+ if (value) {
3079
+ _context.next = 2;
3080
+ break;
3081
+ }
3082
+ return _context.abrupt("return");
3083
+ case 2:
3084
+ _context.next = 4;
3085
+ return extendRequest('/qy/logistics/addressAnalysis', {
3086
+ method: 'post',
3087
+ data: {
3088
+ fullAddress: value
3089
+ }
3090
+ });
3091
+ case 4:
3092
+ _yield$request = _context.sent;
3093
+ data = _yield$request.data;
3094
+ onChange === null || onChange === void 0 ? void 0 : onChange(data);
3095
+ case 7:
3096
+ case "end":
3097
+ return _context.stop();
3098
+ }
3099
+ }, _callee);
3100
+ }));
3101
+ return function handleIdentify() {
3102
+ return _ref.apply(this, arguments);
3103
+ };
3104
+ }();
3199
3105
  return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(TextArea$1, {
3200
- placeholder: "\u6536\u8D27\u4EBA: xxx\u3000\u624B\u673A\u53F7\u7801: xxxxx\u3000\u6240\u5728\u5730\u533A: xx\u7701xx\u5E02xx\u533A\u3000\u8BE6\u7EC6\u5730\u5740: xxx",
3201
- rows: 5,
3106
+ placeholder: "\u590D\u5236\u7269\u6D41\u4FE1\u606F\uFF0C\u70B9\u51FB\u667A\u80FD\u8BC6\u522B",
3107
+ rows: 3,
3202
3108
  value: value,
3203
3109
  onChange: function onChange(e) {
3204
3110
  return setValue(e.target.value);
3205
3111
  }
3206
- }), /*#__PURE__*/React__default['default'].createElement(antd.Button, {
3112
+ }), /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
3207
3113
  size: "small",
3208
3114
  type: "primary",
3209
3115
  onClick: handleIdentify
@@ -3212,7 +3118,7 @@ var ParseLogistics = function ParseLogistics(props) {
3212
3118
  onClick: function onClick() {
3213
3119
  return setValue('');
3214
3120
  }
3215
- }, "\u6E05\u7A7A"));
3121
+ }, "\u6E05\u7A7A")));
3216
3122
  };
3217
3123
 
3218
3124
  var Item = antd.Form.Item;
@@ -3312,7 +3218,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
3312
3218
  })) === null || _find2 === void 0 ? void 0 : (_find2$config = _find2.config) === null || _find2$config === void 0 ? void 0 : _find2$config.showSenderMobile;
3313
3219
  }, [value === null || value === void 0 ? void 0 : value.interceptType, typeOptions, value === null || value === void 0 ? void 0 : value.interceptCompany]);
3314
3220
  //判断是否能修改物流信息
3315
- var canEdit = React.useMemo(function () {
3221
+ var isEdit = React.useMemo(function () {
3316
3222
  var company = expressInterceptData.find(function (item) {
3317
3223
  return item.value === initCompany;
3318
3224
  });
@@ -3344,7 +3250,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
3344
3250
  };
3345
3251
  var handleParseLogistics = function handleParseLogistics(val) {
3346
3252
  var params = _objectSpread2(_objectSpread2({}, value), {}, {
3347
- interceptDetail: val === null || val === void 0 ? void 0 : val.address,
3253
+ interceptDetail: val === null || val === void 0 ? void 0 : val.addressDetail,
3348
3254
  interceptReceiverName: val === null || val === void 0 ? void 0 : val.name,
3349
3255
  interceptReceiverMobile: val === null || val === void 0 ? void 0 : val.phone
3350
3256
  });
@@ -3358,7 +3264,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
3358
3264
  required: required,
3359
3265
  key: 'logistics'
3360
3266
  }, /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
3361
- disabled: disabled || canEdit,
3267
+ disabled: disabled || isEdit,
3362
3268
  placeholder: "\u7269\u6D41\u516C\u53F8",
3363
3269
  style: {
3364
3270
  width: '150px'
@@ -3373,7 +3279,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
3373
3279
  return option.label.includes(input);
3374
3280
  }
3375
3281
  }), /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3376
- disabled: disabled || canEdit,
3282
+ disabled: disabled || isEdit,
3377
3283
  placeholder: "\u7269\u6D41\u5355\u53F7",
3378
3284
  onChange: function onChange(e) {
3379
3285
  return changeHandle(e.target.value, 'interceptCode');
@@ -3384,7 +3290,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
3384
3290
  required: required,
3385
3291
  key: 'interceptType'
3386
3292
  }, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
3387
- disabled: disabled || canEdit,
3293
+ disabled: disabled || isEdit,
3388
3294
  style: {
3389
3295
  width: '200px'
3390
3296
  },
@@ -3405,7 +3311,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
3405
3311
  hidden: !showSenderMobile
3406
3312
  }, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3407
3313
  value: value === null || value === void 0 ? void 0 : value.interceptSenderMobile,
3408
- disabled: disabled || canEdit,
3314
+ disabled: disabled || isEdit,
3409
3315
  placeholder: "\u53D1\u4EF6\u4EBA\u624B\u673A\u53F7",
3410
3316
  onChange: function onChange(e) {
3411
3317
  return changeHandle(e.target.value, 'interceptSenderMobile');
@@ -3415,7 +3321,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
3415
3321
  required: true,
3416
3322
  key: 'newAddress',
3417
3323
  hidden: !showNewAddress
3418
- }, /*#__PURE__*/React__default['default'].createElement(ParseLogistics, {
3324
+ }, !(disabled || isEdit) && /*#__PURE__*/React__default['default'].createElement(ParseLogistics, {
3419
3325
  onChange: handleParseLogistics
3420
3326
  }), /*#__PURE__*/React__default['default'].createElement("br", null), /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(Province, {
3421
3327
  value: value === null || value === void 0 ? void 0 : value.interceptAddress,
@@ -3423,24 +3329,24 @@ var LogisticsInterception = function LogisticsInterception(props) {
3423
3329
  return changeHandle(val, 'interceptAddress');
3424
3330
  },
3425
3331
  options: [],
3426
- disabled: disabled || canEdit
3332
+ disabled: disabled || isEdit
3427
3333
  }), /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3428
3334
  value: value === null || value === void 0 ? void 0 : value.interceptDetail,
3429
- disabled: disabled || canEdit,
3335
+ disabled: disabled || isEdit,
3430
3336
  placeholder: "\u8BE6\u7EC6\u5730\u5740",
3431
3337
  onChange: function onChange(e) {
3432
3338
  return changeHandle(e.target.value, 'interceptDetail');
3433
3339
  }
3434
3340
  })), /*#__PURE__*/React__default['default'].createElement("br", null), /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3435
3341
  value: value === null || value === void 0 ? void 0 : value.interceptReceiverName,
3436
- disabled: disabled || canEdit,
3342
+ disabled: disabled || isEdit,
3437
3343
  placeholder: "\u6536\u4EF6\u4EBA\u59D3\u540D",
3438
3344
  onChange: function onChange(e) {
3439
3345
  return changeHandle(e.target.value, 'interceptReceiverName');
3440
3346
  }
3441
3347
  }), /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3442
3348
  value: value === null || value === void 0 ? void 0 : value.interceptReceiverMobile,
3443
- disabled: disabled || canEdit,
3349
+ disabled: disabled || isEdit,
3444
3350
  placeholder: "\u6536\u4EF6\u4EBA\u7535\u8BDD",
3445
3351
  onChange: function onChange(e) {
3446
3352
  return changeHandle(e.target.value, 'interceptReceiverMobile');
@@ -3464,7 +3370,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
3464
3370
  return option.label.includes(input);
3465
3371
  }
3466
3372
  }), (value === null || value === void 0 ? void 0 : value.interceptLogisticsStatus) === 'OTHER' && /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3467
- disabled: disabled || !canEdit,
3373
+ disabled: disabled || !isEdit,
3468
3374
  style: {
3469
3375
  width: '200px'
3470
3376
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "0.6.3-alpha.58",
3
+ "version": "0.6.3-alpha.59",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "",
6
6
  "license": "ISC",
@@ -20,7 +20,7 @@
20
20
  "test": "jest"
21
21
  },
22
22
  "dependencies": {
23
- "@kmkf-fe-packages/kmkf-utils": "^0.6.3-alpha.58",
23
+ "@kmkf-fe-packages/kmkf-utils": "^0.6.3-alpha.59",
24
24
  "umi-request": "^1.4.0"
25
25
  },
26
26
  "devDependencies": {
@@ -54,5 +54,5 @@
54
54
  "publishConfig": {
55
55
  "access": "public"
56
56
  },
57
- "gitHead": "0b2c3b2d0acf14affaad2fd17799ffe18fcd6537"
57
+ "gitHead": "9158065bef0aecfbd31d70ed129146ff51968fd4"
58
58
  }