@kmkf-fe-packages/basic-components 0.6.3-alpha.56 → 0.6.3-alpha.57
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 +168 -1
- package/dist/index.js +168 -1
- package/dist/src/common/ParseLogistics/index.d.ts +6 -0
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -354,6 +354,53 @@ 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
|
+
}
|
|
357
404
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
358
405
|
try {
|
|
359
406
|
var info = gen[key](arg);
|
|
@@ -398,6 +445,29 @@ function _defineProperty(obj, key, value) {
|
|
|
398
445
|
}
|
|
399
446
|
return obj;
|
|
400
447
|
}
|
|
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
|
+
}
|
|
401
471
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
402
472
|
if (source == null) return {};
|
|
403
473
|
var target = {};
|
|
@@ -3052,6 +3122,89 @@ var Payment = function Payment(props) {
|
|
|
3052
3122
|
}));
|
|
3053
3123
|
};
|
|
3054
3124
|
|
|
3125
|
+
var TextArea$1 = Input.TextArea;
|
|
3126
|
+
var ParseLogistics = function ParseLogistics(props) {
|
|
3127
|
+
var onChange = props.onChange;
|
|
3128
|
+
var _useState = useState(''),
|
|
3129
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
3130
|
+
value = _useState2[0],
|
|
3131
|
+
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
|
+
};
|
|
3189
|
+
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,
|
|
3192
|
+
value: value,
|
|
3193
|
+
onChange: function onChange(e) {
|
|
3194
|
+
return setValue(e.target.value);
|
|
3195
|
+
}
|
|
3196
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
3197
|
+
size: "small",
|
|
3198
|
+
type: "primary",
|
|
3199
|
+
onClick: handleIdentify
|
|
3200
|
+
}, "\u667A\u80FD\u8BC6\u522B"), /*#__PURE__*/React.createElement(Button, {
|
|
3201
|
+
size: "small",
|
|
3202
|
+
onClick: function onClick() {
|
|
3203
|
+
return setValue('');
|
|
3204
|
+
}
|
|
3205
|
+
}, "\u6E05\u7A7A"));
|
|
3206
|
+
};
|
|
3207
|
+
|
|
3055
3208
|
var Item = Form.Item;
|
|
3056
3209
|
var LogisticsInterception = function LogisticsInterception(props) {
|
|
3057
3210
|
var _props$value = props.value,
|
|
@@ -3085,6 +3238,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3085
3238
|
setIsInterface = _useState8[1];
|
|
3086
3239
|
var firstIn = useRef(true);
|
|
3087
3240
|
useEffect(function () {
|
|
3241
|
+
AddressData.getInstance();
|
|
3088
3242
|
//存入第一次的物流地址,防止非对接物流切换成对接物流后无法编辑
|
|
3089
3243
|
if (firstIn.current && JSON.stringify(value) !== '{}') {
|
|
3090
3244
|
setInitCompany(value === null || value === void 0 ? void 0 : value.interceptCompany);
|
|
@@ -3178,6 +3332,17 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3178
3332
|
}
|
|
3179
3333
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
3180
3334
|
};
|
|
3335
|
+
var handleParseLogistics = function handleParseLogistics(val) {
|
|
3336
|
+
var params = _objectSpread2(_objectSpread2({}, value), {}, {
|
|
3337
|
+
interceptDetail: val === null || val === void 0 ? void 0 : val.address,
|
|
3338
|
+
interceptReceiverName: val === null || val === void 0 ? void 0 : val.name,
|
|
3339
|
+
interceptReceiverMobile: val === null || val === void 0 ? void 0 : val.phone
|
|
3340
|
+
});
|
|
3341
|
+
if (val === null || val === void 0 ? void 0 : val.province) {
|
|
3342
|
+
params.interceptAddress = [AddressData.getInstance().getProCodeByName(val === null || val === void 0 ? void 0 : val.province), AddressData.getInstance().getProCodeByName(val === null || val === void 0 ? void 0 : val.city), AddressData.getInstance().getProCodeByName(val === null || val === void 0 ? void 0 : val.district)];
|
|
3343
|
+
}
|
|
3344
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2({}, params));
|
|
3345
|
+
};
|
|
3181
3346
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Item, {
|
|
3182
3347
|
label: '物流信息',
|
|
3183
3348
|
required: required,
|
|
@@ -3240,7 +3405,9 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3240
3405
|
required: true,
|
|
3241
3406
|
key: 'newAddress',
|
|
3242
3407
|
hidden: !showNewAddress
|
|
3243
|
-
}, /*#__PURE__*/React.createElement(
|
|
3408
|
+
}, /*#__PURE__*/React.createElement(ParseLogistics, {
|
|
3409
|
+
onChange: handleParseLogistics
|
|
3410
|
+
}), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Province, {
|
|
3244
3411
|
value: value === null || value === void 0 ? void 0 : value.interceptAddress,
|
|
3245
3412
|
onChange: function onChange(val) {
|
|
3246
3413
|
return changeHandle(val, 'interceptAddress');
|
package/dist/index.js
CHANGED
|
@@ -364,6 +364,53 @@ 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
|
+
}
|
|
367
414
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
368
415
|
try {
|
|
369
416
|
var info = gen[key](arg);
|
|
@@ -408,6 +455,29 @@ function _defineProperty(obj, key, value) {
|
|
|
408
455
|
}
|
|
409
456
|
return obj;
|
|
410
457
|
}
|
|
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
|
+
}
|
|
411
481
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
412
482
|
if (source == null) return {};
|
|
413
483
|
var target = {};
|
|
@@ -3062,6 +3132,89 @@ var Payment = function Payment(props) {
|
|
|
3062
3132
|
}));
|
|
3063
3133
|
};
|
|
3064
3134
|
|
|
3135
|
+
var TextArea$1 = antd.Input.TextArea;
|
|
3136
|
+
var ParseLogistics = function ParseLogistics(props) {
|
|
3137
|
+
var onChange = props.onChange;
|
|
3138
|
+
var _useState = React.useState(''),
|
|
3139
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
3140
|
+
value = _useState2[0],
|
|
3141
|
+
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
|
+
};
|
|
3199
|
+
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,
|
|
3202
|
+
value: value,
|
|
3203
|
+
onChange: function onChange(e) {
|
|
3204
|
+
return setValue(e.target.value);
|
|
3205
|
+
}
|
|
3206
|
+
}), /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
3207
|
+
size: "small",
|
|
3208
|
+
type: "primary",
|
|
3209
|
+
onClick: handleIdentify
|
|
3210
|
+
}, "\u667A\u80FD\u8BC6\u522B"), /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
3211
|
+
size: "small",
|
|
3212
|
+
onClick: function onClick() {
|
|
3213
|
+
return setValue('');
|
|
3214
|
+
}
|
|
3215
|
+
}, "\u6E05\u7A7A"));
|
|
3216
|
+
};
|
|
3217
|
+
|
|
3065
3218
|
var Item = antd.Form.Item;
|
|
3066
3219
|
var LogisticsInterception = function LogisticsInterception(props) {
|
|
3067
3220
|
var _props$value = props.value,
|
|
@@ -3095,6 +3248,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3095
3248
|
setIsInterface = _useState8[1];
|
|
3096
3249
|
var firstIn = React.useRef(true);
|
|
3097
3250
|
React.useEffect(function () {
|
|
3251
|
+
kmkfUtils.AddressData.getInstance();
|
|
3098
3252
|
//存入第一次的物流地址,防止非对接物流切换成对接物流后无法编辑
|
|
3099
3253
|
if (firstIn.current && JSON.stringify(value) !== '{}') {
|
|
3100
3254
|
setInitCompany(value === null || value === void 0 ? void 0 : value.interceptCompany);
|
|
@@ -3188,6 +3342,17 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3188
3342
|
}
|
|
3189
3343
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
3190
3344
|
};
|
|
3345
|
+
var handleParseLogistics = function handleParseLogistics(val) {
|
|
3346
|
+
var params = _objectSpread2(_objectSpread2({}, value), {}, {
|
|
3347
|
+
interceptDetail: val === null || val === void 0 ? void 0 : val.address,
|
|
3348
|
+
interceptReceiverName: val === null || val === void 0 ? void 0 : val.name,
|
|
3349
|
+
interceptReceiverMobile: val === null || val === void 0 ? void 0 : val.phone
|
|
3350
|
+
});
|
|
3351
|
+
if (val === null || val === void 0 ? void 0 : val.province) {
|
|
3352
|
+
params.interceptAddress = [kmkfUtils.AddressData.getInstance().getProCodeByName(val === null || val === void 0 ? void 0 : val.province), kmkfUtils.AddressData.getInstance().getProCodeByName(val === null || val === void 0 ? void 0 : val.city), kmkfUtils.AddressData.getInstance().getProCodeByName(val === null || val === void 0 ? void 0 : val.district)];
|
|
3353
|
+
}
|
|
3354
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2({}, params));
|
|
3355
|
+
};
|
|
3191
3356
|
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(Item, {
|
|
3192
3357
|
label: '物流信息',
|
|
3193
3358
|
required: required,
|
|
@@ -3250,7 +3415,9 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3250
3415
|
required: true,
|
|
3251
3416
|
key: 'newAddress',
|
|
3252
3417
|
hidden: !showNewAddress
|
|
3253
|
-
}, /*#__PURE__*/React__default['default'].createElement(
|
|
3418
|
+
}, /*#__PURE__*/React__default['default'].createElement(ParseLogistics, {
|
|
3419
|
+
onChange: handleParseLogistics
|
|
3420
|
+
}), /*#__PURE__*/React__default['default'].createElement("br", null), /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(Province, {
|
|
3254
3421
|
value: value === null || value === void 0 ? void 0 : value.interceptAddress,
|
|
3255
3422
|
onChange: function onChange(val) {
|
|
3256
3423
|
return changeHandle(val, 'interceptAddress');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/basic-components",
|
|
3
|
-
"version": "0.6.3-alpha.
|
|
3
|
+
"version": "0.6.3-alpha.57",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "ISC",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "2dfaa8121ffa8cd0eeb41be266c0587a0e4e8b38"
|
|
55
55
|
}
|