@kmkf-fe-packages/services-components 0.7.15-alpha.4 → 0.7.15-alpha.42

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 (55) hide show
  1. package/dist/esm/commonComponents/QueryLogisticsTrack/index.js +23 -21
  2. package/dist/esm/components/BS/BsExchange/index.js +166 -93
  3. package/dist/esm/components/BS/BsGoods/index.d.ts +4 -4
  4. package/dist/esm/components/BS/BsGoods/index.js +68 -54
  5. package/dist/esm/components/BS/BsLogistics/index.d.ts +7 -7
  6. package/dist/esm/components/BS/BsLogistics/index.js +14 -14
  7. package/dist/esm/components/BS/BsReissue/index.d.ts +3 -0
  8. package/dist/esm/components/BS/BsReissue/index.js +72 -41
  9. package/dist/esm/components/BS/common/{BsChildPic.d.ts → BsHeaderPic.d.ts} +4 -4
  10. package/dist/esm/components/BS/common/{BsChildPic.js → BsHeaderPic.js} +7 -7
  11. package/dist/esm/components/BS/common/BsMemo.js +3 -3
  12. package/dist/esm/components/BS/common/BsType.js +3 -2
  13. package/dist/esm/components/BS/common/index.d.ts +10 -10
  14. package/dist/esm/components/BS/common/index.js +8 -8
  15. package/dist/esm/components/Cascader/index.d.ts +1 -0
  16. package/dist/esm/components/Cascader/index.js +3 -1
  17. package/dist/esm/components/Common/index.d.ts +5 -0
  18. package/dist/esm/components/Common/index.js +102 -2
  19. package/dist/esm/components/DataTime/ApaasDate.d.ts +2 -2
  20. package/dist/esm/components/EItemEnCode/ItemEncode.d.ts +2 -2
  21. package/dist/esm/components/EItemId/ItemId.d.ts +2 -2
  22. package/dist/esm/components/EItemSelect/ItemSelect.d.ts +2 -2
  23. package/dist/esm/components/ExpressCompany/index.d.ts +2 -2
  24. package/dist/esm/components/File/index.js +2 -2
  25. package/dist/esm/components/JST/JstLogistics/index.js +25 -8
  26. package/dist/esm/components/LogisticsTrajectory/index.d.ts +0 -2
  27. package/dist/esm/components/LogisticsTrajectory/trajectoryCode.js +5 -4
  28. package/dist/esm/components/LogisticsTrajectory/trajectoryCompany.d.ts +0 -1
  29. package/dist/esm/components/LogisticsTrajectory/trajectoryCompany.js +2 -8
  30. package/dist/esm/components/LogisticsTrajectory/trajectorySnapshot.d.ts +0 -1
  31. package/dist/esm/components/LogisticsTrajectory/trajectorySnapshot.js +3 -9
  32. package/dist/esm/components/Payment/BuyerNick.js +1 -2
  33. package/dist/esm/components/Payment/index.d.ts +1 -0
  34. package/dist/esm/components/Payment/index.js +9 -6
  35. package/dist/esm/components/Popover/index.d.ts +2 -2
  36. package/dist/esm/components/PostIng/index.js +2 -2
  37. package/dist/esm/components/ThirdItemSelect/ItemEncode.d.ts +2 -2
  38. package/dist/esm/factory.d.ts +2 -2
  39. package/dist/esm/factory.js +2 -3
  40. package/dist/esm/type.d.ts +3 -1
  41. package/package.json +4 -4
  42. /package/dist/esm/components/BS/common/{BsChildCode.d.ts → BsHeaderCode.d.ts} +0 -0
  43. /package/dist/esm/components/BS/common/{BsChildCode.js → BsHeaderCode.js} +0 -0
  44. /package/dist/esm/components/BS/common/{BsChildMoney.d.ts → BsHeaderMoney.d.ts} +0 -0
  45. /package/dist/esm/components/BS/common/{BsChildMoney.js → BsHeaderMoney.js} +0 -0
  46. /package/dist/esm/components/BS/common/{BsChildName.d.ts → BsHeaderName.d.ts} +0 -0
  47. /package/dist/esm/components/BS/common/{BsChildName.js → BsHeaderName.js} +0 -0
  48. /package/dist/esm/components/BS/common/{BsChildNumber.d.ts → BsHeaderNumber.d.ts} +0 -0
  49. /package/dist/esm/components/BS/common/{BsChildNumber.js → BsHeaderNumber.js} +0 -0
  50. /package/dist/esm/components/BS/common/{BsChildShare.d.ts → BsHeaderShare.d.ts} +0 -0
  51. /package/dist/esm/components/BS/common/{BsChildShare.js → BsHeaderShare.js} +0 -0
  52. /package/dist/esm/components/BS/common/{BsChildSku.d.ts → BsHeaderSku.d.ts} +0 -0
  53. /package/dist/esm/components/BS/common/{BsChildSku.js → BsHeaderSku.js} +0 -0
  54. /package/dist/esm/components/BS/common/{BsChildType.d.ts → BsHeaderType.d.ts} +0 -0
  55. /package/dist/esm/components/BS/common/{BsChildType.js → BsHeaderType.js} +0 -0
@@ -9,7 +9,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
9
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; } }
10
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
11
  import React, { useState } from "react";
12
- import { Modal, Timeline, message, Input } from "antd";
12
+ import { Modal, Timeline, message } from "antd";
13
13
  import { request } from "@kmkf-fe-packages/kmkf-utils";
14
14
  var info = Modal.info;
15
15
  var QueryLogisticsTrack = function QueryLogisticsTrack(_ref) {
@@ -48,24 +48,26 @@ var QueryLogisticsTrack = function QueryLogisticsTrack(_ref) {
48
48
  }
49
49
  return _context.abrupt("return", message.error("缺少物流公司或物流单号"));
50
50
  case 2:
51
+ logisticsTraceSearch();
51
52
  //如果是顺丰且没有手机号 要输入手机号
52
- if (interceptCompany === "SF" && !interceptSenderMobile) {
53
- Modal.confirm({
54
- title: "输入手机号",
55
- okText: "确定",
56
- cancelText: "取消",
57
- content: /*#__PURE__*/React.createElement(Input, {
58
- onChange: function onChange(e) {
59
- return setInputVal(e.target.value);
60
- }
61
- }),
62
- onOk: function onOk() {
63
- logisticsTraceSearch(inputVal);
64
- }
65
- });
66
- } else {
67
- logisticsTraceSearch();
68
- }
53
+ // if (interceptCompany === "SF" && !interceptSenderMobile) {
54
+ // Modal.confirm({
55
+ // title: "查询物流轨迹",
56
+ // okText: "查询",
57
+ // cancelText: "取消",
58
+ // content: (
59
+ // <div>
60
+ // 发件人手机号
61
+ // <Input onChange={(e) => setInputVal(e.target.value)}></Input>
62
+ // </div>
63
+ // ),
64
+ // onOk: () => {
65
+ // logisticsTraceSearch(inputVal);
66
+ // },
67
+ // });
68
+ // } else {
69
+ // logisticsTraceSearch();
70
+ // }
69
71
  case 3:
70
72
  case "end":
71
73
  return _context.stop();
@@ -93,17 +95,17 @@ var QueryLogisticsTrack = function QueryLogisticsTrack(_ref) {
93
95
  var result = res.result,
94
96
  success = res.success,
95
97
  data = res.data,
96
- message = res.message;
98
+ msg = res.message;
97
99
  if (result === 100 || success) {
98
100
  info({
99
101
  title: "物流轨迹",
100
102
  okText: "确定",
101
103
  icon: null,
102
104
  width: modelWidth,
103
- content: LogisticsList(data)
105
+ content: LogisticsList(data === null || data === void 0 ? void 0 : data.traceDetailList)
104
106
  });
105
107
  } else {
106
- message && message.error(message);
108
+ msg && message.error(msg);
107
109
  }
108
110
  });
109
111
  } catch (err) {
@@ -1,4 +1,10 @@
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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
+ 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."); }
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 _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
7
+ 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; }
2
8
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
9
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
10
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
@@ -10,15 +16,120 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
10
16
  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); }
11
17
  import React from "react";
12
18
  import GetFormItem from "../../GetFormItem";
13
- import { GoodImage } from "../../Common";
19
+ import { BsGoodsTable } from "../../Common";
14
20
  import ItemView from "../../../commonComponents/ItemView";
15
21
  import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
16
22
  import { BsExchange as Exchange } from "@kmkf-fe-packages/basic-components";
17
23
  import { SYMBOL } from "../../../constant";
18
24
  import BsExchangeImage from "../common/BsExchangeImage";
19
- import { BsType, BsMemo, BsChildPic, BsChildName, BsChildCode, BsChildSku, BsChildMoney, BsChildNumber, BsChildShare, BsChildType } from "../common/index";
25
+ import { BsType, BsMemo, BsHeaderPic, BsHeaderName, BsHeaderCode, BsHeaderSku, BsHeaderMoney, BsHeaderNumber, BsHeaderShare, BsHeaderType } from "../common/index";
26
+ var returnHeaderMap = {
27
+ pic: {
28
+ component: BsHeaderPic,
29
+ name: "退回图片"
30
+ },
31
+ name: {
32
+ component: BsHeaderName,
33
+ name: "退回名称"
34
+ },
35
+ code: {
36
+ component: BsHeaderCode,
37
+ name: "退回编码"
38
+ },
39
+ sku: {
40
+ component: BsHeaderSku,
41
+ name: "退回sku编码"
42
+ },
43
+ money: {
44
+ component: BsHeaderMoney,
45
+ name: "退回实付金额"
46
+ },
47
+ number: {
48
+ component: BsHeaderNumber,
49
+ name: "退回数量"
50
+ },
51
+ share: {
52
+ component: BsHeaderShare,
53
+ name: "退回分摊价"
54
+ },
55
+ type: {
56
+ component: BsHeaderType,
57
+ name: "退回赠品类型"
58
+ }
59
+ };
60
+ var swapOutHeaderMap = {
61
+ pic: {
62
+ component: BsHeaderPic,
63
+ name: "换出图片"
64
+ },
65
+ name: {
66
+ component: BsHeaderName,
67
+ name: "换出名称"
68
+ },
69
+ code: {
70
+ component: BsHeaderCode,
71
+ name: "换出编码"
72
+ },
73
+ sku: {
74
+ component: BsHeaderSku,
75
+ name: "换出sku编码"
76
+ },
77
+ money: {
78
+ component: BsHeaderMoney,
79
+ name: "换出实付金额"
80
+ },
81
+ number: {
82
+ component: BsHeaderNumber,
83
+ name: "换出数量"
84
+ },
85
+ share: {
86
+ component: BsHeaderShare,
87
+ name: "换出分摊价"
88
+ },
89
+ type: {
90
+ component: BsHeaderType,
91
+ name: "换出赠品类型"
92
+ }
93
+ };
94
+ var giftHeaderMap = {
95
+ pic: {
96
+ component: BsHeaderPic,
97
+ name: "赠品图片"
98
+ },
99
+ name: {
100
+ component: BsHeaderName,
101
+ name: "赠品名称"
102
+ },
103
+ code: {
104
+ component: BsHeaderCode,
105
+ name: "赠品编码"
106
+ },
107
+ sku: {
108
+ component: BsHeaderSku,
109
+ name: "赠品sku编码"
110
+ },
111
+ money: {
112
+ component: BsHeaderMoney,
113
+ name: "赠品实付金额"
114
+ },
115
+ number: {
116
+ component: BsHeaderNumber,
117
+ name: "赠品数量"
118
+ },
119
+ share: {
120
+ component: BsHeaderShare,
121
+ name: "赠品分摊价"
122
+ },
123
+ type: {
124
+ component: BsHeaderType,
125
+ name: "赠品赠品类型"
126
+ }
127
+ };
20
128
  var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
21
- var _this = this;
129
+ var _this = this,
130
+ _options$componentCon,
131
+ _options$componentCon2,
132
+ _options$componentCon3;
22
133
  _classCallCheck(this, BsExchange);
23
134
  _defineProperty(this, "name", void 0);
24
135
  _defineProperty(this, "id", void 0);
@@ -36,14 +147,30 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
36
147
  _defineProperty(this, "bsType", void 0);
37
148
  _defineProperty(this, "bsMemo", void 0);
38
149
  _defineProperty(this, "renderClient", function (record) {
39
- return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
150
+ var _this$componentConfig, _this$componentConfig2, _record, _record$bsExchangeTyp, _this$componentConfig3;
151
+ console.log("bsexchange", record);
152
+ return !isNull(record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) ? /*#__PURE__*/React.createElement(React.Fragment, null, _this.bsType.renderClient(record), _this.bsMemo.renderClient(record), /*#__PURE__*/React.createElement(ItemView, {
40
153
  id: _this.id,
41
- label: _this.name,
42
- value: /*#__PURE__*/React.createElement(GoodImage, {
43
- list: _this.getComponentValue(record),
44
- type: "itemId"
154
+ label: "".concat(_this.name, "-\u9000\u56DE"),
155
+ value: /*#__PURE__*/React.createElement(BsGoodsTable, {
156
+ list: (record === null || record === void 0 ? void 0 : record["".concat(_this.id)].bsExchangeReturnGoods) || [],
157
+ showHeader: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.showHeader) || []
45
158
  })
46
- }) : null;
159
+ }), /*#__PURE__*/React.createElement(ItemView, {
160
+ id: _this.id,
161
+ label: "".concat(_this.name, "-\u6362\u51FA"),
162
+ value: /*#__PURE__*/React.createElement(BsGoodsTable, {
163
+ list: (record === null || record === void 0 ? void 0 : record["".concat(_this.id)].bsExchangeSwapOutGoods) || [],
164
+ showHeader: ((_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.showHeader) || []
165
+ })
166
+ }), ["3", "4"].includes(record === null || record === void 0 ? void 0 : (_record = record["".concat(_this.id)]) === null || _record === void 0 ? void 0 : (_record$bsExchangeTyp = _record.bsExchangeType) === null || _record$bsExchangeTyp === void 0 ? void 0 : _record$bsExchangeTyp[0]) ? /*#__PURE__*/React.createElement(ItemView, {
167
+ id: _this.id,
168
+ label: "".concat(_this.name, "-\u8D60\u54C1"),
169
+ value: /*#__PURE__*/React.createElement(BsGoodsTable, {
170
+ list: (record === null || record === void 0 ? void 0 : record["".concat(_this.id)].bsExchangeGiftGoods) || [],
171
+ showHeader: ((_this$componentConfig3 = _this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.showHeader) || []
172
+ })
173
+ }) : null) : null;
47
174
  });
48
175
  _defineProperty(this, "renderPc", function () {
49
176
  return null;
@@ -58,7 +185,7 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
58
185
  return null;
59
186
  });
60
187
  _defineProperty(this, "editRender", function (p) {
61
- var _this$componentConfig, _this$effects, _this$effects2;
188
+ var _this$componentConfig4, _this$effects, _this$effects2;
62
189
  return /*#__PURE__*/React.createElement(GetFormItem, {
63
190
  title: _this.name,
64
191
  name: _this.id,
@@ -66,7 +193,7 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
66
193
  required: false,
67
194
  hidden: p === null || p === void 0 ? void 0 : p.hidden,
68
195
  component: /*#__PURE__*/React.createElement(Exchange, _extends({}, _this.componentConfig, {
69
- maxLength: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.maxLength) || 20,
196
+ maxLength: ((_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.maxLength) || 20,
70
197
  shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
71
198
  shopList: ((_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.shopList) || [],
72
199
  width: "90%"
@@ -115,99 +242,45 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
115
242
  this.formField = "".concat(options.id);
116
243
  this.type = options.type;
117
244
  this.effects = options === null || options === void 0 ? void 0 : options.effects;
118
- this.isCombinationComponent = false;
245
+ this.isCombinationComponent = true;
119
246
  this.canSort = false;
120
247
  this.goodImage = new BsExchangeImage(_objectSpread(_objectSpread({}, options), {}, {
121
248
  id: "".concat(options.id),
122
249
  name: "换货商品"
123
250
  }));
124
251
  this.bsType = new BsType(_objectSpread(_objectSpread({}, options), {}, {
125
- id: "".concat(options.id, "_bsReissueType"),
252
+ id: "".concat(options.id),
126
253
  name: "换货类型"
127
254
  }));
128
255
  this.bsMemo = new BsMemo(_objectSpread(_objectSpread({}, options), {}, {
129
- id: "".concat(options.id, "_bsReissueType"),
256
+ id: "".concat(options.id),
130
257
  name: "换货备注"
131
258
  }));
132
- this.children = [new BsType(_objectSpread(_objectSpread({}, options), {}, {
133
- id: "".concat(options.id, "_bsReissueType"),
134
- name: "换货类型"
135
- })), new BsMemo(_objectSpread(_objectSpread({}, options), {}, {
136
- id: "".concat(options.id, "_bsReissueType"),
137
- name: "换货备注"
138
- })), new BsChildPic(_objectSpread(_objectSpread({}, options), {}, {
139
- name: "退回图片",
140
- id: "".concat(options.id, "_bsExchangeReturnGoods")
141
- })), new BsChildName(_objectSpread(_objectSpread({}, options), {}, {
142
- name: "退回名称",
143
- id: "".concat(options.id, "_bsExchangeReturnGoods")
144
- })), new BsChildCode(_objectSpread(_objectSpread({}, options), {}, {
145
- name: "退回编码",
146
- id: "".concat(options.id, "_bsExchangeReturnGoods")
147
- })), new BsChildSku(_objectSpread(_objectSpread({}, options), {}, {
148
- name: "退回sku编码",
149
- id: "".concat(options.id, "_bsExchangeReturnGoods")
150
- })), new BsChildMoney(_objectSpread(_objectSpread({}, options), {}, {
151
- name: "退回实付金额",
152
- id: "".concat(options.id, "_bsExchangeReturnGoods")
153
- })), new BsChildNumber(_objectSpread(_objectSpread({}, options), {}, {
154
- name: "退回数量",
155
- id: "".concat(options.id, "_bsExchangeReturnGoods")
156
- })), new BsChildShare(_objectSpread(_objectSpread({}, options), {}, {
157
- name: "退回分摊价",
158
- id: "".concat(options.id, "_bsExchangeReturnGoods")
159
- })), new BsChildType(_objectSpread(_objectSpread({}, options), {}, {
160
- name: "退回赠品类型",
161
- id: "".concat(options.id, "_bsExchangeReturnGoods")
162
- })), new BsChildPic(_objectSpread(_objectSpread({}, options), {}, {
163
- name: "换出图片",
164
- id: "".concat(options.id, "_bsExchangeSwapOutGoods")
165
- })), new BsChildName(_objectSpread(_objectSpread({}, options), {}, {
166
- name: "换出名称",
167
- id: "".concat(options.id, "_bsExchangeSwapOutGoods")
168
- })), new BsChildCode(_objectSpread(_objectSpread({}, options), {}, {
169
- name: "换出编码",
170
- id: "".concat(options.id, "_bsExchangeSwapOutGoods")
171
- })), new BsChildSku(_objectSpread(_objectSpread({}, options), {}, {
172
- name: "换出sku编码",
173
- id: "".concat(options.id, "_bsExchangeSwapOutGoods")
174
- })), new BsChildMoney(_objectSpread(_objectSpread({}, options), {}, {
175
- name: "换出实付金额",
176
- id: "".concat(options.id, "_bsExchangeSwapOutGoods")
177
- })), new BsChildNumber(_objectSpread(_objectSpread({}, options), {}, {
178
- name: "换出数量",
179
- id: "".concat(options.id, "_bsExchangeSwapOutGoods")
180
- })), new BsChildShare(_objectSpread(_objectSpread({}, options), {}, {
181
- name: "换出分摊价",
182
- id: "".concat(options.id, "_bsExchangeSwapOutGoods")
183
- })), new BsChildType(_objectSpread(_objectSpread({}, options), {}, {
184
- name: "换出赠品类型",
185
- id: "".concat(options.id, "_bsExchangeSwapOutGoods")
186
- })), new BsChildPic(_objectSpread(_objectSpread({}, options), {}, {
187
- name: "赠品图片",
188
- id: "".concat(options.id, "_bsExchangeGiftGoods")
189
- })), new BsChildName(_objectSpread(_objectSpread({}, options), {}, {
190
- name: "赠品名称",
191
- id: "".concat(options.id, "_bsExchangeGiftGoods")
192
- })), new BsChildCode(_objectSpread(_objectSpread({}, options), {}, {
193
- name: "赠品编码",
194
- id: "".concat(options.id, "_bsExchangeGiftGoods")
195
- })), new BsChildSku(_objectSpread(_objectSpread({}, options), {}, {
196
- name: "赠品sku编码",
197
- id: "".concat(options.id, "_bsExchangeGiftGoods")
198
- })), new BsChildMoney(_objectSpread(_objectSpread({}, options), {}, {
199
- name: "赠品实付金额",
200
- id: "".concat(options.id, "_bsExchangeGiftGoods")
201
- })), new BsChildNumber(_objectSpread(_objectSpread({}, options), {}, {
202
- name: "赠品数量",
203
- id: "".concat(options.id, "_bsExchangeGiftGoods")
204
- })), new BsChildShare(_objectSpread(_objectSpread({}, options), {}, {
205
- name: "赠品分摊价",
206
- id: "".concat(options.id, "_bsExchangeGiftGoods")
207
- })), new BsChildType(_objectSpread(_objectSpread({}, options), {}, {
208
- name: "赠品赠品类型",
209
- id: "".concat(options.id, "_bsExchangeGiftGoods")
210
- }))];
259
+ this.children = [this.bsType, this.bsMemo].concat(_toConsumableArray(((options === null || options === void 0 ? void 0 : (_options$componentCon = options.componentConfig) === null || _options$componentCon === void 0 ? void 0 : _options$componentCon.showHeader) || []).reduce(function (prv, next) {
260
+ if (returnHeaderMap[next]) {
261
+ prv.push(new returnHeaderMap[next].component(_objectSpread(_objectSpread({}, options), {}, {
262
+ name: returnHeaderMap[next].name,
263
+ id: "".concat(options.id, "_bsExchangeReturnGoods")
264
+ })));
265
+ }
266
+ return prv;
267
+ }, [])), _toConsumableArray(((options === null || options === void 0 ? void 0 : (_options$componentCon2 = options.componentConfig) === null || _options$componentCon2 === void 0 ? void 0 : _options$componentCon2.showHeader) || []).reduce(function (prv, next) {
268
+ if (swapOutHeaderMap[next]) {
269
+ prv.push(new swapOutHeaderMap[next].component(_objectSpread(_objectSpread({}, options), {}, {
270
+ name: swapOutHeaderMap[next].name,
271
+ id: "".concat(options.id, "_bsExchangeSwapOutGoods")
272
+ })));
273
+ }
274
+ return prv;
275
+ }, [])), _toConsumableArray(((options === null || options === void 0 ? void 0 : (_options$componentCon3 = options.componentConfig) === null || _options$componentCon3 === void 0 ? void 0 : _options$componentCon3.showHeader) || []).reduce(function (prv, next) {
276
+ if (giftHeaderMap[next]) {
277
+ prv.push(new giftHeaderMap[next].component(_objectSpread(_objectSpread({}, options), {}, {
278
+ name: giftHeaderMap[next].name,
279
+ id: "".concat(options.id, "_bsExchangeGiftGoods")
280
+ })));
281
+ }
282
+ return prv;
283
+ }, [])));
211
284
  this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
212
285
  this.rules = [{
213
286
  required: true,
@@ -14,9 +14,9 @@ declare class BsGoods implements ComponentInterface {
14
14
  children: ComponentInterface[];
15
15
  dataType: ComponentInterface["dataType"];
16
16
  constructor(options: PickOption);
17
- renderClient: (record: any) => any;
18
- renderPc: (value: unknown, record: Record) => any;
19
- renderLog: (r: Record) => any;
17
+ renderClient: (record: any) => React.JSX.Element | null;
18
+ renderPc: () => null;
19
+ renderLog: (r: Record) => null;
20
20
  getComponentValue: (r: Record) => any;
21
21
  renderExport: () => null;
22
22
  editRender: (p: any) => React.JSX.Element;
@@ -26,6 +26,6 @@ declare class BsGoods implements ComponentInterface {
26
26
  id: string;
27
27
  name: string;
28
28
  filterComponentType: "Input";
29
- };
29
+ }[];
30
30
  }
31
31
  export default BsGoods;
@@ -10,14 +10,50 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
10
10
  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); }
11
11
  import React from "react";
12
12
  import GetFormItem from "../../GetFormItem";
13
- import { BsGoodImage } from "../../Common";
14
- import { BsChildPic, BsChildName, BsChildCode, BsChildSku, BsChildMoney, BsChildNumber, BsChildShare, BsChildType } from "../common/index";
13
+ import { BsGoodsTable } from "../../Common";
14
+ import { BsHeaderPic, BsHeaderName, BsHeaderCode, BsHeaderSku, BsHeaderMoney, BsHeaderNumber, BsHeaderShare, BsHeaderType } from "../common/index";
15
+ import ItemView from "../../../commonComponents/ItemView";
15
16
  import { isNull } from "@kmkf-fe-packages/kmkf-utils";
16
17
  import { BsGoods as Goods } from "@kmkf-fe-packages/basic-components";
17
18
  import { SYMBOL } from "../../../constant";
19
+ var childHeaderMap = {
20
+ pic: {
21
+ component: BsHeaderPic,
22
+ name: "图片"
23
+ },
24
+ name: {
25
+ component: BsHeaderName,
26
+ name: "名称"
27
+ },
28
+ code: {
29
+ component: BsHeaderCode,
30
+ name: "编码"
31
+ },
32
+ sku: {
33
+ component: BsHeaderSku,
34
+ name: "sku编码"
35
+ },
36
+ money: {
37
+ component: BsHeaderMoney,
38
+ name: "实付金额"
39
+ },
40
+ number: {
41
+ component: BsHeaderNumber,
42
+ name: "数量"
43
+ },
44
+ share: {
45
+ component: BsHeaderShare,
46
+ name: "分摊价"
47
+ },
48
+ type: {
49
+ component: BsHeaderType,
50
+ name: "赠品类型"
51
+ }
52
+ };
18
53
  var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
19
54
  var _this = this,
20
- _this$componentConfig2;
55
+ _options$componentCon,
56
+ _this$componentConfig3;
21
57
  _classCallCheck(this, BsGoods);
22
58
  _defineProperty(this, "name", void 0);
23
59
  _defineProperty(this, "id", void 0);
@@ -32,28 +68,21 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
32
68
  _defineProperty(this, "children", void 0);
33
69
  _defineProperty(this, "dataType", void 0);
34
70
  _defineProperty(this, "renderClient", function (record) {
35
- return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? record === null || record === void 0 ? void 0 : record["".concat(_this.id)].map(function (item, index) {
36
- return /*#__PURE__*/React.createElement(BsGoodImage, {
37
- item: item,
38
- index: index
39
- });
40
- }) : null;
71
+ var _record, _this$componentConfig;
72
+ return !isNull(record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ItemView, {
73
+ id: _this.id,
74
+ label: _this.name,
75
+ value: /*#__PURE__*/React.createElement(BsGoodsTable, {
76
+ list: (record === null || record === void 0 ? void 0 : (_record = record["".concat(_this.id)]) === null || _record === void 0 ? void 0 : _record.bsGoods) || [],
77
+ showHeader: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.showHeader) || []
78
+ })
79
+ })) : null;
41
80
  });
42
- _defineProperty(this, "renderPc", function (value, record) {
43
- if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsGoods")]) === undefined) {
44
- return /*#__PURE__*/React.createElement("span", null, "--");
45
- }
46
- //兼容多个商品
47
- return record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsGoods")].map(function (item, index) {
48
- return /*#__PURE__*/React.createElement(BsGoodImage, {
49
- item: item,
50
- index: index
51
- });
52
- });
81
+ _defineProperty(this, "renderPc", function () {
82
+ return null;
53
83
  });
54
84
  _defineProperty(this, "renderLog", function (r) {
55
- if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_bsGoods")])) return null;
56
- return _this.renderPc(undefined, r);
85
+ return null;
57
86
  });
58
87
  _defineProperty(this, "getComponentValue", function (r) {
59
88
  return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_bsGoods")];
@@ -62,7 +91,7 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
62
91
  return null;
63
92
  });
64
93
  _defineProperty(this, "editRender", function (p) {
65
- var _this$componentConfig, _this$effects, _this$effects2;
94
+ var _this$componentConfig2, _this$effects, _this$effects2;
66
95
  return /*#__PURE__*/React.createElement(GetFormItem, {
67
96
  title: _this.name,
68
97
  name: _this.id,
@@ -70,7 +99,7 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
70
99
  required: false,
71
100
  hidden: p === null || p === void 0 ? void 0 : p.hidden,
72
101
  component: /*#__PURE__*/React.createElement(Goods, _extends({}, _this.componentConfig, {
73
- maxLength: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.maxLength) || 20,
102
+ maxLength: ((_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.maxLength) || 20,
74
103
  shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
75
104
  shopList: ((_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.shopList) || [],
76
105
  width: "90%"
@@ -78,7 +107,7 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
78
107
  });
79
108
  });
80
109
  _defineProperty(this, "filterConfig", function (item) {
81
- return {
110
+ return [{
82
111
  searchDefaultConditions: SYMBOL.like,
83
112
  type: item.type,
84
113
  id: "".concat(item.id, "_bsGoods"),
@@ -86,7 +115,7 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
86
115
  name: item.name,
87
116
  // 过滤组件名称
88
117
  filterComponentType: "Input"
89
- };
118
+ }];
90
119
  });
91
120
  this.name = options.name;
92
121
  this.id = options.id;
@@ -94,38 +123,23 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
94
123
  this.formField = "".concat(options.id, "_bsGoods");
95
124
  this.type = options.type;
96
125
  this.effects = options === null || options === void 0 ? void 0 : options.effects;
97
- this.isCombinationComponent = false;
126
+ this.isCombinationComponent = true;
98
127
  this.canSort = false;
99
- this.children = [new BsChildPic(_objectSpread(_objectSpread({}, options), {}, {
100
- name: "bs图片",
101
- id: "".concat(options.id, "_bsGoods")
102
- })), new BsChildName(_objectSpread(_objectSpread({}, options), {}, {
103
- name: "名称",
104
- id: "".concat(options.id, "_bsGoods")
105
- })), new BsChildCode(_objectSpread(_objectSpread({}, options), {}, {
106
- name: "编码",
107
- id: "".concat(options.id, "_bsGoods")
108
- })), new BsChildSku(_objectSpread(_objectSpread({}, options), {}, {
109
- name: "sku编码",
110
- id: "".concat(options.id, "_bsGoods")
111
- })), new BsChildMoney(_objectSpread(_objectSpread({}, options), {}, {
112
- name: "实付金额",
113
- id: "".concat(options.id, "_bsGoods")
114
- })), new BsChildNumber(_objectSpread(_objectSpread({}, options), {}, {
115
- name: "数量",
116
- id: "".concat(options.id, "_bsGoods")
117
- })), new BsChildShare(_objectSpread(_objectSpread({}, options), {}, {
118
- name: "分摊价",
119
- id: "".concat(options.id, "_bsGoods")
120
- })), new BsChildType(_objectSpread(_objectSpread({}, options), {}, {
121
- name: "赠品类型",
122
- id: "".concat(options.id, "_bsGoods")
123
- }))];
128
+ this.children = ((options === null || options === void 0 ? void 0 : (_options$componentCon = options.componentConfig) === null || _options$componentCon === void 0 ? void 0 : _options$componentCon.showHeader) || []).reduce(function (prv, next) {
129
+ if (childHeaderMap[next]) {
130
+ prv.push(new childHeaderMap[next].component(_objectSpread(_objectSpread({}, options), {}, {
131
+ name: childHeaderMap[next].name,
132
+ id: "".concat(options.id, "_bsGoods")
133
+ })));
134
+ }
135
+ return prv;
136
+ }, []);
124
137
  this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
125
- this.rules = this !== null && this !== void 0 && (_this$componentConfig2 = this.componentConfig) !== null && _this$componentConfig2 !== void 0 && _this$componentConfig2.required ? [{
138
+ this.rules = this !== null && this !== void 0 && (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
126
139
  required: true,
127
140
  validator: function validator(_, value) {
128
- if (!value || !value.length) {
141
+ var _value$bsGoods;
142
+ if (!value || !(value !== null && value !== void 0 && (_value$bsGoods = value.bsGoods) !== null && _value$bsGoods !== void 0 && _value$bsGoods.length)) {
129
143
  return Promise.reject(new Error("请选择bs商品"));
130
144
  }
131
145
  return Promise.resolve();
@@ -1,15 +1,15 @@
1
- import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../../type";
2
- import React from "react";
3
- import { ExpressData } from "@kmkf-fe-packages/kmkf-utils";
4
- import Express from "../../Express";
5
- import ExpressCode from "../../ExpressCode";
1
+ import { ComponentInterface, PickOption, ColumnConfig, Record } from '../../../type';
2
+ import React from 'react';
3
+ import { ExpressData } from '@kmkf-fe-packages/kmkf-utils';
4
+ import Express from '../../Express';
5
+ import ExpressCode from '../../ExpressCode';
6
6
  declare class BsLogistics implements ComponentInterface {
7
7
  name: string;
8
8
  id: string;
9
9
  sortField: string;
10
10
  type: string;
11
11
  rules: any[];
12
- componentConfig: ComponentInterface["componentConfig"];
12
+ componentConfig: ComponentInterface['componentConfig'];
13
13
  expressDateInstance: InstanceType<typeof ExpressData>;
14
14
  express: Express;
15
15
  expressCode: ExpressCode;
@@ -17,7 +17,7 @@ declare class BsLogistics implements ComponentInterface {
17
17
  formField: string;
18
18
  canSort: boolean;
19
19
  children: ComponentInterface[];
20
- dataType: ComponentInterface["dataType"];
20
+ dataType: ComponentInterface['dataType'];
21
21
  constructor(options: PickOption);
22
22
  editRender: (p: any) => React.JSX.Element;
23
23
  renderClient: (record: Record) => React.JSX.Element;