@kmkf-fe-packages/basic-components 0.6.3 → 0.7.1-alpha.0

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.
Files changed (61) hide show
  1. package/README.md +1 -1
  2. package/dist/index.esm.js +473 -154
  3. package/dist/index.js +475 -153
  4. package/dist/jest.config.d.ts +17 -0
  5. package/dist/{apaas → src/apaas}/ApaasAddress/index.d.ts +2 -1
  6. package/dist/src/apaas/ApaasCascader/index.d.ts +3 -0
  7. package/dist/{apaas → src/apaas}/ApaasCheckbox/index.d.ts +2 -1
  8. package/dist/{apaas → src/apaas}/ApaasDate/index.d.ts +2 -1
  9. package/dist/{apaas → src/apaas}/ApaasInput/index.d.ts +2 -1
  10. package/dist/src/apaas/ApaasInputNumber/index.d.ts +4 -0
  11. package/dist/src/apaas/ApaasMultipleSelect/index.d.ts +4 -0
  12. package/dist/src/apaas/ApaasRadio/test/props.test.d.ts +1 -0
  13. package/dist/{apaas → src/apaas}/ApaasSelect/index.d.ts +2 -1
  14. package/dist/{apaas → src/apaas}/ApaasTextArea/index.d.ts +2 -1
  15. package/dist/{apaas → src/apaas}/ApaasUpload/index.d.ts +2 -1
  16. package/dist/{apaas → src/apaas}/ApaasUploadAsync/index.d.ts +2 -1
  17. package/dist/{apaas → src/apaas}/hoc/withFormItem.d.ts +1 -1
  18. package/dist/src/basics/FormItem/index.d.ts +3 -0
  19. package/dist/{business → src/business}/AliPay/index.d.ts +2 -1
  20. package/dist/{business → src/business}/BuyerNick/index.d.ts +2 -1
  21. package/dist/src/business/ChooseBaby/index.d.ts +4 -0
  22. package/dist/{business → src/business}/ExpressLogistics/index.d.ts +2 -1
  23. package/dist/{business → src/business}/Invoice/index.d.ts +2 -1
  24. package/dist/src/business/LogisticsInterception/index.d.ts +25 -0
  25. package/dist/{business → src/business}/Payment/index.d.ts +2 -1
  26. package/dist/{business → src/business}/Remark/index.d.ts +2 -1
  27. package/dist/{business → src/business}/ShopName/index.d.ts +2 -1
  28. package/dist/src/business/Status/index.d.ts +25 -0
  29. package/dist/src/business/Supplier/index.d.ts +4 -0
  30. package/dist/src/business/TBGoodId/index.d.ts +4 -0
  31. package/dist/src/business/TBGoodSerial/index.d.ts +4 -0
  32. package/dist/{business → src/business}/TradeId/index.d.ts +2 -1
  33. package/dist/{common → src/common}/ExpressCompany/index.d.ts +2 -1
  34. package/dist/{common → src/common}/Goods/goodModel.d.ts +2 -1
  35. package/dist/{common → src/common}/Goods/index.d.ts +2 -1
  36. package/dist/{common → src/common}/GoodsTable/goodModel.d.ts +2 -1
  37. package/dist/src/common/IdentifyAddress/index.d.ts +13 -0
  38. package/dist/src/common/Logistics/index.d.ts +4 -0
  39. package/dist/src/common/ParseLogistics/index.d.ts +6 -0
  40. package/dist/{config → src/config}/utils.d.ts +0 -1
  41. package/dist/{index.d.ts → src/index.d.ts} +3 -0
  42. package/dist/{jst → src/jst}/Goods/index.d.ts +2 -1
  43. package/dist/{jst → src/jst}/ItemList/index.d.ts +2 -1
  44. package/package.json +21 -4
  45. package/dist/apaas/ApaasCascader/index.d.ts +0 -2
  46. package/dist/apaas/ApaasInputNumber/index.d.ts +0 -3
  47. package/dist/apaas/ApaasMultipleSelect/index.d.ts +0 -3
  48. package/dist/basics/FormItem/index.d.ts +0 -2
  49. package/dist/business/ChooseBaby/index.d.ts +0 -3
  50. package/dist/business/Status/index.d.ts +0 -16
  51. package/dist/business/Supplier/index.d.ts +0 -3
  52. package/dist/business/TBGoodId/index.d.ts +0 -3
  53. package/dist/business/TBGoodSerial/index.d.ts +0 -3
  54. package/dist/common/Logistics/index.d.ts +0 -3
  55. /package/dist/{apaas → src/apaas}/ApaasRadio/index.d.ts +0 -0
  56. /package/dist/{apaas → src/apaas}/ApaasRate/index.d.ts +0 -0
  57. /package/dist/{apaas → src/apaas}/ApaasSlider/index.d.ts +0 -0
  58. /package/dist/{business → src/business}/Address/index.d.ts +0 -0
  59. /package/dist/{common → src/common}/GoodsTable/index.d.ts +0 -0
  60. /package/dist/{common → src/common}/Sku/index.d.ts +0 -0
  61. /package/dist/{common → src/common}/request.d.ts +0 -0
package/dist/index.esm.js CHANGED
@@ -2,6 +2,7 @@ import React, { useRef, useState, useEffect, useMemo, forwardRef, useImperativeH
2
2
  import { Cascader, DatePicker, Input, InputNumber, Select, Upload, Image, message, Radio, Space, Spin, Checkbox, Row, Col, Slider, Rate, Form, Tabs, Modal, Button, ConfigProvider, Pagination, Popover } from 'antd';
3
3
  import { EyeOutlined, DeleteOutlined } from '@ant-design/icons';
4
4
  import request, { extend } from 'umi-request';
5
+ import { AddressData, request as request$1, LogisticsAddressData } from '@kmkf-fe-packages/kmkf-utils';
5
6
  import zhCN from 'antd/lib/locale/zh_CN';
6
7
 
7
8
  function _iterableToArrayLimit(arr, i) {
@@ -498,6 +499,7 @@ var ApaasDate = function ApaasDate(props) {
498
499
 
499
500
  var _excluded$1 = ["isNumber", "replaceWarn"];
500
501
  function ApaasInput(props) {
502
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
501
503
  var isNumber = props.isNumber,
502
504
  replaceWarn = props.replaceWarn,
503
505
  other = _objectWithoutProperties(props, _excluded$1);
@@ -510,6 +512,7 @@ function ApaasInputNumber(props) {
510
512
 
511
513
  var _excluded$2 = ["options", "basicMultSelect"];
512
514
  function ApaasSelect(props) {
515
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
513
516
  var _props$options = props.options,
514
517
  options = _props$options === void 0 ? [] : _props$options,
515
518
  basicMultSelect = props.basicMultSelect,
@@ -579,8 +582,8 @@ var styles = {"imageBox":"index-module_imageBox__3tOEt","inputImage":"index-modu
579
582
  styleInject(css_248z);
580
583
 
581
584
  var _excluded$4 = ["maxCount", "maxSize", "uploadText", "onChange", "value", "accept", "canPreview", "disabled"];
582
- var fn = function fn(_ref) {
583
- var _ref2 = _slicedToArray(_ref, 0);
585
+ var fn = function fn() {
586
+ return void 0;
584
587
  };
585
588
  var getBase64 = function getBase64(file) {
586
589
  return new Promise(function (resolve, reject) {
@@ -594,24 +597,24 @@ var getBase64 = function getBase64(file) {
594
597
  };
595
598
  });
596
599
  };
597
- var ApaasUpload = function ApaasUpload(_ref3) {
598
- var _ref3$maxCount = _ref3.maxCount,
599
- maxCount = _ref3$maxCount === void 0 ? 10 : _ref3$maxCount,
600
- _ref3$maxSize = _ref3.maxSize,
601
- maxSize = _ref3$maxSize === void 0 ? 10 : _ref3$maxSize,
602
- _ref3$uploadText = _ref3.uploadText,
603
- uploadText = _ref3$uploadText === void 0 ? '上传' : _ref3$uploadText,
604
- _ref3$onChange = _ref3.onChange,
605
- onChange = _ref3$onChange === void 0 ? fn : _ref3$onChange,
606
- _ref3$value = _ref3.value,
607
- value = _ref3$value === void 0 ? [] : _ref3$value,
608
- _ref3$accept = _ref3.accept,
609
- accept = _ref3$accept === void 0 ? 'image/gif,image/jpg,image/jpeg,image/png' : _ref3$accept,
610
- _ref3$canPreview = _ref3.canPreview,
611
- canPreview = _ref3$canPreview === void 0 ? false : _ref3$canPreview,
612
- _ref3$disabled = _ref3.disabled,
613
- disabled = _ref3$disabled === void 0 ? false : _ref3$disabled,
614
- resetProps = _objectWithoutProperties(_ref3, _excluded$4);
600
+ var ApaasUpload = function ApaasUpload(_ref) {
601
+ var _ref$maxCount = _ref.maxCount,
602
+ maxCount = _ref$maxCount === void 0 ? 10 : _ref$maxCount,
603
+ _ref$maxSize = _ref.maxSize,
604
+ maxSize = _ref$maxSize === void 0 ? 10 : _ref$maxSize,
605
+ _ref$uploadText = _ref.uploadText,
606
+ uploadText = _ref$uploadText === void 0 ? '上传' : _ref$uploadText,
607
+ _ref$onChange = _ref.onChange,
608
+ onChange = _ref$onChange === void 0 ? fn : _ref$onChange,
609
+ _ref$value = _ref.value,
610
+ value = _ref$value === void 0 ? [] : _ref$value,
611
+ _ref$accept = _ref.accept,
612
+ accept = _ref$accept === void 0 ? 'image/gif,image/jpg,image/jpeg,image/png' : _ref$accept,
613
+ _ref$canPreview = _ref.canPreview,
614
+ canPreview = _ref$canPreview === void 0 ? false : _ref$canPreview,
615
+ _ref$disabled = _ref.disabled,
616
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
617
+ resetProps = _objectWithoutProperties(_ref, _excluded$4);
615
618
  var inputRef = useRef(null);
616
619
  var valueRef = useRef(value);
617
620
  var _useState = useState(false),
@@ -652,8 +655,8 @@ var ApaasUpload = function ApaasUpload(_ref3) {
652
655
  onChange(list);
653
656
  };
654
657
  var clipboardDataChange = function clipboardDataChange(e) {
655
- var clipboardData = e.clipboardData || window.clipboardData,
656
- i = 0,
658
+ var clipboardData = e.clipboardData || window.clipboardData;
659
+ var i = 0,
657
660
  items,
658
661
  item,
659
662
  types;
@@ -852,37 +855,6 @@ function ApaasRadio(props) {
852
855
  }))));
853
856
  }
854
857
 
855
- /*
856
- * @Author: wangzhenggui jianjia.wzg@raycloud.com
857
- * @Date: 2022-09-20 14:29:14
858
- * @LastEditors: litian
859
- * @LastEditTime: 2022-09-27 13:49:32
860
- * @FilePath: /raycloud-apaas-fe-setup/packages/apaas-react-basics-widgets/src/config/utils.ts
861
- * @Description:
862
- *
863
- * Copyright (c) 2022 by wangzhenggui jianjia.wzg@raycloud.com, All Rights Reserved.
864
- */
865
- //组装地址
866
- var toTree = function toTree() {
867
- var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
868
- var parId = arguments.length > 1 ? arguments[1] : undefined;
869
- var len = list === null || list === void 0 ? void 0 : list.length;
870
- function loop(parId) {
871
- var res = [];
872
- for (var i = 0; i < len; i++) {
873
- var item = list[i];
874
- if (item.parentId === Number(parId)) {
875
- item.children = loop(item.id);
876
- res.push(_objectSpread2(_objectSpread2({}, item), {}, {
877
- label: item.name,
878
- value: item.id
879
- }));
880
- }
881
- }
882
- return res;
883
- }
884
- return loop(parId);
885
- };
886
858
  var keepDecimals = function keepDecimals(value) {
887
859
  value = value.replace(/[^\d.]/g, ''); //清除"数字"和"."以外的字符
888
860
  value = value.replace(/^\./g, ''); //验证第一个字符是数字
@@ -911,32 +883,32 @@ var styles$1 = {"imageBox":"index-module_imageBox__8zj7A","inputImage":"index-mo
911
883
  styleInject(css_248z$1);
912
884
 
913
885
  var _excluded$6 = ["maxCount", "maxSize", "uploadText", "onChange", "value", "accept", "canPreview", "disabled", "uniqueKey", "hostUrl", "actionUrl"];
914
- var fn$1 = function fn(_ref) {
915
- var _ref2 = _slicedToArray(_ref, 0);
886
+ var fn$1 = function fn() {
887
+ return void 0;
916
888
  };
917
- var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
918
- var _ref3$maxCount = _ref3.maxCount,
919
- maxCount = _ref3$maxCount === void 0 ? 10 : _ref3$maxCount,
920
- _ref3$maxSize = _ref3.maxSize,
921
- maxSize = _ref3$maxSize === void 0 ? 10 : _ref3$maxSize,
922
- _ref3$uploadText = _ref3.uploadText,
923
- uploadText = _ref3$uploadText === void 0 ? '上传' : _ref3$uploadText,
924
- _ref3$onChange = _ref3.onChange,
925
- onChange = _ref3$onChange === void 0 ? fn$1 : _ref3$onChange,
926
- _ref3$value = _ref3.value,
927
- value = _ref3$value === void 0 ? [] : _ref3$value,
928
- _ref3$accept = _ref3.accept,
929
- accept = _ref3$accept === void 0 ? 'image/gif,image/jpg,image/jpeg,image/png' : _ref3$accept,
930
- _ref3$canPreview = _ref3.canPreview,
931
- canPreview = _ref3$canPreview === void 0 ? false : _ref3$canPreview,
932
- _ref3$disabled = _ref3.disabled,
933
- disabled = _ref3$disabled === void 0 ? false : _ref3$disabled,
934
- uniqueKey = _ref3.uniqueKey,
935
- _ref3$hostUrl = _ref3.hostUrl,
936
- hostUrl = _ref3$hostUrl === void 0 ? '' : _ref3$hostUrl,
937
- _ref3$actionUrl = _ref3.actionUrl,
938
- actionUrl = _ref3$actionUrl === void 0 ? '/qy/common/uploadWorkOrderImg' : _ref3$actionUrl,
939
- resetProps = _objectWithoutProperties(_ref3, _excluded$6);
889
+ var ApaasUploadAsync = function ApaasUploadAsync(_ref) {
890
+ var _ref$maxCount = _ref.maxCount,
891
+ maxCount = _ref$maxCount === void 0 ? 10 : _ref$maxCount,
892
+ _ref$maxSize = _ref.maxSize,
893
+ maxSize = _ref$maxSize === void 0 ? 10 : _ref$maxSize,
894
+ _ref$uploadText = _ref.uploadText,
895
+ uploadText = _ref$uploadText === void 0 ? '上传' : _ref$uploadText,
896
+ _ref$onChange = _ref.onChange,
897
+ onChange = _ref$onChange === void 0 ? fn$1 : _ref$onChange,
898
+ _ref$value = _ref.value,
899
+ value = _ref$value === void 0 ? [] : _ref$value,
900
+ _ref$accept = _ref.accept,
901
+ accept = _ref$accept === void 0 ? 'image/gif,image/jpg,image/jpeg,image/png' : _ref$accept,
902
+ _ref$canPreview = _ref.canPreview,
903
+ canPreview = _ref$canPreview === void 0 ? false : _ref$canPreview,
904
+ _ref$disabled = _ref.disabled,
905
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
906
+ uniqueKey = _ref.uniqueKey,
907
+ _ref$hostUrl = _ref.hostUrl,
908
+ hostUrl = _ref$hostUrl === void 0 ? '' : _ref$hostUrl,
909
+ _ref$actionUrl = _ref.actionUrl,
910
+ actionUrl = _ref$actionUrl === void 0 ? '/qy/common/uploadWorkOrderImg' : _ref$actionUrl,
911
+ resetProps = _objectWithoutProperties(_ref, _excluded$6);
940
912
  var inputRef = useRef(null);
941
913
  var valueRef = useRef(value);
942
914
  var _useState = useState(false),
@@ -959,7 +931,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
959
931
  valueRef.current = value;
960
932
  }, [value]);
961
933
  var asyncUpload = /*#__PURE__*/function () {
962
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {
934
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {
963
935
  var _valueRef$current;
964
936
  var formData, fileName, _yield$request, success, data;
965
937
  return _regeneratorRuntime().wrap(function _callee$(_context) {
@@ -1000,7 +972,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1000
972
  }, _callee, null, [[5, 14, 17, 20]]);
1001
973
  }));
1002
974
  return function asyncUpload(_x) {
1003
- return _ref4.apply(this, arguments);
975
+ return _ref2.apply(this, arguments);
1004
976
  };
1005
977
  }();
1006
978
  var imgReader = function imgReader(item) {
@@ -1015,7 +987,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1015
987
  return;
1016
988
  }
1017
989
  reader.onload = /*#__PURE__*/function () {
1018
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
990
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
1019
991
  var _e$target, _valueRef$current2;
1020
992
  var result, fileName, file;
1021
993
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
@@ -1032,7 +1004,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1032
1004
  }, _callee2);
1033
1005
  }));
1034
1006
  return function (_x2) {
1035
- return _ref5.apply(this, arguments);
1007
+ return _ref3.apply(this, arguments);
1036
1008
  };
1037
1009
  }();
1038
1010
  reader.readAsDataURL(blob);
@@ -1042,8 +1014,8 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1042
1014
  onChange(list);
1043
1015
  };
1044
1016
  var clipboardDataChange = function clipboardDataChange(e) {
1045
- var clipboardData = e.clipboardData || window.clipboardData,
1046
- i = 0,
1017
+ var clipboardData = e.clipboardData || window.clipboardData;
1018
+ var i = 0,
1047
1019
  items,
1048
1020
  item,
1049
1021
  types;
@@ -1188,7 +1160,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1188
1160
  })));
1189
1161
  };
1190
1162
 
1191
- var _excluded$7 = ["showOther", "horizontal", "options", "value", "onChange", "disabled", "checkboxOther"];
1163
+ var _excluded$7 = ["showOther", "horizontal", "options", "value", "onChange", "disabled"];
1192
1164
  function ApaasCheckbox(props) {
1193
1165
  var showOther = props.showOther,
1194
1166
  _props$horizontal = props.horizontal,
@@ -1199,7 +1171,6 @@ function ApaasCheckbox(props) {
1199
1171
  value = _props$value === void 0 ? {} : _props$value,
1200
1172
  onChange = props.onChange,
1201
1173
  disabled = props.disabled,
1202
- checkboxOther = props.checkboxOther,
1203
1174
  otherProps = _objectWithoutProperties(props, _excluded$7);
1204
1175
  var checkboxValue = value.value,
1205
1176
  other = value.other;
@@ -1361,18 +1332,7 @@ function ApaasRate(props) {
1361
1332
  }));
1362
1333
  }
1363
1334
 
1364
- /*
1365
- * @Author: wangzhenggui jianjia.wzg@raycloud.com
1366
- * @Date: 2022-09-13 11:06:09
1367
- * @LastEditors: wangzhenggui jianjia.wzg@raycloud.com
1368
- * @LastEditTime: 2022-11-04 15:55:10
1369
- * @FilePath: /raycloud-apaas-fe-setup/packages/apaas-react-basics-widgets/src/common/request.ts
1370
- * @Description:
1371
- *
1372
- * Copyright (c) 2022 by wangzhenggui jianjia.wzg@raycloud.com, All Rights Reserved.
1373
- */
1374
- var extendRequest = extend({});
1375
-
1335
+ var address = AddressData.getInstance();
1376
1336
  var Province = function Province(props) {
1377
1337
  var _useState = useState([]),
1378
1338
  _useState2 = _slicedToArray(_useState, 2),
@@ -1381,35 +1341,11 @@ var Province = function Province(props) {
1381
1341
  var isFirst = useRef(false);
1382
1342
  var initPageSource = /*#__PURE__*/function () {
1383
1343
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
1384
- var apaasAddress, apaasSaveTime, isExpire, _yield$request, list, arr;
1385
1344
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1386
1345
  while (1) switch (_context.prev = _context.next) {
1387
1346
  case 0:
1388
- apaasAddress = window.localStorage.getItem('apaasAddress');
1389
- apaasSaveTime = window.localStorage.getItem('apaasSaveTime'); //判断是否过期 缓存7天
1390
- isExpire = apaasSaveTime ? Number(apaasSaveTime) + 7 * 3600 * 24 * 1000 < new Date().getTime() : true;
1391
- if (!(apaasAddress && !isExpire)) {
1392
- _context.next = 6;
1393
- break;
1394
- }
1395
- setOptions(JSON.parse(apaasAddress));
1396
- return _context.abrupt("return");
1397
- case 6:
1398
- _context.next = 8;
1399
- return extendRequest('/qy/gdfw/template/queryAreas', {
1400
- method: 'get',
1401
- params: {
1402
- apiName: 'queryAreas'
1403
- }
1404
- });
1405
- case 8:
1406
- _yield$request = _context.sent;
1407
- list = _yield$request.data;
1408
- arr = toTree(list, 0);
1409
- setOptions(arr[0].children);
1410
- window.localStorage.setItem('apaasAddress', JSON.stringify(arr[0].children));
1411
- window.localStorage.setItem('apaasSaveTime', new Date().getTime().toString());
1412
- case 14:
1347
+ setOptions(address.addressOptions || []);
1348
+ case 1:
1413
1349
  case "end":
1414
1350
  return _context.stop();
1415
1351
  }
@@ -1507,15 +1443,11 @@ var ShopNameSelect = function ShopNameSelect(props) {
1507
1443
  disabled = props.disabled,
1508
1444
  style = props.style;
1509
1445
  var _useState = useState([]),
1510
- _useState2 = _slicedToArray(_useState, 2),
1511
- options = _useState2[0],
1512
- setOptions = _useState2[1];
1446
+ _useState2 = _slicedToArray(_useState, 1),
1447
+ options = _useState2[0];
1513
1448
  var handleChange = function handleChange(value) {
1514
1449
  onChange === null || onChange === void 0 ? void 0 : onChange(value);
1515
1450
  };
1516
- useEffect(function () {
1517
- // initDataSource();
1518
- }, []);
1519
1451
  return /*#__PURE__*/React.createElement(Select, {
1520
1452
  defaultValue: value,
1521
1453
  disabled: disabled,
@@ -1540,7 +1472,7 @@ function ApaasAddress(props) {
1540
1472
  var value = props.value,
1541
1473
  onChange = props.onChange,
1542
1474
  disabled = props.disabled;
1543
- var changeCity = function changeCity(city, selectedOptions) {
1475
+ var changeCity = function changeCity(city) {
1544
1476
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
1545
1477
  address: city
1546
1478
  }));
@@ -1690,7 +1622,6 @@ var AliPay = function AliPay(props) {
1690
1622
  var changeValue = function changeValue(e, type) {
1691
1623
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, e.target.value)));
1692
1624
  };
1693
- useEffect(function () {}, []);
1694
1625
  return /*#__PURE__*/React.createElement("div", null, !isSingle ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Input, {
1695
1626
  disabled: disabled,
1696
1627
  placeholder: "\u8BF7\u8F93\u5165\u652F\u4ED8\u5B9D\u540D\u79F0",
@@ -1717,6 +1648,18 @@ var AliPay = function AliPay(props) {
1717
1648
  })));
1718
1649
  };
1719
1650
 
1651
+ /*
1652
+ * @Author: wangzhenggui jianjia.wzg@raycloud.com
1653
+ * @Date: 2022-09-13 11:06:09
1654
+ * @LastEditors: wangzhenggui jianjia.wzg@raycloud.com
1655
+ * @LastEditTime: 2022-11-04 15:55:10
1656
+ * @FilePath: /raycloud-apaas-fe-setup/packages/apaas-react-basics-widgets/src/common/request.ts
1657
+ * @Description:
1658
+ *
1659
+ * Copyright (c) 2022 by wangzhenggui jianjia.wzg@raycloud.com, All Rights Reserved.
1660
+ */
1661
+ var extendRequest = extend({});
1662
+
1720
1663
  var css_248z$4 = ".goodsBox {\n display: flex;\n flex-wrap: wrap;\n}\n.goodsBox .goodBox-Img {\n width: 80px;\n margin: 0 10px 10px 0;\n}\n.goodsBox .right-context {\n font-size: 12px;\n}\n.goodsBox .right-context .ant-input {\n font-size: 12px;\n width: 80px;\n height: 20px;\n padding-left: 5px;\n padding-right: 5px;\n}\n.goodsBox .right-context .ant-input.id-textarea {\n width: 80px;\n resize: none;\n height: 45px;\n}\n.goodsBox.goodsBox-item-horizontal--box {\n flex-direction: row;\n width: auto;\n}\n.goods-imgBox {\n position: relative;\n width: 80px;\n height: 80px;\n border-radius: 4px;\n border: 1px solid #f2f3f5;\n margin: 0 10px 10px 0;\n text-align: center;\n background-color: #f2f3f5;\n}\n.goods-imgBox .add-btn {\n color: #86909c;\n}\n.goods-imgBox .text {\n color: #86909c;\n}\n.icon-close {\n position: absolute;\n top: -5px;\n right: -5px;\n width: 13px;\n height: 13px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n z-index: 3;\n background-color: #fff;\n cursor: pointer;\n}\n.img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.goods-title {\n margin: 0 0 10px 5px;\n color: #4e5969;\n}\n.searchBox {\n display: flex;\n justify-content: space-between;\n flex-wrap: wrap;\n margin-bottom: 10px;\n}\n.searchBox .search {\n width: 150px;\n margin-left: 6px;\n}\n.deg90 {\n transform: rotate(90deg);\n}\n.goodsMain {\n display: flex;\n flex-wrap: wrap;\n height: 400px;\n overflow-y: auto;\n margin-bottom: 10px;\n}\n.goodsMain .goodItem {\n width: 142px;\n height: 184px;\n padding: 7px;\n margin: 0 16px 16px 0;\n border-radius: 4px;\n background: #ffffff;\n box-sizing: border-box;\n /* 主题色/常规 */\n border: 1px solid #c9cdd4;\n}\n.goodsMain .goodItem .goodImg {\n width: 128px;\n height: 128px;\n border-radius: 4px;\n overflow: hidden;\n}\n.goodsMain .goodItem .goodImg img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.goodsMain .goodItem .goodText {\n text-align: center;\n font-size: 12px;\n color: #4e5969;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.goodsMain .goodItem .goodPrice {\n text-align: center;\n font-size: 14px;\n color: #1d2129;\n}\n.goodsMain .goodItem.active {\n border: 1px solid #1b5bf3;\n}\n@media screen and (max-width: 500px) {\n .goodsMain {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n grid-gap: 8px;\n height: 300px;\n }\n .goodsMain .goodItem {\n height: 126px;\n width: 83px;\n padding: 4px;\n margin: 0;\n border-radius: 4px;\n background: #FFFFFF;\n box-sizing: border-box;\n border: 1px solid rgba(0, 0, 0, 0.15);\n }\n .goodsMain .goodItem .goodImg {\n width: 98%;\n height: 77px;\n }\n .goodsMain .goodItem .goodText {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .goodsMain .goodItem.active {\n border: 1px solid #3089dc;\n }\n .searchBox {\n display: flex;\n flex-wrap: wrap;\n justify-content: initial;\n }\n .searchBox .classify {\n width: 120px;\n }\n .goodModal .ant-modal-body {\n padding: 8px;\n }\n}\n.goods-uploaded-count {\n color: #ff3638;\n}\n.footer {\n display: flex;\n justify-content: flex-end;\n}\n.right-context {\n display: flex;\n flex-direction: column;\n}\n.right-context .info-row {\n width: 80px;\n display: flex;\n align-items: center;\n padding: 0px 8px;\n border-radius: 2px;\n cursor: pointer;\n background: #f2f3f5;\n margin-bottom: 4px;\n}\n.right-context .info-row > div {\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n overflow: hidden;\n word-break: break-all;\n}\n.sphPagination {\n display: flex;\n align-items: center;\n}\n.sphPagination .shpBtn {\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 0 8px;\n height: 32px;\n border: 1px solid #d9d9d9;\n border-radius: 2px;\n cursor: pointer;\n margin: 0 8px;\n}\n.sphPagination .shpBtn.unCursor {\n color: #eee;\n cursor: not-allowed;\n}\n";
1721
1664
  styleInject(css_248z$4);
1722
1665
 
@@ -2232,8 +2175,7 @@ var Sku = /*#__PURE__*/forwardRef(function (props, ref) {
2232
2175
  useImperativeHandle(ref, function () {
2233
2176
  return {
2234
2177
  open: function open(_ref) {
2235
- var shopId = _ref.shopId,
2236
- numIids = _ref.numIids,
2178
+ var numIids = _ref.numIids,
2237
2179
  options = _ref.options;
2238
2180
  setVisible(true);
2239
2181
  setSku('');
@@ -2373,19 +2315,14 @@ var Goods = function Goods(props) {
2373
2315
  _useState2 = _slicedToArray(_useState, 2),
2374
2316
  visible = _useState2[0],
2375
2317
  setVisible = _useState2[1];
2376
- var _useState3 = useState(''),
2318
+ var _useState3 = useState(0),
2377
2319
  _useState4 = _slicedToArray(_useState3, 2),
2378
- editState = _useState4[0],
2379
- setEditState = _useState4[1];
2380
- var _useState5 = useState(0),
2381
- _useState6 = _slicedToArray(_useState5, 2),
2382
- uploadImageCount = _useState6[0],
2383
- setUploadImageCount = _useState6[1];
2320
+ uploadImageCount = _useState4[0],
2321
+ setUploadImageCount = _useState4[1];
2384
2322
  var skuRef = useRef();
2385
- var _useState7 = useState(false),
2386
- _useState8 = _slicedToArray(_useState7, 2),
2387
- editVisible = _useState8[0],
2388
- setEditVisible = _useState8[1];
2323
+ var _useState5 = useState(false),
2324
+ _useState6 = _slicedToArray(_useState5, 2),
2325
+ setEditVisible = _useState6[1];
2389
2326
  // onChange事件会修改imgList里的字段,所以保存初始化的imglist值
2390
2327
  if (!imgListConstant.length) {
2391
2328
  imgListConstant = JSON.parse(JSON.stringify(imgList));
@@ -2791,7 +2728,7 @@ var Invoice = function Invoice(props) {
2791
2728
  */
2792
2729
  var handleChange = /*#__PURE__*/function () {
2793
2730
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(ordinaryTaitou) {
2794
- var data, list, newList, index, element, kpName, idx;
2731
+ var data, _list, newList, index, element, kpName, idx;
2795
2732
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2796
2733
  while (1) switch (_context2.prev = _context2.next) {
2797
2734
  case 0:
@@ -2812,16 +2749,16 @@ var Invoice = function Invoice(props) {
2812
2749
  _context2.next = 16;
2813
2750
  break;
2814
2751
  }
2815
- list = data.data ? data.data.info || [] : [];
2816
- if (list.length) {
2752
+ _list = data.data ? data.data.info || [] : [];
2753
+ if (_list.length) {
2817
2754
  _context2.next = 10;
2818
2755
  break;
2819
2756
  }
2820
2757
  return _context2.abrupt("return");
2821
2758
  case 10:
2822
2759
  newList = [];
2823
- for (index = 0; index < list.length; index++) {
2824
- element = list[index];
2760
+ for (index = 0; index < _list.length; index++) {
2761
+ element = _list[index];
2825
2762
  kpName = element.kpName;
2826
2763
  idx = kpName.indexOf(ordinaryTaitou);
2827
2764
  element.kpName1 = kpName.substring(0, idx);
@@ -3115,6 +3052,389 @@ var Payment = function Payment(props) {
3115
3052
  }));
3116
3053
  };
3117
3054
 
3055
+ var TextArea$1 = Input.TextArea;
3056
+ var ParseLogistics = function ParseLogistics(props) {
3057
+ var onChange = props.onChange;
3058
+ var _useState = useState(""),
3059
+ _useState2 = _slicedToArray(_useState, 2),
3060
+ value = _useState2[0],
3061
+ setValue = _useState2[1];
3062
+ var handleIdentify = function handleIdentify() {
3063
+ if (!value) {
3064
+ return;
3065
+ }
3066
+ request$1({
3067
+ url: "/qy/logistics/addressAnalysis",
3068
+ method: "post",
3069
+ data: {
3070
+ fullAddress: value
3071
+ }
3072
+ }).then(function (res) {
3073
+ var data = res.data;
3074
+ onChange === null || onChange === void 0 ? void 0 : onChange(data);
3075
+ }).catch(function (e) {
3076
+ console.log(e);
3077
+ });
3078
+ };
3079
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TextArea$1, {
3080
+ placeholder: "\u590D\u5236\u7269\u6D41\u4FE1\u606F\uFF0C\u70B9\u51FB\u667A\u80FD\u8BC6\u522B",
3081
+ rows: 3,
3082
+ value: value,
3083
+ onChange: function onChange(e) {
3084
+ return setValue(e.target.value);
3085
+ }
3086
+ }), /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Button, {
3087
+ size: "small",
3088
+ type: "primary",
3089
+ onClick: handleIdentify
3090
+ }, "\u667A\u80FD\u8BC6\u522B"), /*#__PURE__*/React.createElement(Button, {
3091
+ size: "small",
3092
+ onClick: function onClick() {
3093
+ return setValue("");
3094
+ }
3095
+ }, "\u6E05\u7A7A")));
3096
+ };
3097
+
3098
+ var IdentifyAddress = function IdentifyAddress(props) {
3099
+ var value = props.value,
3100
+ onChange = props.onChange,
3101
+ _props$disabled = props.disabled,
3102
+ disabled = _props$disabled === void 0 ? false : _props$disabled;
3103
+ var changeHandle = function changeHandle(val, type) {
3104
+ onChange === null || onChange === void 0 ? void 0 : onChange(val, type);
3105
+ };
3106
+ var handleParseLogistics = function handleParseLogistics(val) {
3107
+ var params = {
3108
+ detail: val === null || val === void 0 ? void 0 : val.addressDetail,
3109
+ receiverName: val === null || val === void 0 ? void 0 : val.name,
3110
+ receiverMobile: val === null || val === void 0 ? void 0 : val.phone,
3111
+ address: []
3112
+ };
3113
+ if (val === null || val === void 0 ? void 0 : val.province) {
3114
+ params.address = [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)];
3115
+ }
3116
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2({}, params));
3117
+ };
3118
+ return /*#__PURE__*/React.createElement(React.Fragment, null, !disabled && /*#__PURE__*/React.createElement(ParseLogistics, {
3119
+ onChange: handleParseLogistics
3120
+ }), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Province, {
3121
+ value: value.address,
3122
+ onChange: function onChange(val) {
3123
+ return changeHandle(val, 'address');
3124
+ },
3125
+ options: [],
3126
+ disabled: disabled
3127
+ }), /*#__PURE__*/React.createElement(Input, {
3128
+ value: value.detail,
3129
+ disabled: disabled,
3130
+ placeholder: "\u8BE6\u7EC6\u5730\u5740",
3131
+ onChange: function onChange(e) {
3132
+ return changeHandle(e.target.value, 'detail');
3133
+ }
3134
+ })), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Input, {
3135
+ value: value.receiverName,
3136
+ disabled: disabled,
3137
+ placeholder: "\u6536\u4EF6\u4EBA\u59D3\u540D",
3138
+ onChange: function onChange(e) {
3139
+ return changeHandle(e.target.value, 'receiverName');
3140
+ }
3141
+ }), /*#__PURE__*/React.createElement(Input, {
3142
+ value: value.receiverMobile,
3143
+ disabled: disabled,
3144
+ placeholder: "\u6536\u4EF6\u4EBA\u7535\u8BDD",
3145
+ onChange: function onChange(e) {
3146
+ return changeHandle(e.target.value, 'receiverMobile');
3147
+ }
3148
+ })));
3149
+ };
3150
+
3151
+ var Item = Form.Item;
3152
+ var LogisticsAddress = LogisticsAddressData.getInstance();
3153
+ var LogisticsInterception = function LogisticsInterception(props) {
3154
+ var _props$value = props.value,
3155
+ value = _props$value === void 0 ? {} : _props$value,
3156
+ _props$logisticsOptio = props.logisticsOptions,
3157
+ logisticsOptions = _props$logisticsOptio === void 0 ? [] : _props$logisticsOptio,
3158
+ _props$expressInterce = props.expressInterceptData,
3159
+ expressInterceptData = _props$expressInterce === void 0 ? [] : _props$expressInterce,
3160
+ _props$logisticsAddre = props.logisticsAddressData,
3161
+ logisticsAddressData = _props$logisticsAddre === void 0 ? [] : _props$logisticsAddre,
3162
+ _props$required = props.required,
3163
+ required = _props$required === void 0 ? false : _props$required,
3164
+ onChange = props.onChange,
3165
+ _props$disabled = props.disabled,
3166
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
3167
+ _props$isEditing = props.isEditing,
3168
+ isEditing = _props$isEditing === void 0 ? false : _props$isEditing;
3169
+ var _useState = useState(''),
3170
+ _useState2 = _slicedToArray(_useState, 2),
3171
+ initCompany = _useState2[0],
3172
+ setInitCompany = _useState2[1];
3173
+ var _useState3 = useState([]),
3174
+ _useState4 = _slicedToArray(_useState3, 2),
3175
+ typeOptions = _useState4[0],
3176
+ setTypeOptions = _useState4[1];
3177
+ var _useState5 = useState([]),
3178
+ _useState6 = _slicedToArray(_useState5, 2),
3179
+ statusOptions = _useState6[0],
3180
+ setStatusOptions = _useState6[1];
3181
+ var _useState7 = useState(false),
3182
+ _useState8 = _slicedToArray(_useState7, 2),
3183
+ isInterface = _useState8[0],
3184
+ setIsInterface = _useState8[1];
3185
+ var firstIn = useRef(true);
3186
+ useEffect(function () {
3187
+ AddressData.getInstance();
3188
+ //存入第一次的物流地址,防止非对接物流切换成对接物流后无法编辑
3189
+ if (firstIn.current && JSON.stringify(value) !== '{}') {
3190
+ setInitCompany(value === null || value === void 0 ? void 0 : value.interceptCompany);
3191
+ firstIn.current = false;
3192
+ }
3193
+ if (!(value === null || value === void 0 ? void 0 : value.interceptCompany)) {
3194
+ setTypeOptions([]);
3195
+ setStatusOptions([]);
3196
+ setIsInterface(false);
3197
+ return;
3198
+ }
3199
+ var interceptCompany = expressInterceptData.find(function (item) {
3200
+ return item.value === (value === null || value === void 0 ? void 0 : value.interceptCompany);
3201
+ });
3202
+ setTypeOptions((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionTypeList) || []);
3203
+ setStatusOptions((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.logisticsStatusList) || []);
3204
+ setIsInterface(interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.isInterface);
3205
+ }, [value === null || value === void 0 ? void 0 : value.interceptCompany]);
3206
+ //拦截类型切换 需要清空派送地址
3207
+ useEffect(function () {
3208
+ if (!(value === null || value === void 0 ? void 0 : value.interceptCompany)) return;
3209
+ var interceptCompany = expressInterceptData.find(function (item) {
3210
+ return item.value === (value === null || value === void 0 ? void 0 : value.interceptCompany);
3211
+ });
3212
+ var showAddress = ((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionTypeList) || []).some(function (item) {
3213
+ var _item$config;
3214
+ return item.value === (value === null || value === void 0 ? void 0 : value.interceptType) && (item === null || item === void 0 ? void 0 : (_item$config = item.config) === null || _item$config === void 0 ? void 0 : _item$config.showAddress);
3215
+ });
3216
+ var showSender = ((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionTypeList) || []).some(function (item) {
3217
+ var _item$config2;
3218
+ return item.value === (value === null || value === void 0 ? void 0 : value.interceptType) && (item === null || item === void 0 ? void 0 : (_item$config2 = item.config) === null || _item$config2 === void 0 ? void 0 : _item$config2.showSenderMobile);
3219
+ });
3220
+ var params = _objectSpread2({}, value);
3221
+ if (!showAddress) {
3222
+ params = _objectSpread2(_objectSpread2({}, params), {}, {
3223
+ interceptAddress: [],
3224
+ interceptDetail: '',
3225
+ interceptReceiverName: '',
3226
+ interceptReceiverMobile: ''
3227
+ });
3228
+ }
3229
+ if (!showSender) {
3230
+ params = _objectSpread2(_objectSpread2({}, params), {}, {
3231
+ interceptSenderMobile: undefined
3232
+ });
3233
+ }
3234
+ onChange === null || onChange === void 0 ? void 0 : onChange(params);
3235
+ }, [value === null || value === void 0 ? void 0 : value.interceptType]);
3236
+ //是否展示新地址
3237
+ var showNewAddress = useMemo(function () {
3238
+ var _find, _find$config;
3239
+ return (_find = (typeOptions || []).find(function (item) {
3240
+ return item.value === (value === null || value === void 0 ? void 0 : value.interceptType);
3241
+ })) === null || _find === void 0 ? void 0 : (_find$config = _find.config) === null || _find$config === void 0 ? void 0 : _find$config.showAddress;
3242
+ }, [value === null || value === void 0 ? void 0 : value.interceptType, typeOptions, value === null || value === void 0 ? void 0 : value.interceptCompany]);
3243
+ //是否回退新地址
3244
+ var showReturnAddress = useMemo(function () {
3245
+ var _find2, _find2$config;
3246
+ return (_find2 = (typeOptions || []).find(function (item) {
3247
+ return item.value === (value === null || value === void 0 ? void 0 : value.interceptType);
3248
+ })) === null || _find2 === void 0 ? void 0 : (_find2$config = _find2.config) === null || _find2$config === void 0 ? void 0 : _find2$config.showAddressSelect;
3249
+ }, [value === null || value === void 0 ? void 0 : value.interceptType, typeOptions, value === null || value === void 0 ? void 0 : value.interceptCompany]);
3250
+ //是否展示发件人手机号
3251
+ var showSenderMobile = useMemo(function () {
3252
+ var _find3, _find3$config;
3253
+ return (_find3 = (typeOptions || []).find(function (item) {
3254
+ return item.value === (value === null || value === void 0 ? void 0 : value.interceptType);
3255
+ })) === null || _find3 === void 0 ? void 0 : (_find3$config = _find3.config) === null || _find3$config === void 0 ? void 0 : _find3$config.showSenderMobile;
3256
+ }, [value === null || value === void 0 ? void 0 : value.interceptType, typeOptions, value === null || value === void 0 ? void 0 : value.interceptCompany]);
3257
+ //判断是否能修改物流信息
3258
+ var isEdit = useMemo(function () {
3259
+ var company = expressInterceptData.find(function (item) {
3260
+ return item.value === initCompany;
3261
+ });
3262
+ return isEditing && !!(company === null || company === void 0 ? void 0 : company.isInterface);
3263
+ }, [isEditing, initCompany]);
3264
+ var logisticsAddressOptions = useMemo(function () {
3265
+ return logisticsAddressData.filter(function (item) {
3266
+ return item.cpCode === (value === null || value === void 0 ? void 0 : value.interceptCompany);
3267
+ });
3268
+ }, [value === null || value === void 0 ? void 0 : value.interceptCompany]);
3269
+ //选择回调
3270
+ var changeHandle = function changeHandle(val, type) {
3271
+ var newValue = _objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, val));
3272
+ if (type === 'interceptCompany') {
3273
+ var interceptCompany = expressInterceptData.find(function (item) {
3274
+ return item.value === val;
3275
+ });
3276
+ var returnValue = ((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionTypeList) || []).find(function (item) {
3277
+ var _item$config3;
3278
+ return item === null || item === void 0 ? void 0 : (_item$config3 = item.config) === null || _item$config3 === void 0 ? void 0 : _item$config3.isDefault;
3279
+ });
3280
+ newValue = _objectSpread2(_objectSpread2({}, value), {}, {
3281
+ interceptCompany: val,
3282
+ interceptType: returnValue === null || returnValue === void 0 ? void 0 : returnValue.value,
3283
+ interceptSenderMobile: undefined,
3284
+ interceptAddress: [],
3285
+ interceptDetail: undefined,
3286
+ interceptReceiverName: undefined,
3287
+ interceptReceiverMobile: undefined,
3288
+ interceptLogisticsStatus: undefined,
3289
+ interceptLogisticsStatusOther: undefined
3290
+ });
3291
+ }
3292
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
3293
+ };
3294
+ //智能识别回调
3295
+ var changeIdentify = function changeIdentify(val, type) {
3296
+ //输入返填
3297
+ if (type) {
3298
+ var typeMap = {
3299
+ address: 'interceptAddress',
3300
+ detail: 'interceptDetail',
3301
+ receiverName: 'interceptReceiverName',
3302
+ receiverMobile: 'interceptReceiverMobile'
3303
+ };
3304
+ var newValue = _objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, typeMap[type], val));
3305
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
3306
+ } else {
3307
+ //智能识别返填
3308
+ var parseValue = _objectSpread2(_objectSpread2({}, value), {}, {
3309
+ interceptAddress: (val === null || val === void 0 ? void 0 : val.address) || [],
3310
+ interceptDetail: (val === null || val === void 0 ? void 0 : val.detail) || '',
3311
+ interceptReceiverName: (val === null || val === void 0 ? void 0 : val.receiverName) || '',
3312
+ interceptReceiverMobile: (val === null || val === void 0 ? void 0 : val.receiverMobile) || ''
3313
+ });
3314
+ onChange === null || onChange === void 0 ? void 0 : onChange(parseValue);
3315
+ }
3316
+ };
3317
+ //选择退回地址
3318
+ var changeReturnAddress = function changeReturnAddress(uk) {
3319
+ var item = LogisticsAddress.getItemByUk(uk);
3320
+ if (item) {
3321
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
3322
+ interceptAddress: [item === null || item === void 0 ? void 0 : item.province, item === null || item === void 0 ? void 0 : item.city, item === null || item === void 0 ? void 0 : item.district],
3323
+ interceptDetail: item === null || item === void 0 ? void 0 : item.detail,
3324
+ interceptReceiverName: item === null || item === void 0 ? void 0 : item.userName,
3325
+ interceptReceiverMobile: item === null || item === void 0 ? void 0 : item.mobile
3326
+ }));
3327
+ }
3328
+ };
3329
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Item, {
3330
+ label: '物流信息',
3331
+ required: required,
3332
+ key: 'logistics'
3333
+ }, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Select, {
3334
+ disabled: disabled || isEdit,
3335
+ placeholder: "\u7269\u6D41\u516C\u53F8",
3336
+ style: {
3337
+ width: '150px'
3338
+ },
3339
+ onChange: function onChange(val) {
3340
+ return changeHandle(val, 'interceptCompany');
3341
+ },
3342
+ value: (value === null || value === void 0 ? void 0 : value.interceptCompany) === '' ? undefined : value === null || value === void 0 ? void 0 : value.interceptCompany,
3343
+ options: logisticsOptions,
3344
+ showSearch: true,
3345
+ filterOption: function filterOption(input, option) {
3346
+ return option.label.includes(input);
3347
+ }
3348
+ }), /*#__PURE__*/React.createElement(Input, {
3349
+ disabled: disabled || isEdit,
3350
+ placeholder: "\u7269\u6D41\u5355\u53F7",
3351
+ onChange: function onChange(e) {
3352
+ return changeHandle(e.target.value, 'interceptCode');
3353
+ },
3354
+ value: value === null || value === void 0 ? void 0 : value.interceptCode
3355
+ }))), /*#__PURE__*/React.createElement(Item, {
3356
+ label: '拦截类型',
3357
+ required: required,
3358
+ key: 'interceptType'
3359
+ }, /*#__PURE__*/React.createElement(Select, {
3360
+ disabled: disabled || isEdit,
3361
+ style: {
3362
+ width: '200px'
3363
+ },
3364
+ options: typeOptions,
3365
+ onChange: function onChange(val) {
3366
+ return changeHandle(val, 'interceptType');
3367
+ },
3368
+ value: value === null || value === void 0 ? void 0 : value.interceptType,
3369
+ placeholder: "\u62E6\u622A\u7C7B\u578B",
3370
+ showSearch: true,
3371
+ filterOption: function filterOption(input, option) {
3372
+ return option.label.includes(input);
3373
+ }
3374
+ })), /*#__PURE__*/React.createElement(Item, {
3375
+ label: '发件人手机号',
3376
+ required: true,
3377
+ key: 'interceptSenderMobile',
3378
+ hidden: !showSenderMobile
3379
+ }, /*#__PURE__*/React.createElement(Input, {
3380
+ value: value === null || value === void 0 ? void 0 : value.interceptSenderMobile,
3381
+ disabled: disabled || isEdit,
3382
+ placeholder: "\u53D1\u4EF6\u4EBA\u624B\u673A\u53F7",
3383
+ onChange: function onChange(e) {
3384
+ return changeHandle(e.target.value, 'interceptSenderMobile');
3385
+ }
3386
+ })), /*#__PURE__*/React.createElement(Item, {
3387
+ label: '退回地址',
3388
+ required: true,
3389
+ key: 'returnAddress',
3390
+ hidden: !showReturnAddress
3391
+ }, /*#__PURE__*/React.createElement(Select, {
3392
+ options: logisticsAddressOptions,
3393
+ onChange: changeReturnAddress
3394
+ })), /*#__PURE__*/React.createElement(Item, {
3395
+ label: '派送地址',
3396
+ required: true,
3397
+ key: 'newAddress',
3398
+ hidden: !showNewAddress
3399
+ }, /*#__PURE__*/React.createElement(IdentifyAddress, {
3400
+ disabled: disabled || isEdit,
3401
+ value: {
3402
+ address: (value === null || value === void 0 ? void 0 : value.interceptAddress) || [],
3403
+ detail: (value === null || value === void 0 ? void 0 : value.interceptDetail) || '',
3404
+ receiverName: (value === null || value === void 0 ? void 0 : value.interceptReceiverName) || '',
3405
+ receiverMobile: (value === null || value === void 0 ? void 0 : value.interceptReceiverMobile) || ''
3406
+ },
3407
+ onChange: changeIdentify
3408
+ })), /*#__PURE__*/React.createElement(Item, {
3409
+ label: '物流状态',
3410
+ key: 'interceptLogisticsStatus'
3411
+ }, /*#__PURE__*/React.createElement(Select, {
3412
+ disabled: disabled || isInterface,
3413
+ style: {
3414
+ width: '200px'
3415
+ },
3416
+ options: statusOptions,
3417
+ onChange: function onChange(val) {
3418
+ return changeHandle(val, 'interceptLogisticsStatus');
3419
+ },
3420
+ value: value === null || value === void 0 ? void 0 : value.interceptLogisticsStatus,
3421
+ placeholder: "\u7269\u6D41\u72B6\u6001",
3422
+ showSearch: true,
3423
+ filterOption: function filterOption(input, option) {
3424
+ return option.label.includes(input);
3425
+ }
3426
+ }), (value === null || value === void 0 ? void 0 : value.interceptLogisticsStatus) === 'OTHER' && /*#__PURE__*/React.createElement(Input, {
3427
+ disabled: disabled || !isEdit,
3428
+ style: {
3429
+ width: '200px'
3430
+ },
3431
+ placeholder: "\u5176\u4ED6",
3432
+ onChange: function onChange(e) {
3433
+ return changeHandle(e.target.value, 'interceptLogisticsStatusOther');
3434
+ }
3435
+ })));
3436
+ };
3437
+
3118
3438
  var jstGoods = function jstGoods(props) {
3119
3439
  var _value$changeIndex, _value$changeIndex2, _value$changeIndex3, _value$changeIndex4, _value$changeIndex5, _value$changeIndex6;
3120
3440
  var _props$value = props.value,
@@ -3370,9 +3690,8 @@ var GoodsModal$1 = function GoodsModal(props) {
3370
3690
  tab: '已选择',
3371
3691
  key: 'all'
3372
3692
  }]),
3373
- _useState18 = _slicedToArray(_useState17, 2),
3374
- tabs = _useState18[0],
3375
- setTabs = _useState18[1];
3693
+ _useState18 = _slicedToArray(_useState17, 1),
3694
+ tabs = _useState18[0];
3376
3695
  var _useState19 = useState([{
3377
3696
  name: '上架时间',
3378
3697
  value: 'list_time'
@@ -3780,4 +4099,4 @@ var Goods$1 = function Goods(props, ref) {
3780
4099
  };
3781
4100
  var index = /*#__PURE__*/forwardRef(Goods$1);
3782
4101
 
3783
- export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasMultipleSelect, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, ApaasUploadAsync, BuyerNick, ChooseBaby, ExpressLogistics, Goods, index as GoodsTable, Invoice, jstGoods as JstGoods, ItemList as JstItemList, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, Supplier, TBGoodId, TBGoodSerial, TradeId };
4102
+ export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasMultipleSelect, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, ApaasUploadAsync, BuyerNick, ChooseBaby, ExpressLogistics, Goods, index as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, Supplier, TBGoodId, TBGoodSerial, TradeId };