@kmkf-fe-packages/services-components 1.22.1-beta.4 → 1.22.1-beta.41

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 (42) hide show
  1. package/dist/esm/commonComponents/GlobalContext/index.d.ts +1 -1
  2. package/dist/esm/commonComponents/GlobalContext/index.js +4 -2
  3. package/dist/esm/commonComponents/ShopList/index.d.ts +2 -1
  4. package/dist/esm/commonComponents/ShopList/index.js +5 -5
  5. package/dist/esm/components/BS/BsGoods/index.js +6 -2
  6. package/dist/esm/components/BS/BsLogistics/index.js +8 -1
  7. package/dist/esm/components/BS/BsSystemOrder/index.d.ts +5 -5
  8. package/dist/esm/components/BS/BsSystemOrder/index.js +37 -15
  9. package/dist/esm/components/BS/common/BsHeaderChild.d.ts +6 -4
  10. package/dist/esm/components/BS/common/BsHeaderChild.js +20 -9
  11. package/dist/esm/components/BS/common/BsHeaderGood.d.ts +1 -0
  12. package/dist/esm/components/BS/common/BsHeaderGood.js +151 -101
  13. package/dist/esm/components/BS/common/expressCode.js +4 -1
  14. package/dist/esm/components/BS/common/expressCompany.js +3 -0
  15. package/dist/esm/components/BsE3/BsGoods/index.js +1 -1
  16. package/dist/esm/components/BsE3/BsReissueE3/index.js +1 -1
  17. package/dist/esm/components/Common/index.d.ts +6 -5
  18. package/dist/esm/components/Common/index.js +532 -364
  19. package/dist/esm/components/CommonHeaderGood/index.d.ts +1 -0
  20. package/dist/esm/components/CommonHeaderGood/index.js +126 -93
  21. package/dist/esm/components/CommonMultiStatus/index.d.ts +5 -4
  22. package/dist/esm/components/CommonMultiStatus/index.js +98 -65
  23. package/dist/esm/components/CommonSystemOrder/index.d.ts +4 -4
  24. package/dist/esm/components/CommonSystemOrder/index.js +25 -25
  25. package/dist/esm/components/EItemEnCode/index.d.ts +2 -1
  26. package/dist/esm/components/EItemEnCode/index.js +28 -29
  27. package/dist/esm/components/JST/JstSendGood/index.js +1 -1
  28. package/dist/esm/components/MemberLevel/index.d.ts +35 -0
  29. package/dist/esm/components/MemberLevel/index.js +119 -0
  30. package/dist/esm/components/Payment/PaymentAmount.d.ts +0 -1
  31. package/dist/esm/components/Payment/PaymentAmount.js +0 -4
  32. package/dist/esm/components/Radio/index.js +3 -2
  33. package/dist/esm/components/{JST/JstLogistics → Reissue/Logistics}/index.d.ts +2 -2
  34. package/dist/esm/components/{JST/JstLogistics → Reissue/Logistics}/index.js +3 -9
  35. package/dist/esm/factory.d.ts +2 -2
  36. package/dist/esm/factory.js +7 -4
  37. package/dist/esm/index.d.ts +2 -1
  38. package/dist/esm/index.js +2 -1
  39. package/dist/esm/service/api.d.ts +2 -0
  40. package/dist/esm/service/api.js +12 -0
  41. package/dist/esm/type.d.ts +7 -2
  42. package/package.json +4 -4
@@ -11,9 +11,9 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
11
11
  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; }
12
12
  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; } }
13
13
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
14
15
  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); } }
15
16
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
16
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
17
17
  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; }
18
18
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
19
19
  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); }
@@ -21,6 +21,7 @@ import React from "react";
21
21
  import ItemView from "../../../commonComponents/ItemView";
22
22
  import { isNull } from "@kmkf-fe-packages/kmkf-utils";
23
23
  import { BsHeaderPic, BsHeaderChild, BsHeaderGoodPic } from "./index";
24
+ import { getMapping, columnsGoodsList } from "@kmkf-fe-packages/kmkf-utils";
24
25
  var HeaderMap = {
25
26
  mark: {
26
27
  component: BsHeaderChild,
@@ -46,6 +47,12 @@ var HeaderMap = {
46
47
  key: "name",
47
48
  width: 200
48
49
  },
50
+ num: {
51
+ component: BsHeaderChild,
52
+ name: "商品数量",
53
+ key: "num",
54
+ width: 200
55
+ },
49
56
  code: {
50
57
  component: BsHeaderChild,
51
58
  name: "编码",
@@ -123,6 +130,18 @@ var HeaderMap = {
123
130
  name: "SKU 信息",
124
131
  key: "propertiesName",
125
132
  width: 140
133
+ },
134
+ batch: {
135
+ component: BsHeaderChild,
136
+ name: "批次号",
137
+ key: "batch",
138
+ width: 140
139
+ },
140
+ expireDate: {
141
+ component: BsHeaderChild,
142
+ name: "有效期",
143
+ key: "expireDate",
144
+ width: 140
126
145
  }
127
146
 
128
147
  // title: '商品名称',
@@ -133,105 +152,136 @@ var HeaderMap = {
133
152
  // outerSkuId: 'SKU 编码',
134
153
  // propertiesName: 'SKU 信息',
135
154
  };
136
- var BsHeaderGods = /*#__PURE__*/_createClass(function BsHeaderGods(options) {
137
- var _this = this;
138
- _classCallCheck(this, BsHeaderGods);
139
- _defineProperty(this, "name", void 0);
140
- _defineProperty(this, "id", void 0);
141
- _defineProperty(this, "sortField", void 0);
142
- _defineProperty(this, "type", void 0);
143
- _defineProperty(this, "componentConfig", void 0);
144
- _defineProperty(this, "align", void 0);
145
- _defineProperty(this, "width", void 0);
146
- _defineProperty(this, "isCombinationComponent", void 0);
147
- _defineProperty(this, "formField", void 0);
148
- _defineProperty(this, "canSort", void 0);
149
- _defineProperty(this, "children", void 0);
150
- _defineProperty(this, "dataType", void 0);
151
- _defineProperty(this, "itemKey", void 0);
152
- _defineProperty(this, "getParentId", function () {
153
- var _this$id$split = _this.id.split("_"),
154
- _this$id$split2 = _slicedToArray(_this$id$split, 3),
155
- key = _this$id$split2[0],
156
- name = _this$id$split2[1],
157
- code = _this$id$split2[2];
158
- return "".concat(key, "_").concat(name);
159
- });
160
- _defineProperty(this, "renderClient", function (record) {
161
- return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
162
- id: _this.id,
163
- label: _this.name,
164
- value: _this.getComponentValue(record)
165
- }) : null;
166
- });
167
- _defineProperty(this, "renderPc", function (value, record) {
168
- var _this$getComponentVal;
169
- return /*#__PURE__*/React.createElement("span", null, (_this$getComponentVal = _this.getComponentValue(record)) !== null && _this$getComponentVal !== void 0 ? _this$getComponentVal : "--");
170
- });
171
- _defineProperty(this, "renderLog", function (r) {
172
- var id = _this.getParentId();
173
- if (isNull(r === null || r === void 0 ? void 0 : r[id])) return null;
174
- return _this.renderPc(undefined, r);
175
- });
176
- _defineProperty(this, "getComponentValue", function (r) {
177
- var id = _this.getParentId();
178
- var list = ((r === null || r === void 0 ? void 0 : r[id]) || []).reduce(function (prv, next) {
179
- next["money"] && prv.push(next["money"]);
180
- return prv;
181
- }, []);
182
- return list.join(",");
183
- });
184
- _defineProperty(this, "renderExport", function (value, record) {
185
- var _this$getComponentVal2;
186
- return (_this$getComponentVal2 = _this.getComponentValue(record)) !== null && _this$getComponentVal2 !== void 0 ? _this$getComponentVal2 : "--";
187
- });
188
- _defineProperty(this, "editRender", function () {
189
- return null;
190
- });
191
- _defineProperty(this, "filterConfig", function () {
192
- return [];
193
- });
194
- this.name = options.name;
195
- this.id = options.id;
196
- this.sortField = options.id;
197
- this.formField = options.id;
198
- this.type = options.type;
199
- this.componentConfig = options.componentConfig;
200
- this.align = "left";
201
- this.width = 200;
202
- this.isCombinationComponent = true;
203
- this.canSort = false;
204
- this.dataType = "string";
205
- this.itemKey = options.type === 'ITEM_ENCODE' ? {
206
- title: '商品名称',
207
- outerId: '商品编码',
208
- picUrl: '图片',
209
- numIid: '商品id',
210
- skuId: 'SKU ID',
211
- outerSkuId: 'SKU 编码',
212
- propertiesName: 'SKU 信息'
213
- } : {
214
- mark: "商品标记",
215
- pic: "图片",
216
- name: "名称",
217
- code: "编码",
218
- sku: "sku编码",
219
- skuName: "sku名称",
220
- money: "实付金额",
221
- number: "数量",
222
- share: "分摊价",
223
- type: "赠品类型"
224
- };
225
- this.children = _toConsumableArray(Object.keys(HeaderMap).reduce(function (prv, key) {
226
- var _options$componentCon, _options$componentCon2;
227
- if (options !== null && options !== void 0 && (_options$componentCon = options.componentConfig) !== null && _options$componentCon !== void 0 && (_options$componentCon2 = _options$componentCon.showHeader) !== null && _options$componentCon2 !== void 0 && _options$componentCon2.includes(key)) {
228
- prv.push(new HeaderMap[key].component(_objectSpread(_objectSpread({}, options), {}, {
229
- name: _this.itemKey[key],
230
- id: "".concat(options.id, "_").concat(HeaderMap[key].key),
231
- width: HeaderMap[key].width
232
- })));
155
+ var BsHeaderGods = /*#__PURE__*/function () {
156
+ function BsHeaderGods(options) {
157
+ var _this = this;
158
+ _classCallCheck(this, BsHeaderGods);
159
+ _defineProperty(this, "name", void 0);
160
+ _defineProperty(this, "id", void 0);
161
+ _defineProperty(this, "sortField", void 0);
162
+ _defineProperty(this, "type", void 0);
163
+ _defineProperty(this, "componentConfig", void 0);
164
+ _defineProperty(this, "align", void 0);
165
+ _defineProperty(this, "width", void 0);
166
+ _defineProperty(this, "isCombinationComponent", void 0);
167
+ _defineProperty(this, "formField", void 0);
168
+ _defineProperty(this, "canSort", void 0);
169
+ _defineProperty(this, "children", void 0);
170
+ _defineProperty(this, "dataType", void 0);
171
+ _defineProperty(this, "itemKey", void 0);
172
+ _defineProperty(this, "getParentId", function () {
173
+ var _this$id$split = _this.id.split("_"),
174
+ _this$id$split2 = _slicedToArray(_this$id$split, 3),
175
+ key = _this$id$split2[0],
176
+ name = _this$id$split2[1],
177
+ code = _this$id$split2[2];
178
+ return "".concat(key, "_").concat(name);
179
+ });
180
+ _defineProperty(this, "renderClient", function (record) {
181
+ return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
182
+ id: _this.id,
183
+ label: _this.name,
184
+ value: _this.getComponentValue(record)
185
+ }) : null;
186
+ });
187
+ _defineProperty(this, "renderPc", function (value, record) {
188
+ var _this$getComponentVal;
189
+ return /*#__PURE__*/React.createElement("span", null, (_this$getComponentVal = _this.getComponentValue(record)) !== null && _this$getComponentVal !== void 0 ? _this$getComponentVal : "--");
190
+ });
191
+ _defineProperty(this, "renderLog", function (r) {
192
+ var id = _this.getParentId();
193
+ if (isNull(r === null || r === void 0 ? void 0 : r[id])) return null;
194
+ return _this.renderPc(undefined, r);
195
+ });
196
+ _defineProperty(this, "getComponentValue", function (r) {
197
+ var id = _this.getParentId();
198
+ var list = ((r === null || r === void 0 ? void 0 : r[id]) || []).reduce(function (prv, next) {
199
+ next["money"] && prv.push(next["money"]);
200
+ return prv;
201
+ }, []);
202
+ return list.join(",");
203
+ });
204
+ _defineProperty(this, "renderExport", function (value, record) {
205
+ var _this$getComponentVal2;
206
+ return (_this$getComponentVal2 = _this.getComponentValue(record)) !== null && _this$getComponentVal2 !== void 0 ? _this$getComponentVal2 : "--";
207
+ });
208
+ _defineProperty(this, "editRender", function () {
209
+ return null;
210
+ });
211
+ _defineProperty(this, "filterConfig", function () {
212
+ return [];
213
+ });
214
+ this.name = options.name;
215
+ this.id = options.id;
216
+ this.sortField = options.id;
217
+ this.formField = options.id;
218
+ this.type = options.type;
219
+ this.componentConfig = options.componentConfig;
220
+ this.align = "left";
221
+ this.width = 200;
222
+ this.isCombinationComponent = true;
223
+ this.canSort = false;
224
+ this.dataType = "string";
225
+ this.itemKey = options.type === "ITEM_ENCODE" ? getMapping(columnsGoodsList) : {
226
+ mark: "商品标记",
227
+ pic: "图片",
228
+ name: "名称",
229
+ code: "编码",
230
+ sku: "sku编码",
231
+ skuName: "sku名称",
232
+ money: "实付金额",
233
+ number: "数量",
234
+ share: "分摊价",
235
+ type: "赠品类型",
236
+ batch: "批次号",
237
+ expireDate: "有效期"
238
+ };
239
+ this.children = this.getChildren(options);
240
+ }
241
+ _createClass(BsHeaderGods, [{
242
+ key: "getChildren",
243
+ value: function getChildren(options) {
244
+ var _options$componentCon,
245
+ _this2 = this;
246
+ var showHeader = options === null || options === void 0 ? void 0 : (_options$componentCon = options.componentConfig) === null || _options$componentCon === void 0 ? void 0 : _options$componentCon.showHeader;
247
+ var dataIndexList = [];
248
+ if (!Array.isArray(showHeader)) {
249
+ dataIndexList = Object.keys(this.itemKey);
250
+ showHeader = dataIndexList;
251
+ }
252
+ var isStringArray = Array.isArray(showHeader) && typeof showHeader[0] === "string";
253
+ var isObjectArray = Array.isArray(showHeader) && Object.prototype.toString.call(showHeader[0]) === "[object Object]";
254
+ if (isStringArray) {
255
+ dataIndexList = showHeader;
256
+ } else if (isObjectArray) {
257
+ dataIndexList = showHeader.map(function (item) {
258
+ return item.dataIndex;
259
+ });
260
+ }
261
+ var getKeyIndex = function getKeyIndex(id) {
262
+ return dataIndexList.indexOf(id.split("_").pop() || "");
263
+ };
264
+ var list = _toConsumableArray(Object.keys(HeaderMap).reduce(function (prv, key) {
265
+ if (Array.isArray(showHeader) && (isStringArray && showHeader.includes(key) || isObjectArray && showHeader.filter(function (item) {
266
+ return item.show !== false;
267
+ }).map(function (item) {
268
+ return item.dataIndex;
269
+ }).includes(key))) {
270
+ prv.push(new HeaderMap[key].component(_objectSpread(_objectSpread({}, options), {}, {
271
+ name: _this2.itemKey[key],
272
+ id: "".concat(options.id, "_").concat(HeaderMap[key].key),
273
+ width: HeaderMap[key].width
274
+ })));
275
+ }
276
+ return prv;
277
+ }, []).sort(function (a, b) {
278
+ if (Array.isArray(showHeader)) {
279
+ return getKeyIndex(a.id) - getKeyIndex(b.id);
280
+ }
281
+ }));
282
+ return list;
233
283
  }
234
- return prv;
235
- }, []));
236
- });
284
+ }]);
285
+ return BsHeaderGods;
286
+ }();
237
287
  export default BsHeaderGods;
@@ -26,7 +26,10 @@ var typeMap = {
26
26
  key: "wlnLogisticsItem"
27
27
  },
28
28
  WDT_LOGISTICS: {
29
- key: 'wdtLogisticsItem'
29
+ key: "wdtLogisticsItem"
30
+ },
31
+ JST_LOGISTICS: {
32
+ key: "jstLogisticsItem"
30
33
  }
31
34
  };
32
35
  var ExpressCode = /*#__PURE__*/_createClass(function ExpressCode(options) {
@@ -28,6 +28,9 @@ var typeMap = {
28
28
  },
29
29
  WDT_LOGISTICS: {
30
30
  key: "wdtLogisticsItem"
31
+ },
32
+ JST_LOGISTICS: {
33
+ key: "jstLogisticsItem"
31
34
  }
32
35
  };
33
36
  var Express = /*#__PURE__*/_createClass(function Express(options) {
@@ -72,7 +72,7 @@ var BSE3Goods = /*#__PURE__*/_createClass(function BSE3Goods(options) {
72
72
  required: false,
73
73
  hidden: p === null || p === void 0 ? void 0 : p.hidden,
74
74
  display: p === null || p === void 0 ? void 0 : p.display,
75
- tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : '',
75
+ tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : "",
76
76
  component: /*#__PURE__*/React.createElement(Goods, _extends({}, _this.componentConfig, {
77
77
  maxLength: ((_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.maxLength) || 20,
78
78
  shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
@@ -94,7 +94,7 @@ var BsE3Reissue = /*#__PURE__*/_createClass(function BsE3Reissue(options) {
94
94
  required: false,
95
95
  hidden: p === null || p === void 0 ? void 0 : p.hidden,
96
96
  display: p === null || p === void 0 ? void 0 : p.display,
97
- tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : '',
97
+ tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : "",
98
98
  component: /*#__PURE__*/React.createElement(Reissue, _extends({}, _this.componentConfig, {
99
99
  maxLength: ((_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.maxLength) || 20,
100
100
  shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
@@ -1,4 +1,5 @@
1
1
  import React from "react";
2
+ import { ShowHeaderObjType } from "../../type";
2
3
  declare type getFormItemProps = {
3
4
  name: string;
4
5
  title: string;
@@ -11,13 +12,13 @@ export declare const showImage: ({ item, type, index, showHeader, }: {
11
12
  item: any;
12
13
  type: string;
13
14
  index: number;
14
- showHeader: string[];
15
+ showHeader: (string | ShowHeaderObjType)[];
15
16
  }) => React.JSX.Element;
16
17
  export declare const ShowTotalImage: ({ total, allImage, type, showHeader, }: any) => React.JSX.Element;
17
18
  export declare const GoodImage: ({ list, type, showHeader }: any) => React.JSX.Element | null;
18
- export declare const JstGoodImage: ({ list, type, platformType }: any) => any;
19
- export declare const BsExpressRender: ({ list, showField, platformType }: any) => any;
20
- export declare const CommonOrderContent: ({ list, valueKey, failValue, options, isShowPopover }: any) => any;
19
+ export declare const JstGoodImage: ({ list, type, platformType, }: any) => any;
20
+ export declare const BsExpressRender: ({ list, showField, platformType, }: any) => any;
21
+ export declare const CommonOrderContent: ({ list, valueKey: initValueKey, failValue, options, isShowPopover, }: any) => any;
21
22
  export declare const BsGoodImage: ({ item, index }: {
22
23
  item: any;
23
24
  index: number;
@@ -26,7 +27,7 @@ export declare const BsExchangeList: ({ list, showHeader }: any) => React.JSX.El
26
27
  export declare const BsGoodPic: (list: string[]) => React.JSX.Element[];
27
28
  export declare const BsGoodsTable: ({ list, showHeader, text, type, }: {
28
29
  list: any[];
29
- showHeader: string[];
30
+ showHeader: (string | ShowHeaderObjType)[];
30
31
  text?: string | undefined;
31
32
  type?: string | undefined;
32
33
  }) => React.JSX.Element;