@kmkf-fe-packages/basic-components 0.21.6-alpha.1 → 0.21.6-alpha.4

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
@@ -17,5 +17,4 @@ yarn start
17
17
  - business 快麦工单业务组件
18
18
  - common 公共组件
19
19
  - config 公共方法
20
- - assets 静态资源
21
- -
20
+ - assets 静态资源
package/dist/index.esm.js CHANGED
@@ -9230,7 +9230,9 @@ var Payment = function Payment(props) {
9230
9230
  shopList = props.shopList,
9231
9231
  onChange = props.onChange,
9232
9232
  onSearch = props.onSearch,
9233
- _onBlur = props.onBlur;
9233
+ _onBlur = props.onBlur,
9234
+ _props$replaceValueCh = props.replaceValueCh,
9235
+ replaceValueCh = _props$replaceValueCh === void 0 ? {} : _props$replaceValueCh;
9234
9236
  useEffect(function () {
9235
9237
  var platformList = ['TAOBAO', 'FXG'];
9236
9238
  var showBuyerId = (shopList || []).some(function (item) {
@@ -9307,7 +9309,11 @@ var Payment = function Payment(props) {
9307
9309
  onBlur: function onBlur(e) {
9308
9310
  return _onBlur === null || _onBlur === void 0 ? void 0 : _onBlur(e.target.value, item.name);
9309
9311
  }
9310
- }));
9312
+ }), (replaceValueCh === null || replaceValueCh === void 0 ? void 0 : replaceValueCh[item.name]) && /*#__PURE__*/React.createElement("p", {
9313
+ style: {
9314
+ color: '#e99d42'
9315
+ }
9316
+ }, replaceValueCh === null || replaceValueCh === void 0 ? void 0 : replaceValueCh[item.name]));
9311
9317
  }));
9312
9318
  };
9313
9319
 
@@ -9766,9 +9772,14 @@ var LogisticsMoreTrajectory = function LogisticsMoreTrajectory(props) {
9766
9772
  _useState8 = _slicedToArray(_useState7, 2),
9767
9773
  changeValue = _useState8[0],
9768
9774
  setChangeValue = _useState8[1];
9775
+ var firstRef = useRef(true);
9776
+ var hasSave = useRef(false);
9769
9777
  useEffect(function () {
9770
- setInitValue(value);
9771
- }, []);
9778
+ if (value.length && firstRef.current) {
9779
+ setInitValue(value);
9780
+ firstRef.current = false;
9781
+ }
9782
+ }, [value]);
9772
9783
  useDebounceEffect(function () {
9773
9784
  initHandle({
9774
9785
  initValue: initValue,
@@ -9779,35 +9790,57 @@ var LogisticsMoreTrajectory = function LogisticsMoreTrajectory(props) {
9779
9790
  });
9780
9791
  var initHandle = /*#__PURE__*/function () {
9781
9792
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
9782
- var initValue, value, initList, valueList, changeList, hasValue, listValue, requestList, requestValues;
9793
+ var initValue, value, hasSnapshot, initList, valueList, changeList, initSnapshotList, valueSnapshotList, hasValue, listValue, requestList, requestValues;
9783
9794
  return _regeneratorRuntime().wrap(function _callee$(_context) {
9784
9795
  while (1) switch (_context.prev = _context.next) {
9785
9796
  case 0:
9786
9797
  initValue = _ref.initValue, value = _ref.value;
9798
+ hasSnapshot = showField && showField.includes('snapshot');
9787
9799
  initList = initValue.map(function (item) {
9788
- return {
9789
- trajectoryCompany: item.trajectoryCompany,
9790
- trajectoryCode: item.trajectoryCode,
9791
- trajectoryPhone: item.trajectoryPhone
9792
- };
9800
+ if (item.trajectoryCompany === 'SF') {
9801
+ return {
9802
+ trajectoryCompany: item.trajectoryCompany,
9803
+ trajectoryCode: item.trajectoryCode,
9804
+ trajectoryPhone: item.trajectoryPhone
9805
+ };
9806
+ } else {
9807
+ return {
9808
+ trajectoryCompany: item.trajectoryCompany,
9809
+ trajectoryCode: item.trajectoryCode
9810
+ };
9811
+ }
9793
9812
  });
9794
9813
  valueList = value.map(function (item) {
9795
- return {
9796
- trajectoryCompany: item.trajectoryCompany,
9797
- trajectoryCode: item.trajectoryCode,
9798
- trajectoryPhone: item.trajectoryPhone
9799
- };
9814
+ if (item.trajectoryCompany === 'SF') {
9815
+ return {
9816
+ trajectoryCompany: item.trajectoryCompany,
9817
+ trajectoryCode: item.trajectoryCode,
9818
+ trajectoryPhone: item.trajectoryPhone
9819
+ };
9820
+ } else {
9821
+ return {
9822
+ trajectoryCompany: item.trajectoryCompany,
9823
+ trajectoryCode: item.trajectoryCode
9824
+ };
9825
+ }
9800
9826
  });
9801
9827
  changeList = changeValue.map(function (item) {
9802
- return {
9803
- trajectoryCompany: item.trajectoryCompany,
9804
- trajectoryCode: item.trajectoryCode,
9805
- trajectoryPhone: item.trajectoryPhone
9806
- };
9828
+ if (item.trajectoryCompany === 'SF') {
9829
+ return {
9830
+ trajectoryCompany: item.trajectoryCompany,
9831
+ trajectoryCode: item.trajectoryCode,
9832
+ trajectoryPhone: item.trajectoryPhone
9833
+ };
9834
+ } else {
9835
+ return {
9836
+ trajectoryCompany: item.trajectoryCompany,
9837
+ trajectoryCode: item.trajectoryCode
9838
+ };
9839
+ }
9807
9840
  }); // 1、初始值没有 传入值有请求快照
9808
9841
  // 2、初始值有 传入值有 其中有不一样的请求快照
9809
9842
  // 3、初始值有 传入值有 都一样的返回初始值
9810
- // console.log('list', initList, valueList, changeList);
9843
+ console.log('list', initList, valueList, changeList);
9811
9844
  // console.log('old', initValue, value, changeValue);
9812
9845
  // console.log('一样', JSON.stringify(initList) !== JSON.stringify(valueList));
9813
9846
  // console.log(
@@ -9815,23 +9848,41 @@ var LogisticsMoreTrajectory = function LogisticsMoreTrajectory(props) {
9815
9848
  // JSON.stringify(changeList) !== JSON.stringify(valueList),
9816
9849
  // );
9817
9850
  if (!(JSON.stringify(initList) === JSON.stringify(valueList))) {
9818
- _context.next = 8;
9851
+ _context.next = 12;
9819
9852
  break;
9820
9853
  }
9821
- setNewValue(initValue);
9822
- _context.next = 20;
9854
+ initSnapshotList = initValue.reduce(function (prv, next) {
9855
+ prv += next.trajectorySnapshot;
9856
+ return prv;
9857
+ }, '');
9858
+ valueSnapshotList = value.reduce(function (prv, next) {
9859
+ prv += next.trajectorySnapshot;
9860
+ return prv;
9861
+ }, '');
9862
+ if (initSnapshotList === valueSnapshotList) {
9863
+ hasSave.current = false;
9864
+ setNewValue(value);
9865
+ } else if (!hasSave.current) {
9866
+ hasSave.current = true;
9867
+ setNewValue(initValue);
9868
+ onChange(initValue);
9869
+ }
9870
+ _context.next = 28;
9823
9871
  break;
9824
- case 8:
9825
- if (!(JSON.stringify(initList) !== JSON.stringify(valueList) && JSON.stringify(changeList) !== JSON.stringify(valueList))) {
9826
- _context.next = 20;
9872
+ case 12:
9873
+ if (!(
9874
+ //开启了物流快照才会获取快照信息
9875
+ hasSnapshot && JSON.stringify(initList) !== JSON.stringify(valueList) && JSON.stringify(changeList) !== JSON.stringify(valueList))) {
9876
+ _context.next = 27;
9827
9877
  break;
9828
9878
  }
9879
+ hasSave.current = false;
9829
9880
  hasValue = valueList.every(function (item) {
9830
9881
  return item.trajectoryCompany && item.trajectoryCode;
9831
9882
  });
9832
9883
  listValue = cloneDeep(value);
9833
9884
  if (!hasValue) {
9834
- _context.next = 17;
9885
+ _context.next = 22;
9835
9886
  break;
9836
9887
  }
9837
9888
  requestList = valueList.map(function (item) {
@@ -9844,9 +9895,9 @@ var LogisticsMoreTrajectory = function LogisticsMoreTrajectory(props) {
9844
9895
  }
9845
9896
  });
9846
9897
  });
9847
- _context.next = 15;
9898
+ _context.next = 20;
9848
9899
  return Promise.allSettled(requestList);
9849
- case 15:
9900
+ case 20:
9850
9901
  requestValues = _context.sent;
9851
9902
  listValue = cloneDeep(value).map(function (item, index) {
9852
9903
  var _requestValues$index, _requestValues$index$, _requestValues$index$2;
@@ -9854,11 +9905,15 @@ var LogisticsMoreTrajectory = function LogisticsMoreTrajectory(props) {
9854
9905
  trajectorySnapshot: (_requestValues$index = requestValues[index]) === null || _requestValues$index === void 0 ? void 0 : (_requestValues$index$ = _requestValues$index.value) === null || _requestValues$index$ === void 0 ? void 0 : (_requestValues$index$2 = _requestValues$index$.data) === null || _requestValues$index$2 === void 0 ? void 0 : _requestValues$index$2.logisticsStatusDesc
9855
9906
  });
9856
9907
  });
9857
- case 17:
9908
+ case 22:
9858
9909
  setChangeValue(listValue);
9859
9910
  setNewValue(listValue);
9860
9911
  onChange(listValue);
9861
- case 20:
9912
+ _context.next = 28;
9913
+ break;
9914
+ case 27:
9915
+ setNewValue(value);
9916
+ case 28:
9862
9917
  case "end":
9863
9918
  return _context.stop();
9864
9919
  }
@@ -10768,9 +10823,10 @@ var BsGoods = function BsGoods(props) {
10768
10823
  };
10769
10824
  setTableSelect(['2', '4'].includes(data.val));
10770
10825
  if (['1', '3'].includes(data.val)) {
10771
- var _valueRef$current;
10826
+ var _valueRef$current, _valueRef$current2;
10772
10827
  pubsub.publish('selectListReturn', {
10773
10828
  list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current = valueRef.current) === null || _valueRef$current === void 0 ? void 0 : _valueRef$current.bsGoods) || []),
10829
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.shopCode,
10774
10830
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
10775
10831
  });
10776
10832
  }
@@ -10785,13 +10841,14 @@ var BsGoods = function BsGoods(props) {
10785
10841
  };
10786
10842
  setTableSelect(['2', '4'].includes(data.val));
10787
10843
  if (['1', '3'].includes(data.val)) {
10788
- var _valueRef$current2;
10844
+ var _valueRef$current3, _valueRef$current4;
10789
10845
  // console.log(
10790
10846
  // 'goods-reissueSelectListReturn',
10791
10847
  // valueRef?.current?.bsGoods,
10792
10848
  // );
10793
10849
  pubsub.publish('reissueSelectListReturn', {
10794
- list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.bsGoods) || []),
10850
+ list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current3 = valueRef.current) === null || _valueRef$current3 === void 0 ? void 0 : _valueRef$current3.bsGoods) || []),
10851
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current4 = valueRef.current) === null || _valueRef$current4 === void 0 ? void 0 : _valueRef$current4.shopCode,
10795
10852
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
10796
10853
  });
10797
10854
  }
@@ -10806,9 +10863,10 @@ var BsGoods = function BsGoods(props) {
10806
10863
  };
10807
10864
  setTableSelect(['2', '4'].includes(data.val));
10808
10865
  if (['1', '3'].includes(data.val)) {
10809
- var _valueRef$current3;
10866
+ var _valueRef$current5, _valueRef$current6;
10810
10867
  pubsub.publish('returnSelectListReturn', {
10811
- list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current3 = valueRef.current) === null || _valueRef$current3 === void 0 ? void 0 : _valueRef$current3.bsGoods) || []),
10868
+ list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current5 = valueRef.current) === null || _valueRef$current5 === void 0 ? void 0 : _valueRef$current5.bsGoods) || []),
10869
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current6 = valueRef.current) === null || _valueRef$current6 === void 0 ? void 0 : _valueRef$current6.shopCode,
10812
10870
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
10813
10871
  });
10814
10872
  }
@@ -10824,7 +10882,7 @@ var BsGoods = function BsGoods(props) {
10824
10882
  };
10825
10883
  }, [disabled]);
10826
10884
  var _onSelect = function onSelect(list) {
10827
- var _withInfo$current, _withInfo$current2;
10885
+ var _withInfo$current, _withInfo$current2, _valueRef$current7;
10828
10886
  if (disabled) return;
10829
10887
  var newList = cloneDeep(list);
10830
10888
  var typeMap = {
@@ -10840,6 +10898,7 @@ var BsGoods = function BsGoods(props) {
10840
10898
  item.canDelete = true;
10841
10899
  return item;
10842
10900
  }),
10901
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current7 = valueRef.current) === null || _valueRef$current7 === void 0 ? void 0 : _valueRef$current7.shopCode,
10843
10902
  goodValue: withInfo.current.goodValue
10844
10903
  });
10845
10904
  };
@@ -10917,6 +10976,7 @@ var BsExchange = function BsExchange(props) {
10917
10976
  if (disabled) return;
10918
10977
  var newDataList = cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
10919
10978
  onChange(_objectSpread2(_objectSpread2({}, data.goodValue), {}, {
10979
+ shopCode: data === null || data === void 0 ? void 0 : data.shopCode,
10920
10980
  bsExchangeReturnGoods: getListHandle(newDataList, valueRef.current)
10921
10981
  }));
10922
10982
  });
@@ -10927,6 +10987,7 @@ var BsExchange = function BsExchange(props) {
10927
10987
  var newValue = _objectSpread2({}, data.goodValue);
10928
10988
  var newDataList = cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
10929
10989
  onChange(_objectSpread2(_objectSpread2({}, newValue), {}, {
10990
+ shopCode: data === null || data === void 0 ? void 0 : data.shopCode,
10930
10991
  bsExchangeReturnGoods: getListHandle(newDataList, newValue)
10931
10992
  }));
10932
10993
  });
@@ -11120,7 +11181,9 @@ var BsReissue = function BsReissue(props) {
11120
11181
  pubsub.subscribe('reissueSelectList', function (_, data) {
11121
11182
  // console.log('reissueSelectList', data);
11122
11183
  if (disabled) return;
11123
- var newValue = _objectSpread2({}, data.goodValue);
11184
+ var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
11185
+ shopCode: data === null || data === void 0 ? void 0 : data.shopCode
11186
+ });
11124
11187
  newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
11125
11188
  item.money = 0;
11126
11189
  item.share = 0;
@@ -11134,7 +11197,9 @@ var BsReissue = function BsReissue(props) {
11134
11197
  pubsub.subscribe('reissueSelectListReturn', function (_, data) {
11135
11198
  // console.log('reissueSelectListReturn', data);
11136
11199
  if (disabled) return;
11137
- var newValue = _objectSpread2({}, data.goodValue);
11200
+ var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
11201
+ shopCode: data === null || data === void 0 ? void 0 : data.shopCode
11202
+ });
11138
11203
  newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
11139
11204
  item.money = 0;
11140
11205
  item.share = 0;
@@ -11227,7 +11292,9 @@ var BsReturnGoods = function BsReturnGoods(props) {
11227
11292
  pubsub.subscribe('returnSelectList', function (_, data) {
11228
11293
  // console.log('returnSelectList', data);
11229
11294
  if (disabled) return;
11230
- var newValue = _objectSpread2({}, data.goodValue);
11295
+ var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
11296
+ shopCode: data === null || data === void 0 ? void 0 : data.shopCode
11297
+ });
11231
11298
  newValue.bsReturnGoods = (data === null || data === void 0 ? void 0 : data.list) || [];
11232
11299
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
11233
11300
  });
@@ -11236,7 +11303,9 @@ var BsReturnGoods = function BsReturnGoods(props) {
11236
11303
  pubsub.subscribe('returnSelectListReturn', function (_, data) {
11237
11304
  // console.log('returnSelectListReturn', data);
11238
11305
  if (disabled) return;
11239
- var newValue = _objectSpread2({}, data.goodValue);
11306
+ var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
11307
+ shopCode: data === null || data === void 0 ? void 0 : data.shopCode
11308
+ });
11240
11309
  newValue.bsReturnGoods = (data === null || data === void 0 ? void 0 : data.list) || [];
11241
11310
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
11242
11311
  });
package/dist/index.js CHANGED
@@ -9241,7 +9241,9 @@ var Payment = function Payment(props) {
9241
9241
  shopList = props.shopList,
9242
9242
  onChange = props.onChange,
9243
9243
  onSearch = props.onSearch,
9244
- _onBlur = props.onBlur;
9244
+ _onBlur = props.onBlur,
9245
+ _props$replaceValueCh = props.replaceValueCh,
9246
+ replaceValueCh = _props$replaceValueCh === void 0 ? {} : _props$replaceValueCh;
9245
9247
  React.useEffect(function () {
9246
9248
  var platformList = ['TAOBAO', 'FXG'];
9247
9249
  var showBuyerId = (shopList || []).some(function (item) {
@@ -9318,7 +9320,11 @@ var Payment = function Payment(props) {
9318
9320
  onBlur: function onBlur(e) {
9319
9321
  return _onBlur === null || _onBlur === void 0 ? void 0 : _onBlur(e.target.value, item.name);
9320
9322
  }
9321
- }));
9323
+ }), (replaceValueCh === null || replaceValueCh === void 0 ? void 0 : replaceValueCh[item.name]) && /*#__PURE__*/React__default['default'].createElement("p", {
9324
+ style: {
9325
+ color: '#e99d42'
9326
+ }
9327
+ }, replaceValueCh === null || replaceValueCh === void 0 ? void 0 : replaceValueCh[item.name]));
9322
9328
  }));
9323
9329
  };
9324
9330
 
@@ -9777,9 +9783,14 @@ var LogisticsMoreTrajectory = function LogisticsMoreTrajectory(props) {
9777
9783
  _useState8 = _slicedToArray(_useState7, 2),
9778
9784
  changeValue = _useState8[0],
9779
9785
  setChangeValue = _useState8[1];
9786
+ var firstRef = React.useRef(true);
9787
+ var hasSave = React.useRef(false);
9780
9788
  React.useEffect(function () {
9781
- setInitValue(value);
9782
- }, []);
9789
+ if (value.length && firstRef.current) {
9790
+ setInitValue(value);
9791
+ firstRef.current = false;
9792
+ }
9793
+ }, [value]);
9783
9794
  ahooks.useDebounceEffect(function () {
9784
9795
  initHandle({
9785
9796
  initValue: initValue,
@@ -9790,35 +9801,57 @@ var LogisticsMoreTrajectory = function LogisticsMoreTrajectory(props) {
9790
9801
  });
9791
9802
  var initHandle = /*#__PURE__*/function () {
9792
9803
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
9793
- var initValue, value, initList, valueList, changeList, hasValue, listValue, requestList, requestValues;
9804
+ var initValue, value, hasSnapshot, initList, valueList, changeList, initSnapshotList, valueSnapshotList, hasValue, listValue, requestList, requestValues;
9794
9805
  return _regeneratorRuntime().wrap(function _callee$(_context) {
9795
9806
  while (1) switch (_context.prev = _context.next) {
9796
9807
  case 0:
9797
9808
  initValue = _ref.initValue, value = _ref.value;
9809
+ hasSnapshot = showField && showField.includes('snapshot');
9798
9810
  initList = initValue.map(function (item) {
9799
- return {
9800
- trajectoryCompany: item.trajectoryCompany,
9801
- trajectoryCode: item.trajectoryCode,
9802
- trajectoryPhone: item.trajectoryPhone
9803
- };
9811
+ if (item.trajectoryCompany === 'SF') {
9812
+ return {
9813
+ trajectoryCompany: item.trajectoryCompany,
9814
+ trajectoryCode: item.trajectoryCode,
9815
+ trajectoryPhone: item.trajectoryPhone
9816
+ };
9817
+ } else {
9818
+ return {
9819
+ trajectoryCompany: item.trajectoryCompany,
9820
+ trajectoryCode: item.trajectoryCode
9821
+ };
9822
+ }
9804
9823
  });
9805
9824
  valueList = value.map(function (item) {
9806
- return {
9807
- trajectoryCompany: item.trajectoryCompany,
9808
- trajectoryCode: item.trajectoryCode,
9809
- trajectoryPhone: item.trajectoryPhone
9810
- };
9825
+ if (item.trajectoryCompany === 'SF') {
9826
+ return {
9827
+ trajectoryCompany: item.trajectoryCompany,
9828
+ trajectoryCode: item.trajectoryCode,
9829
+ trajectoryPhone: item.trajectoryPhone
9830
+ };
9831
+ } else {
9832
+ return {
9833
+ trajectoryCompany: item.trajectoryCompany,
9834
+ trajectoryCode: item.trajectoryCode
9835
+ };
9836
+ }
9811
9837
  });
9812
9838
  changeList = changeValue.map(function (item) {
9813
- return {
9814
- trajectoryCompany: item.trajectoryCompany,
9815
- trajectoryCode: item.trajectoryCode,
9816
- trajectoryPhone: item.trajectoryPhone
9817
- };
9839
+ if (item.trajectoryCompany === 'SF') {
9840
+ return {
9841
+ trajectoryCompany: item.trajectoryCompany,
9842
+ trajectoryCode: item.trajectoryCode,
9843
+ trajectoryPhone: item.trajectoryPhone
9844
+ };
9845
+ } else {
9846
+ return {
9847
+ trajectoryCompany: item.trajectoryCompany,
9848
+ trajectoryCode: item.trajectoryCode
9849
+ };
9850
+ }
9818
9851
  }); // 1、初始值没有 传入值有请求快照
9819
9852
  // 2、初始值有 传入值有 其中有不一样的请求快照
9820
9853
  // 3、初始值有 传入值有 都一样的返回初始值
9821
- // console.log('list', initList, valueList, changeList);
9854
+ console.log('list', initList, valueList, changeList);
9822
9855
  // console.log('old', initValue, value, changeValue);
9823
9856
  // console.log('一样', JSON.stringify(initList) !== JSON.stringify(valueList));
9824
9857
  // console.log(
@@ -9826,23 +9859,41 @@ var LogisticsMoreTrajectory = function LogisticsMoreTrajectory(props) {
9826
9859
  // JSON.stringify(changeList) !== JSON.stringify(valueList),
9827
9860
  // );
9828
9861
  if (!(JSON.stringify(initList) === JSON.stringify(valueList))) {
9829
- _context.next = 8;
9862
+ _context.next = 12;
9830
9863
  break;
9831
9864
  }
9832
- setNewValue(initValue);
9833
- _context.next = 20;
9865
+ initSnapshotList = initValue.reduce(function (prv, next) {
9866
+ prv += next.trajectorySnapshot;
9867
+ return prv;
9868
+ }, '');
9869
+ valueSnapshotList = value.reduce(function (prv, next) {
9870
+ prv += next.trajectorySnapshot;
9871
+ return prv;
9872
+ }, '');
9873
+ if (initSnapshotList === valueSnapshotList) {
9874
+ hasSave.current = false;
9875
+ setNewValue(value);
9876
+ } else if (!hasSave.current) {
9877
+ hasSave.current = true;
9878
+ setNewValue(initValue);
9879
+ onChange(initValue);
9880
+ }
9881
+ _context.next = 28;
9834
9882
  break;
9835
- case 8:
9836
- if (!(JSON.stringify(initList) !== JSON.stringify(valueList) && JSON.stringify(changeList) !== JSON.stringify(valueList))) {
9837
- _context.next = 20;
9883
+ case 12:
9884
+ if (!(
9885
+ //开启了物流快照才会获取快照信息
9886
+ hasSnapshot && JSON.stringify(initList) !== JSON.stringify(valueList) && JSON.stringify(changeList) !== JSON.stringify(valueList))) {
9887
+ _context.next = 27;
9838
9888
  break;
9839
9889
  }
9890
+ hasSave.current = false;
9840
9891
  hasValue = valueList.every(function (item) {
9841
9892
  return item.trajectoryCompany && item.trajectoryCode;
9842
9893
  });
9843
9894
  listValue = lodash.cloneDeep(value);
9844
9895
  if (!hasValue) {
9845
- _context.next = 17;
9896
+ _context.next = 22;
9846
9897
  break;
9847
9898
  }
9848
9899
  requestList = valueList.map(function (item) {
@@ -9855,9 +9906,9 @@ var LogisticsMoreTrajectory = function LogisticsMoreTrajectory(props) {
9855
9906
  }
9856
9907
  });
9857
9908
  });
9858
- _context.next = 15;
9909
+ _context.next = 20;
9859
9910
  return Promise.allSettled(requestList);
9860
- case 15:
9911
+ case 20:
9861
9912
  requestValues = _context.sent;
9862
9913
  listValue = lodash.cloneDeep(value).map(function (item, index) {
9863
9914
  var _requestValues$index, _requestValues$index$, _requestValues$index$2;
@@ -9865,11 +9916,15 @@ var LogisticsMoreTrajectory = function LogisticsMoreTrajectory(props) {
9865
9916
  trajectorySnapshot: (_requestValues$index = requestValues[index]) === null || _requestValues$index === void 0 ? void 0 : (_requestValues$index$ = _requestValues$index.value) === null || _requestValues$index$ === void 0 ? void 0 : (_requestValues$index$2 = _requestValues$index$.data) === null || _requestValues$index$2 === void 0 ? void 0 : _requestValues$index$2.logisticsStatusDesc
9866
9917
  });
9867
9918
  });
9868
- case 17:
9919
+ case 22:
9869
9920
  setChangeValue(listValue);
9870
9921
  setNewValue(listValue);
9871
9922
  onChange(listValue);
9872
- case 20:
9923
+ _context.next = 28;
9924
+ break;
9925
+ case 27:
9926
+ setNewValue(value);
9927
+ case 28:
9873
9928
  case "end":
9874
9929
  return _context.stop();
9875
9930
  }
@@ -10779,9 +10834,10 @@ var BsGoods = function BsGoods(props) {
10779
10834
  };
10780
10835
  setTableSelect(['2', '4'].includes(data.val));
10781
10836
  if (['1', '3'].includes(data.val)) {
10782
- var _valueRef$current;
10837
+ var _valueRef$current, _valueRef$current2;
10783
10838
  pubsub__default['default'].publish('selectListReturn', {
10784
10839
  list: lodash.cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current = valueRef.current) === null || _valueRef$current === void 0 ? void 0 : _valueRef$current.bsGoods) || []),
10840
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.shopCode,
10785
10841
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
10786
10842
  });
10787
10843
  }
@@ -10796,13 +10852,14 @@ var BsGoods = function BsGoods(props) {
10796
10852
  };
10797
10853
  setTableSelect(['2', '4'].includes(data.val));
10798
10854
  if (['1', '3'].includes(data.val)) {
10799
- var _valueRef$current2;
10855
+ var _valueRef$current3, _valueRef$current4;
10800
10856
  // console.log(
10801
10857
  // 'goods-reissueSelectListReturn',
10802
10858
  // valueRef?.current?.bsGoods,
10803
10859
  // );
10804
10860
  pubsub__default['default'].publish('reissueSelectListReturn', {
10805
- list: lodash.cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.bsGoods) || []),
10861
+ list: lodash.cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current3 = valueRef.current) === null || _valueRef$current3 === void 0 ? void 0 : _valueRef$current3.bsGoods) || []),
10862
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current4 = valueRef.current) === null || _valueRef$current4 === void 0 ? void 0 : _valueRef$current4.shopCode,
10806
10863
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
10807
10864
  });
10808
10865
  }
@@ -10817,9 +10874,10 @@ var BsGoods = function BsGoods(props) {
10817
10874
  };
10818
10875
  setTableSelect(['2', '4'].includes(data.val));
10819
10876
  if (['1', '3'].includes(data.val)) {
10820
- var _valueRef$current3;
10877
+ var _valueRef$current5, _valueRef$current6;
10821
10878
  pubsub__default['default'].publish('returnSelectListReturn', {
10822
- list: lodash.cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current3 = valueRef.current) === null || _valueRef$current3 === void 0 ? void 0 : _valueRef$current3.bsGoods) || []),
10879
+ list: lodash.cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current5 = valueRef.current) === null || _valueRef$current5 === void 0 ? void 0 : _valueRef$current5.bsGoods) || []),
10880
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current6 = valueRef.current) === null || _valueRef$current6 === void 0 ? void 0 : _valueRef$current6.shopCode,
10823
10881
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
10824
10882
  });
10825
10883
  }
@@ -10835,7 +10893,7 @@ var BsGoods = function BsGoods(props) {
10835
10893
  };
10836
10894
  }, [disabled]);
10837
10895
  var _onSelect = function onSelect(list) {
10838
- var _withInfo$current, _withInfo$current2;
10896
+ var _withInfo$current, _withInfo$current2, _valueRef$current7;
10839
10897
  if (disabled) return;
10840
10898
  var newList = lodash.cloneDeep(list);
10841
10899
  var typeMap = {
@@ -10851,6 +10909,7 @@ var BsGoods = function BsGoods(props) {
10851
10909
  item.canDelete = true;
10852
10910
  return item;
10853
10911
  }),
10912
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current7 = valueRef.current) === null || _valueRef$current7 === void 0 ? void 0 : _valueRef$current7.shopCode,
10854
10913
  goodValue: withInfo.current.goodValue
10855
10914
  });
10856
10915
  };
@@ -10928,6 +10987,7 @@ var BsExchange = function BsExchange(props) {
10928
10987
  if (disabled) return;
10929
10988
  var newDataList = lodash.cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
10930
10989
  onChange(_objectSpread2(_objectSpread2({}, data.goodValue), {}, {
10990
+ shopCode: data === null || data === void 0 ? void 0 : data.shopCode,
10931
10991
  bsExchangeReturnGoods: getListHandle(newDataList, valueRef.current)
10932
10992
  }));
10933
10993
  });
@@ -10938,6 +10998,7 @@ var BsExchange = function BsExchange(props) {
10938
10998
  var newValue = _objectSpread2({}, data.goodValue);
10939
10999
  var newDataList = lodash.cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
10940
11000
  onChange(_objectSpread2(_objectSpread2({}, newValue), {}, {
11001
+ shopCode: data === null || data === void 0 ? void 0 : data.shopCode,
10941
11002
  bsExchangeReturnGoods: getListHandle(newDataList, newValue)
10942
11003
  }));
10943
11004
  });
@@ -11131,7 +11192,9 @@ var BsReissue = function BsReissue(props) {
11131
11192
  pubsub__default['default'].subscribe('reissueSelectList', function (_, data) {
11132
11193
  // console.log('reissueSelectList', data);
11133
11194
  if (disabled) return;
11134
- var newValue = _objectSpread2({}, data.goodValue);
11195
+ var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
11196
+ shopCode: data === null || data === void 0 ? void 0 : data.shopCode
11197
+ });
11135
11198
  newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
11136
11199
  item.money = 0;
11137
11200
  item.share = 0;
@@ -11145,7 +11208,9 @@ var BsReissue = function BsReissue(props) {
11145
11208
  pubsub__default['default'].subscribe('reissueSelectListReturn', function (_, data) {
11146
11209
  // console.log('reissueSelectListReturn', data);
11147
11210
  if (disabled) return;
11148
- var newValue = _objectSpread2({}, data.goodValue);
11211
+ var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
11212
+ shopCode: data === null || data === void 0 ? void 0 : data.shopCode
11213
+ });
11149
11214
  newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
11150
11215
  item.money = 0;
11151
11216
  item.share = 0;
@@ -11238,7 +11303,9 @@ var BsReturnGoods = function BsReturnGoods(props) {
11238
11303
  pubsub__default['default'].subscribe('returnSelectList', function (_, data) {
11239
11304
  // console.log('returnSelectList', data);
11240
11305
  if (disabled) return;
11241
- var newValue = _objectSpread2({}, data.goodValue);
11306
+ var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
11307
+ shopCode: data === null || data === void 0 ? void 0 : data.shopCode
11308
+ });
11242
11309
  newValue.bsReturnGoods = (data === null || data === void 0 ? void 0 : data.list) || [];
11243
11310
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
11244
11311
  });
@@ -11247,7 +11314,9 @@ var BsReturnGoods = function BsReturnGoods(props) {
11247
11314
  pubsub__default['default'].subscribe('returnSelectListReturn', function (_, data) {
11248
11315
  // console.log('returnSelectListReturn', data);
11249
11316
  if (disabled) return;
11250
- var newValue = _objectSpread2({}, data.goodValue);
11317
+ var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
11318
+ shopCode: data === null || data === void 0 ? void 0 : data.shopCode
11319
+ });
11251
11320
  newValue.bsReturnGoods = (data === null || data === void 0 ? void 0 : data.list) || [];
11252
11321
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
11253
11322
  });
@@ -10,6 +10,9 @@ export interface PaymentProps {
10
10
  onChange: (value: any) => void;
11
11
  onSearch: (value: any) => void;
12
12
  onBlur: (value: any, type: string) => void;
13
+ replaceValueCh?: {
14
+ [key: string]: string;
15
+ };
13
16
  }
14
17
  declare const Payment: (props: Partial<PaymentProps>) => React.JSX.Element;
15
18
  export default Payment;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "0.21.6-alpha.1",
3
+ "version": "0.21.6-alpha.4",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "",
6
6
  "license": "ISC",
@@ -20,7 +20,7 @@
20
20
  "watch": "nodemon --ignore dist/ --ignore node_modules/ --watch src/ -C -e ts,tsx,less --debug -x 'yarn async'"
21
21
  },
22
22
  "dependencies": {
23
- "@kmkf-fe-packages/kmkf-utils": "^0.21.6-alpha.1",
23
+ "@kmkf-fe-packages/kmkf-utils": "^0.21.6-alpha.4",
24
24
  "ahooks": "^3.7.8",
25
25
  "lodash": "^4.17.21",
26
26
  "pubsub-js": "^1.9.4",
@@ -62,5 +62,5 @@
62
62
  "publishConfig": {
63
63
  "access": "public"
64
64
  },
65
- "gitHead": "d542c40a1e72468eba0e31e0e290460dad5fbc84"
65
+ "gitHead": "6e8607051c7505581ca51a0146ed1de51a94dd42"
66
66
  }