@kmkf-fe-packages/services-components 1.22.1-beta.22 → 1.22.1-beta.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/components/BS/common/BsHeaderGood.d.ts +1 -0
- package/dist/esm/components/BS/common/BsHeaderGood.js +166 -103
- package/dist/esm/components/BsE3/BsGoods/index.js +1 -1
- package/dist/esm/components/BsE3/BsReissueE3/index.js +1 -1
- package/dist/esm/components/CommonHeaderGood/index copy.d.ts +27 -0
- package/dist/esm/components/CommonHeaderGood/index copy.js +659 -0
- package/dist/esm/components/CommonHeaderGood/index.d.ts +1 -0
- package/dist/esm/components/CommonHeaderGood/index.js +126 -93
- package/dist/esm/components/MemberLevel/index.d.ts +3 -3
- package/dist/esm/components/MemberLevel/index.js +14 -13
- package/dist/esm/factory.d.ts +1 -1
- package/dist/esm/type.d.ts +6 -1
- package/package.json +3 -3
|
@@ -15,6 +15,7 @@ declare class BsHeaderGods implements ComponentInterface {
|
|
|
15
15
|
dataType: ComponentInterface["dataType"];
|
|
16
16
|
itemKey: any;
|
|
17
17
|
constructor(options: PickOption);
|
|
18
|
+
getChildren(options: PickOption): any[];
|
|
18
19
|
getParentId: () => string;
|
|
19
20
|
renderClient: (record: any) => React.JSX.Element | null;
|
|
20
21
|
renderPc: (value: unknown, record: Record) => React.JSX.Element;
|
|
@@ -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); }
|
|
@@ -145,107 +145,170 @@ var HeaderMap = {
|
|
|
145
145
|
// outerSkuId: 'SKU 编码',
|
|
146
146
|
// propertiesName: 'SKU 信息',
|
|
147
147
|
};
|
|
148
|
-
var BsHeaderGods = /*#__PURE__*/
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
_this$id$
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
148
|
+
var BsHeaderGods = /*#__PURE__*/function () {
|
|
149
|
+
function BsHeaderGods(options) {
|
|
150
|
+
var _this = this;
|
|
151
|
+
_classCallCheck(this, BsHeaderGods);
|
|
152
|
+
_defineProperty(this, "name", void 0);
|
|
153
|
+
_defineProperty(this, "id", void 0);
|
|
154
|
+
_defineProperty(this, "sortField", void 0);
|
|
155
|
+
_defineProperty(this, "type", void 0);
|
|
156
|
+
_defineProperty(this, "componentConfig", void 0);
|
|
157
|
+
_defineProperty(this, "align", void 0);
|
|
158
|
+
_defineProperty(this, "width", void 0);
|
|
159
|
+
_defineProperty(this, "isCombinationComponent", void 0);
|
|
160
|
+
_defineProperty(this, "formField", void 0);
|
|
161
|
+
_defineProperty(this, "canSort", void 0);
|
|
162
|
+
_defineProperty(this, "children", void 0);
|
|
163
|
+
_defineProperty(this, "dataType", void 0);
|
|
164
|
+
_defineProperty(this, "itemKey", void 0);
|
|
165
|
+
_defineProperty(this, "getParentId", function () {
|
|
166
|
+
var _this$id$split = _this.id.split("_"),
|
|
167
|
+
_this$id$split2 = _slicedToArray(_this$id$split, 3),
|
|
168
|
+
key = _this$id$split2[0],
|
|
169
|
+
name = _this$id$split2[1],
|
|
170
|
+
code = _this$id$split2[2];
|
|
171
|
+
return "".concat(key, "_").concat(name);
|
|
172
|
+
});
|
|
173
|
+
_defineProperty(this, "renderClient", function (record) {
|
|
174
|
+
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
175
|
+
id: _this.id,
|
|
176
|
+
label: _this.name,
|
|
177
|
+
value: _this.getComponentValue(record)
|
|
178
|
+
}) : null;
|
|
179
|
+
});
|
|
180
|
+
_defineProperty(this, "renderPc", function (value, record) {
|
|
181
|
+
var _this$getComponentVal;
|
|
182
|
+
return /*#__PURE__*/React.createElement("span", null, (_this$getComponentVal = _this.getComponentValue(record)) !== null && _this$getComponentVal !== void 0 ? _this$getComponentVal : "--");
|
|
183
|
+
});
|
|
184
|
+
_defineProperty(this, "renderLog", function (r) {
|
|
185
|
+
var id = _this.getParentId();
|
|
186
|
+
if (isNull(r === null || r === void 0 ? void 0 : r[id])) return null;
|
|
187
|
+
return _this.renderPc(undefined, r);
|
|
188
|
+
});
|
|
189
|
+
_defineProperty(this, "getComponentValue", function (r) {
|
|
190
|
+
var id = _this.getParentId();
|
|
191
|
+
var list = ((r === null || r === void 0 ? void 0 : r[id]) || []).reduce(function (prv, next) {
|
|
192
|
+
next["money"] && prv.push(next["money"]);
|
|
193
|
+
return prv;
|
|
194
|
+
}, []);
|
|
195
|
+
return list.join(",");
|
|
196
|
+
});
|
|
197
|
+
_defineProperty(this, "renderExport", function (value, record) {
|
|
198
|
+
var _this$getComponentVal2;
|
|
199
|
+
return (_this$getComponentVal2 = _this.getComponentValue(record)) !== null && _this$getComponentVal2 !== void 0 ? _this$getComponentVal2 : "--";
|
|
200
|
+
});
|
|
201
|
+
_defineProperty(this, "editRender", function () {
|
|
202
|
+
return null;
|
|
203
|
+
});
|
|
204
|
+
_defineProperty(this, "filterConfig", function () {
|
|
205
|
+
return [];
|
|
206
|
+
});
|
|
207
|
+
this.name = options.name;
|
|
208
|
+
this.id = options.id;
|
|
209
|
+
this.sortField = options.id;
|
|
210
|
+
this.formField = options.id;
|
|
211
|
+
this.type = options.type;
|
|
212
|
+
this.componentConfig = options.componentConfig;
|
|
213
|
+
this.align = "left";
|
|
214
|
+
this.width = 200;
|
|
215
|
+
this.isCombinationComponent = true;
|
|
216
|
+
this.canSort = false;
|
|
217
|
+
this.dataType = "string";
|
|
218
|
+
this.itemKey = options.type === "ITEM_ENCODE" ? {
|
|
219
|
+
title: "商品名称",
|
|
220
|
+
outerId: "商品编码",
|
|
221
|
+
picUrl: "图片",
|
|
222
|
+
numIid: "商品id",
|
|
223
|
+
skuId: "SKU ID",
|
|
224
|
+
outerSkuId: "SKU 编码",
|
|
225
|
+
propertiesName: "SKU 信息"
|
|
226
|
+
} : {
|
|
227
|
+
mark: "商品标记",
|
|
228
|
+
pic: "图片",
|
|
229
|
+
name: "名称",
|
|
230
|
+
code: "编码",
|
|
231
|
+
sku: "sku编码",
|
|
232
|
+
skuName: "sku名称",
|
|
233
|
+
money: "实付金额",
|
|
234
|
+
number: "数量",
|
|
235
|
+
share: "分摊价",
|
|
236
|
+
type: "赠品类型",
|
|
237
|
+
batch: "批次号",
|
|
238
|
+
expireDate: "有效期"
|
|
239
|
+
};
|
|
240
|
+
this.children = this.getChildren(options);
|
|
241
|
+
// [
|
|
242
|
+
// ...Object.keys(HeaderMap).reduce((prv: any, key: string) => {
|
|
243
|
+
// if (options?.componentConfig?.showHeader?.includes(key)) {
|
|
244
|
+
// prv.push(
|
|
245
|
+
// new HeaderMap[key].component({
|
|
246
|
+
// ...options,
|
|
247
|
+
// name: this.itemKey[key],
|
|
248
|
+
// id: `${options.id}_${HeaderMap[key].key}`,
|
|
249
|
+
// width: HeaderMap[key].width,
|
|
250
|
+
// })
|
|
251
|
+
// );
|
|
252
|
+
// }
|
|
253
|
+
// return prv;
|
|
254
|
+
// }, []),
|
|
255
|
+
// ...(options?.componentConfig?.showHeader || []).reduce(
|
|
256
|
+
// (prv: any, next: string) => {
|
|
257
|
+
// if (HeaderMap[next]) {
|
|
258
|
+
// prv.push(
|
|
259
|
+
// new HeaderMap[next].component({
|
|
260
|
+
// ...options,
|
|
261
|
+
// name: this.itemKey[next],
|
|
262
|
+
// id: `${options.id}_${HeaderMap[next].key}`,
|
|
263
|
+
// })
|
|
264
|
+
// );
|
|
265
|
+
// }
|
|
266
|
+
// return prv;
|
|
267
|
+
// },
|
|
268
|
+
// []
|
|
269
|
+
// ),
|
|
270
|
+
// ];
|
|
271
|
+
}
|
|
272
|
+
_createClass(BsHeaderGods, [{
|
|
273
|
+
key: "getChildren",
|
|
274
|
+
value: function getChildren(options) {
|
|
275
|
+
var _options$componentCon,
|
|
276
|
+
_this2 = this;
|
|
277
|
+
var showHeader = options === null || options === void 0 ? void 0 : (_options$componentCon = options.componentConfig) === null || _options$componentCon === void 0 ? void 0 : _options$componentCon.showHeader;
|
|
278
|
+
var isStringArray = Array.isArray(showHeader) && typeof showHeader[0] === "string";
|
|
279
|
+
var isObjectArray = Array.isArray(showHeader) && Object.prototype.toString.call(showHeader[0]) === "[object Object]";
|
|
280
|
+
var dataIndexList = [];
|
|
281
|
+
if (isStringArray) {
|
|
282
|
+
dataIndexList = showHeader;
|
|
283
|
+
} else if (isObjectArray) {
|
|
284
|
+
dataIndexList = showHeader.map(function (item) {
|
|
285
|
+
return item.dataIndex;
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
var getKeyIndex = function getKeyIndex(id) {
|
|
289
|
+
return dataIndexList.indexOf(id.split("_").pop() || "");
|
|
290
|
+
};
|
|
291
|
+
var list = _toConsumableArray(Object.keys(HeaderMap).reduce(function (prv, key) {
|
|
292
|
+
if (Array.isArray(showHeader) && (isStringArray && showHeader.includes(key) || isObjectArray && showHeader.filter(function (item) {
|
|
293
|
+
return item.show !== false;
|
|
294
|
+
}).map(function (item) {
|
|
295
|
+
return item.dataIndex;
|
|
296
|
+
}).includes(key))) {
|
|
297
|
+
prv.push(new HeaderMap[key].component(_objectSpread(_objectSpread({}, options), {}, {
|
|
298
|
+
name: _this2.itemKey[key],
|
|
299
|
+
id: "".concat(options.id, "_").concat(HeaderMap[key].key),
|
|
300
|
+
width: HeaderMap[key].width
|
|
301
|
+
})));
|
|
302
|
+
}
|
|
303
|
+
return prv;
|
|
304
|
+
}, []).sort(function (a, b) {
|
|
305
|
+
if (Array.isArray(showHeader)) {
|
|
306
|
+
return getKeyIndex(a.id) - getKeyIndex(b.id);
|
|
307
|
+
}
|
|
308
|
+
}));
|
|
309
|
+
return list;
|
|
247
310
|
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
});
|
|
311
|
+
}]);
|
|
312
|
+
return BsHeaderGods;
|
|
313
|
+
}();
|
|
251
314
|
export default BsHeaderGods;
|
|
@@ -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,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ComponentInterface, PickOption, ALignType, Record } from "../../type";
|
|
2
|
+
import React from "react";
|
|
3
|
+
declare class CommonHeaderGoods implements ComponentInterface {
|
|
4
|
+
name: string;
|
|
5
|
+
id: string;
|
|
6
|
+
sortField: string;
|
|
7
|
+
type: string;
|
|
8
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
9
|
+
align: ALignType;
|
|
10
|
+
width: number;
|
|
11
|
+
isCombinationComponent: boolean;
|
|
12
|
+
formField: string;
|
|
13
|
+
canSort: boolean;
|
|
14
|
+
children: ComponentInterface[];
|
|
15
|
+
dataType: ComponentInterface["dataType"];
|
|
16
|
+
itemKey: any;
|
|
17
|
+
constructor(options: PickOption);
|
|
18
|
+
getParentId: () => string;
|
|
19
|
+
renderClient: (record: any) => React.JSX.Element | null;
|
|
20
|
+
renderPc: (value: unknown, record: Record) => React.JSX.Element;
|
|
21
|
+
renderLog: (r: Record) => React.JSX.Element | null;
|
|
22
|
+
getComponentValue: (r: Record) => any;
|
|
23
|
+
renderExport: (value: string, record: Record) => any;
|
|
24
|
+
editRender: () => null;
|
|
25
|
+
filterConfig: () => never[];
|
|
26
|
+
}
|
|
27
|
+
export default CommonHeaderGoods;
|