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

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,4 +17,5 @@ yarn start
17
17
  - business 快麦工单业务组件
18
18
  - common 公共组件
19
19
  - config 公共方法
20
- - assets 静态资源
20
+ - assets 静态资源
21
+ -
package/dist/index.esm.js CHANGED
@@ -5,8 +5,9 @@ import request, { extend as extend$1 } from 'umi-request';
5
5
  import { CopyToClipboard } from 'react-copy-to-clipboard';
6
6
  import { AddressData, BsAddressData, request as request$1, ExpressData, LogisticsAddressData, uuid } from '@kmkf-fe-packages/kmkf-utils';
7
7
  import zhCN from 'antd/lib/locale/zh_CN';
8
- import pubsub from 'pubsub-js';
9
8
  import { cloneDeep } from 'lodash';
9
+ import { useDebounceEffect } from 'ahooks';
10
+ import pubsub from 'pubsub-js';
10
11
 
11
12
  function _iterableToArrayLimit(arr, i) {
12
13
  var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
@@ -9229,9 +9230,7 @@ var Payment = function Payment(props) {
9229
9230
  shopList = props.shopList,
9230
9231
  onChange = props.onChange,
9231
9232
  onSearch = props.onSearch,
9232
- _onBlur = props.onBlur,
9233
- _props$replaceValueCh = props.replaceValueCh,
9234
- replaceValueCh = _props$replaceValueCh === void 0 ? {} : _props$replaceValueCh;
9233
+ _onBlur = props.onBlur;
9235
9234
  useEffect(function () {
9236
9235
  var platformList = ['TAOBAO', 'FXG'];
9237
9236
  var showBuyerId = (shopList || []).some(function (item) {
@@ -9308,11 +9307,7 @@ var Payment = function Payment(props) {
9308
9307
  onBlur: function onBlur(e) {
9309
9308
  return _onBlur === null || _onBlur === void 0 ? void 0 : _onBlur(e.target.value, item.name);
9310
9309
  }
9311
- }), (replaceValueCh === null || replaceValueCh === void 0 ? void 0 : replaceValueCh[item.name]) && /*#__PURE__*/React.createElement("p", {
9312
- style: {
9313
- color: '#e99d42'
9314
- }
9315
- }, replaceValueCh === null || replaceValueCh === void 0 ? void 0 : replaceValueCh[item.name]));
9310
+ }));
9316
9311
  }));
9317
9312
  };
9318
9313
 
@@ -9618,8 +9613,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
9618
9613
  };
9619
9614
 
9620
9615
  var LogisticsTrajectory = function LogisticsTrajectory(props) {
9621
- var options = props.options,
9622
- showField = props.showField,
9616
+ var showField = props.showField,
9623
9617
  _props$value = props.value,
9624
9618
  value = _props$value === void 0 ? {} : _props$value,
9625
9619
  disabled = props.disabled,
@@ -9750,6 +9744,159 @@ var LogisticsTrajectory = function LogisticsTrajectory(props) {
9750
9744
  return /*#__PURE__*/React.createElement("div", null, LogisticsCompany(), LogisticsCode(), (value === null || value === void 0 ? void 0 : value.trajectoryCompany) === 'SF' ? LogisticsPhone() : null, showField && showField.includes('snapshot') ? /*#__PURE__*/React.createElement(LogisticsSnapshot, null) : null);
9751
9745
  };
9752
9746
 
9747
+ var LogisticsMoreTrajectory = function LogisticsMoreTrajectory(props) {
9748
+ var showField = props.showField,
9749
+ _props$value = props.value,
9750
+ value = _props$value === void 0 ? [] : _props$value,
9751
+ disabled = props.disabled,
9752
+ onChange = props.onChange;
9753
+ var _useState = useState([]),
9754
+ _useState2 = _slicedToArray(_useState, 2),
9755
+ newValue = _useState2[0],
9756
+ setNewValue = _useState2[1];
9757
+ var _useState3 = useState(0),
9758
+ _useState4 = _slicedToArray(_useState3, 2),
9759
+ changeIndex = _useState4[0],
9760
+ setChangeIndex = _useState4[1];
9761
+ var _useState5 = useState([]),
9762
+ _useState6 = _slicedToArray(_useState5, 2),
9763
+ initValue = _useState6[0],
9764
+ setInitValue = _useState6[1];
9765
+ var _useState7 = useState([]),
9766
+ _useState8 = _slicedToArray(_useState7, 2),
9767
+ changeValue = _useState8[0],
9768
+ setChangeValue = _useState8[1];
9769
+ useEffect(function () {
9770
+ setInitValue(value);
9771
+ }, []);
9772
+ useDebounceEffect(function () {
9773
+ initHandle({
9774
+ initValue: initValue,
9775
+ value: value
9776
+ });
9777
+ }, [initValue, value], {
9778
+ wait: 500
9779
+ });
9780
+ var initHandle = /*#__PURE__*/function () {
9781
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
9782
+ var initValue, value, initList, valueList, changeList, hasValue, listValue, requestList, requestValues;
9783
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
9784
+ while (1) switch (_context.prev = _context.next) {
9785
+ case 0:
9786
+ initValue = _ref.initValue, value = _ref.value;
9787
+ initList = initValue.map(function (item) {
9788
+ return {
9789
+ trajectoryCompany: item.trajectoryCompany,
9790
+ trajectoryCode: item.trajectoryCode,
9791
+ trajectoryPhone: item.trajectoryPhone
9792
+ };
9793
+ });
9794
+ valueList = value.map(function (item) {
9795
+ return {
9796
+ trajectoryCompany: item.trajectoryCompany,
9797
+ trajectoryCode: item.trajectoryCode,
9798
+ trajectoryPhone: item.trajectoryPhone
9799
+ };
9800
+ });
9801
+ changeList = changeValue.map(function (item) {
9802
+ return {
9803
+ trajectoryCompany: item.trajectoryCompany,
9804
+ trajectoryCode: item.trajectoryCode,
9805
+ trajectoryPhone: item.trajectoryPhone
9806
+ };
9807
+ }); // 1、初始值没有 传入值有请求快照
9808
+ // 2、初始值有 传入值有 其中有不一样的请求快照
9809
+ // 3、初始值有 传入值有 都一样的返回初始值
9810
+ // console.log('list', initList, valueList, changeList);
9811
+ // console.log('old', initValue, value, changeValue);
9812
+ // console.log('一样', JSON.stringify(initList) !== JSON.stringify(valueList));
9813
+ // console.log(
9814
+ // '一样2',
9815
+ // JSON.stringify(changeList) !== JSON.stringify(valueList),
9816
+ // );
9817
+ if (!(JSON.stringify(initList) === JSON.stringify(valueList))) {
9818
+ _context.next = 8;
9819
+ break;
9820
+ }
9821
+ setNewValue(initValue);
9822
+ _context.next = 20;
9823
+ break;
9824
+ case 8:
9825
+ if (!(JSON.stringify(initList) !== JSON.stringify(valueList) && JSON.stringify(changeList) !== JSON.stringify(valueList))) {
9826
+ _context.next = 20;
9827
+ break;
9828
+ }
9829
+ hasValue = valueList.every(function (item) {
9830
+ return item.trajectoryCompany && item.trajectoryCode;
9831
+ });
9832
+ listValue = cloneDeep(value);
9833
+ if (!hasValue) {
9834
+ _context.next = 17;
9835
+ break;
9836
+ }
9837
+ requestList = valueList.map(function (item) {
9838
+ return extendRequest('/qy/logistics/logisticsTraceSearch', {
9839
+ method: 'post',
9840
+ data: {
9841
+ mailNo: item.trajectoryCode,
9842
+ cpCode: item.trajectoryCompany,
9843
+ mobile: item.trajectoryPhone
9844
+ }
9845
+ });
9846
+ });
9847
+ _context.next = 15;
9848
+ return Promise.allSettled(requestList);
9849
+ case 15:
9850
+ requestValues = _context.sent;
9851
+ listValue = cloneDeep(value).map(function (item, index) {
9852
+ var _requestValues$index, _requestValues$index$, _requestValues$index$2;
9853
+ return _objectSpread2(_objectSpread2({}, item), {}, {
9854
+ 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
+ });
9856
+ });
9857
+ case 17:
9858
+ setChangeValue(listValue);
9859
+ setNewValue(listValue);
9860
+ onChange(listValue);
9861
+ case 20:
9862
+ case "end":
9863
+ return _context.stop();
9864
+ }
9865
+ }, _callee);
9866
+ }));
9867
+ return function initHandle(_x) {
9868
+ return _ref2.apply(this, arguments);
9869
+ };
9870
+ }();
9871
+ var handleChange = function handleChange(val, index) {
9872
+ var newValue = cloneDeep(value);
9873
+ newValue.splice(index, 1, val);
9874
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
9875
+ setChangeValue(newValue);
9876
+ setNewValue(newValue);
9877
+ };
9878
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Space, {
9879
+ wrap: true
9880
+ }, (newValue || []).map(function (item, index) {
9881
+ return /*#__PURE__*/React.createElement("span", {
9882
+ style: {
9883
+ color: changeIndex === index ? '#4569d4' : 'black',
9884
+ cursor: 'pointer'
9885
+ },
9886
+ onClick: function onClick() {
9887
+ return setChangeIndex(index);
9888
+ }
9889
+ }, "\u5305\u88F9".concat(index + 1));
9890
+ })), /*#__PURE__*/React.createElement(LogisticsTrajectory, {
9891
+ value: newValue[changeIndex],
9892
+ showField: showField,
9893
+ disabled: disabled,
9894
+ onChange: function onChange(val) {
9895
+ return handleChange(val, changeIndex);
9896
+ }
9897
+ }));
9898
+ };
9899
+
9753
9900
  //组件类型的默认值
9754
9901
  var typeInitValueMap = {
9755
9902
  1: [{
@@ -10621,10 +10768,9 @@ var BsGoods = function BsGoods(props) {
10621
10768
  };
10622
10769
  setTableSelect(['2', '4'].includes(data.val));
10623
10770
  if (['1', '3'].includes(data.val)) {
10624
- var _valueRef$current, _valueRef$current2;
10771
+ var _valueRef$current;
10625
10772
  pubsub.publish('selectListReturn', {
10626
10773
  list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current = valueRef.current) === null || _valueRef$current === void 0 ? void 0 : _valueRef$current.bsGoods) || []),
10627
- shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.shopCode,
10628
10774
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
10629
10775
  });
10630
10776
  }
@@ -10639,14 +10785,13 @@ var BsGoods = function BsGoods(props) {
10639
10785
  };
10640
10786
  setTableSelect(['2', '4'].includes(data.val));
10641
10787
  if (['1', '3'].includes(data.val)) {
10642
- var _valueRef$current3, _valueRef$current4;
10788
+ var _valueRef$current2;
10643
10789
  // console.log(
10644
10790
  // 'goods-reissueSelectListReturn',
10645
10791
  // valueRef?.current?.bsGoods,
10646
10792
  // );
10647
10793
  pubsub.publish('reissueSelectListReturn', {
10648
- list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current3 = valueRef.current) === null || _valueRef$current3 === void 0 ? void 0 : _valueRef$current3.bsGoods) || []),
10649
- shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current4 = valueRef.current) === null || _valueRef$current4 === void 0 ? void 0 : _valueRef$current4.shopCode,
10794
+ list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.bsGoods) || []),
10650
10795
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
10651
10796
  });
10652
10797
  }
@@ -10661,10 +10806,9 @@ var BsGoods = function BsGoods(props) {
10661
10806
  };
10662
10807
  setTableSelect(['2', '4'].includes(data.val));
10663
10808
  if (['1', '3'].includes(data.val)) {
10664
- var _valueRef$current5, _valueRef$current6;
10809
+ var _valueRef$current3;
10665
10810
  pubsub.publish('returnSelectListReturn', {
10666
- list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current5 = valueRef.current) === null || _valueRef$current5 === void 0 ? void 0 : _valueRef$current5.bsGoods) || []),
10667
- shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current6 = valueRef.current) === null || _valueRef$current6 === void 0 ? void 0 : _valueRef$current6.shopCode,
10811
+ list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current3 = valueRef.current) === null || _valueRef$current3 === void 0 ? void 0 : _valueRef$current3.bsGoods) || []),
10668
10812
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
10669
10813
  });
10670
10814
  }
@@ -10680,7 +10824,7 @@ var BsGoods = function BsGoods(props) {
10680
10824
  };
10681
10825
  }, [disabled]);
10682
10826
  var _onSelect = function onSelect(list) {
10683
- var _withInfo$current, _withInfo$current2, _valueRef$current7;
10827
+ var _withInfo$current, _withInfo$current2;
10684
10828
  if (disabled) return;
10685
10829
  var newList = cloneDeep(list);
10686
10830
  var typeMap = {
@@ -10696,7 +10840,6 @@ var BsGoods = function BsGoods(props) {
10696
10840
  item.canDelete = true;
10697
10841
  return item;
10698
10842
  }),
10699
- shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current7 = valueRef.current) === null || _valueRef$current7 === void 0 ? void 0 : _valueRef$current7.shopCode,
10700
10843
  goodValue: withInfo.current.goodValue
10701
10844
  });
10702
10845
  };
@@ -10774,7 +10917,6 @@ var BsExchange = function BsExchange(props) {
10774
10917
  if (disabled) return;
10775
10918
  var newDataList = cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
10776
10919
  onChange(_objectSpread2(_objectSpread2({}, data.goodValue), {}, {
10777
- shopCode: data === null || data === void 0 ? void 0 : data.shopCode,
10778
10920
  bsExchangeReturnGoods: getListHandle(newDataList, valueRef.current)
10779
10921
  }));
10780
10922
  });
@@ -10785,7 +10927,6 @@ var BsExchange = function BsExchange(props) {
10785
10927
  var newValue = _objectSpread2({}, data.goodValue);
10786
10928
  var newDataList = cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
10787
10929
  onChange(_objectSpread2(_objectSpread2({}, newValue), {}, {
10788
- shopCode: data === null || data === void 0 ? void 0 : data.shopCode,
10789
10930
  bsExchangeReturnGoods: getListHandle(newDataList, newValue)
10790
10931
  }));
10791
10932
  });
@@ -10979,9 +11120,7 @@ var BsReissue = function BsReissue(props) {
10979
11120
  pubsub.subscribe('reissueSelectList', function (_, data) {
10980
11121
  // console.log('reissueSelectList', data);
10981
11122
  if (disabled) return;
10982
- var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
10983
- shopCode: data === null || data === void 0 ? void 0 : data.shopCode
10984
- });
11123
+ var newValue = _objectSpread2({}, data.goodValue);
10985
11124
  newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
10986
11125
  item.money = 0;
10987
11126
  item.share = 0;
@@ -10995,9 +11134,7 @@ var BsReissue = function BsReissue(props) {
10995
11134
  pubsub.subscribe('reissueSelectListReturn', function (_, data) {
10996
11135
  // console.log('reissueSelectListReturn', data);
10997
11136
  if (disabled) return;
10998
- var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
10999
- shopCode: data === null || data === void 0 ? void 0 : data.shopCode
11000
- });
11137
+ var newValue = _objectSpread2({}, data.goodValue);
11001
11138
  newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
11002
11139
  item.money = 0;
11003
11140
  item.share = 0;
@@ -11090,9 +11227,7 @@ var BsReturnGoods = function BsReturnGoods(props) {
11090
11227
  pubsub.subscribe('returnSelectList', function (_, data) {
11091
11228
  // console.log('returnSelectList', data);
11092
11229
  if (disabled) return;
11093
- var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
11094
- shopCode: data === null || data === void 0 ? void 0 : data.shopCode
11095
- });
11230
+ var newValue = _objectSpread2({}, data.goodValue);
11096
11231
  newValue.bsReturnGoods = (data === null || data === void 0 ? void 0 : data.list) || [];
11097
11232
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
11098
11233
  });
@@ -11101,9 +11236,7 @@ var BsReturnGoods = function BsReturnGoods(props) {
11101
11236
  pubsub.subscribe('returnSelectListReturn', function (_, data) {
11102
11237
  // console.log('returnSelectListReturn', data);
11103
11238
  if (disabled) return;
11104
- var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
11105
- shopCode: data === null || data === void 0 ? void 0 : data.shopCode
11106
- });
11239
+ var newValue = _objectSpread2({}, data.goodValue);
11107
11240
  newValue.bsReturnGoods = (data === null || data === void 0 ? void 0 : data.list) || [];
11108
11241
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
11109
11242
  });
@@ -12112,4 +12245,4 @@ var CalculationInput = function CalculationInput(props) {
12112
12245
  }, config === null || config === void 0 ? void 0 : config.unit));
12113
12246
  };
12114
12247
 
12115
- export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, index as ApaasUploadAsync, ApaasUploadFile, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonSystemOrder$1 as CommonMultiStatus, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$2 as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, Supplier, TBGoodId, TBGoodSerial, TradeId, WlnGoods };
12248
+ export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, index as ApaasUploadAsync, ApaasUploadFile, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonSystemOrder$1 as CommonMultiStatus, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$2 as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsMoreTrajectory, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, Supplier, TBGoodId, TBGoodSerial, TradeId, WlnGoods };
package/dist/index.js CHANGED
@@ -9,8 +9,9 @@ var request = require('umi-request');
9
9
  var reactCopyToClipboard = require('react-copy-to-clipboard');
10
10
  var kmkfUtils = require('@kmkf-fe-packages/kmkf-utils');
11
11
  var zhCN = require('antd/lib/locale/zh_CN');
12
- var pubsub = require('pubsub-js');
13
12
  var lodash = require('lodash');
13
+ var ahooks = require('ahooks');
14
+ var pubsub = require('pubsub-js');
14
15
 
15
16
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
16
17
 
@@ -9240,9 +9241,7 @@ var Payment = function Payment(props) {
9240
9241
  shopList = props.shopList,
9241
9242
  onChange = props.onChange,
9242
9243
  onSearch = props.onSearch,
9243
- _onBlur = props.onBlur,
9244
- _props$replaceValueCh = props.replaceValueCh,
9245
- replaceValueCh = _props$replaceValueCh === void 0 ? {} : _props$replaceValueCh;
9244
+ _onBlur = props.onBlur;
9246
9245
  React.useEffect(function () {
9247
9246
  var platformList = ['TAOBAO', 'FXG'];
9248
9247
  var showBuyerId = (shopList || []).some(function (item) {
@@ -9319,11 +9318,7 @@ var Payment = function Payment(props) {
9319
9318
  onBlur: function onBlur(e) {
9320
9319
  return _onBlur === null || _onBlur === void 0 ? void 0 : _onBlur(e.target.value, item.name);
9321
9320
  }
9322
- }), (replaceValueCh === null || replaceValueCh === void 0 ? void 0 : replaceValueCh[item.name]) && /*#__PURE__*/React__default['default'].createElement("p", {
9323
- style: {
9324
- color: '#e99d42'
9325
- }
9326
- }, replaceValueCh === null || replaceValueCh === void 0 ? void 0 : replaceValueCh[item.name]));
9321
+ }));
9327
9322
  }));
9328
9323
  };
9329
9324
 
@@ -9629,8 +9624,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
9629
9624
  };
9630
9625
 
9631
9626
  var LogisticsTrajectory = function LogisticsTrajectory(props) {
9632
- var options = props.options,
9633
- showField = props.showField,
9627
+ var showField = props.showField,
9634
9628
  _props$value = props.value,
9635
9629
  value = _props$value === void 0 ? {} : _props$value,
9636
9630
  disabled = props.disabled,
@@ -9761,6 +9755,159 @@ var LogisticsTrajectory = function LogisticsTrajectory(props) {
9761
9755
  return /*#__PURE__*/React__default['default'].createElement("div", null, LogisticsCompany(), LogisticsCode(), (value === null || value === void 0 ? void 0 : value.trajectoryCompany) === 'SF' ? LogisticsPhone() : null, showField && showField.includes('snapshot') ? /*#__PURE__*/React__default['default'].createElement(LogisticsSnapshot, null) : null);
9762
9756
  };
9763
9757
 
9758
+ var LogisticsMoreTrajectory = function LogisticsMoreTrajectory(props) {
9759
+ var showField = props.showField,
9760
+ _props$value = props.value,
9761
+ value = _props$value === void 0 ? [] : _props$value,
9762
+ disabled = props.disabled,
9763
+ onChange = props.onChange;
9764
+ var _useState = React.useState([]),
9765
+ _useState2 = _slicedToArray(_useState, 2),
9766
+ newValue = _useState2[0],
9767
+ setNewValue = _useState2[1];
9768
+ var _useState3 = React.useState(0),
9769
+ _useState4 = _slicedToArray(_useState3, 2),
9770
+ changeIndex = _useState4[0],
9771
+ setChangeIndex = _useState4[1];
9772
+ var _useState5 = React.useState([]),
9773
+ _useState6 = _slicedToArray(_useState5, 2),
9774
+ initValue = _useState6[0],
9775
+ setInitValue = _useState6[1];
9776
+ var _useState7 = React.useState([]),
9777
+ _useState8 = _slicedToArray(_useState7, 2),
9778
+ changeValue = _useState8[0],
9779
+ setChangeValue = _useState8[1];
9780
+ React.useEffect(function () {
9781
+ setInitValue(value);
9782
+ }, []);
9783
+ ahooks.useDebounceEffect(function () {
9784
+ initHandle({
9785
+ initValue: initValue,
9786
+ value: value
9787
+ });
9788
+ }, [initValue, value], {
9789
+ wait: 500
9790
+ });
9791
+ var initHandle = /*#__PURE__*/function () {
9792
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
9793
+ var initValue, value, initList, valueList, changeList, hasValue, listValue, requestList, requestValues;
9794
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
9795
+ while (1) switch (_context.prev = _context.next) {
9796
+ case 0:
9797
+ initValue = _ref.initValue, value = _ref.value;
9798
+ initList = initValue.map(function (item) {
9799
+ return {
9800
+ trajectoryCompany: item.trajectoryCompany,
9801
+ trajectoryCode: item.trajectoryCode,
9802
+ trajectoryPhone: item.trajectoryPhone
9803
+ };
9804
+ });
9805
+ valueList = value.map(function (item) {
9806
+ return {
9807
+ trajectoryCompany: item.trajectoryCompany,
9808
+ trajectoryCode: item.trajectoryCode,
9809
+ trajectoryPhone: item.trajectoryPhone
9810
+ };
9811
+ });
9812
+ changeList = changeValue.map(function (item) {
9813
+ return {
9814
+ trajectoryCompany: item.trajectoryCompany,
9815
+ trajectoryCode: item.trajectoryCode,
9816
+ trajectoryPhone: item.trajectoryPhone
9817
+ };
9818
+ }); // 1、初始值没有 传入值有请求快照
9819
+ // 2、初始值有 传入值有 其中有不一样的请求快照
9820
+ // 3、初始值有 传入值有 都一样的返回初始值
9821
+ // console.log('list', initList, valueList, changeList);
9822
+ // console.log('old', initValue, value, changeValue);
9823
+ // console.log('一样', JSON.stringify(initList) !== JSON.stringify(valueList));
9824
+ // console.log(
9825
+ // '一样2',
9826
+ // JSON.stringify(changeList) !== JSON.stringify(valueList),
9827
+ // );
9828
+ if (!(JSON.stringify(initList) === JSON.stringify(valueList))) {
9829
+ _context.next = 8;
9830
+ break;
9831
+ }
9832
+ setNewValue(initValue);
9833
+ _context.next = 20;
9834
+ break;
9835
+ case 8:
9836
+ if (!(JSON.stringify(initList) !== JSON.stringify(valueList) && JSON.stringify(changeList) !== JSON.stringify(valueList))) {
9837
+ _context.next = 20;
9838
+ break;
9839
+ }
9840
+ hasValue = valueList.every(function (item) {
9841
+ return item.trajectoryCompany && item.trajectoryCode;
9842
+ });
9843
+ listValue = lodash.cloneDeep(value);
9844
+ if (!hasValue) {
9845
+ _context.next = 17;
9846
+ break;
9847
+ }
9848
+ requestList = valueList.map(function (item) {
9849
+ return extendRequest('/qy/logistics/logisticsTraceSearch', {
9850
+ method: 'post',
9851
+ data: {
9852
+ mailNo: item.trajectoryCode,
9853
+ cpCode: item.trajectoryCompany,
9854
+ mobile: item.trajectoryPhone
9855
+ }
9856
+ });
9857
+ });
9858
+ _context.next = 15;
9859
+ return Promise.allSettled(requestList);
9860
+ case 15:
9861
+ requestValues = _context.sent;
9862
+ listValue = lodash.cloneDeep(value).map(function (item, index) {
9863
+ var _requestValues$index, _requestValues$index$, _requestValues$index$2;
9864
+ return _objectSpread2(_objectSpread2({}, item), {}, {
9865
+ 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
+ });
9867
+ });
9868
+ case 17:
9869
+ setChangeValue(listValue);
9870
+ setNewValue(listValue);
9871
+ onChange(listValue);
9872
+ case 20:
9873
+ case "end":
9874
+ return _context.stop();
9875
+ }
9876
+ }, _callee);
9877
+ }));
9878
+ return function initHandle(_x) {
9879
+ return _ref2.apply(this, arguments);
9880
+ };
9881
+ }();
9882
+ var handleChange = function handleChange(val, index) {
9883
+ var newValue = lodash.cloneDeep(value);
9884
+ newValue.splice(index, 1, val);
9885
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
9886
+ setChangeValue(newValue);
9887
+ setNewValue(newValue);
9888
+ };
9889
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Space, {
9890
+ wrap: true
9891
+ }, (newValue || []).map(function (item, index) {
9892
+ return /*#__PURE__*/React__default['default'].createElement("span", {
9893
+ style: {
9894
+ color: changeIndex === index ? '#4569d4' : 'black',
9895
+ cursor: 'pointer'
9896
+ },
9897
+ onClick: function onClick() {
9898
+ return setChangeIndex(index);
9899
+ }
9900
+ }, "\u5305\u88F9".concat(index + 1));
9901
+ })), /*#__PURE__*/React__default['default'].createElement(LogisticsTrajectory, {
9902
+ value: newValue[changeIndex],
9903
+ showField: showField,
9904
+ disabled: disabled,
9905
+ onChange: function onChange(val) {
9906
+ return handleChange(val, changeIndex);
9907
+ }
9908
+ }));
9909
+ };
9910
+
9764
9911
  //组件类型的默认值
9765
9912
  var typeInitValueMap = {
9766
9913
  1: [{
@@ -10632,10 +10779,9 @@ var BsGoods = function BsGoods(props) {
10632
10779
  };
10633
10780
  setTableSelect(['2', '4'].includes(data.val));
10634
10781
  if (['1', '3'].includes(data.val)) {
10635
- var _valueRef$current, _valueRef$current2;
10782
+ var _valueRef$current;
10636
10783
  pubsub__default['default'].publish('selectListReturn', {
10637
10784
  list: lodash.cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current = valueRef.current) === null || _valueRef$current === void 0 ? void 0 : _valueRef$current.bsGoods) || []),
10638
- shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.shopCode,
10639
10785
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
10640
10786
  });
10641
10787
  }
@@ -10650,14 +10796,13 @@ var BsGoods = function BsGoods(props) {
10650
10796
  };
10651
10797
  setTableSelect(['2', '4'].includes(data.val));
10652
10798
  if (['1', '3'].includes(data.val)) {
10653
- var _valueRef$current3, _valueRef$current4;
10799
+ var _valueRef$current2;
10654
10800
  // console.log(
10655
10801
  // 'goods-reissueSelectListReturn',
10656
10802
  // valueRef?.current?.bsGoods,
10657
10803
  // );
10658
10804
  pubsub__default['default'].publish('reissueSelectListReturn', {
10659
- list: lodash.cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current3 = valueRef.current) === null || _valueRef$current3 === void 0 ? void 0 : _valueRef$current3.bsGoods) || []),
10660
- shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current4 = valueRef.current) === null || _valueRef$current4 === void 0 ? void 0 : _valueRef$current4.shopCode,
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) || []),
10661
10806
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
10662
10807
  });
10663
10808
  }
@@ -10672,10 +10817,9 @@ var BsGoods = function BsGoods(props) {
10672
10817
  };
10673
10818
  setTableSelect(['2', '4'].includes(data.val));
10674
10819
  if (['1', '3'].includes(data.val)) {
10675
- var _valueRef$current5, _valueRef$current6;
10820
+ var _valueRef$current3;
10676
10821
  pubsub__default['default'].publish('returnSelectListReturn', {
10677
- list: lodash.cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current5 = valueRef.current) === null || _valueRef$current5 === void 0 ? void 0 : _valueRef$current5.bsGoods) || []),
10678
- shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current6 = valueRef.current) === null || _valueRef$current6 === void 0 ? void 0 : _valueRef$current6.shopCode,
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) || []),
10679
10823
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
10680
10824
  });
10681
10825
  }
@@ -10691,7 +10835,7 @@ var BsGoods = function BsGoods(props) {
10691
10835
  };
10692
10836
  }, [disabled]);
10693
10837
  var _onSelect = function onSelect(list) {
10694
- var _withInfo$current, _withInfo$current2, _valueRef$current7;
10838
+ var _withInfo$current, _withInfo$current2;
10695
10839
  if (disabled) return;
10696
10840
  var newList = lodash.cloneDeep(list);
10697
10841
  var typeMap = {
@@ -10707,7 +10851,6 @@ var BsGoods = function BsGoods(props) {
10707
10851
  item.canDelete = true;
10708
10852
  return item;
10709
10853
  }),
10710
- shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current7 = valueRef.current) === null || _valueRef$current7 === void 0 ? void 0 : _valueRef$current7.shopCode,
10711
10854
  goodValue: withInfo.current.goodValue
10712
10855
  });
10713
10856
  };
@@ -10785,7 +10928,6 @@ var BsExchange = function BsExchange(props) {
10785
10928
  if (disabled) return;
10786
10929
  var newDataList = lodash.cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
10787
10930
  onChange(_objectSpread2(_objectSpread2({}, data.goodValue), {}, {
10788
- shopCode: data === null || data === void 0 ? void 0 : data.shopCode,
10789
10931
  bsExchangeReturnGoods: getListHandle(newDataList, valueRef.current)
10790
10932
  }));
10791
10933
  });
@@ -10796,7 +10938,6 @@ var BsExchange = function BsExchange(props) {
10796
10938
  var newValue = _objectSpread2({}, data.goodValue);
10797
10939
  var newDataList = lodash.cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
10798
10940
  onChange(_objectSpread2(_objectSpread2({}, newValue), {}, {
10799
- shopCode: data === null || data === void 0 ? void 0 : data.shopCode,
10800
10941
  bsExchangeReturnGoods: getListHandle(newDataList, newValue)
10801
10942
  }));
10802
10943
  });
@@ -10990,9 +11131,7 @@ var BsReissue = function BsReissue(props) {
10990
11131
  pubsub__default['default'].subscribe('reissueSelectList', function (_, data) {
10991
11132
  // console.log('reissueSelectList', data);
10992
11133
  if (disabled) return;
10993
- var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
10994
- shopCode: data === null || data === void 0 ? void 0 : data.shopCode
10995
- });
11134
+ var newValue = _objectSpread2({}, data.goodValue);
10996
11135
  newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
10997
11136
  item.money = 0;
10998
11137
  item.share = 0;
@@ -11006,9 +11145,7 @@ var BsReissue = function BsReissue(props) {
11006
11145
  pubsub__default['default'].subscribe('reissueSelectListReturn', function (_, data) {
11007
11146
  // console.log('reissueSelectListReturn', data);
11008
11147
  if (disabled) return;
11009
- var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
11010
- shopCode: data === null || data === void 0 ? void 0 : data.shopCode
11011
- });
11148
+ var newValue = _objectSpread2({}, data.goodValue);
11012
11149
  newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
11013
11150
  item.money = 0;
11014
11151
  item.share = 0;
@@ -11101,9 +11238,7 @@ var BsReturnGoods = function BsReturnGoods(props) {
11101
11238
  pubsub__default['default'].subscribe('returnSelectList', function (_, data) {
11102
11239
  // console.log('returnSelectList', data);
11103
11240
  if (disabled) return;
11104
- var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
11105
- shopCode: data === null || data === void 0 ? void 0 : data.shopCode
11106
- });
11241
+ var newValue = _objectSpread2({}, data.goodValue);
11107
11242
  newValue.bsReturnGoods = (data === null || data === void 0 ? void 0 : data.list) || [];
11108
11243
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
11109
11244
  });
@@ -11112,9 +11247,7 @@ var BsReturnGoods = function BsReturnGoods(props) {
11112
11247
  pubsub__default['default'].subscribe('returnSelectListReturn', function (_, data) {
11113
11248
  // console.log('returnSelectListReturn', data);
11114
11249
  if (disabled) return;
11115
- var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
11116
- shopCode: data === null || data === void 0 ? void 0 : data.shopCode
11117
- });
11250
+ var newValue = _objectSpread2({}, data.goodValue);
11118
11251
  newValue.bsReturnGoods = (data === null || data === void 0 ? void 0 : data.list) || [];
11119
11252
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
11120
11253
  });
@@ -12162,6 +12295,7 @@ exports.Invoice = Invoice;
12162
12295
  exports.JstGoods = jstGoods;
12163
12296
  exports.JstItemList = ItemList;
12164
12297
  exports.LogisticsInterception = LogisticsInterception;
12298
+ exports.LogisticsMoreTrajectory = LogisticsMoreTrajectory;
12165
12299
  exports.LogisticsTrajectory = LogisticsTrajectory;
12166
12300
  exports.MsgStatus = MsgStatus;
12167
12301
  exports.ParseLogistics = ParseLogistics;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const LogisticsMoreTrajectory: (props: any) => React.JSX.Element;
3
+ export default LogisticsMoreTrajectory;
@@ -10,9 +10,6 @@ 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
- };
16
13
  }
17
14
  declare const Payment: (props: Partial<PaymentProps>) => React.JSX.Element;
18
15
  export default Payment;
@@ -33,6 +33,7 @@ export { default as Status } from './business/Status';
33
33
  export { default as Payment } from './business/Payment';
34
34
  export { default as LogisticsInterception } from './business/LogisticsInterception';
35
35
  export { default as LogisticsTrajectory } from './business/LogisticsTrajectory';
36
+ export { default as LogisticsMoreTrajectory } from './business/LogisticsMoreTrajectory';
36
37
  export { default as Goods } from './common/Goods';
37
38
  export { default as JstGoods } from './jst/Goods';
38
39
  export { default as JstItemList } from './jst/ItemList';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "0.21.4-alpha.5",
3
+ "version": "0.21.6-alpha.1",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "",
6
6
  "license": "ISC",
@@ -20,7 +20,8 @@
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.4-alpha.4",
23
+ "@kmkf-fe-packages/kmkf-utils": "^0.21.6-alpha.1",
24
+ "ahooks": "^3.7.8",
24
25
  "lodash": "^4.17.21",
25
26
  "pubsub-js": "^1.9.4",
26
27
  "react-copy-to-clipboard": "^5.1.0",
@@ -61,5 +62,5 @@
61
62
  "publishConfig": {
62
63
  "access": "public"
63
64
  },
64
- "gitHead": "bd06d499c72911eb927e6bd9d3c4ae9c8aeba2b9"
65
+ "gitHead": "d542c40a1e72468eba0e31e0e290460dad5fbc84"
65
66
  }