@kmkf-fe-packages/services-components 0.7.15-alpha.7 → 0.7.15-alpha.70

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.
Files changed (99) hide show
  1. package/dist/esm/commonComponents/QueryLogisticsTrack/index.js +23 -21
  2. package/dist/esm/commonComponents/ShopList/index.d.ts +1 -1
  3. package/dist/esm/commonComponents/ShopList/index.js +4 -2
  4. package/dist/esm/components/ActualPayment/index.d.ts +5 -4
  5. package/dist/esm/components/ActualPayment/index.js +25 -21
  6. package/dist/esm/components/AlipayAccount/index.js +2 -1
  7. package/dist/esm/components/BS/BsExchange/index.d.ts +12 -6
  8. package/dist/esm/components/BS/BsExchange/index.js +233 -111
  9. package/dist/esm/components/BS/BsGoods/index.d.ts +11 -9
  10. package/dist/esm/components/BS/BsGoods/index.js +93 -60
  11. package/dist/esm/components/BS/BsReissue/index.d.ts +17 -6
  12. package/dist/esm/components/BS/BsReissue/index.js +110 -54
  13. package/dist/esm/components/BS/common/{BsChildNumber.d.ts → BsHeaderCode.d.ts} +5 -4
  14. package/dist/esm/components/BS/common/{BsChildNumber.js → BsHeaderCode.js} +28 -11
  15. package/dist/esm/components/BS/common/BsHeaderGood.d.ts +27 -0
  16. package/dist/esm/components/BS/common/BsHeaderGood.js +156 -0
  17. package/dist/esm/components/BS/common/{BsChildMoney.d.ts → BsHeaderMoney.d.ts} +5 -4
  18. package/dist/esm/components/BS/common/{BsChildMoney.js → BsHeaderMoney.js} +28 -11
  19. package/dist/esm/components/BS/common/{BsChildName.d.ts → BsHeaderName.d.ts} +5 -4
  20. package/dist/esm/components/BS/common/{BsChildName.js → BsHeaderName.js} +29 -11
  21. package/dist/esm/components/BS/common/{BsChildCode.d.ts → BsHeaderNumber.d.ts} +5 -4
  22. package/dist/esm/components/BS/common/{BsChildCode.js → BsHeaderNumber.js} +28 -11
  23. package/dist/esm/components/BS/common/{BsChildPic.d.ts → BsHeaderPic.d.ts} +7 -6
  24. package/dist/esm/components/BS/common/{BsChildPic.js → BsHeaderPic.js} +36 -10
  25. package/dist/esm/components/BS/common/{BsChildShare.d.ts → BsHeaderShare.d.ts} +5 -4
  26. package/dist/esm/components/BS/common/{BsChildShare.js → BsHeaderShare.js} +28 -11
  27. package/dist/esm/components/BS/common/{BsChildSku.d.ts → BsHeaderSku.d.ts} +5 -4
  28. package/dist/esm/components/BS/common/{BsChildSku.js → BsHeaderSku.js} +28 -11
  29. package/dist/esm/components/BS/common/{BsChildType.d.ts → BsHeaderType.d.ts} +5 -4
  30. package/dist/esm/components/BS/common/{BsChildType.js → BsHeaderType.js} +28 -11
  31. package/dist/esm/components/BS/common/BsMemo.d.ts +8 -7
  32. package/dist/esm/components/BS/common/BsMemo.js +55 -21
  33. package/dist/esm/components/BS/common/BsType.d.ts +8 -6
  34. package/dist/esm/components/BS/common/BsType.js +53 -17
  35. package/dist/esm/components/BS/common/index.d.ts +9 -8
  36. package/dist/esm/components/BS/common/index.js +9 -8
  37. package/dist/esm/components/BuyerNick/index.js +5 -1
  38. package/dist/esm/components/Cascader/index.d.ts +1 -0
  39. package/dist/esm/components/Cascader/index.js +3 -1
  40. package/dist/esm/components/Common/index.d.ts +7 -2
  41. package/dist/esm/components/Common/index.js +176 -78
  42. package/dist/esm/components/EItemEnCode/index.js +6 -2
  43. package/dist/esm/components/EItemId/index.d.ts +3 -3
  44. package/dist/esm/components/EItemId/index.js +14 -10
  45. package/dist/esm/components/EItemSelect/index.js +6 -2
  46. package/dist/esm/components/ErpTradeId/index.d.ts +2 -1
  47. package/dist/esm/components/ErpTradeId/index.js +27 -4
  48. package/dist/esm/components/ExpressCode/index.d.ts +1 -1
  49. package/dist/esm/components/ExpressCode/index.js +2 -2
  50. package/dist/esm/components/File/index.d.ts +1 -1
  51. package/dist/esm/components/File/index.js +26 -5
  52. package/dist/esm/components/FlowStatusSelect/index.d.ts +0 -1
  53. package/dist/esm/components/FlowStatusSelect/index.js +30 -24
  54. package/dist/esm/components/FlowWorkOrderId/index.d.ts +33 -0
  55. package/dist/esm/components/FlowWorkOrderId/index.js +112 -0
  56. package/dist/esm/components/JST/JstItemSelect/index.js +6 -2
  57. package/dist/esm/components/JST/JstLogistics/index.d.ts +19 -13
  58. package/dist/esm/components/JST/JstLogistics/index.js +71 -33
  59. package/dist/esm/components/JST/JstSendGood/index.d.ts +10 -4
  60. package/dist/esm/components/JST/JstSendGood/index.js +33 -19
  61. package/dist/esm/components/JST/JstSupply/index.js +6 -2
  62. package/dist/esm/components/LogisticsInterception/InterceptStatus.js +5 -1
  63. package/dist/esm/components/LogisticsTrajectory/index.d.ts +8 -9
  64. package/dist/esm/components/LogisticsTrajectory/index.js +12 -10
  65. package/dist/esm/components/LogisticsTrajectory/trajectoryCode.js +11 -6
  66. package/dist/esm/components/LogisticsTrajectory/trajectoryCompany.d.ts +6 -6
  67. package/dist/esm/components/LogisticsTrajectory/trajectoryCompany.js +8 -8
  68. package/dist/esm/components/LogisticsTrajectory/trajectorySnapshot.d.ts +0 -1
  69. package/dist/esm/components/LogisticsTrajectory/trajectorySnapshot.js +4 -10
  70. package/dist/esm/components/Payment/AlipayNick.js +2 -1
  71. package/dist/esm/components/Payment/AlipayNo.js +2 -1
  72. package/dist/esm/components/Payment/BuyerNick.js +6 -3
  73. package/dist/esm/components/Payment/index.d.ts +1 -0
  74. package/dist/esm/components/Payment/index.js +9 -6
  75. package/dist/esm/components/Picture/index.js +3 -0
  76. package/dist/esm/components/PostIng/index.d.ts +1 -24
  77. package/dist/esm/components/PostIng/index.js +53 -52
  78. package/dist/esm/components/Rate/index.js +5 -1
  79. package/dist/esm/components/ReceiverAddress/index.js +2 -1
  80. package/dist/esm/components/ReceiverMobile/index.js +2 -1
  81. package/dist/esm/components/ReceiverName/index.js +2 -1
  82. package/dist/esm/components/ThirdItemSelect/index.js +6 -2
  83. package/dist/esm/components/TradeDateTime/index.d.ts +6 -14
  84. package/dist/esm/components/TradeDateTime/index.js +30 -25
  85. package/dist/esm/components/TradeId/index.d.ts +1 -0
  86. package/dist/esm/components/TradeId/index.js +27 -4
  87. package/dist/esm/components/WorkOrderId/index.js +5 -3
  88. package/dist/esm/factory.d.ts +2 -2
  89. package/dist/esm/factory.js +6 -3
  90. package/dist/esm/index.d.ts +1 -1
  91. package/dist/esm/index.js +1 -1
  92. package/dist/esm/type.d.ts +10 -2
  93. package/package.json +4 -4
  94. package/dist/esm/components/BS/BsLogistics/index.d.ts +0 -50
  95. package/dist/esm/components/BS/BsLogistics/index.js +0 -115
  96. package/dist/esm/components/BS/common/BsExchangeImage.d.ts +0 -31
  97. package/dist/esm/components/BS/common/BsExchangeImage.js +0 -126
  98. package/dist/esm/components/BS/common/BsGoodImage.d.ts +0 -31
  99. package/dist/esm/components/BS/common/BsGoodImage.js +0 -88
@@ -1,14 +1,24 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
6
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
7
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
2
8
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
3
9
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
4
10
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
5
11
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
12
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
13
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
- import React from "react";
14
+ import React from 'react';
9
15
  import ItemView from "../../../commonComponents/ItemView";
10
- import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
16
+ import { isNull, filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
11
17
  import { SYMBOL } from "../../../constant";
18
+ var componentType = {
19
+ BS_EXCHANGE_GOODS: 'bsExchangeType',
20
+ BS_REISSUE_GOODS: 'bsReissueType'
21
+ };
12
22
  var BsType = /*#__PURE__*/_createClass(function BsType(options) {
13
23
  var _this = this;
14
24
  _classCallCheck(this, BsType);
@@ -24,32 +34,52 @@ var BsType = /*#__PURE__*/_createClass(function BsType(options) {
24
34
  _defineProperty(this, "canSort", void 0);
25
35
  _defineProperty(this, "children", void 0);
26
36
  _defineProperty(this, "dataType", void 0);
37
+ _defineProperty(this, "getParentId", function () {
38
+ var _this$id$split = _this.id.split('_'),
39
+ _this$id$split2 = _slicedToArray(_this$id$split, 2),
40
+ key = _this$id$split2[0],
41
+ name = _this$id$split2[1];
42
+ return "".concat(key, "_").concat(name);
43
+ });
27
44
  _defineProperty(this, "renderClient", function (record) {
28
- return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
45
+ var _record$key$component, _find, _this$componentConfig;
46
+ var _this$getParentId$spl = _this.getParentId().split('_'),
47
+ _this$getParentId$spl2 = _slicedToArray(_this$getParentId$spl, 1),
48
+ key = _this$getParentId$spl2[0];
49
+ if (!(record !== null && record !== void 0 && (_record$key$component = record[key][componentType[_this.type]]) !== null && _record$key$component !== void 0 && _record$key$component.length)) {
50
+ return null;
51
+ }
52
+ var text = (_find = (((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.reasonList) || []).find(function (item) {
53
+ var _record$key, _record$key$component2;
54
+ return item.value === ((_record$key = record[key]) === null || _record$key === void 0 ? void 0 : (_record$key$component2 = _record$key[componentType[_this.type]]) === null || _record$key$component2 === void 0 ? void 0 : _record$key$component2[0]);
55
+ })) === null || _find === void 0 ? void 0 : _find.label;
56
+ return !isNull(record === null || record === void 0 ? void 0 : record[key]) ? /*#__PURE__*/React.createElement(ItemView, {
29
57
  id: _this.id,
30
58
  label: _this.name,
31
- value: _this.getComponentValue(record)
59
+ value: text
32
60
  }) : null;
33
61
  });
34
62
  _defineProperty(this, "renderPc", function (value, record) {
35
63
  var _this$getComponentVal;
36
- return /*#__PURE__*/React.createElement("span", null, (_this$getComponentVal = _this.getComponentValue(record)) !== null && _this$getComponentVal !== void 0 ? _this$getComponentVal : "--");
64
+ return /*#__PURE__*/React.createElement("span", null, (_this$getComponentVal = _this.getComponentValue(record)) !== null && _this$getComponentVal !== void 0 ? _this$getComponentVal : '--');
37
65
  });
38
66
  _defineProperty(this, "renderLog", function (r) {
39
- if (isNull(r === null || r === void 0 ? void 0 : r[_this.id])) return null;
67
+ var id = _this.getParentId();
68
+ if (isNull(r === null || r === void 0 ? void 0 : r[id])) return null;
40
69
  return _this.renderPc(undefined, r);
41
70
  });
42
71
  _defineProperty(this, "getComponentValue", function (r) {
43
- var _find, _this$componentConfig;
44
- var type = r !== null && r !== void 0 && r[_this.id] ? r === null || r === void 0 ? void 0 : r[_this.id][0] : "";
45
- var text = (_find = (((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.reasonList) || []).find(function (item) {
72
+ var _r$id, _find2, _this$componentConfig2;
73
+ var id = _this.getParentId();
74
+ var type = r !== null && r !== void 0 && r[id] ? r === null || r === void 0 ? void 0 : (_r$id = r[id]) === null || _r$id === void 0 ? void 0 : _r$id[0] : '';
75
+ var text = (_find2 = (((_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.reasonList) || []).find(function (item) {
46
76
  return item.value === type;
47
- })) === null || _find === void 0 ? void 0 : _find.label;
77
+ })) === null || _find2 === void 0 ? void 0 : _find2.label;
48
78
  return text;
49
79
  });
50
80
  _defineProperty(this, "renderExport", function (value, record) {
51
81
  var _this$getComponentVal2;
52
- return (_this$getComponentVal2 = _this.getComponentValue(record)) !== null && _this$getComponentVal2 !== void 0 ? _this$getComponentVal2 : "--";
82
+ return (_this$getComponentVal2 = _this.getComponentValue(record)) !== null && _this$getComponentVal2 !== void 0 ? _this$getComponentVal2 : '--';
53
83
  });
54
84
  _defineProperty(this, "editRender", function () {
55
85
  return null;
@@ -57,14 +87,20 @@ var BsType = /*#__PURE__*/_createClass(function BsType(options) {
57
87
  _defineProperty(this, "filterConfig", function (item) {
58
88
  var _item$config;
59
89
  var subKey = item.subKey;
90
+ console.log('bsTypefilterConfig', item);
60
91
  return {
61
- searchDefaultConditions: SYMBOL.eq,
92
+ searchDefaultConditions: SYMBOL.in,
62
93
  type: item.type,
63
94
  id: item.id,
64
95
  name: "".concat(item.name, "-\u7C7B\u578B"),
65
- filterComponentType: "Cascader",
96
+ filterComponentType: 'Cascader',
66
97
  props: {
67
- options: item === null || item === void 0 ? void 0 : (_item$config = item.config) === null || _item$config === void 0 ? void 0 : _item$config.reasonList
98
+ options: (item === null || item === void 0 ? void 0 : (_item$config = item.config) === null || _item$config === void 0 ? void 0 : _item$config.reasonList) || []
99
+ },
100
+ formatFilterValue: function formatFilterValue(val) {
101
+ if ((val === null || val === void 0 ? void 0 : val.length) > 0) {
102
+ return val[val.length - 1];
103
+ }
68
104
  },
69
105
  filterFn: function filterFn(value) {
70
106
  return function (i) {
@@ -79,11 +115,11 @@ var BsType = /*#__PURE__*/_createClass(function BsType(options) {
79
115
  this.formField = options.id;
80
116
  this.type = options.type;
81
117
  this.componentConfig = options.componentConfig;
82
- this.align = "left";
118
+ this.align = 'left';
83
119
  this.width = 200;
84
120
  this.isCombinationComponent = false;
85
- this.canSort = true;
86
- this.dataType = "string";
121
+ this.canSort = false;
122
+ this.dataType = 'string';
87
123
  this.children = [];
88
124
  });
89
125
  export default BsType;
@@ -1,10 +1,11 @@
1
1
  export { default as BsType } from "./BsType";
2
2
  export { default as BsMemo } from "./BsMemo";
3
- export { default as BsChildPic } from "./BsChildPic";
4
- export { default as BsChildName } from "./BsChildName";
5
- export { default as BsChildCode } from "./BsChildCode";
6
- export { default as BsChildSku } from "./BsChildSku";
7
- export { default as BsChildMoney } from "./BsChildMoney";
8
- export { default as BsChildNumber } from "./BsChildNumber";
9
- export { default as BsChildShare } from "./BsChildShare";
10
- export { default as BsChildType } from "./BsChildType";
3
+ export { default as BsHeaderPic } from "./BsHeaderPic";
4
+ export { default as BsHeaderName } from "./BsHeaderName";
5
+ export { default as BsHeaderCode } from "./BsHeaderCode";
6
+ export { default as BsHeaderSku } from "./BsHeaderSku";
7
+ export { default as BsHeaderMoney } from "./BsHeaderMoney";
8
+ export { default as BsHeaderNumber } from "./BsHeaderNumber";
9
+ export { default as BsHeaderShare } from "./BsHeaderShare";
10
+ export { default as BsHeaderType } from "./BsHeaderType";
11
+ export { default as BsHeaderGood } from "./BsHeaderGood";
@@ -1,10 +1,11 @@
1
1
  export { default as BsType } from "./BsType";
2
2
  export { default as BsMemo } from "./BsMemo";
3
- export { default as BsChildPic } from "./BsChildPic";
4
- export { default as BsChildName } from "./BsChildName";
5
- export { default as BsChildCode } from "./BsChildCode";
6
- export { default as BsChildSku } from "./BsChildSku";
7
- export { default as BsChildMoney } from "./BsChildMoney";
8
- export { default as BsChildNumber } from "./BsChildNumber";
9
- export { default as BsChildShare } from "./BsChildShare";
10
- export { default as BsChildType } from "./BsChildType";
3
+ export { default as BsHeaderPic } from "./BsHeaderPic";
4
+ export { default as BsHeaderName } from "./BsHeaderName";
5
+ export { default as BsHeaderCode } from "./BsHeaderCode";
6
+ export { default as BsHeaderSku } from "./BsHeaderSku";
7
+ export { default as BsHeaderMoney } from "./BsHeaderMoney";
8
+ export { default as BsHeaderNumber } from "./BsHeaderNumber";
9
+ export { default as BsHeaderShare } from "./BsHeaderShare";
10
+ export { default as BsHeaderType } from "./BsHeaderType";
11
+ export { default as BsHeaderGood } from "./BsHeaderGood";
@@ -60,7 +60,11 @@ var EBuyerNick = /*#__PURE__*/_createClass(function EBuyerNick(options) {
60
60
  if (buyerNick === undefined && buyerOpenUid === undefined) {
61
61
  return /*#__PURE__*/React.createElement("span", null, "--");
62
62
  }
63
- return /*#__PURE__*/React.createElement("span", null, buyerNick && /*#__PURE__*/React.createElement(PlatBuyer, {
63
+ return /*#__PURE__*/React.createElement("span", {
64
+ onClick: function onClick(e) {
65
+ return e.stopPropagation();
66
+ }
67
+ }, buyerNick && /*#__PURE__*/React.createElement(PlatBuyer, {
64
68
  shopId: record === null || record === void 0 ? void 0 : record.shopId,
65
69
  buyerNick: buyerNick,
66
70
  buyerOpenUid: buyerOpenUid,
@@ -12,6 +12,7 @@ declare class BasicCascader implements ComponentInterface {
12
12
  canSort: boolean;
13
13
  children: ComponentInterface[];
14
14
  dataType: ComponentInterface['dataType'];
15
+ format: ComponentInterface['format'];
15
16
  constructor(options: PickOption);
16
17
  /**
17
18
  * 通过值计算展示内容
@@ -28,6 +28,7 @@ var BasicCascader = /*#__PURE__*/_createClass(function BasicCascader(_options) {
28
28
  _defineProperty(this, "canSort", void 0);
29
29
  _defineProperty(this, "children", void 0);
30
30
  _defineProperty(this, "dataType", void 0);
31
+ _defineProperty(this, "format", void 0);
31
32
  _defineProperty(this, "getValue", function (value) {
32
33
  var _findLabelBySelectVal, _findLabelBySelectVal2, _this$componentConfig;
33
34
  return (_findLabelBySelectVal = findLabelBySelectValue(value, (_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.options)) === null || _findLabelBySelectVal === void 0 ? void 0 : (_findLabelBySelectVal2 = _findLabelBySelectVal.map(function (i) {
@@ -139,7 +140,8 @@ var BasicCascader = /*#__PURE__*/_createClass(function BasicCascader(_options) {
139
140
  this.children = [];
140
141
  this.isCombinationComponent = false;
141
142
  this.canSort = true;
142
- this.dataType = 'object'; // FIXME: 多级下拉这种不知道要如何去做条件判断
143
+ this.dataType = 'array';
144
+ this.format = 'cascader';
143
145
  }
144
146
 
145
147
  /**
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  declare type getFormItemProps = {
3
3
  name: string;
4
4
  title: string;
@@ -19,6 +19,11 @@ export declare const BsGoodImage: ({ item, index }: {
19
19
  item: any;
20
20
  index: number;
21
21
  }) => React.JSX.Element;
22
- export declare const BsExchangeList: ({ list }: any) => React.JSX.Element;
22
+ export declare const BsExchangeList: ({ list, showHeader }: any) => React.JSX.Element;
23
23
  export declare const BsGoodPic: (list: string[]) => React.JSX.Element[];
24
+ export declare const BsGoodsTable: ({ list, showHeader, text, }: {
25
+ list: any[];
26
+ showHeader: string[];
27
+ text?: string | undefined;
28
+ }) => React.JSX.Element;
24
29
  export {};
@@ -1,12 +1,16 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
4
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
1
5
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
6
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
7
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
8
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
9
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- import { Form, Button, Modal, Tooltip, Space, Image, Popover } from "antd";
8
- import React, { useState } from "react";
9
- import { ExpressData } from "@kmkf-fe-packages/kmkf-utils";
11
+ import { Form, Button, Modal, Tooltip, Space, Image, Popover, Table } from 'antd';
12
+ import React, { useState, useMemo } from 'react';
13
+ import { ExpressData } from '@kmkf-fe-packages/kmkf-utils';
10
14
  import styles from "./index.module.less";
11
15
  import defaultImg from "./img/default-img.png";
12
16
  export var getFormItem = function getFormItem(_ref) {
@@ -26,7 +30,7 @@ export var getFormItem = function getFormItem(_ref) {
26
30
  return /*#__PURE__*/React.createElement("div", {
27
31
  className: "form-item--wrap",
28
32
  style: {
29
- position: "relative"
33
+ position: 'relative'
30
34
  }
31
35
  }, /*#__PURE__*/React.createElement(Form.Item, {
32
36
  name: name,
@@ -40,43 +44,43 @@ export var showImage = function showImage(_ref2) {
40
44
  var item = _ref2.item,
41
45
  type = _ref2.type,
42
46
  index = _ref2.index;
43
- var picUrl = item.picUrl ? (item === null || item === void 0 ? void 0 : item.platform) !== "tabao" ? item.picUrl : item.picUrl + "_40x40.jpg" : defaultImg;
47
+ var picUrl = item.picUrl ? (item === null || item === void 0 ? void 0 : item.platform) !== 'tabao' ? item.picUrl : item.picUrl + '_40x40.jpg' : defaultImg;
44
48
  return /*#__PURE__*/React.createElement("div", {
45
49
  className: styles.goodImgBox,
46
50
  key: index
47
- }, (item === null || item === void 0 ? void 0 : item.platform) === "taobao" ? /*#__PURE__*/React.createElement("a", {
51
+ }, (item === null || item === void 0 ? void 0 : item.platform) === 'taobao' ? /*#__PURE__*/React.createElement("a", {
48
52
  target: "_blank",
49
53
  href: "https://item.taobao.com/item.htm?id=".concat(item.numIid)
50
54
  }, /*#__PURE__*/React.createElement("img", {
51
55
  style: {
52
- width: "40px",
53
- height: "40px",
54
- objectFit: "contain"
56
+ width: '40px',
57
+ height: '40px',
58
+ objectFit: 'contain'
55
59
  },
56
60
  src: picUrl
57
61
  })) : /*#__PURE__*/React.createElement("img", {
58
62
  style: {
59
- width: "40px",
60
- height: "40px",
61
- objectFit: "contain"
63
+ width: '40px',
64
+ height: '40px',
65
+ objectFit: 'contain'
62
66
  },
63
67
  src: picUrl
64
68
  }), /*#__PURE__*/React.createElement("div", {
65
69
  className: styles.options
66
- }, type === "itemId" && /*#__PURE__*/React.createElement(TextTool, {
67
- title: "商品id",
70
+ }, type === 'itemId' && /*#__PURE__*/React.createElement(TextTool, {
71
+ title: '商品id',
68
72
  text: item.numIid
69
- }), type === "itemCode" && /*#__PURE__*/React.createElement(TextTool, {
70
- title: "商品编码",
73
+ }), type === 'itemCode' && /*#__PURE__*/React.createElement(TextTool, {
74
+ title: '商品编码',
71
75
  text: item.outerId
72
- }), (type === "itemThird" || type === "jstItemThird") && (item.itemId || item.supplierItemOuterId) && /*#__PURE__*/React.createElement(TextTool, {
73
- title: "供应商编码",
76
+ }), (type === 'itemThird' || type === 'jstItemThird') && (item.itemId || item.supplierItemOuterId) && /*#__PURE__*/React.createElement(TextTool, {
77
+ title: '供应商编码',
74
78
  text: item.itemId || item.supplierItemOuterId
75
- }), (type === "itemThird" || type === "jstItemThird") && item.supplierName && /*#__PURE__*/React.createElement(TextTool, {
76
- title: "供应商名称",
79
+ }), (type === 'itemThird' || type === 'jstItemThird') && item.supplierName && /*#__PURE__*/React.createElement(TextTool, {
80
+ title: '供应商名称',
77
81
  text: item.supplierName
78
82
  }), item.propertiesName && /*#__PURE__*/React.createElement(TextTool, {
79
- title: "规格",
83
+ title: '规格',
80
84
  text: item.propertiesName
81
85
  })));
82
86
  };
@@ -89,9 +93,9 @@ var TextTool = function TextTool(_ref3) {
89
93
  title: text
90
94
  }, /*#__PURE__*/React.createElement("div", {
91
95
  style: {
92
- overflow: "hidden",
93
- whiteSpace: "nowrap",
94
- textOverflow: "ellipsis"
96
+ overflow: 'hidden',
97
+ whiteSpace: 'nowrap',
98
+ textOverflow: 'ellipsis'
95
99
  }
96
100
  }, title, ":", text));
97
101
  };
@@ -111,7 +115,7 @@ export var ShowTotalImage = function ShowTotalImage(_ref4) {
111
115
  return setVisible(true);
112
116
  }
113
117
  }, "\u67E5\u770B\u5168\u90E8(".concat(total, ")")), /*#__PURE__*/React.createElement(Modal, {
114
- open: visible,
118
+ visible: visible,
115
119
  footer: null,
116
120
  onCancel: function onCancel() {
117
121
  return setVisible(false);
@@ -119,47 +123,47 @@ export var ShowTotalImage = function ShowTotalImage(_ref4) {
119
123
  title: "\u6240\u6709\u9009\u62E9\u5B9D\u8D1D"
120
124
  }, /*#__PURE__*/React.createElement("div", {
121
125
  style: {
122
- display: "flex",
123
- flexWrap: "wrap"
126
+ display: 'flex',
127
+ flexWrap: 'wrap'
124
128
  }
125
129
  }, allImage.map(function (i, index) {
126
130
  return /*#__PURE__*/React.createElement("div", {
127
131
  style: {
128
- width: "50%"
132
+ width: '50%'
129
133
  },
130
134
  key: index
131
135
  }, /*#__PURE__*/React.createElement("a", {
132
136
  href: i.link,
133
137
  target: "__blank",
134
138
  style: {
135
- marginRight: "12px",
136
- marginTop: "8px",
137
- padding: "2px",
138
- border: "1px dashed #ccc",
139
- display: "inline-block"
139
+ marginRight: '12px',
140
+ marginTop: '8px',
141
+ padding: '2px',
142
+ border: '1px dashed #ccc',
143
+ display: 'inline-block'
140
144
  }
141
145
  }, /*#__PURE__*/React.createElement("img", {
142
146
  alt: "",
143
147
  src: i.picUrl || defaultImg,
144
148
  style: {
145
- width: "72px",
146
- height: "72px",
147
- objectFit: "contain"
149
+ width: '72px',
150
+ height: '72px',
151
+ objectFit: 'contain'
148
152
  }
149
- })), /*#__PURE__*/React.createElement("div", null, type === "itemId" && /*#__PURE__*/React.createElement(TextTool, {
150
- title: "商品id",
153
+ })), /*#__PURE__*/React.createElement("div", null, type === 'itemId' && /*#__PURE__*/React.createElement(TextTool, {
154
+ title: '商品id',
151
155
  text: i.numIid
152
- }), type === "itemCode" && /*#__PURE__*/React.createElement(TextTool, {
153
- title: "商品编码",
156
+ }), type === 'itemCode' && /*#__PURE__*/React.createElement(TextTool, {
157
+ title: '商品编码',
154
158
  text: i.outerId
155
- }), (type === "itemThird" || type === "jstItemThird") && (i.itemId || i.supplierItemOuterId) && /*#__PURE__*/React.createElement(TextTool, {
156
- title: "供应商编码",
159
+ }), (type === 'itemThird' || type === 'jstItemThird') && (i.itemId || i.supplierItemOuterId) && /*#__PURE__*/React.createElement(TextTool, {
160
+ title: '供应商编码',
157
161
  text: i.itemId || i.supplierItemOuterId
158
- }), (type === "itemThird" || type === "jstItemThird") && i.supplierName && /*#__PURE__*/React.createElement(TextTool, {
159
- title: "供应商名称",
162
+ }), (type === 'itemThird' || type === 'jstItemThird') && i.supplierName && /*#__PURE__*/React.createElement(TextTool, {
163
+ title: '供应商名称',
160
164
  text: i.supplierName
161
165
  }), i.propertiesName && /*#__PURE__*/React.createElement(TextTool, {
162
- title: "规格",
166
+ title: '规格',
163
167
  text: i.propertiesName
164
168
  })));
165
169
  }))));
@@ -169,12 +173,12 @@ export var GoodImage = function GoodImage(_ref5) {
169
173
  var _list$slice;
170
174
  var list = _ref5.list,
171
175
  _ref5$type = _ref5.type,
172
- type = _ref5$type === void 0 ? "" : _ref5$type;
176
+ type = _ref5$type === void 0 ? '' : _ref5$type;
173
177
  var total = (list === null || list === void 0 ? void 0 : list.length) || 0;
174
178
  var initShowTotal = 3;
175
179
  return (list === null || list === void 0 ? void 0 : list.length) > 0 ? /*#__PURE__*/React.createElement("div", {
176
180
  style: {
177
- display: type === "itemSelect" ? "flex" : "block"
181
+ display: type === 'itemSelect' ? 'flex' : 'block'
178
182
  }
179
183
  }, list === null || list === void 0 ? void 0 : (_list$slice = list.slice(0, initShowTotal)) === null || _list$slice === void 0 ? void 0 : _list$slice.map(function (item, index) {
180
184
  return showImage({
@@ -191,7 +195,7 @@ export var GoodImage = function GoodImage(_ref5) {
191
195
  var content = function content(item, index) {
192
196
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
193
197
  style: {
194
- textAlign: "center"
198
+ textAlign: 'center'
195
199
  }
196
200
  }, "\u5305\u88F9".concat(index + 1, "\u5546\u54C1\u4FE1\u606F")), ((item === null || item === void 0 ? void 0 : item.items) || []).map(function (t, index) {
197
201
  return /*#__PURE__*/React.createElement("div", {
@@ -211,14 +215,17 @@ export var JstGoodImage = function JstGoodImage(_ref6) {
211
215
  var logisticsCompany = item.logisticsCompany;
212
216
  var company = ExpressData.getInstance().getExpressNameByCode(logisticsCompany);
213
217
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Popover, {
214
- content: content(item, index)
218
+ content: content(item, index),
219
+ overlayStyle: {
220
+ zIndex: 1080
221
+ }
215
222
  }, /*#__PURE__*/React.createElement("span", {
216
223
  key: index,
217
224
  style: {
218
- color: "#1890ff",
219
- cursor: "pointer"
225
+ color: '#1890ff',
226
+ cursor: 'pointer'
220
227
  }
221
- }, "\u5305\u88F9".concat(index + 1), ":")), type === 1 ? /*#__PURE__*/React.createElement("span", null, company && item.logisticsCode ? [company, item.logisticsCode].join("/") : company ? company : item.logisticsCode) : null, type === 2 ? /*#__PURE__*/React.createElement("span", null, item.supplyName && item.supplyId ? [item.supplyId, item.supplyName].join("/") : item.supplyId ? item.supplyId : item.supplyName) : null, type === 3 ? /*#__PURE__*/React.createElement("span", null, item.sendName && item.sendId ? [item.sendId, item.sendName].join("/") : item.sendId ? item.sendId : item.sendName) : null));
228
+ }, "\u5305\u88F9".concat(index + 1), ":")), type === 1 ? /*#__PURE__*/React.createElement("span", null, company && item.logisticsCode ? [company, item.logisticsCode].join('/') : company ? company : item.logisticsCode) : null, type === 2 ? /*#__PURE__*/React.createElement("span", null, item.supplyName && item.supplyId ? [item.supplyId, item.supplyName].join('/') : item.supplyId ? item.supplyId : item.supplyName) : null, type === 3 ? /*#__PURE__*/React.createElement("span", null, item.sendName && item.sendId ? [item.sendId, item.sendName].join('/') : item.sendId ? item.sendId : item.sendName) : null));
222
229
  }) : null;
223
230
  };
224
231
  //bs商品展示 todo
@@ -227,22 +234,22 @@ export var BsGoodImage = function BsGoodImage(_ref7) {
227
234
  index = _ref7.index;
228
235
  var picUrl = item.picUrl || defaultImg;
229
236
  var keyMap = {
230
- name: "bs名称",
231
- code: "bs编码",
232
- skuId: "bssku编码",
233
- money: "bs实付金额",
234
- number: "bs数量",
235
- share: "bs分摊价",
236
- type: "bs赠品类型"
237
+ name: 'bs名称',
238
+ code: 'bs编码',
239
+ skuId: 'bssku编码',
240
+ money: 'bs实付金额',
241
+ number: 'bs数量',
242
+ share: 'bs分摊价',
243
+ type: 'bs赠品类型'
237
244
  };
238
245
  return /*#__PURE__*/React.createElement("div", {
239
246
  className: styles.goodImgBox,
240
247
  key: index
241
248
  }, /*#__PURE__*/React.createElement("img", {
242
249
  style: {
243
- width: "40px",
244
- height: "40px",
245
- objectFit: "contain"
250
+ width: '40px',
251
+ height: '40px',
252
+ objectFit: 'contain'
246
253
  },
247
254
  src: picUrl
248
255
  }), /*#__PURE__*/React.createElement("div", {
@@ -256,25 +263,20 @@ export var BsGoodImage = function BsGoodImage(_ref7) {
256
263
  };
257
264
  //bs换货 todo
258
265
  export var BsExchangeList = function BsExchangeList(_ref8) {
259
- var list = _ref8.list;
266
+ var list = _ref8.list,
267
+ showHeader = _ref8.showHeader;
260
268
  return /*#__PURE__*/React.createElement("div", {
261
269
  className: styles.bsImgBox
262
270
  }, list.map(function (item) {
263
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
264
- className: styles.bsImgItem
265
- }, ((item === null || item === void 0 ? void 0 : item.returnGood) || []).map(function (t, i) {
266
- return BsGoodImage({
267
- item: t,
268
- index: i
269
- });
270
- })), "==>", /*#__PURE__*/React.createElement("div", {
271
- className: styles.bsImgItem
272
- }, ((item === null || item === void 0 ? void 0 : item.returnGood) || []).map(function (t, i) {
273
- return BsGoodImage({
274
- item: t,
275
- index: i
276
- });
277
- })));
271
+ return /*#__PURE__*/React.createElement(React.Fragment, null, BsGoodsTable({
272
+ list: (item === null || item === void 0 ? void 0 : item.bsExchangeReturnGoods) || [],
273
+ showHeader: showHeader,
274
+ text: '退回'
275
+ }), BsGoodsTable({
276
+ list: item === null || item === void 0 ? void 0 : item.bsExchangeSwapOutGoods,
277
+ showHeader: showHeader,
278
+ text: '换出'
279
+ }));
278
280
  }));
279
281
  };
280
282
  //bs图片展示
@@ -285,4 +287,100 @@ export var BsGoodPic = function BsGoodPic(list) {
285
287
  src: t
286
288
  });
287
289
  });
290
+ };
291
+ export var BsGoodsTable = function BsGoodsTable(_ref9) {
292
+ var list = _ref9.list,
293
+ showHeader = _ref9.showHeader,
294
+ _ref9$text = _ref9.text,
295
+ text = _ref9$text === void 0 ? '' : _ref9$text;
296
+ //商品信息
297
+ var GOODS_INFO_COLUMNS = function GOODS_INFO_COLUMNS() {
298
+ var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
299
+ return [{
300
+ dataIndex: 'pic',
301
+ title: "\u56FE\u7247",
302
+ align: 'center',
303
+ ellipsis: true,
304
+ width: 100,
305
+ render: function render(val) {
306
+ return /*#__PURE__*/React.createElement(Image, {
307
+ width: 60,
308
+ src: val
309
+ });
310
+ }
311
+ }, {
312
+ dataIndex: 'name',
313
+ title: "".concat(text, "\u540D\u79F0"),
314
+ align: 'center',
315
+ ellipsis: true,
316
+ width: 100
317
+ }, {
318
+ dataIndex: 'code',
319
+ title: "".concat(text, "\u7F16\u7801"),
320
+ align: 'center',
321
+ ellipsis: true,
322
+ width: 100
323
+ }, {
324
+ dataIndex: 'sku',
325
+ title: "".concat(text, "sku\u7F16\u7801"),
326
+ align: 'center',
327
+ ellipsis: true,
328
+ width: 100
329
+ }, {
330
+ dataIndex: 'money',
331
+ title: "\u5B9E\u4ED8\u91D1\u989D",
332
+ align: 'center',
333
+ ellipsis: true,
334
+ width: 100
335
+ }, {
336
+ dataIndex: 'number',
337
+ title: "".concat(text, "\u6570\u91CF"),
338
+ align: 'center',
339
+ ellipsis: true,
340
+ width: 100,
341
+ render: function render(val, record, index) {
342
+ return /*#__PURE__*/React.createElement("span", null, val);
343
+ }
344
+ }, {
345
+ dataIndex: 'share',
346
+ title: "\u5206\u644A\u4EF7",
347
+ align: 'center',
348
+ ellipsis: true,
349
+ width: 70
350
+ }, {
351
+ dataIndex: 'type',
352
+ title: "\u8D60\u54C1\u7C7B\u578B",
353
+ align: 'center',
354
+ ellipsis: true,
355
+ width: 100
356
+ }];
357
+ };
358
+ var newColumns = useMemo(function () {
359
+ var columnList = [{
360
+ dataIndex: '',
361
+ title: '序号',
362
+ align: 'center',
363
+ ellipsis: true,
364
+ width: 50,
365
+ render: function render(val, record, index) {
366
+ return /*#__PURE__*/React.createElement("span", null, index + 1);
367
+ }
368
+ }].concat(_toConsumableArray(GOODS_INFO_COLUMNS(text).filter(function (t) {
369
+ return showHeader.includes(t === null || t === void 0 ? void 0 : t.dataIndex);
370
+ })));
371
+ return columnList;
372
+ }, [showHeader, list]);
373
+ return /*#__PURE__*/React.createElement(Table, {
374
+ columns: newColumns,
375
+ dataSource: list,
376
+ rowKey: 'id',
377
+ size: "small",
378
+ pagination: false,
379
+ scroll: {
380
+ x: '100%'
381
+ },
382
+ locale: {
383
+ emptyText: '暂无数据'
384
+ }
385
+ });
288
386
  };