@kmkf-fe-packages/basic-components 0.6.3-alpha.4 → 0.6.3-alpha.45

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 (39) hide show
  1. package/README.md +1 -1
  2. package/dist/apaas/ApaasAddress/index.d.ts +2 -1
  3. package/dist/apaas/ApaasCascader/index.d.ts +2 -1
  4. package/dist/apaas/ApaasCheckbox/index.d.ts +2 -1
  5. package/dist/apaas/ApaasDate/index.d.ts +2 -1
  6. package/dist/apaas/ApaasInput/index.d.ts +2 -1
  7. package/dist/apaas/ApaasInputNumber/index.d.ts +2 -1
  8. package/dist/apaas/ApaasMultipleSelect/index.d.ts +2 -1
  9. package/dist/apaas/ApaasSelect/index.d.ts +2 -1
  10. package/dist/apaas/ApaasTextArea/index.d.ts +2 -1
  11. package/dist/apaas/ApaasUpload/index.d.ts +2 -1
  12. package/dist/apaas/ApaasUploadAsync/index.d.ts +2 -1
  13. package/dist/apaas/hoc/withFormItem.d.ts +1 -1
  14. package/dist/basics/FormItem/index.d.ts +2 -1
  15. package/dist/business/AliPay/index.d.ts +2 -1
  16. package/dist/business/BuyerNick/index.d.ts +2 -1
  17. package/dist/business/ChooseBaby/index.d.ts +2 -1
  18. package/dist/business/ExpressLogistics/index.d.ts +2 -1
  19. package/dist/business/Invoice/index.d.ts +2 -1
  20. package/dist/business/LogisticsInterception/index.d.ts +5 -4
  21. package/dist/business/Payment/index.d.ts +2 -1
  22. package/dist/business/Remark/index.d.ts +2 -1
  23. package/dist/business/ShopName/index.d.ts +2 -1
  24. package/dist/business/Status/index.d.ts +10 -1
  25. package/dist/business/Supplier/index.d.ts +2 -1
  26. package/dist/business/TBGoodId/index.d.ts +2 -1
  27. package/dist/business/TBGoodSerial/index.d.ts +2 -1
  28. package/dist/business/TradeId/index.d.ts +2 -1
  29. package/dist/common/ExpressCompany/index.d.ts +2 -1
  30. package/dist/common/Goods/goodModel.d.ts +2 -1
  31. package/dist/common/Goods/index.d.ts +2 -1
  32. package/dist/common/GoodsTable/goodModel.d.ts +2 -1
  33. package/dist/common/Logistics/index.d.ts +2 -1
  34. package/dist/config/utils.d.ts +0 -1
  35. package/dist/index.esm.js +167 -198
  36. package/dist/index.js +167 -198
  37. package/dist/jst/Goods/index.d.ts +2 -1
  38. package/dist/jst/ItemList/index.d.ts +2 -1
  39. package/package.json +9 -4
package/dist/index.js CHANGED
@@ -6,6 +6,7 @@ var React = require('react');
6
6
  var antd = require('antd');
7
7
  var icons = require('@ant-design/icons');
8
8
  var request = require('umi-request');
9
+ var kmkfUtils = require('@kmkf-fe-packages/kmkf-utils');
9
10
  var zhCN = require('antd/lib/locale/zh_CN');
10
11
 
11
12
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -508,6 +509,7 @@ var ApaasDate = function ApaasDate(props) {
508
509
 
509
510
  var _excluded$1 = ["isNumber", "replaceWarn"];
510
511
  function ApaasInput(props) {
512
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
511
513
  var isNumber = props.isNumber,
512
514
  replaceWarn = props.replaceWarn,
513
515
  other = _objectWithoutProperties(props, _excluded$1);
@@ -520,6 +522,7 @@ function ApaasInputNumber(props) {
520
522
 
521
523
  var _excluded$2 = ["options", "basicMultSelect"];
522
524
  function ApaasSelect(props) {
525
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
523
526
  var _props$options = props.options,
524
527
  options = _props$options === void 0 ? [] : _props$options,
525
528
  basicMultSelect = props.basicMultSelect,
@@ -589,8 +592,8 @@ var styles = {"imageBox":"index-module_imageBox__3tOEt","inputImage":"index-modu
589
592
  styleInject(css_248z);
590
593
 
591
594
  var _excluded$4 = ["maxCount", "maxSize", "uploadText", "onChange", "value", "accept", "canPreview", "disabled"];
592
- var fn = function fn(_ref) {
593
- var _ref2 = _slicedToArray(_ref, 0);
595
+ var fn = function fn() {
596
+ return void 0;
594
597
  };
595
598
  var getBase64 = function getBase64(file) {
596
599
  return new Promise(function (resolve, reject) {
@@ -604,24 +607,24 @@ var getBase64 = function getBase64(file) {
604
607
  };
605
608
  });
606
609
  };
607
- var ApaasUpload = function ApaasUpload(_ref3) {
608
- var _ref3$maxCount = _ref3.maxCount,
609
- maxCount = _ref3$maxCount === void 0 ? 10 : _ref3$maxCount,
610
- _ref3$maxSize = _ref3.maxSize,
611
- maxSize = _ref3$maxSize === void 0 ? 10 : _ref3$maxSize,
612
- _ref3$uploadText = _ref3.uploadText,
613
- uploadText = _ref3$uploadText === void 0 ? '上传' : _ref3$uploadText,
614
- _ref3$onChange = _ref3.onChange,
615
- onChange = _ref3$onChange === void 0 ? fn : _ref3$onChange,
616
- _ref3$value = _ref3.value,
617
- value = _ref3$value === void 0 ? [] : _ref3$value,
618
- _ref3$accept = _ref3.accept,
619
- accept = _ref3$accept === void 0 ? 'image/gif,image/jpg,image/jpeg,image/png' : _ref3$accept,
620
- _ref3$canPreview = _ref3.canPreview,
621
- canPreview = _ref3$canPreview === void 0 ? false : _ref3$canPreview,
622
- _ref3$disabled = _ref3.disabled,
623
- disabled = _ref3$disabled === void 0 ? false : _ref3$disabled,
624
- resetProps = _objectWithoutProperties(_ref3, _excluded$4);
610
+ var ApaasUpload = function ApaasUpload(_ref) {
611
+ var _ref$maxCount = _ref.maxCount,
612
+ maxCount = _ref$maxCount === void 0 ? 10 : _ref$maxCount,
613
+ _ref$maxSize = _ref.maxSize,
614
+ maxSize = _ref$maxSize === void 0 ? 10 : _ref$maxSize,
615
+ _ref$uploadText = _ref.uploadText,
616
+ uploadText = _ref$uploadText === void 0 ? '上传' : _ref$uploadText,
617
+ _ref$onChange = _ref.onChange,
618
+ onChange = _ref$onChange === void 0 ? fn : _ref$onChange,
619
+ _ref$value = _ref.value,
620
+ value = _ref$value === void 0 ? [] : _ref$value,
621
+ _ref$accept = _ref.accept,
622
+ accept = _ref$accept === void 0 ? 'image/gif,image/jpg,image/jpeg,image/png' : _ref$accept,
623
+ _ref$canPreview = _ref.canPreview,
624
+ canPreview = _ref$canPreview === void 0 ? false : _ref$canPreview,
625
+ _ref$disabled = _ref.disabled,
626
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
627
+ resetProps = _objectWithoutProperties(_ref, _excluded$4);
625
628
  var inputRef = React.useRef(null);
626
629
  var valueRef = React.useRef(value);
627
630
  var _useState = React.useState(false),
@@ -662,8 +665,8 @@ var ApaasUpload = function ApaasUpload(_ref3) {
662
665
  onChange(list);
663
666
  };
664
667
  var clipboardDataChange = function clipboardDataChange(e) {
665
- var clipboardData = e.clipboardData || window.clipboardData,
666
- i = 0,
668
+ var clipboardData = e.clipboardData || window.clipboardData;
669
+ var i = 0,
667
670
  items,
668
671
  item,
669
672
  types;
@@ -862,37 +865,6 @@ function ApaasRadio(props) {
862
865
  }))));
863
866
  }
864
867
 
865
- /*
866
- * @Author: wangzhenggui jianjia.wzg@raycloud.com
867
- * @Date: 2022-09-20 14:29:14
868
- * @LastEditors: litian
869
- * @LastEditTime: 2022-09-27 13:49:32
870
- * @FilePath: /raycloud-apaas-fe-setup/packages/apaas-react-basics-widgets/src/config/utils.ts
871
- * @Description:
872
- *
873
- * Copyright (c) 2022 by wangzhenggui jianjia.wzg@raycloud.com, All Rights Reserved.
874
- */
875
- //组装地址
876
- var toTree = function toTree() {
877
- var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
878
- var parId = arguments.length > 1 ? arguments[1] : undefined;
879
- var len = list === null || list === void 0 ? void 0 : list.length;
880
- function loop(parId) {
881
- var res = [];
882
- for (var i = 0; i < len; i++) {
883
- var item = list[i];
884
- if (item.parentId === Number(parId)) {
885
- item.children = loop(item.id);
886
- res.push(_objectSpread2(_objectSpread2({}, item), {}, {
887
- label: item.name,
888
- value: item.id
889
- }));
890
- }
891
- }
892
- return res;
893
- }
894
- return loop(parId);
895
- };
896
868
  var keepDecimals = function keepDecimals(value) {
897
869
  value = value.replace(/[^\d.]/g, ''); //清除"数字"和"."以外的字符
898
870
  value = value.replace(/^\./g, ''); //验证第一个字符是数字
@@ -921,32 +893,32 @@ var styles$1 = {"imageBox":"index-module_imageBox__8zj7A","inputImage":"index-mo
921
893
  styleInject(css_248z$1);
922
894
 
923
895
  var _excluded$6 = ["maxCount", "maxSize", "uploadText", "onChange", "value", "accept", "canPreview", "disabled", "uniqueKey", "hostUrl", "actionUrl"];
924
- var fn$1 = function fn(_ref) {
925
- var _ref2 = _slicedToArray(_ref, 0);
896
+ var fn$1 = function fn() {
897
+ return void 0;
926
898
  };
927
- var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
928
- var _ref3$maxCount = _ref3.maxCount,
929
- maxCount = _ref3$maxCount === void 0 ? 10 : _ref3$maxCount,
930
- _ref3$maxSize = _ref3.maxSize,
931
- maxSize = _ref3$maxSize === void 0 ? 10 : _ref3$maxSize,
932
- _ref3$uploadText = _ref3.uploadText,
933
- uploadText = _ref3$uploadText === void 0 ? '上传' : _ref3$uploadText,
934
- _ref3$onChange = _ref3.onChange,
935
- onChange = _ref3$onChange === void 0 ? fn$1 : _ref3$onChange,
936
- _ref3$value = _ref3.value,
937
- value = _ref3$value === void 0 ? [] : _ref3$value,
938
- _ref3$accept = _ref3.accept,
939
- accept = _ref3$accept === void 0 ? 'image/gif,image/jpg,image/jpeg,image/png' : _ref3$accept,
940
- _ref3$canPreview = _ref3.canPreview,
941
- canPreview = _ref3$canPreview === void 0 ? false : _ref3$canPreview,
942
- _ref3$disabled = _ref3.disabled,
943
- disabled = _ref3$disabled === void 0 ? false : _ref3$disabled,
944
- uniqueKey = _ref3.uniqueKey,
945
- _ref3$hostUrl = _ref3.hostUrl,
946
- hostUrl = _ref3$hostUrl === void 0 ? '' : _ref3$hostUrl,
947
- _ref3$actionUrl = _ref3.actionUrl,
948
- actionUrl = _ref3$actionUrl === void 0 ? '/qy/common/uploadWorkOrderImg' : _ref3$actionUrl,
949
- resetProps = _objectWithoutProperties(_ref3, _excluded$6);
899
+ var ApaasUploadAsync = function ApaasUploadAsync(_ref) {
900
+ var _ref$maxCount = _ref.maxCount,
901
+ maxCount = _ref$maxCount === void 0 ? 10 : _ref$maxCount,
902
+ _ref$maxSize = _ref.maxSize,
903
+ maxSize = _ref$maxSize === void 0 ? 10 : _ref$maxSize,
904
+ _ref$uploadText = _ref.uploadText,
905
+ uploadText = _ref$uploadText === void 0 ? '上传' : _ref$uploadText,
906
+ _ref$onChange = _ref.onChange,
907
+ onChange = _ref$onChange === void 0 ? fn$1 : _ref$onChange,
908
+ _ref$value = _ref.value,
909
+ value = _ref$value === void 0 ? [] : _ref$value,
910
+ _ref$accept = _ref.accept,
911
+ accept = _ref$accept === void 0 ? 'image/gif,image/jpg,image/jpeg,image/png' : _ref$accept,
912
+ _ref$canPreview = _ref.canPreview,
913
+ canPreview = _ref$canPreview === void 0 ? false : _ref$canPreview,
914
+ _ref$disabled = _ref.disabled,
915
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
916
+ uniqueKey = _ref.uniqueKey,
917
+ _ref$hostUrl = _ref.hostUrl,
918
+ hostUrl = _ref$hostUrl === void 0 ? '' : _ref$hostUrl,
919
+ _ref$actionUrl = _ref.actionUrl,
920
+ actionUrl = _ref$actionUrl === void 0 ? '/qy/common/uploadWorkOrderImg' : _ref$actionUrl,
921
+ resetProps = _objectWithoutProperties(_ref, _excluded$6);
950
922
  var inputRef = React.useRef(null);
951
923
  var valueRef = React.useRef(value);
952
924
  var _useState = React.useState(false),
@@ -969,7 +941,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
969
941
  valueRef.current = value;
970
942
  }, [value]);
971
943
  var asyncUpload = /*#__PURE__*/function () {
972
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {
944
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {
973
945
  var _valueRef$current;
974
946
  var formData, fileName, _yield$request, success, data;
975
947
  return _regeneratorRuntime().wrap(function _callee$(_context) {
@@ -1010,7 +982,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1010
982
  }, _callee, null, [[5, 14, 17, 20]]);
1011
983
  }));
1012
984
  return function asyncUpload(_x) {
1013
- return _ref4.apply(this, arguments);
985
+ return _ref2.apply(this, arguments);
1014
986
  };
1015
987
  }();
1016
988
  var imgReader = function imgReader(item) {
@@ -1025,7 +997,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1025
997
  return;
1026
998
  }
1027
999
  reader.onload = /*#__PURE__*/function () {
1028
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
1000
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
1029
1001
  var _e$target, _valueRef$current2;
1030
1002
  var result, fileName, file;
1031
1003
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
@@ -1042,7 +1014,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1042
1014
  }, _callee2);
1043
1015
  }));
1044
1016
  return function (_x2) {
1045
- return _ref5.apply(this, arguments);
1017
+ return _ref3.apply(this, arguments);
1046
1018
  };
1047
1019
  }();
1048
1020
  reader.readAsDataURL(blob);
@@ -1052,8 +1024,8 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1052
1024
  onChange(list);
1053
1025
  };
1054
1026
  var clipboardDataChange = function clipboardDataChange(e) {
1055
- var clipboardData = e.clipboardData || window.clipboardData,
1056
- i = 0,
1027
+ var clipboardData = e.clipboardData || window.clipboardData;
1028
+ var i = 0,
1057
1029
  items,
1058
1030
  item,
1059
1031
  types;
@@ -1198,7 +1170,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1198
1170
  })));
1199
1171
  };
1200
1172
 
1201
- var _excluded$7 = ["showOther", "horizontal", "options", "value", "onChange", "disabled", "checkboxOther"];
1173
+ var _excluded$7 = ["showOther", "horizontal", "options", "value", "onChange", "disabled"];
1202
1174
  function ApaasCheckbox(props) {
1203
1175
  var showOther = props.showOther,
1204
1176
  _props$horizontal = props.horizontal,
@@ -1209,7 +1181,6 @@ function ApaasCheckbox(props) {
1209
1181
  value = _props$value === void 0 ? {} : _props$value,
1210
1182
  onChange = props.onChange,
1211
1183
  disabled = props.disabled,
1212
- checkboxOther = props.checkboxOther,
1213
1184
  otherProps = _objectWithoutProperties(props, _excluded$7);
1214
1185
  var checkboxValue = value.value,
1215
1186
  other = value.other;
@@ -1371,18 +1342,7 @@ function ApaasRate(props) {
1371
1342
  }));
1372
1343
  }
1373
1344
 
1374
- /*
1375
- * @Author: wangzhenggui jianjia.wzg@raycloud.com
1376
- * @Date: 2022-09-13 11:06:09
1377
- * @LastEditors: wangzhenggui jianjia.wzg@raycloud.com
1378
- * @LastEditTime: 2022-11-04 15:55:10
1379
- * @FilePath: /raycloud-apaas-fe-setup/packages/apaas-react-basics-widgets/src/common/request.ts
1380
- * @Description:
1381
- *
1382
- * Copyright (c) 2022 by wangzhenggui jianjia.wzg@raycloud.com, All Rights Reserved.
1383
- */
1384
- var extendRequest = request.extend({});
1385
-
1345
+ var address = kmkfUtils.AddressData.getInstance();
1386
1346
  var Province = function Province(props) {
1387
1347
  var _useState = React.useState([]),
1388
1348
  _useState2 = _slicedToArray(_useState, 2),
@@ -1391,35 +1351,11 @@ var Province = function Province(props) {
1391
1351
  var isFirst = React.useRef(false);
1392
1352
  var initPageSource = /*#__PURE__*/function () {
1393
1353
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
1394
- var apaasAddress, apaasSaveTime, isExpire, _yield$request, list, arr;
1395
1354
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1396
1355
  while (1) switch (_context.prev = _context.next) {
1397
1356
  case 0:
1398
- apaasAddress = window.localStorage.getItem('apaasAddress');
1399
- apaasSaveTime = window.localStorage.getItem('apaasSaveTime'); //判断是否过期 缓存7天
1400
- isExpire = apaasSaveTime ? Number(apaasSaveTime) + 7 * 3600 * 24 * 1000 < new Date().getTime() : true;
1401
- if (!(apaasAddress && !isExpire)) {
1402
- _context.next = 6;
1403
- break;
1404
- }
1405
- setOptions(JSON.parse(apaasAddress));
1406
- return _context.abrupt("return");
1407
- case 6:
1408
- _context.next = 8;
1409
- return extendRequest('/qy/gdfw/template/queryAreas', {
1410
- method: 'get',
1411
- params: {
1412
- apiName: 'queryAreas'
1413
- }
1414
- });
1415
- case 8:
1416
- _yield$request = _context.sent;
1417
- list = _yield$request.data;
1418
- arr = toTree(list, 0);
1419
- setOptions(arr[0].children);
1420
- window.localStorage.setItem('apaasAddress', JSON.stringify(arr[0].children));
1421
- window.localStorage.setItem('apaasSaveTime', new Date().getTime().toString());
1422
- case 14:
1357
+ setOptions(address.addressOptions || []);
1358
+ case 1:
1423
1359
  case "end":
1424
1360
  return _context.stop();
1425
1361
  }
@@ -1517,15 +1453,11 @@ var ShopNameSelect = function ShopNameSelect(props) {
1517
1453
  disabled = props.disabled,
1518
1454
  style = props.style;
1519
1455
  var _useState = React.useState([]),
1520
- _useState2 = _slicedToArray(_useState, 2),
1521
- options = _useState2[0],
1522
- setOptions = _useState2[1];
1456
+ _useState2 = _slicedToArray(_useState, 1),
1457
+ options = _useState2[0];
1523
1458
  var handleChange = function handleChange(value) {
1524
1459
  onChange === null || onChange === void 0 ? void 0 : onChange(value);
1525
1460
  };
1526
- React.useEffect(function () {
1527
- // initDataSource();
1528
- }, []);
1529
1461
  return /*#__PURE__*/React__default['default'].createElement(antd.Select, {
1530
1462
  defaultValue: value,
1531
1463
  disabled: disabled,
@@ -1550,7 +1482,7 @@ function ApaasAddress(props) {
1550
1482
  var value = props.value,
1551
1483
  onChange = props.onChange,
1552
1484
  disabled = props.disabled;
1553
- var changeCity = function changeCity(city, selectedOptions) {
1485
+ var changeCity = function changeCity(city) {
1554
1486
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
1555
1487
  address: city
1556
1488
  }));
@@ -1700,7 +1632,6 @@ var AliPay = function AliPay(props) {
1700
1632
  var changeValue = function changeValue(e, type) {
1701
1633
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, e.target.value)));
1702
1634
  };
1703
- React.useEffect(function () {}, []);
1704
1635
  return /*#__PURE__*/React__default['default'].createElement("div", null, !isSingle ? /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
1705
1636
  disabled: disabled,
1706
1637
  placeholder: "\u8BF7\u8F93\u5165\u652F\u4ED8\u5B9D\u540D\u79F0",
@@ -1727,6 +1658,18 @@ var AliPay = function AliPay(props) {
1727
1658
  })));
1728
1659
  };
1729
1660
 
1661
+ /*
1662
+ * @Author: wangzhenggui jianjia.wzg@raycloud.com
1663
+ * @Date: 2022-09-13 11:06:09
1664
+ * @LastEditors: wangzhenggui jianjia.wzg@raycloud.com
1665
+ * @LastEditTime: 2022-11-04 15:55:10
1666
+ * @FilePath: /raycloud-apaas-fe-setup/packages/apaas-react-basics-widgets/src/common/request.ts
1667
+ * @Description:
1668
+ *
1669
+ * Copyright (c) 2022 by wangzhenggui jianjia.wzg@raycloud.com, All Rights Reserved.
1670
+ */
1671
+ var extendRequest = request.extend({});
1672
+
1730
1673
  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";
1731
1674
  styleInject(css_248z$4);
1732
1675
 
@@ -2242,8 +2185,7 @@ var Sku = /*#__PURE__*/React.forwardRef(function (props, ref) {
2242
2185
  React.useImperativeHandle(ref, function () {
2243
2186
  return {
2244
2187
  open: function open(_ref) {
2245
- var shopId = _ref.shopId,
2246
- numIids = _ref.numIids,
2188
+ var numIids = _ref.numIids,
2247
2189
  options = _ref.options;
2248
2190
  setVisible(true);
2249
2191
  setSku('');
@@ -2383,19 +2325,14 @@ var Goods = function Goods(props) {
2383
2325
  _useState2 = _slicedToArray(_useState, 2),
2384
2326
  visible = _useState2[0],
2385
2327
  setVisible = _useState2[1];
2386
- var _useState3 = React.useState(''),
2328
+ var _useState3 = React.useState(0),
2387
2329
  _useState4 = _slicedToArray(_useState3, 2),
2388
- editState = _useState4[0],
2389
- setEditState = _useState4[1];
2390
- var _useState5 = React.useState(0),
2391
- _useState6 = _slicedToArray(_useState5, 2),
2392
- uploadImageCount = _useState6[0],
2393
- setUploadImageCount = _useState6[1];
2330
+ uploadImageCount = _useState4[0],
2331
+ setUploadImageCount = _useState4[1];
2394
2332
  var skuRef = React.useRef();
2395
- var _useState7 = React.useState(false),
2396
- _useState8 = _slicedToArray(_useState7, 2),
2397
- editVisible = _useState8[0],
2398
- setEditVisible = _useState8[1];
2333
+ var _useState5 = React.useState(false),
2334
+ _useState6 = _slicedToArray(_useState5, 2),
2335
+ setEditVisible = _useState6[1];
2399
2336
  // onChange事件会修改imgList里的字段,所以保存初始化的imglist值
2400
2337
  if (!imgListConstant.length) {
2401
2338
  imgListConstant = JSON.parse(JSON.stringify(imgList));
@@ -2801,7 +2738,7 @@ var Invoice = function Invoice(props) {
2801
2738
  */
2802
2739
  var handleChange = /*#__PURE__*/function () {
2803
2740
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(ordinaryTaitou) {
2804
- var data, list, newList, index, element, kpName, idx;
2741
+ var data, _list, newList, index, element, kpName, idx;
2805
2742
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2806
2743
  while (1) switch (_context2.prev = _context2.next) {
2807
2744
  case 0:
@@ -2822,16 +2759,16 @@ var Invoice = function Invoice(props) {
2822
2759
  _context2.next = 16;
2823
2760
  break;
2824
2761
  }
2825
- list = data.data ? data.data.info || [] : [];
2826
- if (list.length) {
2762
+ _list = data.data ? data.data.info || [] : [];
2763
+ if (_list.length) {
2827
2764
  _context2.next = 10;
2828
2765
  break;
2829
2766
  }
2830
2767
  return _context2.abrupt("return");
2831
2768
  case 10:
2832
2769
  newList = [];
2833
- for (index = 0; index < list.length; index++) {
2834
- element = list[index];
2770
+ for (index = 0; index < _list.length; index++) {
2771
+ element = _list[index];
2835
2772
  kpName = element.kpName;
2836
2773
  idx = kpName.indexOf(ordinaryTaitou);
2837
2774
  element.kpName1 = kpName.substring(0, idx);
@@ -3131,6 +3068,8 @@ var LogisticsInterception = function LogisticsInterception(props) {
3131
3068
  value = _props$value === void 0 ? {} : _props$value,
3132
3069
  _props$logisticsOptio = props.logisticsOptions,
3133
3070
  logisticsOptions = _props$logisticsOptio === void 0 ? [] : _props$logisticsOptio,
3071
+ _props$expressInterce = props.expressInterceptData,
3072
+ expressInterceptData = _props$expressInterce === void 0 ? [] : _props$expressInterce,
3134
3073
  _props$required = props.required,
3135
3074
  required = _props$required === void 0 ? false : _props$required,
3136
3075
  onChange = props.onChange,
@@ -3138,41 +3077,61 @@ var LogisticsInterception = function LogisticsInterception(props) {
3138
3077
  disabled = _props$disabled === void 0 ? false : _props$disabled,
3139
3078
  _props$isEditing = props.isEditing,
3140
3079
  isEditing = _props$isEditing === void 0 ? false : _props$isEditing;
3141
- var _useState = React.useState([]),
3080
+ var _useState = React.useState(''),
3142
3081
  _useState2 = _slicedToArray(_useState, 2),
3143
- typeOptions = _useState2[0],
3144
- setTypeOptions = _useState2[1];
3082
+ initCompany = _useState2[0],
3083
+ setInitCompany = _useState2[1];
3145
3084
  var _useState3 = React.useState([]),
3146
3085
  _useState4 = _slicedToArray(_useState3, 2),
3147
- statusOptions = _useState4[0],
3148
- setStatusOptions = _useState4[1];
3149
- var _useState5 = React.useState(false),
3086
+ typeOptions = _useState4[0],
3087
+ setTypeOptions = _useState4[1];
3088
+ var _useState5 = React.useState([]),
3150
3089
  _useState6 = _slicedToArray(_useState5, 2),
3151
- isInterface = _useState6[0],
3152
- setIsInterface = _useState6[1];
3153
- var canEdit = React.useMemo(function () {
3154
- //非对接公司可以修改
3155
- if (!isInterface) return true;
3156
- //已对接公司在拦截中可以修改
3157
- var INTERCEPTING = statusOptions.some(function (item) {
3158
- return item.value === (value === null || value === void 0 ? void 0 : value.interceptStatus) && (item === null || item === void 0 ? void 0 : item.showInterceptionBtn);
3159
- });
3160
- return isEditing && (value === null || value === void 0 ? void 0 : value.interceptStatus) ? INTERCEPTING && isEditing : true;
3161
- }, [value, statusOptions, isInterface, isEditing]);
3090
+ statusOptions = _useState6[0],
3091
+ setStatusOptions = _useState6[1];
3092
+ var _useState7 = React.useState(false),
3093
+ _useState8 = _slicedToArray(_useState7, 2),
3094
+ isInterface = _useState8[0],
3095
+ setIsInterface = _useState8[1];
3096
+ var firstIn = React.useRef(true);
3162
3097
  React.useEffect(function () {
3098
+ //存入第一次的物流地址,防止非对接物流切换成对接物流后无法编辑
3099
+ if (firstIn.current && JSON.stringify(value) !== '{}') {
3100
+ setInitCompany(value === null || value === void 0 ? void 0 : value.interceptCompany);
3101
+ firstIn.current = false;
3102
+ }
3163
3103
  if (!(value === null || value === void 0 ? void 0 : value.interceptCompany)) {
3164
3104
  setTypeOptions([]);
3165
3105
  setStatusOptions([]);
3166
3106
  setIsInterface(false);
3167
3107
  return;
3168
3108
  }
3169
- var interceptCompany = logisticsOptions.find(function (item) {
3170
- return item.expressCode === (value === null || value === void 0 ? void 0 : value.interceptCompany);
3109
+ var interceptCompany = expressInterceptData.find(function (item) {
3110
+ return item.value === (value === null || value === void 0 ? void 0 : value.interceptCompany);
3171
3111
  });
3172
3112
  setTypeOptions((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionTypeList) || []);
3173
- setStatusOptions((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionStatusList) || []);
3113
+ setStatusOptions((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.logisticsStatusList) || []);
3174
3114
  setIsInterface(interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.isInterface);
3175
3115
  }, [value === null || value === void 0 ? void 0 : value.interceptCompany]);
3116
+ //拦截类型切换 需要清空新派送地
3117
+ React.useEffect(function () {
3118
+ if (!(value === null || value === void 0 ? void 0 : value.interceptCompany)) return;
3119
+ var interceptCompany = expressInterceptData.find(function (item) {
3120
+ return item.value === (value === null || value === void 0 ? void 0 : value.interceptCompany);
3121
+ });
3122
+ var showAddress = ((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionTypeList) || []).some(function (item) {
3123
+ var _item$config;
3124
+ 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);
3125
+ });
3126
+ if (!showAddress) {
3127
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
3128
+ interceptAddress: [],
3129
+ interceptDetail: '',
3130
+ interceptReceiverName: '',
3131
+ interceptReceiverMobile: ''
3132
+ }));
3133
+ }
3134
+ }, [value === null || value === void 0 ? void 0 : value.interceptType]);
3176
3135
  //是否展示新地址
3177
3136
  var showNewAddress = React.useMemo(function () {
3178
3137
  var _find, _find$config;
@@ -3180,18 +3139,32 @@ var LogisticsInterception = function LogisticsInterception(props) {
3180
3139
  return item.value === (value === null || value === void 0 ? void 0 : value.interceptType);
3181
3140
  })) === null || _find === void 0 ? void 0 : (_find$config = _find.config) === null || _find$config === void 0 ? void 0 : _find$config.showAddress;
3182
3141
  }, [value === null || value === void 0 ? void 0 : value.interceptType, typeOptions, value === null || value === void 0 ? void 0 : value.interceptCompany]);
3142
+ //判断是否能修改物流信息
3143
+ var canEdit = React.useMemo(function () {
3144
+ var company = expressInterceptData.find(function (item) {
3145
+ return item.value === initCompany;
3146
+ });
3147
+ return isEditing && !!(company === null || company === void 0 ? void 0 : company.isInterface);
3148
+ }, [isEditing, initCompany]);
3183
3149
  var changeHandle = function changeHandle(val, type) {
3184
3150
  var newValue = _objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, val));
3185
3151
  if (type === 'interceptCompany') {
3152
+ var interceptCompany = expressInterceptData.find(function (item) {
3153
+ return item.value === val;
3154
+ });
3155
+ var returnValue = ((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionTypeList) || []).find(function (item) {
3156
+ var _item$config2;
3157
+ return item === null || item === void 0 ? void 0 : (_item$config2 = item.config) === null || _item$config2 === void 0 ? void 0 : _item$config2.isDefault;
3158
+ });
3186
3159
  newValue = _objectSpread2(_objectSpread2({}, value), {}, {
3187
3160
  interceptCompany: val,
3188
- interceptType: 'RETURN',
3161
+ interceptType: returnValue === null || returnValue === void 0 ? void 0 : returnValue.value,
3189
3162
  interceptAddress: [],
3190
- interceptDetail: '',
3191
- interceptReceiverName: '',
3192
- interceptReceiverMobile: '',
3193
- interceptStatus: '',
3194
- interceptOther: ''
3163
+ interceptDetail: undefined,
3164
+ interceptReceiverName: undefined,
3165
+ interceptReceiverMobile: undefined,
3166
+ interceptLogisticsStatus: undefined,
3167
+ interceptLogisticsStatusOther: undefined
3195
3168
  });
3196
3169
  }
3197
3170
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
@@ -3201,10 +3174,10 @@ var LogisticsInterception = function LogisticsInterception(props) {
3201
3174
  required: required,
3202
3175
  key: 'logistics'
3203
3176
  }, /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
3204
- disabled: disabled || !canEdit,
3177
+ disabled: disabled || canEdit,
3205
3178
  placeholder: "\u7269\u6D41\u516C\u53F8",
3206
3179
  style: {
3207
- width: '200px'
3180
+ width: '150px'
3208
3181
  },
3209
3182
  onChange: function onChange(val) {
3210
3183
  return changeHandle(val, 'interceptCompany');
@@ -3216,7 +3189,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
3216
3189
  return option.label.includes(input);
3217
3190
  }
3218
3191
  }), /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3219
- disabled: disabled || !canEdit,
3192
+ disabled: disabled || canEdit,
3220
3193
  placeholder: "\u7269\u6D41\u5355\u53F7",
3221
3194
  onChange: function onChange(e) {
3222
3195
  return changeHandle(e.target.value, 'interceptCode');
@@ -3227,7 +3200,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
3227
3200
  required: required,
3228
3201
  key: 'interceptType'
3229
3202
  }, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
3230
- disabled: disabled || !canEdit,
3203
+ disabled: disabled || canEdit,
3231
3204
  style: {
3232
3205
  width: '200px'
3233
3206
  },
@@ -3252,34 +3225,31 @@ var LogisticsInterception = function LogisticsInterception(props) {
3252
3225
  return changeHandle(val, 'interceptAddress');
3253
3226
  },
3254
3227
  options: [],
3255
- disabled: disabled || !canEdit
3228
+ disabled: disabled || canEdit
3256
3229
  }), /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3257
3230
  value: value === null || value === void 0 ? void 0 : value.interceptDetail,
3258
- disabled: disabled || !canEdit,
3231
+ disabled: disabled || canEdit,
3259
3232
  placeholder: "\u8BE6\u7EC6\u5730\u5740",
3260
3233
  onChange: function onChange(e) {
3261
3234
  return changeHandle(e.target.value, 'interceptDetail');
3262
3235
  }
3263
3236
  })), /*#__PURE__*/React__default['default'].createElement("br", null), /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3264
3237
  value: value === null || value === void 0 ? void 0 : value.interceptReceiverName,
3265
- disabled: disabled || !canEdit,
3266
- style: {
3267
- width: '200px'
3268
- },
3238
+ disabled: disabled || canEdit,
3269
3239
  placeholder: "\u6536\u4EF6\u4EBA\u59D3\u540D",
3270
3240
  onChange: function onChange(e) {
3271
3241
  return changeHandle(e.target.value, 'interceptReceiverName');
3272
3242
  }
3273
3243
  }), /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3274
3244
  value: value === null || value === void 0 ? void 0 : value.interceptReceiverMobile,
3275
- disabled: disabled || !canEdit,
3245
+ disabled: disabled || canEdit,
3276
3246
  placeholder: "\u6536\u4EF6\u4EBA\u7535\u8BDD",
3277
3247
  onChange: function onChange(e) {
3278
3248
  return changeHandle(e.target.value, 'interceptReceiverMobile');
3279
3249
  }
3280
3250
  }))), /*#__PURE__*/React__default['default'].createElement(Item, {
3281
- label: '拦截状态',
3282
- key: 'interceptStatus'
3251
+ label: '物流状态',
3252
+ key: 'interceptLogisticsStatus'
3283
3253
  }, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
3284
3254
  disabled: disabled || isInterface,
3285
3255
  style: {
@@ -3287,22 +3257,22 @@ var LogisticsInterception = function LogisticsInterception(props) {
3287
3257
  },
3288
3258
  options: statusOptions,
3289
3259
  onChange: function onChange(val) {
3290
- return changeHandle(val, 'interceptStatus');
3260
+ return changeHandle(val, 'interceptLogisticsStatus');
3291
3261
  },
3292
- value: value === null || value === void 0 ? void 0 : value.interceptStatus,
3293
- placeholder: "\u62E6\u622A\u72B6\u6001",
3262
+ value: value === null || value === void 0 ? void 0 : value.interceptLogisticsStatus,
3263
+ placeholder: "\u7269\u6D41\u72B6\u6001",
3294
3264
  showSearch: true,
3295
3265
  filterOption: function filterOption(input, option) {
3296
3266
  return option.label.includes(input);
3297
3267
  }
3298
- }), (value === null || value === void 0 ? void 0 : value.interceptStatus) === 'OTHER' && /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3299
- disabled: disabled || canEdit,
3268
+ }), (value === null || value === void 0 ? void 0 : value.interceptLogisticsStatus) === 'OTHER' && /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3269
+ disabled: disabled || !canEdit,
3300
3270
  style: {
3301
3271
  width: '200px'
3302
3272
  },
3303
3273
  placeholder: "\u5176\u4ED6",
3304
3274
  onChange: function onChange(e) {
3305
- return changeHandle(e.target.value, 'interceptOther');
3275
+ return changeHandle(e.target.value, 'interceptLogisticsStatusOther');
3306
3276
  }
3307
3277
  })));
3308
3278
  };
@@ -3562,9 +3532,8 @@ var GoodsModal$1 = function GoodsModal(props) {
3562
3532
  tab: '已选择',
3563
3533
  key: 'all'
3564
3534
  }]),
3565
- _useState18 = _slicedToArray(_useState17, 2),
3566
- tabs = _useState18[0],
3567
- setTabs = _useState18[1];
3535
+ _useState18 = _slicedToArray(_useState17, 1),
3536
+ tabs = _useState18[0];
3568
3537
  var _useState19 = React.useState([{
3569
3538
  name: '上架时间',
3570
3539
  value: 'list_time'