@kmkf-fe-packages/basic-components 0.6.3-alpha.3 → 0.6.3-alpha.30

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/README.md CHANGED
@@ -19,4 +19,4 @@ yarn start
19
19
  - config 公共方法
20
20
  - assets 静态资源
21
21
 
22
- ####
22
+ #### 1
@@ -12,10 +12,11 @@ interface LogisticsInterceptionValueType {
12
12
  interface LogisticsInterceptionProps {
13
13
  value: Partial<LogisticsInterceptionValueType>;
14
14
  logisticsOptions: any[];
15
+ expressInterceptData: any[];
15
16
  required: boolean;
16
17
  disabled: boolean;
17
18
  isEditing: boolean;
18
- id: string;
19
+ logisticsInterceptHandleStatus: string;
19
20
  onChange: (value: Partial<LogisticsInterceptionValueType>) => void;
20
21
  }
21
22
  declare const LogisticsInterception: (props: Partial<LogisticsInterceptionProps>) => JSX.Element;
package/dist/index.esm.js CHANGED
@@ -498,6 +498,7 @@ var ApaasDate = function ApaasDate(props) {
498
498
 
499
499
  var _excluded$1 = ["isNumber", "replaceWarn"];
500
500
  function ApaasInput(props) {
501
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
501
502
  var isNumber = props.isNumber,
502
503
  replaceWarn = props.replaceWarn,
503
504
  other = _objectWithoutProperties(props, _excluded$1);
@@ -510,6 +511,7 @@ function ApaasInputNumber(props) {
510
511
 
511
512
  var _excluded$2 = ["options", "basicMultSelect"];
512
513
  function ApaasSelect(props) {
514
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
513
515
  var _props$options = props.options,
514
516
  options = _props$options === void 0 ? [] : _props$options,
515
517
  basicMultSelect = props.basicMultSelect,
@@ -579,8 +581,8 @@ var styles = {"imageBox":"index-module_imageBox__3tOEt","inputImage":"index-modu
579
581
  styleInject(css_248z);
580
582
 
581
583
  var _excluded$4 = ["maxCount", "maxSize", "uploadText", "onChange", "value", "accept", "canPreview", "disabled"];
582
- var fn = function fn(_ref) {
583
- var _ref2 = _slicedToArray(_ref, 0);
584
+ var fn = function fn() {
585
+ return void 0;
584
586
  };
585
587
  var getBase64 = function getBase64(file) {
586
588
  return new Promise(function (resolve, reject) {
@@ -594,24 +596,24 @@ var getBase64 = function getBase64(file) {
594
596
  };
595
597
  });
596
598
  };
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);
599
+ var ApaasUpload = function ApaasUpload(_ref) {
600
+ var _ref$maxCount = _ref.maxCount,
601
+ maxCount = _ref$maxCount === void 0 ? 10 : _ref$maxCount,
602
+ _ref$maxSize = _ref.maxSize,
603
+ maxSize = _ref$maxSize === void 0 ? 10 : _ref$maxSize,
604
+ _ref$uploadText = _ref.uploadText,
605
+ uploadText = _ref$uploadText === void 0 ? '上传' : _ref$uploadText,
606
+ _ref$onChange = _ref.onChange,
607
+ onChange = _ref$onChange === void 0 ? fn : _ref$onChange,
608
+ _ref$value = _ref.value,
609
+ value = _ref$value === void 0 ? [] : _ref$value,
610
+ _ref$accept = _ref.accept,
611
+ accept = _ref$accept === void 0 ? 'image/gif,image/jpg,image/jpeg,image/png' : _ref$accept,
612
+ _ref$canPreview = _ref.canPreview,
613
+ canPreview = _ref$canPreview === void 0 ? false : _ref$canPreview,
614
+ _ref$disabled = _ref.disabled,
615
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
616
+ resetProps = _objectWithoutProperties(_ref, _excluded$4);
615
617
  var inputRef = useRef(null);
616
618
  var valueRef = useRef(value);
617
619
  var _useState = useState(false),
@@ -652,8 +654,8 @@ var ApaasUpload = function ApaasUpload(_ref3) {
652
654
  onChange(list);
653
655
  };
654
656
  var clipboardDataChange = function clipboardDataChange(e) {
655
- var clipboardData = e.clipboardData || window.clipboardData,
656
- i = 0,
657
+ var clipboardData = e.clipboardData || window.clipboardData;
658
+ var i = 0,
657
659
  items,
658
660
  item,
659
661
  types;
@@ -911,32 +913,32 @@ var styles$1 = {"imageBox":"index-module_imageBox__8zj7A","inputImage":"index-mo
911
913
  styleInject(css_248z$1);
912
914
 
913
915
  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);
916
+ var fn$1 = function fn() {
917
+ return void 0;
916
918
  };
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);
919
+ var ApaasUploadAsync = function ApaasUploadAsync(_ref) {
920
+ var _ref$maxCount = _ref.maxCount,
921
+ maxCount = _ref$maxCount === void 0 ? 10 : _ref$maxCount,
922
+ _ref$maxSize = _ref.maxSize,
923
+ maxSize = _ref$maxSize === void 0 ? 10 : _ref$maxSize,
924
+ _ref$uploadText = _ref.uploadText,
925
+ uploadText = _ref$uploadText === void 0 ? '上传' : _ref$uploadText,
926
+ _ref$onChange = _ref.onChange,
927
+ onChange = _ref$onChange === void 0 ? fn$1 : _ref$onChange,
928
+ _ref$value = _ref.value,
929
+ value = _ref$value === void 0 ? [] : _ref$value,
930
+ _ref$accept = _ref.accept,
931
+ accept = _ref$accept === void 0 ? 'image/gif,image/jpg,image/jpeg,image/png' : _ref$accept,
932
+ _ref$canPreview = _ref.canPreview,
933
+ canPreview = _ref$canPreview === void 0 ? false : _ref$canPreview,
934
+ _ref$disabled = _ref.disabled,
935
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
936
+ uniqueKey = _ref.uniqueKey,
937
+ _ref$hostUrl = _ref.hostUrl,
938
+ hostUrl = _ref$hostUrl === void 0 ? '' : _ref$hostUrl,
939
+ _ref$actionUrl = _ref.actionUrl,
940
+ actionUrl = _ref$actionUrl === void 0 ? '/qy/common/uploadWorkOrderImg' : _ref$actionUrl,
941
+ resetProps = _objectWithoutProperties(_ref, _excluded$6);
940
942
  var inputRef = useRef(null);
941
943
  var valueRef = useRef(value);
942
944
  var _useState = useState(false),
@@ -959,7 +961,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
959
961
  valueRef.current = value;
960
962
  }, [value]);
961
963
  var asyncUpload = /*#__PURE__*/function () {
962
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {
964
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {
963
965
  var _valueRef$current;
964
966
  var formData, fileName, _yield$request, success, data;
965
967
  return _regeneratorRuntime().wrap(function _callee$(_context) {
@@ -1000,7 +1002,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1000
1002
  }, _callee, null, [[5, 14, 17, 20]]);
1001
1003
  }));
1002
1004
  return function asyncUpload(_x) {
1003
- return _ref4.apply(this, arguments);
1005
+ return _ref2.apply(this, arguments);
1004
1006
  };
1005
1007
  }();
1006
1008
  var imgReader = function imgReader(item) {
@@ -1015,7 +1017,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1015
1017
  return;
1016
1018
  }
1017
1019
  reader.onload = /*#__PURE__*/function () {
1018
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
1020
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
1019
1021
  var _e$target, _valueRef$current2;
1020
1022
  var result, fileName, file;
1021
1023
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
@@ -1032,7 +1034,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1032
1034
  }, _callee2);
1033
1035
  }));
1034
1036
  return function (_x2) {
1035
- return _ref5.apply(this, arguments);
1037
+ return _ref3.apply(this, arguments);
1036
1038
  };
1037
1039
  }();
1038
1040
  reader.readAsDataURL(blob);
@@ -1042,8 +1044,8 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1042
1044
  onChange(list);
1043
1045
  };
1044
1046
  var clipboardDataChange = function clipboardDataChange(e) {
1045
- var clipboardData = e.clipboardData || window.clipboardData,
1046
- i = 0,
1047
+ var clipboardData = e.clipboardData || window.clipboardData;
1048
+ var i = 0,
1047
1049
  items,
1048
1050
  item,
1049
1051
  types;
@@ -1188,7 +1190,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1188
1190
  })));
1189
1191
  };
1190
1192
 
1191
- var _excluded$7 = ["showOther", "horizontal", "options", "value", "onChange", "disabled", "checkboxOther"];
1193
+ var _excluded$7 = ["showOther", "horizontal", "options", "value", "onChange", "disabled"];
1192
1194
  function ApaasCheckbox(props) {
1193
1195
  var showOther = props.showOther,
1194
1196
  _props$horizontal = props.horizontal,
@@ -1199,7 +1201,6 @@ function ApaasCheckbox(props) {
1199
1201
  value = _props$value === void 0 ? {} : _props$value,
1200
1202
  onChange = props.onChange,
1201
1203
  disabled = props.disabled,
1202
- checkboxOther = props.checkboxOther,
1203
1204
  otherProps = _objectWithoutProperties(props, _excluded$7);
1204
1205
  var checkboxValue = value.value,
1205
1206
  other = value.other;
@@ -1507,15 +1508,11 @@ var ShopNameSelect = function ShopNameSelect(props) {
1507
1508
  disabled = props.disabled,
1508
1509
  style = props.style;
1509
1510
  var _useState = useState([]),
1510
- _useState2 = _slicedToArray(_useState, 2),
1511
- options = _useState2[0],
1512
- setOptions = _useState2[1];
1511
+ _useState2 = _slicedToArray(_useState, 1),
1512
+ options = _useState2[0];
1513
1513
  var handleChange = function handleChange(value) {
1514
1514
  onChange === null || onChange === void 0 ? void 0 : onChange(value);
1515
1515
  };
1516
- useEffect(function () {
1517
- // initDataSource();
1518
- }, []);
1519
1516
  return /*#__PURE__*/React.createElement(Select, {
1520
1517
  defaultValue: value,
1521
1518
  disabled: disabled,
@@ -1540,7 +1537,7 @@ function ApaasAddress(props) {
1540
1537
  var value = props.value,
1541
1538
  onChange = props.onChange,
1542
1539
  disabled = props.disabled;
1543
- var changeCity = function changeCity(city, selectedOptions) {
1540
+ var changeCity = function changeCity(city) {
1544
1541
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
1545
1542
  address: city
1546
1543
  }));
@@ -1690,7 +1687,6 @@ var AliPay = function AliPay(props) {
1690
1687
  var changeValue = function changeValue(e, type) {
1691
1688
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, e.target.value)));
1692
1689
  };
1693
- useEffect(function () {}, []);
1694
1690
  return /*#__PURE__*/React.createElement("div", null, !isSingle ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Input, {
1695
1691
  disabled: disabled,
1696
1692
  placeholder: "\u8BF7\u8F93\u5165\u652F\u4ED8\u5B9D\u540D\u79F0",
@@ -2232,8 +2228,7 @@ var Sku = /*#__PURE__*/forwardRef(function (props, ref) {
2232
2228
  useImperativeHandle(ref, function () {
2233
2229
  return {
2234
2230
  open: function open(_ref) {
2235
- var shopId = _ref.shopId,
2236
- numIids = _ref.numIids,
2231
+ var numIids = _ref.numIids,
2237
2232
  options = _ref.options;
2238
2233
  setVisible(true);
2239
2234
  setSku('');
@@ -2373,19 +2368,14 @@ var Goods = function Goods(props) {
2373
2368
  _useState2 = _slicedToArray(_useState, 2),
2374
2369
  visible = _useState2[0],
2375
2370
  setVisible = _useState2[1];
2376
- var _useState3 = useState(''),
2371
+ var _useState3 = useState(0),
2377
2372
  _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];
2373
+ uploadImageCount = _useState4[0],
2374
+ setUploadImageCount = _useState4[1];
2384
2375
  var skuRef = useRef();
2385
- var _useState7 = useState(false),
2386
- _useState8 = _slicedToArray(_useState7, 2),
2387
- editVisible = _useState8[0],
2388
- setEditVisible = _useState8[1];
2376
+ var _useState5 = useState(false),
2377
+ _useState6 = _slicedToArray(_useState5, 2),
2378
+ setEditVisible = _useState6[1];
2389
2379
  // onChange事件会修改imgList里的字段,所以保存初始化的imglist值
2390
2380
  if (!imgListConstant.length) {
2391
2381
  imgListConstant = JSON.parse(JSON.stringify(imgList));
@@ -2791,7 +2781,7 @@ var Invoice = function Invoice(props) {
2791
2781
  */
2792
2782
  var handleChange = /*#__PURE__*/function () {
2793
2783
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(ordinaryTaitou) {
2794
- var data, list, newList, index, element, kpName, idx;
2784
+ var data, _list, newList, index, element, kpName, idx;
2795
2785
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2796
2786
  while (1) switch (_context2.prev = _context2.next) {
2797
2787
  case 0:
@@ -2812,16 +2802,16 @@ var Invoice = function Invoice(props) {
2812
2802
  _context2.next = 16;
2813
2803
  break;
2814
2804
  }
2815
- list = data.data ? data.data.info || [] : [];
2816
- if (list.length) {
2805
+ _list = data.data ? data.data.info || [] : [];
2806
+ if (_list.length) {
2817
2807
  _context2.next = 10;
2818
2808
  break;
2819
2809
  }
2820
2810
  return _context2.abrupt("return");
2821
2811
  case 10:
2822
2812
  newList = [];
2823
- for (index = 0; index < list.length; index++) {
2824
- element = list[index];
2813
+ for (index = 0; index < _list.length; index++) {
2814
+ element = _list[index];
2825
2815
  kpName = element.kpName;
2826
2816
  idx = kpName.indexOf(ordinaryTaitou);
2827
2817
  element.kpName1 = kpName.substring(0, idx);
@@ -3121,48 +3111,71 @@ var LogisticsInterception = function LogisticsInterception(props) {
3121
3111
  value = _props$value === void 0 ? {} : _props$value,
3122
3112
  _props$logisticsOptio = props.logisticsOptions,
3123
3113
  logisticsOptions = _props$logisticsOptio === void 0 ? [] : _props$logisticsOptio,
3114
+ _props$expressInterce = props.expressInterceptData,
3115
+ expressInterceptData = _props$expressInterce === void 0 ? [] : _props$expressInterce,
3124
3116
  _props$required = props.required,
3125
3117
  required = _props$required === void 0 ? false : _props$required,
3126
3118
  onChange = props.onChange,
3127
3119
  _props$disabled = props.disabled,
3128
3120
  disabled = _props$disabled === void 0 ? false : _props$disabled,
3129
3121
  _props$isEditing = props.isEditing,
3130
- isEditing = _props$isEditing === void 0 ? false : _props$isEditing;
3131
- var _useState = useState([]),
3122
+ isEditing = _props$isEditing === void 0 ? false : _props$isEditing,
3123
+ logisticsInterceptHandleStatus = props.logisticsInterceptHandleStatus;
3124
+ var _useState = useState(''),
3132
3125
  _useState2 = _slicedToArray(_useState, 2),
3133
- typeOptions = _useState2[0],
3134
- setTypeOptions = _useState2[1];
3126
+ initCompany = _useState2[0],
3127
+ setInitCompany = _useState2[1];
3135
3128
  var _useState3 = useState([]),
3136
3129
  _useState4 = _slicedToArray(_useState3, 2),
3137
- statusOptions = _useState4[0],
3138
- setStatusOptions = _useState4[1];
3139
- var _useState5 = useState(false),
3130
+ typeOptions = _useState4[0],
3131
+ setTypeOptions = _useState4[1];
3132
+ var _useState5 = useState([]),
3140
3133
  _useState6 = _slicedToArray(_useState5, 2),
3141
- isInterface = _useState6[0],
3142
- setIsInterface = _useState6[1];
3143
- var canEdit = useMemo(function () {
3144
- //非对接公司可以修改
3145
- if (!isInterface) return true;
3146
- //已对接公司在拦截中可以修改
3147
- var INTERCEPTING = statusOptions.some(function (item) {
3148
- return item.value === (value === null || value === void 0 ? void 0 : value.interceptStatus) && (item === null || item === void 0 ? void 0 : item.showInterceptionBtn);
3149
- });
3150
- return isEditing && (value === null || value === void 0 ? void 0 : value.interceptStatus) ? INTERCEPTING && isEditing : true;
3151
- }, [value, statusOptions, isInterface, isEditing]);
3134
+ statusOptions = _useState6[0],
3135
+ setStatusOptions = _useState6[1];
3136
+ var _useState7 = useState(false),
3137
+ _useState8 = _slicedToArray(_useState7, 2),
3138
+ isInterface = _useState8[0],
3139
+ setIsInterface = _useState8[1];
3140
+ var firstIn = useRef(true);
3152
3141
  useEffect(function () {
3142
+ //存入第一次的物流地址,防止非对接物流切换成对接物流后无法编辑
3143
+ if (firstIn.current && (value === null || value === void 0 ? void 0 : value.interceptCompany)) {
3144
+ setInitCompany(value === null || value === void 0 ? void 0 : value.interceptCompany);
3145
+ firstIn.current = false;
3146
+ }
3153
3147
  if (!(value === null || value === void 0 ? void 0 : value.interceptCompany)) {
3154
3148
  setTypeOptions([]);
3155
3149
  setStatusOptions([]);
3156
3150
  setIsInterface(false);
3157
3151
  return;
3158
3152
  }
3159
- var interceptCompany = logisticsOptions.find(function (item) {
3160
- return item.expressCode === (value === null || value === void 0 ? void 0 : value.interceptCompany);
3153
+ var interceptCompany = expressInterceptData.find(function (item) {
3154
+ return item.value === (value === null || value === void 0 ? void 0 : value.interceptCompany);
3161
3155
  });
3162
3156
  setTypeOptions((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionTypeList) || []);
3163
3157
  setStatusOptions((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionStatusList) || []);
3164
3158
  setIsInterface(interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.isInterface);
3165
3159
  }, [value === null || value === void 0 ? void 0 : value.interceptCompany]);
3160
+ //拦截类型切换 需要清空新派送地
3161
+ useEffect(function () {
3162
+ if (!(value === null || value === void 0 ? void 0 : value.interceptCompany)) return;
3163
+ var interceptCompany = expressInterceptData.find(function (item) {
3164
+ return item.value === (value === null || value === void 0 ? void 0 : value.interceptCompany);
3165
+ });
3166
+ var showAddress = ((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionTypeList) || []).some(function (item) {
3167
+ var _item$config;
3168
+ 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);
3169
+ });
3170
+ if (!showAddress) {
3171
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
3172
+ interceptAddress: [],
3173
+ interceptDetail: '',
3174
+ interceptReceiverName: '',
3175
+ interceptReceiverMobile: ''
3176
+ }));
3177
+ }
3178
+ }, [value === null || value === void 0 ? void 0 : value.interceptType]);
3166
3179
  //是否展示新地址
3167
3180
  var showNewAddress = useMemo(function () {
3168
3181
  var _find, _find$config;
@@ -3170,18 +3183,41 @@ var LogisticsInterception = function LogisticsInterception(props) {
3170
3183
  return item.value === (value === null || value === void 0 ? void 0 : value.interceptType);
3171
3184
  })) === null || _find === void 0 ? void 0 : (_find$config = _find.config) === null || _find$config === void 0 ? void 0 : _find$config.showAddress;
3172
3185
  }, [value === null || value === void 0 ? void 0 : value.interceptType, typeOptions, value === null || value === void 0 ? void 0 : value.interceptCompany]);
3186
+ //判断是否能修改信息
3187
+ var canEdit = useMemo(function () {
3188
+ // 已对接公司如果拦截状态为【拦截中】,可以修改物流拦截组件信息,否则该组件不能修改;
3189
+ // 非对接公司可以修改组件
3190
+ // 修改后把工单信息重新提交给快递公司,清空拦截状态的值
3191
+ if (!isInterface) return true;
3192
+ //已对接公司在拦截中可以修改
3193
+ var INTERCEPTING = !logisticsInterceptHandleStatus || logisticsInterceptHandleStatus === 'INTERCEPTING';
3194
+ return isEditing ? INTERCEPTING : true;
3195
+ }, [value === null || value === void 0 ? void 0 : value.interceptCompany, statusOptions, isInterface, isEditing]);
3196
+ //判断是否能修改物流信息
3197
+ var canEditCompany = useMemo(function () {
3198
+ var company = expressInterceptData.find(function (item) {
3199
+ return item.value === initCompany;
3200
+ });
3201
+ return isEditing && !!(company === null || company === void 0 ? void 0 : company.isInterface);
3202
+ }, [isEditing, initCompany]);
3173
3203
  var changeHandle = function changeHandle(val, type) {
3174
3204
  var newValue = _objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, val));
3175
3205
  if (type === 'interceptCompany') {
3206
+ var interceptCompany = expressInterceptData.find(function (item) {
3207
+ return item.value === val;
3208
+ });
3209
+ var returnValue = ((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionTypeList) || []).find(function (item) {
3210
+ return item === null || item === void 0 ? void 0 : item.isDefault;
3211
+ });
3176
3212
  newValue = _objectSpread2(_objectSpread2({}, value), {}, {
3177
3213
  interceptCompany: val,
3178
- interceptType: 'RETURN',
3214
+ interceptType: returnValue === null || returnValue === void 0 ? void 0 : returnValue.value,
3179
3215
  interceptAddress: [],
3180
- interceptDetail: '',
3181
- interceptReceiverName: '',
3182
- interceptReceiverMobile: '',
3183
- interceptStatus: '',
3184
- interceptOther: ''
3216
+ interceptDetail: undefined,
3217
+ interceptReceiverName: undefined,
3218
+ interceptReceiverMobile: undefined,
3219
+ interceptStatus: undefined,
3220
+ interceptOther: undefined
3185
3221
  });
3186
3222
  }
3187
3223
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
@@ -3191,10 +3227,10 @@ var LogisticsInterception = function LogisticsInterception(props) {
3191
3227
  required: required,
3192
3228
  key: 'logistics'
3193
3229
  }, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Select, {
3194
- disabled: disabled || !canEdit,
3230
+ disabled: disabled || canEditCompany,
3195
3231
  placeholder: "\u7269\u6D41\u516C\u53F8",
3196
3232
  style: {
3197
- width: '200px'
3233
+ width: '150px'
3198
3234
  },
3199
3235
  onChange: function onChange(val) {
3200
3236
  return changeHandle(val, 'interceptCompany');
@@ -3206,7 +3242,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
3206
3242
  return option.label.includes(input);
3207
3243
  }
3208
3244
  }), /*#__PURE__*/React.createElement(Input, {
3209
- disabled: disabled || !canEdit,
3245
+ disabled: disabled || canEditCompany,
3210
3246
  placeholder: "\u7269\u6D41\u5355\u53F7",
3211
3247
  onChange: function onChange(e) {
3212
3248
  return changeHandle(e.target.value, 'interceptCode');
@@ -3253,9 +3289,6 @@ var LogisticsInterception = function LogisticsInterception(props) {
3253
3289
  })), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Input, {
3254
3290
  value: value === null || value === void 0 ? void 0 : value.interceptReceiverName,
3255
3291
  disabled: disabled || !canEdit,
3256
- style: {
3257
- width: '200px'
3258
- },
3259
3292
  placeholder: "\u6536\u4EF6\u4EBA\u59D3\u540D",
3260
3293
  onChange: function onChange(e) {
3261
3294
  return changeHandle(e.target.value, 'interceptReceiverName');
@@ -3286,7 +3319,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
3286
3319
  return option.label.includes(input);
3287
3320
  }
3288
3321
  }), (value === null || value === void 0 ? void 0 : value.interceptStatus) === 'OTHER' && /*#__PURE__*/React.createElement(Input, {
3289
- disabled: disabled || canEdit,
3322
+ disabled: disabled || !canEdit,
3290
3323
  style: {
3291
3324
  width: '200px'
3292
3325
  },
@@ -3552,9 +3585,8 @@ var GoodsModal$1 = function GoodsModal(props) {
3552
3585
  tab: '已选择',
3553
3586
  key: 'all'
3554
3587
  }]),
3555
- _useState18 = _slicedToArray(_useState17, 2),
3556
- tabs = _useState18[0],
3557
- setTabs = _useState18[1];
3588
+ _useState18 = _slicedToArray(_useState17, 1),
3589
+ tabs = _useState18[0];
3558
3590
  var _useState19 = useState([{
3559
3591
  name: '上架时间',
3560
3592
  value: 'list_time'
package/dist/index.js CHANGED
@@ -508,6 +508,7 @@ var ApaasDate = function ApaasDate(props) {
508
508
 
509
509
  var _excluded$1 = ["isNumber", "replaceWarn"];
510
510
  function ApaasInput(props) {
511
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
511
512
  var isNumber = props.isNumber,
512
513
  replaceWarn = props.replaceWarn,
513
514
  other = _objectWithoutProperties(props, _excluded$1);
@@ -520,6 +521,7 @@ function ApaasInputNumber(props) {
520
521
 
521
522
  var _excluded$2 = ["options", "basicMultSelect"];
522
523
  function ApaasSelect(props) {
524
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
523
525
  var _props$options = props.options,
524
526
  options = _props$options === void 0 ? [] : _props$options,
525
527
  basicMultSelect = props.basicMultSelect,
@@ -589,8 +591,8 @@ var styles = {"imageBox":"index-module_imageBox__3tOEt","inputImage":"index-modu
589
591
  styleInject(css_248z);
590
592
 
591
593
  var _excluded$4 = ["maxCount", "maxSize", "uploadText", "onChange", "value", "accept", "canPreview", "disabled"];
592
- var fn = function fn(_ref) {
593
- var _ref2 = _slicedToArray(_ref, 0);
594
+ var fn = function fn() {
595
+ return void 0;
594
596
  };
595
597
  var getBase64 = function getBase64(file) {
596
598
  return new Promise(function (resolve, reject) {
@@ -604,24 +606,24 @@ var getBase64 = function getBase64(file) {
604
606
  };
605
607
  });
606
608
  };
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);
609
+ var ApaasUpload = function ApaasUpload(_ref) {
610
+ var _ref$maxCount = _ref.maxCount,
611
+ maxCount = _ref$maxCount === void 0 ? 10 : _ref$maxCount,
612
+ _ref$maxSize = _ref.maxSize,
613
+ maxSize = _ref$maxSize === void 0 ? 10 : _ref$maxSize,
614
+ _ref$uploadText = _ref.uploadText,
615
+ uploadText = _ref$uploadText === void 0 ? '上传' : _ref$uploadText,
616
+ _ref$onChange = _ref.onChange,
617
+ onChange = _ref$onChange === void 0 ? fn : _ref$onChange,
618
+ _ref$value = _ref.value,
619
+ value = _ref$value === void 0 ? [] : _ref$value,
620
+ _ref$accept = _ref.accept,
621
+ accept = _ref$accept === void 0 ? 'image/gif,image/jpg,image/jpeg,image/png' : _ref$accept,
622
+ _ref$canPreview = _ref.canPreview,
623
+ canPreview = _ref$canPreview === void 0 ? false : _ref$canPreview,
624
+ _ref$disabled = _ref.disabled,
625
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
626
+ resetProps = _objectWithoutProperties(_ref, _excluded$4);
625
627
  var inputRef = React.useRef(null);
626
628
  var valueRef = React.useRef(value);
627
629
  var _useState = React.useState(false),
@@ -662,8 +664,8 @@ var ApaasUpload = function ApaasUpload(_ref3) {
662
664
  onChange(list);
663
665
  };
664
666
  var clipboardDataChange = function clipboardDataChange(e) {
665
- var clipboardData = e.clipboardData || window.clipboardData,
666
- i = 0,
667
+ var clipboardData = e.clipboardData || window.clipboardData;
668
+ var i = 0,
667
669
  items,
668
670
  item,
669
671
  types;
@@ -921,32 +923,32 @@ var styles$1 = {"imageBox":"index-module_imageBox__8zj7A","inputImage":"index-mo
921
923
  styleInject(css_248z$1);
922
924
 
923
925
  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);
926
+ var fn$1 = function fn() {
927
+ return void 0;
926
928
  };
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);
929
+ var ApaasUploadAsync = function ApaasUploadAsync(_ref) {
930
+ var _ref$maxCount = _ref.maxCount,
931
+ maxCount = _ref$maxCount === void 0 ? 10 : _ref$maxCount,
932
+ _ref$maxSize = _ref.maxSize,
933
+ maxSize = _ref$maxSize === void 0 ? 10 : _ref$maxSize,
934
+ _ref$uploadText = _ref.uploadText,
935
+ uploadText = _ref$uploadText === void 0 ? '上传' : _ref$uploadText,
936
+ _ref$onChange = _ref.onChange,
937
+ onChange = _ref$onChange === void 0 ? fn$1 : _ref$onChange,
938
+ _ref$value = _ref.value,
939
+ value = _ref$value === void 0 ? [] : _ref$value,
940
+ _ref$accept = _ref.accept,
941
+ accept = _ref$accept === void 0 ? 'image/gif,image/jpg,image/jpeg,image/png' : _ref$accept,
942
+ _ref$canPreview = _ref.canPreview,
943
+ canPreview = _ref$canPreview === void 0 ? false : _ref$canPreview,
944
+ _ref$disabled = _ref.disabled,
945
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
946
+ uniqueKey = _ref.uniqueKey,
947
+ _ref$hostUrl = _ref.hostUrl,
948
+ hostUrl = _ref$hostUrl === void 0 ? '' : _ref$hostUrl,
949
+ _ref$actionUrl = _ref.actionUrl,
950
+ actionUrl = _ref$actionUrl === void 0 ? '/qy/common/uploadWorkOrderImg' : _ref$actionUrl,
951
+ resetProps = _objectWithoutProperties(_ref, _excluded$6);
950
952
  var inputRef = React.useRef(null);
951
953
  var valueRef = React.useRef(value);
952
954
  var _useState = React.useState(false),
@@ -969,7 +971,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
969
971
  valueRef.current = value;
970
972
  }, [value]);
971
973
  var asyncUpload = /*#__PURE__*/function () {
972
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {
974
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {
973
975
  var _valueRef$current;
974
976
  var formData, fileName, _yield$request, success, data;
975
977
  return _regeneratorRuntime().wrap(function _callee$(_context) {
@@ -1010,7 +1012,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1010
1012
  }, _callee, null, [[5, 14, 17, 20]]);
1011
1013
  }));
1012
1014
  return function asyncUpload(_x) {
1013
- return _ref4.apply(this, arguments);
1015
+ return _ref2.apply(this, arguments);
1014
1016
  };
1015
1017
  }();
1016
1018
  var imgReader = function imgReader(item) {
@@ -1025,7 +1027,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1025
1027
  return;
1026
1028
  }
1027
1029
  reader.onload = /*#__PURE__*/function () {
1028
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
1030
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
1029
1031
  var _e$target, _valueRef$current2;
1030
1032
  var result, fileName, file;
1031
1033
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
@@ -1042,7 +1044,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1042
1044
  }, _callee2);
1043
1045
  }));
1044
1046
  return function (_x2) {
1045
- return _ref5.apply(this, arguments);
1047
+ return _ref3.apply(this, arguments);
1046
1048
  };
1047
1049
  }();
1048
1050
  reader.readAsDataURL(blob);
@@ -1052,8 +1054,8 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1052
1054
  onChange(list);
1053
1055
  };
1054
1056
  var clipboardDataChange = function clipboardDataChange(e) {
1055
- var clipboardData = e.clipboardData || window.clipboardData,
1056
- i = 0,
1057
+ var clipboardData = e.clipboardData || window.clipboardData;
1058
+ var i = 0,
1057
1059
  items,
1058
1060
  item,
1059
1061
  types;
@@ -1198,7 +1200,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1198
1200
  })));
1199
1201
  };
1200
1202
 
1201
- var _excluded$7 = ["showOther", "horizontal", "options", "value", "onChange", "disabled", "checkboxOther"];
1203
+ var _excluded$7 = ["showOther", "horizontal", "options", "value", "onChange", "disabled"];
1202
1204
  function ApaasCheckbox(props) {
1203
1205
  var showOther = props.showOther,
1204
1206
  _props$horizontal = props.horizontal,
@@ -1209,7 +1211,6 @@ function ApaasCheckbox(props) {
1209
1211
  value = _props$value === void 0 ? {} : _props$value,
1210
1212
  onChange = props.onChange,
1211
1213
  disabled = props.disabled,
1212
- checkboxOther = props.checkboxOther,
1213
1214
  otherProps = _objectWithoutProperties(props, _excluded$7);
1214
1215
  var checkboxValue = value.value,
1215
1216
  other = value.other;
@@ -1517,15 +1518,11 @@ var ShopNameSelect = function ShopNameSelect(props) {
1517
1518
  disabled = props.disabled,
1518
1519
  style = props.style;
1519
1520
  var _useState = React.useState([]),
1520
- _useState2 = _slicedToArray(_useState, 2),
1521
- options = _useState2[0],
1522
- setOptions = _useState2[1];
1521
+ _useState2 = _slicedToArray(_useState, 1),
1522
+ options = _useState2[0];
1523
1523
  var handleChange = function handleChange(value) {
1524
1524
  onChange === null || onChange === void 0 ? void 0 : onChange(value);
1525
1525
  };
1526
- React.useEffect(function () {
1527
- // initDataSource();
1528
- }, []);
1529
1526
  return /*#__PURE__*/React__default['default'].createElement(antd.Select, {
1530
1527
  defaultValue: value,
1531
1528
  disabled: disabled,
@@ -1550,7 +1547,7 @@ function ApaasAddress(props) {
1550
1547
  var value = props.value,
1551
1548
  onChange = props.onChange,
1552
1549
  disabled = props.disabled;
1553
- var changeCity = function changeCity(city, selectedOptions) {
1550
+ var changeCity = function changeCity(city) {
1554
1551
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
1555
1552
  address: city
1556
1553
  }));
@@ -1700,7 +1697,6 @@ var AliPay = function AliPay(props) {
1700
1697
  var changeValue = function changeValue(e, type) {
1701
1698
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, e.target.value)));
1702
1699
  };
1703
- React.useEffect(function () {}, []);
1704
1700
  return /*#__PURE__*/React__default['default'].createElement("div", null, !isSingle ? /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
1705
1701
  disabled: disabled,
1706
1702
  placeholder: "\u8BF7\u8F93\u5165\u652F\u4ED8\u5B9D\u540D\u79F0",
@@ -2242,8 +2238,7 @@ var Sku = /*#__PURE__*/React.forwardRef(function (props, ref) {
2242
2238
  React.useImperativeHandle(ref, function () {
2243
2239
  return {
2244
2240
  open: function open(_ref) {
2245
- var shopId = _ref.shopId,
2246
- numIids = _ref.numIids,
2241
+ var numIids = _ref.numIids,
2247
2242
  options = _ref.options;
2248
2243
  setVisible(true);
2249
2244
  setSku('');
@@ -2383,19 +2378,14 @@ var Goods = function Goods(props) {
2383
2378
  _useState2 = _slicedToArray(_useState, 2),
2384
2379
  visible = _useState2[0],
2385
2380
  setVisible = _useState2[1];
2386
- var _useState3 = React.useState(''),
2381
+ var _useState3 = React.useState(0),
2387
2382
  _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];
2383
+ uploadImageCount = _useState4[0],
2384
+ setUploadImageCount = _useState4[1];
2394
2385
  var skuRef = React.useRef();
2395
- var _useState7 = React.useState(false),
2396
- _useState8 = _slicedToArray(_useState7, 2),
2397
- editVisible = _useState8[0],
2398
- setEditVisible = _useState8[1];
2386
+ var _useState5 = React.useState(false),
2387
+ _useState6 = _slicedToArray(_useState5, 2),
2388
+ setEditVisible = _useState6[1];
2399
2389
  // onChange事件会修改imgList里的字段,所以保存初始化的imglist值
2400
2390
  if (!imgListConstant.length) {
2401
2391
  imgListConstant = JSON.parse(JSON.stringify(imgList));
@@ -2801,7 +2791,7 @@ var Invoice = function Invoice(props) {
2801
2791
  */
2802
2792
  var handleChange = /*#__PURE__*/function () {
2803
2793
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(ordinaryTaitou) {
2804
- var data, list, newList, index, element, kpName, idx;
2794
+ var data, _list, newList, index, element, kpName, idx;
2805
2795
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2806
2796
  while (1) switch (_context2.prev = _context2.next) {
2807
2797
  case 0:
@@ -2822,16 +2812,16 @@ var Invoice = function Invoice(props) {
2822
2812
  _context2.next = 16;
2823
2813
  break;
2824
2814
  }
2825
- list = data.data ? data.data.info || [] : [];
2826
- if (list.length) {
2815
+ _list = data.data ? data.data.info || [] : [];
2816
+ if (_list.length) {
2827
2817
  _context2.next = 10;
2828
2818
  break;
2829
2819
  }
2830
2820
  return _context2.abrupt("return");
2831
2821
  case 10:
2832
2822
  newList = [];
2833
- for (index = 0; index < list.length; index++) {
2834
- element = list[index];
2823
+ for (index = 0; index < _list.length; index++) {
2824
+ element = _list[index];
2835
2825
  kpName = element.kpName;
2836
2826
  idx = kpName.indexOf(ordinaryTaitou);
2837
2827
  element.kpName1 = kpName.substring(0, idx);
@@ -3131,48 +3121,71 @@ var LogisticsInterception = function LogisticsInterception(props) {
3131
3121
  value = _props$value === void 0 ? {} : _props$value,
3132
3122
  _props$logisticsOptio = props.logisticsOptions,
3133
3123
  logisticsOptions = _props$logisticsOptio === void 0 ? [] : _props$logisticsOptio,
3124
+ _props$expressInterce = props.expressInterceptData,
3125
+ expressInterceptData = _props$expressInterce === void 0 ? [] : _props$expressInterce,
3134
3126
  _props$required = props.required,
3135
3127
  required = _props$required === void 0 ? false : _props$required,
3136
3128
  onChange = props.onChange,
3137
3129
  _props$disabled = props.disabled,
3138
3130
  disabled = _props$disabled === void 0 ? false : _props$disabled,
3139
3131
  _props$isEditing = props.isEditing,
3140
- isEditing = _props$isEditing === void 0 ? false : _props$isEditing;
3141
- var _useState = React.useState([]),
3132
+ isEditing = _props$isEditing === void 0 ? false : _props$isEditing,
3133
+ logisticsInterceptHandleStatus = props.logisticsInterceptHandleStatus;
3134
+ var _useState = React.useState(''),
3142
3135
  _useState2 = _slicedToArray(_useState, 2),
3143
- typeOptions = _useState2[0],
3144
- setTypeOptions = _useState2[1];
3136
+ initCompany = _useState2[0],
3137
+ setInitCompany = _useState2[1];
3145
3138
  var _useState3 = React.useState([]),
3146
3139
  _useState4 = _slicedToArray(_useState3, 2),
3147
- statusOptions = _useState4[0],
3148
- setStatusOptions = _useState4[1];
3149
- var _useState5 = React.useState(false),
3140
+ typeOptions = _useState4[0],
3141
+ setTypeOptions = _useState4[1];
3142
+ var _useState5 = React.useState([]),
3150
3143
  _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]);
3144
+ statusOptions = _useState6[0],
3145
+ setStatusOptions = _useState6[1];
3146
+ var _useState7 = React.useState(false),
3147
+ _useState8 = _slicedToArray(_useState7, 2),
3148
+ isInterface = _useState8[0],
3149
+ setIsInterface = _useState8[1];
3150
+ var firstIn = React.useRef(true);
3162
3151
  React.useEffect(function () {
3152
+ //存入第一次的物流地址,防止非对接物流切换成对接物流后无法编辑
3153
+ if (firstIn.current && (value === null || value === void 0 ? void 0 : value.interceptCompany)) {
3154
+ setInitCompany(value === null || value === void 0 ? void 0 : value.interceptCompany);
3155
+ firstIn.current = false;
3156
+ }
3163
3157
  if (!(value === null || value === void 0 ? void 0 : value.interceptCompany)) {
3164
3158
  setTypeOptions([]);
3165
3159
  setStatusOptions([]);
3166
3160
  setIsInterface(false);
3167
3161
  return;
3168
3162
  }
3169
- var interceptCompany = logisticsOptions.find(function (item) {
3170
- return item.expressCode === (value === null || value === void 0 ? void 0 : value.interceptCompany);
3163
+ var interceptCompany = expressInterceptData.find(function (item) {
3164
+ return item.value === (value === null || value === void 0 ? void 0 : value.interceptCompany);
3171
3165
  });
3172
3166
  setTypeOptions((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionTypeList) || []);
3173
3167
  setStatusOptions((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionStatusList) || []);
3174
3168
  setIsInterface(interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.isInterface);
3175
3169
  }, [value === null || value === void 0 ? void 0 : value.interceptCompany]);
3170
+ //拦截类型切换 需要清空新派送地
3171
+ React.useEffect(function () {
3172
+ if (!(value === null || value === void 0 ? void 0 : value.interceptCompany)) return;
3173
+ var interceptCompany = expressInterceptData.find(function (item) {
3174
+ return item.value === (value === null || value === void 0 ? void 0 : value.interceptCompany);
3175
+ });
3176
+ var showAddress = ((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionTypeList) || []).some(function (item) {
3177
+ var _item$config;
3178
+ 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);
3179
+ });
3180
+ if (!showAddress) {
3181
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
3182
+ interceptAddress: [],
3183
+ interceptDetail: '',
3184
+ interceptReceiverName: '',
3185
+ interceptReceiverMobile: ''
3186
+ }));
3187
+ }
3188
+ }, [value === null || value === void 0 ? void 0 : value.interceptType]);
3176
3189
  //是否展示新地址
3177
3190
  var showNewAddress = React.useMemo(function () {
3178
3191
  var _find, _find$config;
@@ -3180,18 +3193,41 @@ var LogisticsInterception = function LogisticsInterception(props) {
3180
3193
  return item.value === (value === null || value === void 0 ? void 0 : value.interceptType);
3181
3194
  })) === null || _find === void 0 ? void 0 : (_find$config = _find.config) === null || _find$config === void 0 ? void 0 : _find$config.showAddress;
3182
3195
  }, [value === null || value === void 0 ? void 0 : value.interceptType, typeOptions, value === null || value === void 0 ? void 0 : value.interceptCompany]);
3196
+ //判断是否能修改信息
3197
+ var canEdit = React.useMemo(function () {
3198
+ // 已对接公司如果拦截状态为【拦截中】,可以修改物流拦截组件信息,否则该组件不能修改;
3199
+ // 非对接公司可以修改组件
3200
+ // 修改后把工单信息重新提交给快递公司,清空拦截状态的值
3201
+ if (!isInterface) return true;
3202
+ //已对接公司在拦截中可以修改
3203
+ var INTERCEPTING = !logisticsInterceptHandleStatus || logisticsInterceptHandleStatus === 'INTERCEPTING';
3204
+ return isEditing ? INTERCEPTING : true;
3205
+ }, [value === null || value === void 0 ? void 0 : value.interceptCompany, statusOptions, isInterface, isEditing]);
3206
+ //判断是否能修改物流信息
3207
+ var canEditCompany = React.useMemo(function () {
3208
+ var company = expressInterceptData.find(function (item) {
3209
+ return item.value === initCompany;
3210
+ });
3211
+ return isEditing && !!(company === null || company === void 0 ? void 0 : company.isInterface);
3212
+ }, [isEditing, initCompany]);
3183
3213
  var changeHandle = function changeHandle(val, type) {
3184
3214
  var newValue = _objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, val));
3185
3215
  if (type === 'interceptCompany') {
3216
+ var interceptCompany = expressInterceptData.find(function (item) {
3217
+ return item.value === val;
3218
+ });
3219
+ var returnValue = ((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionTypeList) || []).find(function (item) {
3220
+ return item === null || item === void 0 ? void 0 : item.isDefault;
3221
+ });
3186
3222
  newValue = _objectSpread2(_objectSpread2({}, value), {}, {
3187
3223
  interceptCompany: val,
3188
- interceptType: 'RETURN',
3224
+ interceptType: returnValue === null || returnValue === void 0 ? void 0 : returnValue.value,
3189
3225
  interceptAddress: [],
3190
- interceptDetail: '',
3191
- interceptReceiverName: '',
3192
- interceptReceiverMobile: '',
3193
- interceptStatus: '',
3194
- interceptOther: ''
3226
+ interceptDetail: undefined,
3227
+ interceptReceiverName: undefined,
3228
+ interceptReceiverMobile: undefined,
3229
+ interceptStatus: undefined,
3230
+ interceptOther: undefined
3195
3231
  });
3196
3232
  }
3197
3233
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
@@ -3201,10 +3237,10 @@ var LogisticsInterception = function LogisticsInterception(props) {
3201
3237
  required: required,
3202
3238
  key: 'logistics'
3203
3239
  }, /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
3204
- disabled: disabled || !canEdit,
3240
+ disabled: disabled || canEditCompany,
3205
3241
  placeholder: "\u7269\u6D41\u516C\u53F8",
3206
3242
  style: {
3207
- width: '200px'
3243
+ width: '150px'
3208
3244
  },
3209
3245
  onChange: function onChange(val) {
3210
3246
  return changeHandle(val, 'interceptCompany');
@@ -3216,7 +3252,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
3216
3252
  return option.label.includes(input);
3217
3253
  }
3218
3254
  }), /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3219
- disabled: disabled || !canEdit,
3255
+ disabled: disabled || canEditCompany,
3220
3256
  placeholder: "\u7269\u6D41\u5355\u53F7",
3221
3257
  onChange: function onChange(e) {
3222
3258
  return changeHandle(e.target.value, 'interceptCode');
@@ -3263,9 +3299,6 @@ var LogisticsInterception = function LogisticsInterception(props) {
3263
3299
  })), /*#__PURE__*/React__default['default'].createElement("br", null), /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3264
3300
  value: value === null || value === void 0 ? void 0 : value.interceptReceiverName,
3265
3301
  disabled: disabled || !canEdit,
3266
- style: {
3267
- width: '200px'
3268
- },
3269
3302
  placeholder: "\u6536\u4EF6\u4EBA\u59D3\u540D",
3270
3303
  onChange: function onChange(e) {
3271
3304
  return changeHandle(e.target.value, 'interceptReceiverName');
@@ -3296,7 +3329,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
3296
3329
  return option.label.includes(input);
3297
3330
  }
3298
3331
  }), (value === null || value === void 0 ? void 0 : value.interceptStatus) === 'OTHER' && /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3299
- disabled: disabled || canEdit,
3332
+ disabled: disabled || !canEdit,
3300
3333
  style: {
3301
3334
  width: '200px'
3302
3335
  },
@@ -3562,9 +3595,8 @@ var GoodsModal$1 = function GoodsModal(props) {
3562
3595
  tab: '已选择',
3563
3596
  key: 'all'
3564
3597
  }]),
3565
- _useState18 = _slicedToArray(_useState17, 2),
3566
- tabs = _useState18[0],
3567
- setTabs = _useState18[1];
3598
+ _useState18 = _slicedToArray(_useState17, 1),
3599
+ tabs = _useState18[0];
3568
3600
  var _useState19 = React.useState([{
3569
3601
  name: '上架时间',
3570
3602
  value: 'list_time'
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",
3
+ "version": "0.6.3-alpha.30",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "",
6
6
  "license": "ISC",
@@ -12,7 +12,9 @@
12
12
  ],
13
13
  "scripts": {
14
14
  "async": "yarn build && yalc push",
15
- "build": "father-build",
15
+ "build": "yarn lint && father-build",
16
+ "lint": "eslint '**/*.{ts,tsx}'",
17
+ "lint:fix": "eslint --fix '**/*.{ts,tsx}'",
16
18
  "start": "dumi dev",
17
19
  "watch": "nodemon --ignore dist/ --ignore node_modules/ --watch src/ -C -e ts,tsx,less --debug -x 'yarn async'"
18
20
  },
@@ -20,9 +22,12 @@
20
22
  "umi-request": "^1.4.0"
21
23
  },
22
24
  "devDependencies": {
25
+ "@typescript-eslint/eslint-plugin": "^5.59.2",
26
+ "@typescript-eslint/parser": "^5.59.2",
23
27
  "@umijs/test": "^3.0.5",
24
28
  "babel-plugin-import": "^1.13.5",
25
29
  "dumi": "^1.0.16",
30
+ "eslint": "^8.40.0",
26
31
  "father-build": "^1.17.2",
27
32
  "gh-pages": "^3.0.0",
28
33
  "lint-staged": "^10.0.7",
@@ -37,5 +42,5 @@
37
42
  "publishConfig": {
38
43
  "access": "public"
39
44
  },
40
- "gitHead": "021dc716b8d75e9cc0ce3abfe3be4b25724fa133"
45
+ "gitHead": "17f4fb7c97d953750f7bb2028bf2b5fc8205afc5"
41
46
  }