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

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.
@@ -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
@@ -579,8 +579,8 @@ var styles = {"imageBox":"index-module_imageBox__3tOEt","inputImage":"index-modu
579
579
  styleInject(css_248z);
580
580
 
581
581
  var _excluded$4 = ["maxCount", "maxSize", "uploadText", "onChange", "value", "accept", "canPreview", "disabled"];
582
- var fn = function fn(_ref) {
583
- var _ref2 = _slicedToArray(_ref, 0);
582
+ var fn = function fn() {
583
+ return void 0;
584
584
  };
585
585
  var getBase64 = function getBase64(file) {
586
586
  return new Promise(function (resolve, reject) {
@@ -594,24 +594,24 @@ var getBase64 = function getBase64(file) {
594
594
  };
595
595
  });
596
596
  };
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);
597
+ var ApaasUpload = function ApaasUpload(_ref) {
598
+ var _ref$maxCount = _ref.maxCount,
599
+ maxCount = _ref$maxCount === void 0 ? 10 : _ref$maxCount,
600
+ _ref$maxSize = _ref.maxSize,
601
+ maxSize = _ref$maxSize === void 0 ? 10 : _ref$maxSize,
602
+ _ref$uploadText = _ref.uploadText,
603
+ uploadText = _ref$uploadText === void 0 ? '上传' : _ref$uploadText,
604
+ _ref$onChange = _ref.onChange,
605
+ onChange = _ref$onChange === void 0 ? fn : _ref$onChange,
606
+ _ref$value = _ref.value,
607
+ value = _ref$value === void 0 ? [] : _ref$value,
608
+ _ref$accept = _ref.accept,
609
+ accept = _ref$accept === void 0 ? 'image/gif,image/jpg,image/jpeg,image/png' : _ref$accept,
610
+ _ref$canPreview = _ref.canPreview,
611
+ canPreview = _ref$canPreview === void 0 ? false : _ref$canPreview,
612
+ _ref$disabled = _ref.disabled,
613
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
614
+ resetProps = _objectWithoutProperties(_ref, _excluded$4);
615
615
  var inputRef = useRef(null);
616
616
  var valueRef = useRef(value);
617
617
  var _useState = useState(false),
@@ -652,8 +652,8 @@ var ApaasUpload = function ApaasUpload(_ref3) {
652
652
  onChange(list);
653
653
  };
654
654
  var clipboardDataChange = function clipboardDataChange(e) {
655
- var clipboardData = e.clipboardData || window.clipboardData,
656
- i = 0,
655
+ var clipboardData = e.clipboardData || window.clipboardData;
656
+ var i = 0,
657
657
  items,
658
658
  item,
659
659
  types;
@@ -911,32 +911,32 @@ var styles$1 = {"imageBox":"index-module_imageBox__8zj7A","inputImage":"index-mo
911
911
  styleInject(css_248z$1);
912
912
 
913
913
  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);
914
+ var fn$1 = function fn() {
915
+ return void 0;
916
916
  };
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);
917
+ var ApaasUploadAsync = function ApaasUploadAsync(_ref) {
918
+ var _ref$maxCount = _ref.maxCount,
919
+ maxCount = _ref$maxCount === void 0 ? 10 : _ref$maxCount,
920
+ _ref$maxSize = _ref.maxSize,
921
+ maxSize = _ref$maxSize === void 0 ? 10 : _ref$maxSize,
922
+ _ref$uploadText = _ref.uploadText,
923
+ uploadText = _ref$uploadText === void 0 ? '上传' : _ref$uploadText,
924
+ _ref$onChange = _ref.onChange,
925
+ onChange = _ref$onChange === void 0 ? fn$1 : _ref$onChange,
926
+ _ref$value = _ref.value,
927
+ value = _ref$value === void 0 ? [] : _ref$value,
928
+ _ref$accept = _ref.accept,
929
+ accept = _ref$accept === void 0 ? 'image/gif,image/jpg,image/jpeg,image/png' : _ref$accept,
930
+ _ref$canPreview = _ref.canPreview,
931
+ canPreview = _ref$canPreview === void 0 ? false : _ref$canPreview,
932
+ _ref$disabled = _ref.disabled,
933
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
934
+ uniqueKey = _ref.uniqueKey,
935
+ _ref$hostUrl = _ref.hostUrl,
936
+ hostUrl = _ref$hostUrl === void 0 ? '' : _ref$hostUrl,
937
+ _ref$actionUrl = _ref.actionUrl,
938
+ actionUrl = _ref$actionUrl === void 0 ? '/qy/common/uploadWorkOrderImg' : _ref$actionUrl,
939
+ resetProps = _objectWithoutProperties(_ref, _excluded$6);
940
940
  var inputRef = useRef(null);
941
941
  var valueRef = useRef(value);
942
942
  var _useState = useState(false),
@@ -959,7 +959,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
959
959
  valueRef.current = value;
960
960
  }, [value]);
961
961
  var asyncUpload = /*#__PURE__*/function () {
962
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {
962
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {
963
963
  var _valueRef$current;
964
964
  var formData, fileName, _yield$request, success, data;
965
965
  return _regeneratorRuntime().wrap(function _callee$(_context) {
@@ -1000,7 +1000,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1000
1000
  }, _callee, null, [[5, 14, 17, 20]]);
1001
1001
  }));
1002
1002
  return function asyncUpload(_x) {
1003
- return _ref4.apply(this, arguments);
1003
+ return _ref2.apply(this, arguments);
1004
1004
  };
1005
1005
  }();
1006
1006
  var imgReader = function imgReader(item) {
@@ -1015,7 +1015,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1015
1015
  return;
1016
1016
  }
1017
1017
  reader.onload = /*#__PURE__*/function () {
1018
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
1018
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
1019
1019
  var _e$target, _valueRef$current2;
1020
1020
  var result, fileName, file;
1021
1021
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
@@ -1032,7 +1032,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1032
1032
  }, _callee2);
1033
1033
  }));
1034
1034
  return function (_x2) {
1035
- return _ref5.apply(this, arguments);
1035
+ return _ref3.apply(this, arguments);
1036
1036
  };
1037
1037
  }();
1038
1038
  reader.readAsDataURL(blob);
@@ -1042,8 +1042,8 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1042
1042
  onChange(list);
1043
1043
  };
1044
1044
  var clipboardDataChange = function clipboardDataChange(e) {
1045
- var clipboardData = e.clipboardData || window.clipboardData,
1046
- i = 0,
1045
+ var clipboardData = e.clipboardData || window.clipboardData;
1046
+ var i = 0,
1047
1047
  items,
1048
1048
  item,
1049
1049
  types;
@@ -1188,7 +1188,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1188
1188
  })));
1189
1189
  };
1190
1190
 
1191
- var _excluded$7 = ["showOther", "horizontal", "options", "value", "onChange", "disabled", "checkboxOther"];
1191
+ var _excluded$7 = ["showOther", "horizontal", "options", "value", "onChange", "disabled"];
1192
1192
  function ApaasCheckbox(props) {
1193
1193
  var showOther = props.showOther,
1194
1194
  _props$horizontal = props.horizontal,
@@ -1199,7 +1199,6 @@ function ApaasCheckbox(props) {
1199
1199
  value = _props$value === void 0 ? {} : _props$value,
1200
1200
  onChange = props.onChange,
1201
1201
  disabled = props.disabled,
1202
- checkboxOther = props.checkboxOther,
1203
1202
  otherProps = _objectWithoutProperties(props, _excluded$7);
1204
1203
  var checkboxValue = value.value,
1205
1204
  other = value.other;
@@ -1540,7 +1539,7 @@ function ApaasAddress(props) {
1540
1539
  var value = props.value,
1541
1540
  onChange = props.onChange,
1542
1541
  disabled = props.disabled;
1543
- var changeCity = function changeCity(city, selectedOptions) {
1542
+ var changeCity = function changeCity(city) {
1544
1543
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
1545
1544
  address: city
1546
1545
  }));
@@ -1690,7 +1689,6 @@ var AliPay = function AliPay(props) {
1690
1689
  var changeValue = function changeValue(e, type) {
1691
1690
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, e.target.value)));
1692
1691
  };
1693
- useEffect(function () {}, []);
1694
1692
  return /*#__PURE__*/React.createElement("div", null, !isSingle ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Input, {
1695
1693
  disabled: disabled,
1696
1694
  placeholder: "\u8BF7\u8F93\u5165\u652F\u4ED8\u5B9D\u540D\u79F0",
@@ -2791,7 +2789,7 @@ var Invoice = function Invoice(props) {
2791
2789
  */
2792
2790
  var handleChange = /*#__PURE__*/function () {
2793
2791
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(ordinaryTaitou) {
2794
- var data, list, newList, index, element, kpName, idx;
2792
+ var data, _list, newList, index, element, kpName, idx;
2795
2793
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2796
2794
  while (1) switch (_context2.prev = _context2.next) {
2797
2795
  case 0:
@@ -2812,16 +2810,16 @@ var Invoice = function Invoice(props) {
2812
2810
  _context2.next = 16;
2813
2811
  break;
2814
2812
  }
2815
- list = data.data ? data.data.info || [] : [];
2816
- if (list.length) {
2813
+ _list = data.data ? data.data.info || [] : [];
2814
+ if (_list.length) {
2817
2815
  _context2.next = 10;
2818
2816
  break;
2819
2817
  }
2820
2818
  return _context2.abrupt("return");
2821
2819
  case 10:
2822
2820
  newList = [];
2823
- for (index = 0; index < list.length; index++) {
2824
- element = list[index];
2821
+ for (index = 0; index < _list.length; index++) {
2822
+ element = _list[index];
2825
2823
  kpName = element.kpName;
2826
2824
  idx = kpName.indexOf(ordinaryTaitou);
2827
2825
  element.kpName1 = kpName.substring(0, idx);
@@ -3121,13 +3119,16 @@ var LogisticsInterception = function LogisticsInterception(props) {
3121
3119
  value = _props$value === void 0 ? {} : _props$value,
3122
3120
  _props$logisticsOptio = props.logisticsOptions,
3123
3121
  logisticsOptions = _props$logisticsOptio === void 0 ? [] : _props$logisticsOptio,
3122
+ _props$expressInterce = props.expressInterceptData,
3123
+ expressInterceptData = _props$expressInterce === void 0 ? [] : _props$expressInterce,
3124
3124
  _props$required = props.required,
3125
3125
  required = _props$required === void 0 ? false : _props$required,
3126
3126
  onChange = props.onChange,
3127
3127
  _props$disabled = props.disabled,
3128
3128
  disabled = _props$disabled === void 0 ? false : _props$disabled,
3129
3129
  _props$isEditing = props.isEditing,
3130
- isEditing = _props$isEditing === void 0 ? false : _props$isEditing;
3130
+ isEditing = _props$isEditing === void 0 ? false : _props$isEditing,
3131
+ logisticsInterceptHandleStatus = props.logisticsInterceptHandleStatus;
3131
3132
  var _useState = useState([]),
3132
3133
  _useState2 = _slicedToArray(_useState, 2),
3133
3134
  typeOptions = _useState2[0],
@@ -3141,14 +3142,14 @@ var LogisticsInterception = function LogisticsInterception(props) {
3141
3142
  isInterface = _useState6[0],
3142
3143
  setIsInterface = _useState6[1];
3143
3144
  var canEdit = useMemo(function () {
3144
- //非对接公司可以修改
3145
+ // 已对接公司如果拦截状态为【拦截中】,可以修改物流拦截组件信息,否则该组件不能修改;
3146
+ // 非对接公司可以修改组件
3147
+ // 修改后把工单信息重新提交给快递公司,清空拦截状态的值
3145
3148
  if (!isInterface) return true;
3146
3149
  //已对接公司在拦截中可以修改
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]);
3150
+ var INTERCEPTING = logisticsInterceptHandleStatus === 'INTERCEPTING';
3151
+ return isEditing ? INTERCEPTING : true;
3152
+ }, [value === null || value === void 0 ? void 0 : value.interceptCompany, statusOptions, isInterface, isEditing]);
3152
3153
  useEffect(function () {
3153
3154
  if (!(value === null || value === void 0 ? void 0 : value.interceptCompany)) {
3154
3155
  setTypeOptions([]);
@@ -3156,13 +3157,31 @@ var LogisticsInterception = function LogisticsInterception(props) {
3156
3157
  setIsInterface(false);
3157
3158
  return;
3158
3159
  }
3159
- var interceptCompany = logisticsOptions.find(function (item) {
3160
- return item.expressCode === (value === null || value === void 0 ? void 0 : value.interceptCompany);
3160
+ var interceptCompany = expressInterceptData.find(function (item) {
3161
+ return item.value === (value === null || value === void 0 ? void 0 : value.interceptCompany);
3161
3162
  });
3162
3163
  setTypeOptions((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionTypeList) || []);
3163
3164
  setStatusOptions((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionStatusList) || []);
3164
3165
  setIsInterface(interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.isInterface);
3165
3166
  }, [value === null || value === void 0 ? void 0 : value.interceptCompany]);
3167
+ useEffect(function () {
3168
+ if (!(value === null || value === void 0 ? void 0 : value.interceptCompany)) return;
3169
+ var interceptCompany = expressInterceptData.find(function (item) {
3170
+ return item.value === (value === null || value === void 0 ? void 0 : value.interceptCompany);
3171
+ });
3172
+ var showAddress = ((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionTypeList) || []).some(function (item) {
3173
+ var _item$config;
3174
+ 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);
3175
+ });
3176
+ if (!showAddress) {
3177
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
3178
+ interceptAddress: [],
3179
+ interceptDetail: '',
3180
+ interceptReceiverName: '',
3181
+ interceptReceiverMobile: ''
3182
+ }));
3183
+ }
3184
+ }, [value === null || value === void 0 ? void 0 : value.interceptType]);
3166
3185
  //是否展示新地址
3167
3186
  var showNewAddress = useMemo(function () {
3168
3187
  var _find, _find$config;
@@ -3173,14 +3192,21 @@ var LogisticsInterception = function LogisticsInterception(props) {
3173
3192
  var changeHandle = function changeHandle(val, type) {
3174
3193
  var newValue = _objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, val));
3175
3194
  if (type === 'interceptCompany') {
3195
+ var interceptCompany = expressInterceptData.find(function (item) {
3196
+ return item.value === val;
3197
+ });
3198
+ var returnValue = ((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionTypeList) || []).find(function (item) {
3199
+ var _item$label;
3200
+ return (item === null || item === void 0 ? void 0 : item.label) && (item === null || item === void 0 ? void 0 : (_item$label = item.label) === null || _item$label === void 0 ? void 0 : _item$label.indexOf('退回')) > -1;
3201
+ });
3176
3202
  newValue = _objectSpread2(_objectSpread2({}, value), {}, {
3177
3203
  interceptCompany: val,
3178
- interceptType: 'RETURN',
3204
+ interceptType: (returnValue === null || returnValue === void 0 ? void 0 : returnValue.value) || '',
3179
3205
  interceptAddress: [],
3180
3206
  interceptDetail: '',
3181
3207
  interceptReceiverName: '',
3182
3208
  interceptReceiverMobile: '',
3183
- interceptStatus: '',
3209
+ interceptStatus: undefined,
3184
3210
  interceptOther: ''
3185
3211
  });
3186
3212
  }
@@ -3286,7 +3312,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
3286
3312
  return option.label.includes(input);
3287
3313
  }
3288
3314
  }), (value === null || value === void 0 ? void 0 : value.interceptStatus) === 'OTHER' && /*#__PURE__*/React.createElement(Input, {
3289
- disabled: disabled || canEdit,
3315
+ disabled: disabled || !canEdit,
3290
3316
  style: {
3291
3317
  width: '200px'
3292
3318
  },
package/dist/index.js CHANGED
@@ -589,8 +589,8 @@ var styles = {"imageBox":"index-module_imageBox__3tOEt","inputImage":"index-modu
589
589
  styleInject(css_248z);
590
590
 
591
591
  var _excluded$4 = ["maxCount", "maxSize", "uploadText", "onChange", "value", "accept", "canPreview", "disabled"];
592
- var fn = function fn(_ref) {
593
- var _ref2 = _slicedToArray(_ref, 0);
592
+ var fn = function fn() {
593
+ return void 0;
594
594
  };
595
595
  var getBase64 = function getBase64(file) {
596
596
  return new Promise(function (resolve, reject) {
@@ -604,24 +604,24 @@ var getBase64 = function getBase64(file) {
604
604
  };
605
605
  });
606
606
  };
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);
607
+ var ApaasUpload = function ApaasUpload(_ref) {
608
+ var _ref$maxCount = _ref.maxCount,
609
+ maxCount = _ref$maxCount === void 0 ? 10 : _ref$maxCount,
610
+ _ref$maxSize = _ref.maxSize,
611
+ maxSize = _ref$maxSize === void 0 ? 10 : _ref$maxSize,
612
+ _ref$uploadText = _ref.uploadText,
613
+ uploadText = _ref$uploadText === void 0 ? '上传' : _ref$uploadText,
614
+ _ref$onChange = _ref.onChange,
615
+ onChange = _ref$onChange === void 0 ? fn : _ref$onChange,
616
+ _ref$value = _ref.value,
617
+ value = _ref$value === void 0 ? [] : _ref$value,
618
+ _ref$accept = _ref.accept,
619
+ accept = _ref$accept === void 0 ? 'image/gif,image/jpg,image/jpeg,image/png' : _ref$accept,
620
+ _ref$canPreview = _ref.canPreview,
621
+ canPreview = _ref$canPreview === void 0 ? false : _ref$canPreview,
622
+ _ref$disabled = _ref.disabled,
623
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
624
+ resetProps = _objectWithoutProperties(_ref, _excluded$4);
625
625
  var inputRef = React.useRef(null);
626
626
  var valueRef = React.useRef(value);
627
627
  var _useState = React.useState(false),
@@ -662,8 +662,8 @@ var ApaasUpload = function ApaasUpload(_ref3) {
662
662
  onChange(list);
663
663
  };
664
664
  var clipboardDataChange = function clipboardDataChange(e) {
665
- var clipboardData = e.clipboardData || window.clipboardData,
666
- i = 0,
665
+ var clipboardData = e.clipboardData || window.clipboardData;
666
+ var i = 0,
667
667
  items,
668
668
  item,
669
669
  types;
@@ -921,32 +921,32 @@ var styles$1 = {"imageBox":"index-module_imageBox__8zj7A","inputImage":"index-mo
921
921
  styleInject(css_248z$1);
922
922
 
923
923
  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);
924
+ var fn$1 = function fn() {
925
+ return void 0;
926
926
  };
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);
927
+ var ApaasUploadAsync = function ApaasUploadAsync(_ref) {
928
+ var _ref$maxCount = _ref.maxCount,
929
+ maxCount = _ref$maxCount === void 0 ? 10 : _ref$maxCount,
930
+ _ref$maxSize = _ref.maxSize,
931
+ maxSize = _ref$maxSize === void 0 ? 10 : _ref$maxSize,
932
+ _ref$uploadText = _ref.uploadText,
933
+ uploadText = _ref$uploadText === void 0 ? '上传' : _ref$uploadText,
934
+ _ref$onChange = _ref.onChange,
935
+ onChange = _ref$onChange === void 0 ? fn$1 : _ref$onChange,
936
+ _ref$value = _ref.value,
937
+ value = _ref$value === void 0 ? [] : _ref$value,
938
+ _ref$accept = _ref.accept,
939
+ accept = _ref$accept === void 0 ? 'image/gif,image/jpg,image/jpeg,image/png' : _ref$accept,
940
+ _ref$canPreview = _ref.canPreview,
941
+ canPreview = _ref$canPreview === void 0 ? false : _ref$canPreview,
942
+ _ref$disabled = _ref.disabled,
943
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
944
+ uniqueKey = _ref.uniqueKey,
945
+ _ref$hostUrl = _ref.hostUrl,
946
+ hostUrl = _ref$hostUrl === void 0 ? '' : _ref$hostUrl,
947
+ _ref$actionUrl = _ref.actionUrl,
948
+ actionUrl = _ref$actionUrl === void 0 ? '/qy/common/uploadWorkOrderImg' : _ref$actionUrl,
949
+ resetProps = _objectWithoutProperties(_ref, _excluded$6);
950
950
  var inputRef = React.useRef(null);
951
951
  var valueRef = React.useRef(value);
952
952
  var _useState = React.useState(false),
@@ -969,7 +969,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
969
969
  valueRef.current = value;
970
970
  }, [value]);
971
971
  var asyncUpload = /*#__PURE__*/function () {
972
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {
972
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {
973
973
  var _valueRef$current;
974
974
  var formData, fileName, _yield$request, success, data;
975
975
  return _regeneratorRuntime().wrap(function _callee$(_context) {
@@ -1010,7 +1010,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1010
1010
  }, _callee, null, [[5, 14, 17, 20]]);
1011
1011
  }));
1012
1012
  return function asyncUpload(_x) {
1013
- return _ref4.apply(this, arguments);
1013
+ return _ref2.apply(this, arguments);
1014
1014
  };
1015
1015
  }();
1016
1016
  var imgReader = function imgReader(item) {
@@ -1025,7 +1025,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1025
1025
  return;
1026
1026
  }
1027
1027
  reader.onload = /*#__PURE__*/function () {
1028
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
1028
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
1029
1029
  var _e$target, _valueRef$current2;
1030
1030
  var result, fileName, file;
1031
1031
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
@@ -1042,7 +1042,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1042
1042
  }, _callee2);
1043
1043
  }));
1044
1044
  return function (_x2) {
1045
- return _ref5.apply(this, arguments);
1045
+ return _ref3.apply(this, arguments);
1046
1046
  };
1047
1047
  }();
1048
1048
  reader.readAsDataURL(blob);
@@ -1052,8 +1052,8 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1052
1052
  onChange(list);
1053
1053
  };
1054
1054
  var clipboardDataChange = function clipboardDataChange(e) {
1055
- var clipboardData = e.clipboardData || window.clipboardData,
1056
- i = 0,
1055
+ var clipboardData = e.clipboardData || window.clipboardData;
1056
+ var i = 0,
1057
1057
  items,
1058
1058
  item,
1059
1059
  types;
@@ -1198,7 +1198,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
1198
1198
  })));
1199
1199
  };
1200
1200
 
1201
- var _excluded$7 = ["showOther", "horizontal", "options", "value", "onChange", "disabled", "checkboxOther"];
1201
+ var _excluded$7 = ["showOther", "horizontal", "options", "value", "onChange", "disabled"];
1202
1202
  function ApaasCheckbox(props) {
1203
1203
  var showOther = props.showOther,
1204
1204
  _props$horizontal = props.horizontal,
@@ -1209,7 +1209,6 @@ function ApaasCheckbox(props) {
1209
1209
  value = _props$value === void 0 ? {} : _props$value,
1210
1210
  onChange = props.onChange,
1211
1211
  disabled = props.disabled,
1212
- checkboxOther = props.checkboxOther,
1213
1212
  otherProps = _objectWithoutProperties(props, _excluded$7);
1214
1213
  var checkboxValue = value.value,
1215
1214
  other = value.other;
@@ -1550,7 +1549,7 @@ function ApaasAddress(props) {
1550
1549
  var value = props.value,
1551
1550
  onChange = props.onChange,
1552
1551
  disabled = props.disabled;
1553
- var changeCity = function changeCity(city, selectedOptions) {
1552
+ var changeCity = function changeCity(city) {
1554
1553
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
1555
1554
  address: city
1556
1555
  }));
@@ -1700,7 +1699,6 @@ var AliPay = function AliPay(props) {
1700
1699
  var changeValue = function changeValue(e, type) {
1701
1700
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, e.target.value)));
1702
1701
  };
1703
- React.useEffect(function () {}, []);
1704
1702
  return /*#__PURE__*/React__default['default'].createElement("div", null, !isSingle ? /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
1705
1703
  disabled: disabled,
1706
1704
  placeholder: "\u8BF7\u8F93\u5165\u652F\u4ED8\u5B9D\u540D\u79F0",
@@ -2801,7 +2799,7 @@ var Invoice = function Invoice(props) {
2801
2799
  */
2802
2800
  var handleChange = /*#__PURE__*/function () {
2803
2801
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(ordinaryTaitou) {
2804
- var data, list, newList, index, element, kpName, idx;
2802
+ var data, _list, newList, index, element, kpName, idx;
2805
2803
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2806
2804
  while (1) switch (_context2.prev = _context2.next) {
2807
2805
  case 0:
@@ -2822,16 +2820,16 @@ var Invoice = function Invoice(props) {
2822
2820
  _context2.next = 16;
2823
2821
  break;
2824
2822
  }
2825
- list = data.data ? data.data.info || [] : [];
2826
- if (list.length) {
2823
+ _list = data.data ? data.data.info || [] : [];
2824
+ if (_list.length) {
2827
2825
  _context2.next = 10;
2828
2826
  break;
2829
2827
  }
2830
2828
  return _context2.abrupt("return");
2831
2829
  case 10:
2832
2830
  newList = [];
2833
- for (index = 0; index < list.length; index++) {
2834
- element = list[index];
2831
+ for (index = 0; index < _list.length; index++) {
2832
+ element = _list[index];
2835
2833
  kpName = element.kpName;
2836
2834
  idx = kpName.indexOf(ordinaryTaitou);
2837
2835
  element.kpName1 = kpName.substring(0, idx);
@@ -3131,13 +3129,16 @@ var LogisticsInterception = function LogisticsInterception(props) {
3131
3129
  value = _props$value === void 0 ? {} : _props$value,
3132
3130
  _props$logisticsOptio = props.logisticsOptions,
3133
3131
  logisticsOptions = _props$logisticsOptio === void 0 ? [] : _props$logisticsOptio,
3132
+ _props$expressInterce = props.expressInterceptData,
3133
+ expressInterceptData = _props$expressInterce === void 0 ? [] : _props$expressInterce,
3134
3134
  _props$required = props.required,
3135
3135
  required = _props$required === void 0 ? false : _props$required,
3136
3136
  onChange = props.onChange,
3137
3137
  _props$disabled = props.disabled,
3138
3138
  disabled = _props$disabled === void 0 ? false : _props$disabled,
3139
3139
  _props$isEditing = props.isEditing,
3140
- isEditing = _props$isEditing === void 0 ? false : _props$isEditing;
3140
+ isEditing = _props$isEditing === void 0 ? false : _props$isEditing,
3141
+ logisticsInterceptHandleStatus = props.logisticsInterceptHandleStatus;
3141
3142
  var _useState = React.useState([]),
3142
3143
  _useState2 = _slicedToArray(_useState, 2),
3143
3144
  typeOptions = _useState2[0],
@@ -3151,14 +3152,14 @@ var LogisticsInterception = function LogisticsInterception(props) {
3151
3152
  isInterface = _useState6[0],
3152
3153
  setIsInterface = _useState6[1];
3153
3154
  var canEdit = React.useMemo(function () {
3154
- //非对接公司可以修改
3155
+ // 已对接公司如果拦截状态为【拦截中】,可以修改物流拦截组件信息,否则该组件不能修改;
3156
+ // 非对接公司可以修改组件
3157
+ // 修改后把工单信息重新提交给快递公司,清空拦截状态的值
3155
3158
  if (!isInterface) return true;
3156
3159
  //已对接公司在拦截中可以修改
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]);
3160
+ var INTERCEPTING = logisticsInterceptHandleStatus === 'INTERCEPTING';
3161
+ return isEditing ? INTERCEPTING : true;
3162
+ }, [value === null || value === void 0 ? void 0 : value.interceptCompany, statusOptions, isInterface, isEditing]);
3162
3163
  React.useEffect(function () {
3163
3164
  if (!(value === null || value === void 0 ? void 0 : value.interceptCompany)) {
3164
3165
  setTypeOptions([]);
@@ -3166,13 +3167,31 @@ var LogisticsInterception = function LogisticsInterception(props) {
3166
3167
  setIsInterface(false);
3167
3168
  return;
3168
3169
  }
3169
- var interceptCompany = logisticsOptions.find(function (item) {
3170
- return item.expressCode === (value === null || value === void 0 ? void 0 : value.interceptCompany);
3170
+ var interceptCompany = expressInterceptData.find(function (item) {
3171
+ return item.value === (value === null || value === void 0 ? void 0 : value.interceptCompany);
3171
3172
  });
3172
3173
  setTypeOptions((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionTypeList) || []);
3173
3174
  setStatusOptions((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionStatusList) || []);
3174
3175
  setIsInterface(interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.isInterface);
3175
3176
  }, [value === null || value === void 0 ? void 0 : value.interceptCompany]);
3177
+ React.useEffect(function () {
3178
+ if (!(value === null || value === void 0 ? void 0 : value.interceptCompany)) return;
3179
+ var interceptCompany = expressInterceptData.find(function (item) {
3180
+ return item.value === (value === null || value === void 0 ? void 0 : value.interceptCompany);
3181
+ });
3182
+ var showAddress = ((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionTypeList) || []).some(function (item) {
3183
+ var _item$config;
3184
+ 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);
3185
+ });
3186
+ if (!showAddress) {
3187
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
3188
+ interceptAddress: [],
3189
+ interceptDetail: '',
3190
+ interceptReceiverName: '',
3191
+ interceptReceiverMobile: ''
3192
+ }));
3193
+ }
3194
+ }, [value === null || value === void 0 ? void 0 : value.interceptType]);
3176
3195
  //是否展示新地址
3177
3196
  var showNewAddress = React.useMemo(function () {
3178
3197
  var _find, _find$config;
@@ -3183,14 +3202,21 @@ var LogisticsInterception = function LogisticsInterception(props) {
3183
3202
  var changeHandle = function changeHandle(val, type) {
3184
3203
  var newValue = _objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, val));
3185
3204
  if (type === 'interceptCompany') {
3205
+ var interceptCompany = expressInterceptData.find(function (item) {
3206
+ return item.value === val;
3207
+ });
3208
+ var returnValue = ((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionTypeList) || []).find(function (item) {
3209
+ var _item$label;
3210
+ return (item === null || item === void 0 ? void 0 : item.label) && (item === null || item === void 0 ? void 0 : (_item$label = item.label) === null || _item$label === void 0 ? void 0 : _item$label.indexOf('退回')) > -1;
3211
+ });
3186
3212
  newValue = _objectSpread2(_objectSpread2({}, value), {}, {
3187
3213
  interceptCompany: val,
3188
- interceptType: 'RETURN',
3214
+ interceptType: (returnValue === null || returnValue === void 0 ? void 0 : returnValue.value) || '',
3189
3215
  interceptAddress: [],
3190
3216
  interceptDetail: '',
3191
3217
  interceptReceiverName: '',
3192
3218
  interceptReceiverMobile: '',
3193
- interceptStatus: '',
3219
+ interceptStatus: undefined,
3194
3220
  interceptOther: ''
3195
3221
  });
3196
3222
  }
@@ -3296,7 +3322,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
3296
3322
  return option.label.includes(input);
3297
3323
  }
3298
3324
  }), (value === null || value === void 0 ? void 0 : value.interceptStatus) === 'OTHER' && /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3299
- disabled: disabled || canEdit,
3325
+ disabled: disabled || !canEdit,
3300
3326
  style: {
3301
3327
  width: '200px'
3302
3328
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "0.6.3-alpha.0",
3
+ "version": "0.6.3-alpha.16",
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": "f2de883a1a57e0ead13d3ee345acaf3dd1b3467d"
45
+ "gitHead": "b12616df54e56709922c3dc064f381f3032c0b73"
41
46
  }