@kmkf-fe-packages/basic-components 0.21.4 → 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 +2 -1
- package/dist/index.esm.js +167 -28
- package/dist/index.js +167 -27
- package/dist/src/business/LogisticsMoreTrajectory/index.d.ts +3 -0
- package/dist/src/index.d.ts +1 -0
- package/package.json +4 -3
package/README.md
CHANGED
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"];
|
|
@@ -9612,8 +9613,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
9612
9613
|
};
|
|
9613
9614
|
|
|
9614
9615
|
var LogisticsTrajectory = function LogisticsTrajectory(props) {
|
|
9615
|
-
var
|
|
9616
|
-
showField = props.showField,
|
|
9616
|
+
var showField = props.showField,
|
|
9617
9617
|
_props$value = props.value,
|
|
9618
9618
|
value = _props$value === void 0 ? {} : _props$value,
|
|
9619
9619
|
disabled = props.disabled,
|
|
@@ -9744,6 +9744,159 @@ var LogisticsTrajectory = function LogisticsTrajectory(props) {
|
|
|
9744
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);
|
|
9745
9745
|
};
|
|
9746
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
|
+
|
|
9747
9900
|
//组件类型的默认值
|
|
9748
9901
|
var typeInitValueMap = {
|
|
9749
9902
|
1: [{
|
|
@@ -10615,10 +10768,9 @@ var BsGoods = function BsGoods(props) {
|
|
|
10615
10768
|
};
|
|
10616
10769
|
setTableSelect(['2', '4'].includes(data.val));
|
|
10617
10770
|
if (['1', '3'].includes(data.val)) {
|
|
10618
|
-
var _valueRef$current
|
|
10771
|
+
var _valueRef$current;
|
|
10619
10772
|
pubsub.publish('selectListReturn', {
|
|
10620
10773
|
list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current = valueRef.current) === null || _valueRef$current === void 0 ? void 0 : _valueRef$current.bsGoods) || []),
|
|
10621
|
-
shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.shopCode,
|
|
10622
10774
|
goodValue: data === null || data === void 0 ? void 0 : data.goodValue
|
|
10623
10775
|
});
|
|
10624
10776
|
}
|
|
@@ -10633,14 +10785,13 @@ var BsGoods = function BsGoods(props) {
|
|
|
10633
10785
|
};
|
|
10634
10786
|
setTableSelect(['2', '4'].includes(data.val));
|
|
10635
10787
|
if (['1', '3'].includes(data.val)) {
|
|
10636
|
-
var _valueRef$
|
|
10788
|
+
var _valueRef$current2;
|
|
10637
10789
|
// console.log(
|
|
10638
10790
|
// 'goods-reissueSelectListReturn',
|
|
10639
10791
|
// valueRef?.current?.bsGoods,
|
|
10640
10792
|
// );
|
|
10641
10793
|
pubsub.publish('reissueSelectListReturn', {
|
|
10642
|
-
list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$
|
|
10643
|
-
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) || []),
|
|
10644
10795
|
goodValue: data === null || data === void 0 ? void 0 : data.goodValue
|
|
10645
10796
|
});
|
|
10646
10797
|
}
|
|
@@ -10655,10 +10806,9 @@ var BsGoods = function BsGoods(props) {
|
|
|
10655
10806
|
};
|
|
10656
10807
|
setTableSelect(['2', '4'].includes(data.val));
|
|
10657
10808
|
if (['1', '3'].includes(data.val)) {
|
|
10658
|
-
var _valueRef$
|
|
10809
|
+
var _valueRef$current3;
|
|
10659
10810
|
pubsub.publish('returnSelectListReturn', {
|
|
10660
|
-
list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$
|
|
10661
|
-
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) || []),
|
|
10662
10812
|
goodValue: data === null || data === void 0 ? void 0 : data.goodValue
|
|
10663
10813
|
});
|
|
10664
10814
|
}
|
|
@@ -10674,7 +10824,7 @@ var BsGoods = function BsGoods(props) {
|
|
|
10674
10824
|
};
|
|
10675
10825
|
}, [disabled]);
|
|
10676
10826
|
var _onSelect = function onSelect(list) {
|
|
10677
|
-
var _withInfo$current, _withInfo$current2
|
|
10827
|
+
var _withInfo$current, _withInfo$current2;
|
|
10678
10828
|
if (disabled) return;
|
|
10679
10829
|
var newList = cloneDeep(list);
|
|
10680
10830
|
var typeMap = {
|
|
@@ -10690,7 +10840,6 @@ var BsGoods = function BsGoods(props) {
|
|
|
10690
10840
|
item.canDelete = true;
|
|
10691
10841
|
return item;
|
|
10692
10842
|
}),
|
|
10693
|
-
shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current7 = valueRef.current) === null || _valueRef$current7 === void 0 ? void 0 : _valueRef$current7.shopCode,
|
|
10694
10843
|
goodValue: withInfo.current.goodValue
|
|
10695
10844
|
});
|
|
10696
10845
|
};
|
|
@@ -10768,7 +10917,6 @@ var BsExchange = function BsExchange(props) {
|
|
|
10768
10917
|
if (disabled) return;
|
|
10769
10918
|
var newDataList = cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
|
|
10770
10919
|
onChange(_objectSpread2(_objectSpread2({}, data.goodValue), {}, {
|
|
10771
|
-
shopCode: data === null || data === void 0 ? void 0 : data.shopCode,
|
|
10772
10920
|
bsExchangeReturnGoods: getListHandle(newDataList, valueRef.current)
|
|
10773
10921
|
}));
|
|
10774
10922
|
});
|
|
@@ -10779,7 +10927,6 @@ var BsExchange = function BsExchange(props) {
|
|
|
10779
10927
|
var newValue = _objectSpread2({}, data.goodValue);
|
|
10780
10928
|
var newDataList = cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
|
|
10781
10929
|
onChange(_objectSpread2(_objectSpread2({}, newValue), {}, {
|
|
10782
|
-
shopCode: data === null || data === void 0 ? void 0 : data.shopCode,
|
|
10783
10930
|
bsExchangeReturnGoods: getListHandle(newDataList, newValue)
|
|
10784
10931
|
}));
|
|
10785
10932
|
});
|
|
@@ -10973,9 +11120,7 @@ var BsReissue = function BsReissue(props) {
|
|
|
10973
11120
|
pubsub.subscribe('reissueSelectList', function (_, data) {
|
|
10974
11121
|
// console.log('reissueSelectList', data);
|
|
10975
11122
|
if (disabled) return;
|
|
10976
|
-
var newValue = _objectSpread2(
|
|
10977
|
-
shopCode: data === null || data === void 0 ? void 0 : data.shopCode
|
|
10978
|
-
});
|
|
11123
|
+
var newValue = _objectSpread2({}, data.goodValue);
|
|
10979
11124
|
newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
|
|
10980
11125
|
item.money = 0;
|
|
10981
11126
|
item.share = 0;
|
|
@@ -10989,9 +11134,7 @@ var BsReissue = function BsReissue(props) {
|
|
|
10989
11134
|
pubsub.subscribe('reissueSelectListReturn', function (_, data) {
|
|
10990
11135
|
// console.log('reissueSelectListReturn', data);
|
|
10991
11136
|
if (disabled) return;
|
|
10992
|
-
var newValue = _objectSpread2(
|
|
10993
|
-
shopCode: data === null || data === void 0 ? void 0 : data.shopCode
|
|
10994
|
-
});
|
|
11137
|
+
var newValue = _objectSpread2({}, data.goodValue);
|
|
10995
11138
|
newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
|
|
10996
11139
|
item.money = 0;
|
|
10997
11140
|
item.share = 0;
|
|
@@ -11084,9 +11227,7 @@ var BsReturnGoods = function BsReturnGoods(props) {
|
|
|
11084
11227
|
pubsub.subscribe('returnSelectList', function (_, data) {
|
|
11085
11228
|
// console.log('returnSelectList', data);
|
|
11086
11229
|
if (disabled) return;
|
|
11087
|
-
var newValue = _objectSpread2(
|
|
11088
|
-
shopCode: data === null || data === void 0 ? void 0 : data.shopCode
|
|
11089
|
-
});
|
|
11230
|
+
var newValue = _objectSpread2({}, data.goodValue);
|
|
11090
11231
|
newValue.bsReturnGoods = (data === null || data === void 0 ? void 0 : data.list) || [];
|
|
11091
11232
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
11092
11233
|
});
|
|
@@ -11095,9 +11236,7 @@ var BsReturnGoods = function BsReturnGoods(props) {
|
|
|
11095
11236
|
pubsub.subscribe('returnSelectListReturn', function (_, data) {
|
|
11096
11237
|
// console.log('returnSelectListReturn', data);
|
|
11097
11238
|
if (disabled) return;
|
|
11098
|
-
var newValue = _objectSpread2(
|
|
11099
|
-
shopCode: data === null || data === void 0 ? void 0 : data.shopCode
|
|
11100
|
-
});
|
|
11239
|
+
var newValue = _objectSpread2({}, data.goodValue);
|
|
11101
11240
|
newValue.bsReturnGoods = (data === null || data === void 0 ? void 0 : data.list) || [];
|
|
11102
11241
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
11103
11242
|
});
|
|
@@ -12106,4 +12245,4 @@ var CalculationInput = function CalculationInput(props) {
|
|
|
12106
12245
|
}, config === null || config === void 0 ? void 0 : config.unit));
|
|
12107
12246
|
};
|
|
12108
12247
|
|
|
12109
|
-
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
|
|
|
@@ -9623,8 +9624,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
9623
9624
|
};
|
|
9624
9625
|
|
|
9625
9626
|
var LogisticsTrajectory = function LogisticsTrajectory(props) {
|
|
9626
|
-
var
|
|
9627
|
-
showField = props.showField,
|
|
9627
|
+
var showField = props.showField,
|
|
9628
9628
|
_props$value = props.value,
|
|
9629
9629
|
value = _props$value === void 0 ? {} : _props$value,
|
|
9630
9630
|
disabled = props.disabled,
|
|
@@ -9755,6 +9755,159 @@ var LogisticsTrajectory = function LogisticsTrajectory(props) {
|
|
|
9755
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);
|
|
9756
9756
|
};
|
|
9757
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
|
+
|
|
9758
9911
|
//组件类型的默认值
|
|
9759
9912
|
var typeInitValueMap = {
|
|
9760
9913
|
1: [{
|
|
@@ -10626,10 +10779,9 @@ var BsGoods = function BsGoods(props) {
|
|
|
10626
10779
|
};
|
|
10627
10780
|
setTableSelect(['2', '4'].includes(data.val));
|
|
10628
10781
|
if (['1', '3'].includes(data.val)) {
|
|
10629
|
-
var _valueRef$current
|
|
10782
|
+
var _valueRef$current;
|
|
10630
10783
|
pubsub__default['default'].publish('selectListReturn', {
|
|
10631
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) || []),
|
|
10632
|
-
shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.shopCode,
|
|
10633
10785
|
goodValue: data === null || data === void 0 ? void 0 : data.goodValue
|
|
10634
10786
|
});
|
|
10635
10787
|
}
|
|
@@ -10644,14 +10796,13 @@ var BsGoods = function BsGoods(props) {
|
|
|
10644
10796
|
};
|
|
10645
10797
|
setTableSelect(['2', '4'].includes(data.val));
|
|
10646
10798
|
if (['1', '3'].includes(data.val)) {
|
|
10647
|
-
var _valueRef$
|
|
10799
|
+
var _valueRef$current2;
|
|
10648
10800
|
// console.log(
|
|
10649
10801
|
// 'goods-reissueSelectListReturn',
|
|
10650
10802
|
// valueRef?.current?.bsGoods,
|
|
10651
10803
|
// );
|
|
10652
10804
|
pubsub__default['default'].publish('reissueSelectListReturn', {
|
|
10653
|
-
list: lodash.cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$
|
|
10654
|
-
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) || []),
|
|
10655
10806
|
goodValue: data === null || data === void 0 ? void 0 : data.goodValue
|
|
10656
10807
|
});
|
|
10657
10808
|
}
|
|
@@ -10666,10 +10817,9 @@ var BsGoods = function BsGoods(props) {
|
|
|
10666
10817
|
};
|
|
10667
10818
|
setTableSelect(['2', '4'].includes(data.val));
|
|
10668
10819
|
if (['1', '3'].includes(data.val)) {
|
|
10669
|
-
var _valueRef$
|
|
10820
|
+
var _valueRef$current3;
|
|
10670
10821
|
pubsub__default['default'].publish('returnSelectListReturn', {
|
|
10671
|
-
list: lodash.cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$
|
|
10672
|
-
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) || []),
|
|
10673
10823
|
goodValue: data === null || data === void 0 ? void 0 : data.goodValue
|
|
10674
10824
|
});
|
|
10675
10825
|
}
|
|
@@ -10685,7 +10835,7 @@ var BsGoods = function BsGoods(props) {
|
|
|
10685
10835
|
};
|
|
10686
10836
|
}, [disabled]);
|
|
10687
10837
|
var _onSelect = function onSelect(list) {
|
|
10688
|
-
var _withInfo$current, _withInfo$current2
|
|
10838
|
+
var _withInfo$current, _withInfo$current2;
|
|
10689
10839
|
if (disabled) return;
|
|
10690
10840
|
var newList = lodash.cloneDeep(list);
|
|
10691
10841
|
var typeMap = {
|
|
@@ -10701,7 +10851,6 @@ var BsGoods = function BsGoods(props) {
|
|
|
10701
10851
|
item.canDelete = true;
|
|
10702
10852
|
return item;
|
|
10703
10853
|
}),
|
|
10704
|
-
shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current7 = valueRef.current) === null || _valueRef$current7 === void 0 ? void 0 : _valueRef$current7.shopCode,
|
|
10705
10854
|
goodValue: withInfo.current.goodValue
|
|
10706
10855
|
});
|
|
10707
10856
|
};
|
|
@@ -10779,7 +10928,6 @@ var BsExchange = function BsExchange(props) {
|
|
|
10779
10928
|
if (disabled) return;
|
|
10780
10929
|
var newDataList = lodash.cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
|
|
10781
10930
|
onChange(_objectSpread2(_objectSpread2({}, data.goodValue), {}, {
|
|
10782
|
-
shopCode: data === null || data === void 0 ? void 0 : data.shopCode,
|
|
10783
10931
|
bsExchangeReturnGoods: getListHandle(newDataList, valueRef.current)
|
|
10784
10932
|
}));
|
|
10785
10933
|
});
|
|
@@ -10790,7 +10938,6 @@ var BsExchange = function BsExchange(props) {
|
|
|
10790
10938
|
var newValue = _objectSpread2({}, data.goodValue);
|
|
10791
10939
|
var newDataList = lodash.cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
|
|
10792
10940
|
onChange(_objectSpread2(_objectSpread2({}, newValue), {}, {
|
|
10793
|
-
shopCode: data === null || data === void 0 ? void 0 : data.shopCode,
|
|
10794
10941
|
bsExchangeReturnGoods: getListHandle(newDataList, newValue)
|
|
10795
10942
|
}));
|
|
10796
10943
|
});
|
|
@@ -10984,9 +11131,7 @@ var BsReissue = function BsReissue(props) {
|
|
|
10984
11131
|
pubsub__default['default'].subscribe('reissueSelectList', function (_, data) {
|
|
10985
11132
|
// console.log('reissueSelectList', data);
|
|
10986
11133
|
if (disabled) return;
|
|
10987
|
-
var newValue = _objectSpread2(
|
|
10988
|
-
shopCode: data === null || data === void 0 ? void 0 : data.shopCode
|
|
10989
|
-
});
|
|
11134
|
+
var newValue = _objectSpread2({}, data.goodValue);
|
|
10990
11135
|
newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
|
|
10991
11136
|
item.money = 0;
|
|
10992
11137
|
item.share = 0;
|
|
@@ -11000,9 +11145,7 @@ var BsReissue = function BsReissue(props) {
|
|
|
11000
11145
|
pubsub__default['default'].subscribe('reissueSelectListReturn', function (_, data) {
|
|
11001
11146
|
// console.log('reissueSelectListReturn', data);
|
|
11002
11147
|
if (disabled) return;
|
|
11003
|
-
var newValue = _objectSpread2(
|
|
11004
|
-
shopCode: data === null || data === void 0 ? void 0 : data.shopCode
|
|
11005
|
-
});
|
|
11148
|
+
var newValue = _objectSpread2({}, data.goodValue);
|
|
11006
11149
|
newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
|
|
11007
11150
|
item.money = 0;
|
|
11008
11151
|
item.share = 0;
|
|
@@ -11095,9 +11238,7 @@ var BsReturnGoods = function BsReturnGoods(props) {
|
|
|
11095
11238
|
pubsub__default['default'].subscribe('returnSelectList', function (_, data) {
|
|
11096
11239
|
// console.log('returnSelectList', data);
|
|
11097
11240
|
if (disabled) return;
|
|
11098
|
-
var newValue = _objectSpread2(
|
|
11099
|
-
shopCode: data === null || data === void 0 ? void 0 : data.shopCode
|
|
11100
|
-
});
|
|
11241
|
+
var newValue = _objectSpread2({}, data.goodValue);
|
|
11101
11242
|
newValue.bsReturnGoods = (data === null || data === void 0 ? void 0 : data.list) || [];
|
|
11102
11243
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
11103
11244
|
});
|
|
@@ -11106,9 +11247,7 @@ var BsReturnGoods = function BsReturnGoods(props) {
|
|
|
11106
11247
|
pubsub__default['default'].subscribe('returnSelectListReturn', function (_, data) {
|
|
11107
11248
|
// console.log('returnSelectListReturn', data);
|
|
11108
11249
|
if (disabled) return;
|
|
11109
|
-
var newValue = _objectSpread2(
|
|
11110
|
-
shopCode: data === null || data === void 0 ? void 0 : data.shopCode
|
|
11111
|
-
});
|
|
11250
|
+
var newValue = _objectSpread2({}, data.goodValue);
|
|
11112
11251
|
newValue.bsReturnGoods = (data === null || data === void 0 ? void 0 : data.list) || [];
|
|
11113
11252
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
11114
11253
|
});
|
|
@@ -12156,6 +12295,7 @@ exports.Invoice = Invoice;
|
|
|
12156
12295
|
exports.JstGoods = jstGoods;
|
|
12157
12296
|
exports.JstItemList = ItemList;
|
|
12158
12297
|
exports.LogisticsInterception = LogisticsInterception;
|
|
12298
|
+
exports.LogisticsMoreTrajectory = LogisticsMoreTrajectory;
|
|
12159
12299
|
exports.LogisticsTrajectory = LogisticsTrajectory;
|
|
12160
12300
|
exports.MsgStatus = MsgStatus;
|
|
12161
12301
|
exports.ParseLogistics = ParseLogistics;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -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.
|
|
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.
|
|
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": "
|
|
65
|
+
"gitHead": "d542c40a1e72468eba0e31e0e290460dad5fbc84"
|
|
65
66
|
}
|