@kmkf-fe-packages/services-components 0.7.15-alpha.80 → 0.7.15-alpha.82

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 (30) hide show
  1. package/dist/esm/components/BS/BsExchange/index.d.ts +6 -6
  2. package/dist/esm/components/BS/BsExchange/index.js +37 -208
  3. package/dist/esm/components/BS/BsGoods/index.d.ts +6 -6
  4. package/dist/esm/components/BS/BsGoods/index.js +8 -65
  5. package/dist/esm/components/BS/BsReissue/index.js +4 -64
  6. package/dist/esm/components/BS/common/BsHeaderChild.d.ts +4 -4
  7. package/dist/esm/components/BS/common/BsHeaderChild.js +8 -8
  8. package/dist/esm/components/BS/common/BsHeaderGood.d.ts +4 -4
  9. package/dist/esm/components/BS/common/BsHeaderGood.js +41 -41
  10. package/dist/esm/components/BS/common/BsHeaderPic.js +1 -1
  11. package/dist/esm/components/BS/common/BsMemo.js +1 -1
  12. package/dist/esm/components/BS/common/BsType.js +1 -1
  13. package/dist/esm/components/BS/common/index.d.ts +5 -12
  14. package/dist/esm/components/BS/common/index.js +7 -7
  15. package/dist/esm/factory.d.ts +1 -1
  16. package/package.json +4 -4
  17. package/dist/esm/components/BS/common/BsHeaderCode.d.ts +0 -26
  18. package/dist/esm/components/BS/common/BsHeaderCode.js +0 -88
  19. package/dist/esm/components/BS/common/BsHeaderMoney.d.ts +0 -26
  20. package/dist/esm/components/BS/common/BsHeaderMoney.js +0 -88
  21. package/dist/esm/components/BS/common/BsHeaderName.d.ts +0 -26
  22. package/dist/esm/components/BS/common/BsHeaderName.js +0 -88
  23. package/dist/esm/components/BS/common/BsHeaderNumber.d.ts +0 -26
  24. package/dist/esm/components/BS/common/BsHeaderNumber.js +0 -88
  25. package/dist/esm/components/BS/common/BsHeaderShare.d.ts +0 -26
  26. package/dist/esm/components/BS/common/BsHeaderShare.js +0 -88
  27. package/dist/esm/components/BS/common/BsHeaderSku.d.ts +0 -26
  28. package/dist/esm/components/BS/common/BsHeaderSku.js +0 -88
  29. package/dist/esm/components/BS/common/BsHeaderType.d.ts +0 -26
  30. package/dist/esm/components/BS/common/BsHeaderType.js +0 -88
@@ -1,19 +1,19 @@
1
- import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../../type";
2
- import React from "react";
3
- import { BsType, BsMemo, BsHeaderGood } from "../common/index";
1
+ import { ComponentInterface, PickOption, ColumnConfig, Record } from '../../../type';
2
+ import React from 'react';
3
+ import { BsType, BsMemo, BsHeaderGood } from '../common/index';
4
4
  declare class BsExchange implements ComponentInterface {
5
5
  name: string;
6
6
  id: string;
7
7
  sortField: string;
8
8
  type: string;
9
9
  rules: any[];
10
- componentConfig: ComponentInterface["componentConfig"];
11
- effects: ComponentInterface["effects"];
10
+ componentConfig: ComponentInterface['componentConfig'];
11
+ effects: ComponentInterface['effects'];
12
12
  isCombinationComponent: boolean;
13
13
  formField: string;
14
14
  canSort: boolean;
15
15
  children: ComponentInterface[];
16
- dataType: ComponentInterface["dataType"];
16
+ dataType: ComponentInterface['dataType'];
17
17
  bsType: BsType;
18
18
  bsMemo: BsMemo;
19
19
  returnGoods: BsHeaderGood;
@@ -8,140 +8,14 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
8
8
  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; }
9
9
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
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
- import React from "react";
11
+ import React from 'react';
12
12
  import GetFormItem from "../../GetFormItem";
13
- import { BsGoodsTable, BsExchangeList } from "../../Common";
13
+ import { BsGoodsTable } from "../../Common";
14
14
  import ItemView from "../../../commonComponents/ItemView";
15
- import { isNull } from "@kmkf-fe-packages/kmkf-utils";
16
- import { BsExchange as Exchange } from "@kmkf-fe-packages/basic-components";
15
+ import { isNull } from '@kmkf-fe-packages/kmkf-utils';
16
+ import { BsExchange as Exchange } from '@kmkf-fe-packages/basic-components';
17
17
  import { SYMBOL } from "../../../constant";
18
- import { BsType, BsMemo, BsHeaderPic, BsHeaderName, BsHeaderCode, BsHeaderSku, BsHeaderMoney, BsHeaderNumber, BsHeaderShare, BsHeaderType, BsHeaderGood } from "../common/index";
19
- var returnHeaderMap = {
20
- pic: {
21
- component: BsHeaderPic,
22
- name: "退回图片",
23
- key: "pic"
24
- },
25
- name: {
26
- component: BsHeaderName,
27
- name: "退回名称",
28
- key: "name"
29
- },
30
- code: {
31
- component: BsHeaderCode,
32
- name: "退回编码",
33
- key: "code"
34
- },
35
- sku: {
36
- component: BsHeaderSku,
37
- name: "退回sku编码",
38
- key: "sku"
39
- },
40
- money: {
41
- component: BsHeaderMoney,
42
- name: "退回实付金额",
43
- key: "money"
44
- },
45
- number: {
46
- component: BsHeaderNumber,
47
- name: "退回数量",
48
- key: "number"
49
- },
50
- share: {
51
- component: BsHeaderShare,
52
- name: "退回分摊价",
53
- key: "share"
54
- },
55
- type: {
56
- component: BsHeaderType,
57
- name: "退回赠品类型",
58
- key: "giftType"
59
- }
60
- };
61
- var swapOutHeaderMap = {
62
- pic: {
63
- component: BsHeaderPic,
64
- name: "换出图片",
65
- key: "pic"
66
- },
67
- name: {
68
- component: BsHeaderName,
69
- name: "换出名称",
70
- key: "name"
71
- },
72
- code: {
73
- component: BsHeaderCode,
74
- name: "换出编码",
75
- key: "code"
76
- },
77
- sku: {
78
- component: BsHeaderSku,
79
- name: "换出sku编码",
80
- key: "sku"
81
- },
82
- money: {
83
- component: BsHeaderMoney,
84
- name: "换出实付金额",
85
- key: "money"
86
- },
87
- number: {
88
- component: BsHeaderNumber,
89
- name: "换出数量",
90
- key: "number"
91
- },
92
- share: {
93
- component: BsHeaderShare,
94
- name: "换出分摊价",
95
- key: "share"
96
- },
97
- type: {
98
- component: BsHeaderType,
99
- name: "换出赠品类型",
100
- key: "type"
101
- }
102
- };
103
- var giftHeaderMap = {
104
- pic: {
105
- component: BsHeaderPic,
106
- name: "赠品图片",
107
- key: "pic"
108
- },
109
- name: {
110
- component: BsHeaderName,
111
- name: "赠品名称",
112
- key: "name"
113
- },
114
- code: {
115
- component: BsHeaderCode,
116
- name: "赠品编码",
117
- key: "code"
118
- },
119
- sku: {
120
- component: BsHeaderSku,
121
- name: "赠品sku编码",
122
- key: "sku"
123
- },
124
- money: {
125
- component: BsHeaderMoney,
126
- name: "赠品实付金额",
127
- key: "money"
128
- },
129
- number: {
130
- component: BsHeaderNumber,
131
- name: "赠品数量",
132
- key: "number"
133
- },
134
- share: {
135
- component: BsHeaderShare,
136
- name: "赠品分摊价",
137
- key: "share"
138
- },
139
- type: {
140
- component: BsHeaderType,
141
- name: "赠品赠品类型",
142
- key: "giftType"
143
- }
144
- };
18
+ import { BsType, BsMemo, BsHeaderGood } from "../common/index";
145
19
  var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
146
20
  var _this = this;
147
21
  _classCallCheck(this, BsExchange);
@@ -163,23 +37,25 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
163
37
  _defineProperty(this, "swapOutGoods", void 0);
164
38
  _defineProperty(this, "giftGoods", void 0);
165
39
  _defineProperty(this, "renderClient", function (record) {
166
- var _record, _record$bsExchangeTyp, _this$componentConfig, _record2, _record2$bsExchangeTy, _this$componentConfig2, _record3, _record3$bsExchangeTy, _this$componentConfig3;
167
- 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), ["1", "3"].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, {
40
+ var _this$componentConfig, _this$componentConfig2, _record, _record$bsExchangeTyp, _this$componentConfig3;
41
+ var bsExchangeReturnGoods = JSON.parse((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsExchangeReturnGoods")]) || '[]');
42
+ var bsExchangeSwapOutGoods = JSON.parse((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsExchangeSwapOutGoods")]) || '[]');
43
+ 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, {
168
44
  id: _this.id,
169
- label: "".concat(_this.name),
45
+ label: "".concat(_this.name, "-\u9000\u56DE"),
170
46
  value: /*#__PURE__*/React.createElement(BsGoodsTable, {
171
- list: (record === null || record === void 0 ? void 0 : record["".concat(_this.id)].bsExchangeReturnGoods) || [],
47
+ list: bsExchangeReturnGoods || [],
172
48
  showHeader: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.showHeader) || []
173
49
  })
174
- }) : null, ["2", "4"].includes(record === null || record === void 0 ? void 0 : (_record2 = record["".concat(_this.id)]) === null || _record2 === void 0 ? void 0 : (_record2$bsExchangeTy = _record2.bsExchangeType) === null || _record2$bsExchangeTy === void 0 ? void 0 : _record2$bsExchangeTy[0]) ? /*#__PURE__*/React.createElement(ItemView, {
175
- id: _this.id,
176
- label: "".concat(_this.name),
177
- value: /*#__PURE__*/React.createElement(BsExchangeList, {
178
- list: (record === null || record === void 0 ? void 0 : record["".concat(_this.id)].bsExchangeSwapOutGoods) || [],
50
+ }), /*#__PURE__*/React.createElement(ItemView, {
51
+ id: "".concat(_this.id, "-out"),
52
+ label: "".concat(_this.name, "-\u6362\u51FA"),
53
+ value: /*#__PURE__*/React.createElement(BsGoodsTable, {
54
+ list: bsExchangeSwapOutGoods || [],
179
55
  showHeader: ((_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.showHeader) || []
180
56
  })
181
- }) : null, ["3", "4"].includes(record === null || record === void 0 ? void 0 : (_record3 = record["".concat(_this.id)]) === null || _record3 === void 0 ? void 0 : (_record3$bsExchangeTy = _record3.bsExchangeType) === null || _record3$bsExchangeTy === void 0 ? void 0 : _record3$bsExchangeTy[0]) ? /*#__PURE__*/React.createElement(ItemView, {
182
- id: _this.id,
57
+ }), ['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]) && record !== null && record !== void 0 && record["".concat(_this.id)].bsExchangeGiftGoods.length ? /*#__PURE__*/React.createElement(ItemView, {
58
+ id: "".concat(_this.id, "-gift"),
183
59
  label: "".concat(_this.name, "-\u8D60\u54C1"),
184
60
  value: /*#__PURE__*/React.createElement(BsGoodsTable, {
185
61
  list: (record === null || record === void 0 ? void 0 : record["".concat(_this.id)].bsExchangeGiftGoods) || [],
@@ -222,13 +98,13 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
222
98
  type: item.type,
223
99
  id: "".concat(item.id, "_bsExchangeType"),
224
100
  name: "".concat(item.name, "-\u6362\u8D27\u7C7B\u578B"),
225
- filterComponentType: "Cascader",
101
+ filterComponentType: 'Cascader',
226
102
  props: {
227
103
  options: item === null || item === void 0 ? void 0 : (_item$templateConfig = item.templateConfig) === null || _item$templateConfig === void 0 ? void 0 : _item$templateConfig.reasonList,
228
104
  fieldNames: {
229
- label: "label",
230
- value: "value",
231
- children: "children"
105
+ label: 'label',
106
+ value: 'value',
107
+ children: 'children'
232
108
  }
233
109
  },
234
110
  formatFilterValue: function formatFilterValue(val) {
@@ -241,19 +117,19 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
241
117
  type: item.type,
242
118
  id: "".concat(item.id, "_bsExchangeReturnGoods"),
243
119
  name: "".concat(_this.name, "-\u9000\u56DE"),
244
- filterComponentType: "Input"
120
+ filterComponentType: 'Input'
245
121
  }, {
246
122
  searchDefaultConditions: SYMBOL.like,
247
123
  type: item.type,
248
124
  id: "".concat(item.id, "_bsExchangeSwapOutGoods"),
249
125
  name: "".concat(_this.name, "-\u6362\u51FA"),
250
- filterComponentType: "Input"
126
+ filterComponentType: 'Input'
251
127
  }, {
252
128
  searchDefaultConditions: SYMBOL.like,
253
129
  type: item.type,
254
130
  id: "".concat(item.id, "_bsExchangeGiftGoods"),
255
131
  name: "".concat(_this.name, "-\u8D60\u54C1"),
256
- filterComponentType: "Input"
132
+ filterComponentType: 'Input'
257
133
  }];
258
134
  });
259
135
  this.name = options.name;
@@ -266,90 +142,43 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
266
142
  this.canSort = false;
267
143
  this.bsType = new BsType(_objectSpread(_objectSpread({}, options), {}, {
268
144
  id: "".concat(options.id, "_bsExchangeType_type"),
269
- name: "换货类型"
145
+ name: '换货类型'
270
146
  }));
271
147
  this.bsMemo = new BsMemo(_objectSpread(_objectSpread({}, options), {}, {
272
148
  id: "".concat(options.id, "_bsExchangeType_memo"),
273
- name: "换货备注"
149
+ name: '换货备注'
274
150
  }));
275
151
  this.returnGoods = new BsHeaderGood(_objectSpread(_objectSpread({}, options), {}, {
276
152
  id: "".concat(options.id, "_bsExchangeReturnGoods"),
277
- name: "退回商品"
153
+ name: '退回商品'
278
154
  }));
279
155
  this.swapOutGoods = new BsHeaderGood(_objectSpread(_objectSpread({}, options), {}, {
280
156
  id: "".concat(options.id, "_bsExchangeSwapOutGoods"),
281
- name: "换出商品"
157
+ name: '换出商品'
282
158
  }));
283
159
  this.giftGoods = new BsHeaderGood(_objectSpread(_objectSpread({}, options), {}, {
284
160
  id: "".concat(options.id, "_bsExchangeGiftGoods"),
285
- name: "赠品商品"
161
+ name: '赠品商品'
286
162
  }));
287
- this.children = [this.bsType, this.bsMemo, this.returnGoods, this.swapOutGoods, this.giftGoods
288
- // ...(options?.componentConfig?.showHeader || []).reduce(
289
- // (prv: any, next: string) => {
290
- // if (returnHeaderMap[next]) {
291
- // prv.push(
292
- // new returnHeaderMap[next].component({
293
- // ...options,
294
- // name: returnHeaderMap[next].name,
295
- // id: `${options.id}_bsExchangeReturnGoods_${returnHeaderMap[next].key}`,
296
- // })
297
- // );
298
- // }
299
- // return prv;
300
- // },
301
- // []
302
- // ),
303
- // ...(options?.componentConfig?.showHeader || []).reduce(
304
- // (prv: any, next: string) => {
305
- // if (swapOutHeaderMap[next]) {
306
- // prv.push(
307
- // new swapOutHeaderMap[next].component({
308
- // ...options,
309
- // name: swapOutHeaderMap[next].name,
310
- // id: `${options.id}_bsExchangeSwapOutGoods_${swapOutHeaderMap[next].key}`,
311
- // })
312
- // );
313
- // }
314
- // return prv;
315
- // },
316
- // []
317
- // ),
318
- // ...(options?.componentConfig?.showHeader || []).reduce(
319
- // (prv: any, next: string) => {
320
- // if (giftHeaderMap[next]) {
321
- // prv.push(
322
- // new giftHeaderMap[next].component({
323
- // ...options,
324
- // name: giftHeaderMap[next].name,
325
- // id: `${options.id}_bsExchangeGiftGoods_${giftHeaderMap[next].key}`,
326
- // })
327
- // );
328
- // }
329
- // return prv;
330
- // },
331
- // []
332
- // ),
333
- ];
334
-
163
+ this.children = [this.bsType, this.bsMemo, this.returnGoods, this.swapOutGoods, this.giftGoods];
335
164
  this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
336
165
  this.rules = [{
337
166
  validator: function validator(_, value) {
338
167
  var _this$componentConfig5, _value$bsExchangeRetu;
339
168
  if ((_this$componentConfig5 = _this.componentConfig) !== null && _this$componentConfig5 !== void 0 && _this$componentConfig5.required && !(value !== null && value !== void 0 && (_value$bsExchangeRetu = value.bsExchangeReturnGoods) !== null && _value$bsExchangeRetu !== void 0 && _value$bsExchangeRetu.length)) {
340
- return Promise.reject(new Error("请选择bs换货商品"));
169
+ return Promise.reject(new Error('请选择bs换货商品'));
341
170
  }
342
171
  return Promise.resolve();
343
172
  }
344
173
  }, {
345
174
  validator: function validator(_, value) {
346
175
  var _value$bsExchangeType;
347
- if (value && ["2", "4"].includes(value === null || value === void 0 ? void 0 : (_value$bsExchangeType = value.bsExchangeType) === null || _value$bsExchangeType === void 0 ? void 0 : _value$bsExchangeType[0])) {
176
+ if (value && ['2', '4'].includes(value === null || value === void 0 ? void 0 : (_value$bsExchangeType = value.bsExchangeType) === null || _value$bsExchangeType === void 0 ? void 0 : _value$bsExchangeType[0])) {
348
177
  var hasNoGood = ((value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods) || []).some(function (item) {
349
178
  return !(item !== null && item !== void 0 && item.bsExchangeReturnGoods.length);
350
179
  });
351
180
  if (hasNoGood) {
352
- return Promise.reject(new Error("请选择退回商品后再提交工单"));
181
+ return Promise.reject(new Error('请选择退回商品后再提交工单'));
353
182
  }
354
183
  var hasMore = ((value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods) || []).some(function (item) {
355
184
  var returnMoney = ((item === null || item === void 0 ? void 0 : item.bsExchangeReturnGoods) || []).reduce(function (prv, next) {
@@ -363,18 +192,18 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
363
192
  return returnMoney < swapOutMoney;
364
193
  });
365
194
  if (hasMore) {
366
- return Promise.reject(new Error("换货商品的金额不能大于退回商品的金额"));
195
+ return Promise.reject(new Error('换货商品的金额不能大于退回商品的金额'));
367
196
  }
368
197
  var hasLen = ((value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods) || []).some(function (item) {
369
198
  return (item === null || item === void 0 ? void 0 : item.bsExchangeReturnGoods.length) !== (item === null || item === void 0 ? void 0 : item.bsExchangeSwapOutGoods.length);
370
199
  });
371
200
  if (hasLen) {
372
- return Promise.reject(new Error("请核对商品数据,再提交工单"));
201
+ return Promise.reject(new Error('请核对商品数据,再提交工单'));
373
202
  }
374
203
  }
375
204
  return Promise.resolve();
376
205
  }
377
206
  }];
378
- this.dataType = "object";
207
+ this.dataType = 'object';
379
208
  });
380
209
  export default BsExchange;
@@ -1,19 +1,19 @@
1
- import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../../type";
2
- import React from "react";
3
- import { BsHeaderGood } from "../common/index";
1
+ import { ComponentInterface, PickOption, ColumnConfig, Record } from '../../../type';
2
+ import React from 'react';
3
+ import { BsHeaderGood } from '../common/index';
4
4
  declare class BsGoods implements ComponentInterface {
5
5
  name: string;
6
6
  id: string;
7
7
  sortField: string;
8
8
  type: string;
9
9
  rules: any[];
10
- componentConfig: ComponentInterface["componentConfig"];
11
- effects: ComponentInterface["effects"];
10
+ componentConfig: ComponentInterface['componentConfig'];
11
+ effects: ComponentInterface['effects'];
12
12
  isCombinationComponent: boolean;
13
13
  formField: string;
14
14
  canSort: boolean;
15
15
  children: ComponentInterface[];
16
- dataType: ComponentInterface["dataType"];
16
+ dataType: ComponentInterface['dataType'];
17
17
  bsGoods: BsHeaderGood;
18
18
  constructor(options: PickOption);
19
19
  renderClient: (record: any) => React.JSX.Element | null;
@@ -8,56 +8,14 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
8
8
  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; }
9
9
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
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
- import React from "react";
11
+ import React from 'react';
12
12
  import GetFormItem from "../../GetFormItem";
13
13
  import { BsGoodsTable } from "../../Common";
14
- import { BsHeaderPic, BsHeaderName, BsHeaderCode, BsHeaderSku, BsHeaderMoney, BsHeaderNumber, BsHeaderShare, BsHeaderType, BsHeaderGood } from "../common/index";
14
+ import { BsHeaderGood } from "../common/index";
15
15
  import ItemView from "../../../commonComponents/ItemView";
16
- import { isNull } from "@kmkf-fe-packages/kmkf-utils";
17
- import { BsGoods as Goods } from "@kmkf-fe-packages/basic-components";
16
+ import { isNull } from '@kmkf-fe-packages/kmkf-utils';
17
+ import { BsGoods as Goods } from '@kmkf-fe-packages/basic-components';
18
18
  import { SYMBOL } from "../../../constant";
19
- var childHeaderMap = {
20
- pic: {
21
- component: BsHeaderPic,
22
- name: "图片",
23
- key: "pic"
24
- },
25
- name: {
26
- component: BsHeaderName,
27
- name: "名称",
28
- key: "name"
29
- },
30
- code: {
31
- component: BsHeaderCode,
32
- name: "编码",
33
- key: "code"
34
- },
35
- sku: {
36
- component: BsHeaderSku,
37
- name: "sku编码",
38
- key: "sku"
39
- },
40
- money: {
41
- component: BsHeaderMoney,
42
- name: "实付金额",
43
- key: "money"
44
- },
45
- number: {
46
- component: BsHeaderNumber,
47
- name: "数量",
48
- key: "number"
49
- },
50
- share: {
51
- component: BsHeaderShare,
52
- name: "分摊价",
53
- key: "share"
54
- },
55
- type: {
56
- component: BsHeaderType,
57
- name: "赠品类型",
58
- key: "giftType"
59
- }
60
- };
61
19
  var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
62
20
  var _this = this,
63
21
  _this$componentConfig3;
@@ -122,7 +80,7 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
122
80
  // 过滤组件id
123
81
  name: item.name,
124
82
  // 过滤组件名称
125
- filterComponentType: "Input"
83
+ filterComponentType: 'Input'
126
84
  }];
127
85
  });
128
86
  this.name = options.name;
@@ -135,35 +93,20 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
135
93
  this.canSort = false;
136
94
  this.bsGoods = new BsHeaderGood(_objectSpread(_objectSpread({}, options), {}, {
137
95
  id: "".concat(options.id, "_bsGoods"),
138
- name: "商品信息"
96
+ name: '商品信息'
139
97
  }));
140
98
  this.children = [this.bsGoods];
141
- // this.children = (options?.componentConfig?.showHeader || []).reduce(
142
- // (prv: any, next: string) => {
143
- // if (childHeaderMap[next]) {
144
- // prv.push(
145
- // new childHeaderMap[next].component({
146
- // ...options,
147
- // name: childHeaderMap[next].name,
148
- // id: `${options.id}_bsGoods_${childHeaderMap[next].key}`,
149
- // }),
150
- // );
151
- // }
152
- // return prv;
153
- // },
154
- // [],
155
- // );
156
99
  this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
157
100
  this.rules = this !== null && this !== void 0 && (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
158
101
  required: true,
159
102
  validator: function validator(_, value) {
160
103
  var _value$bsGoods;
161
104
  if (!value || !(value !== null && value !== void 0 && (_value$bsGoods = value.bsGoods) !== null && _value$bsGoods !== void 0 && _value$bsGoods.length)) {
162
- return Promise.reject(new Error("请选择bs商品"));
105
+ return Promise.reject(new Error('请选择bs商品'));
163
106
  }
164
107
  return Promise.resolve();
165
108
  }
166
109
  }] : [];
167
- this.dataType = "object";
110
+ this.dataType = 'object';
168
111
  });
169
112
  export default BsGoods;
@@ -15,49 +15,7 @@ import { isNull, filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
15
15
  import { BsReissue as Reissue } from '@kmkf-fe-packages/basic-components';
16
16
  import { SYMBOL } from "../../../constant";
17
17
  import { BsGoodsTable } from "../../Common";
18
- import { BsType, BsMemo, BsHeaderPic, BsHeaderName, BsHeaderCode, BsHeaderSku, BsHeaderMoney, BsHeaderNumber, BsHeaderShare, BsHeaderType, BsHeaderGood } from "../common/index";
19
- var childHeaderMap = {
20
- pic: {
21
- component: BsHeaderPic,
22
- name: '图片',
23
- key: 'pic'
24
- },
25
- name: {
26
- component: BsHeaderName,
27
- name: '名称',
28
- key: 'name'
29
- },
30
- code: {
31
- component: BsHeaderCode,
32
- name: '编码',
33
- key: 'code'
34
- },
35
- sku: {
36
- component: BsHeaderSku,
37
- name: 'sku编码',
38
- key: 'sku'
39
- },
40
- money: {
41
- component: BsHeaderMoney,
42
- name: '实付金额',
43
- key: 'money'
44
- },
45
- number: {
46
- component: BsHeaderNumber,
47
- name: '数量',
48
- key: 'number'
49
- },
50
- share: {
51
- component: BsHeaderShare,
52
- name: '分摊价',
53
- key: 'share'
54
- },
55
- type: {
56
- component: BsHeaderType,
57
- name: '赠品类型',
58
- key: 'giftType'
59
- }
60
- };
18
+ import { BsType, BsMemo, BsHeaderGood } from "../common/index";
61
19
  var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
62
20
  var _this = this,
63
21
  _this$componentConfig3;
@@ -79,15 +37,14 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
79
37
  _defineProperty(this, "reissueGoods", void 0);
80
38
  _defineProperty(this, "renderClient", function (record) {
81
39
  var _this$componentConfig;
82
- console.log('bsreissue', record);
83
- 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
+ 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), record !== null && record !== void 0 && record["".concat(_this.id)].bsReissueGoods.length ? /*#__PURE__*/React.createElement(ItemView, {
84
41
  id: _this.id,
85
42
  label: _this.name,
86
43
  value: /*#__PURE__*/React.createElement(BsGoodsTable, {
87
44
  list: (record === null || record === void 0 ? void 0 : record["".concat(_this.id)].bsReissueGoods) || [],
88
45
  showHeader: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.showHeader) || []
89
46
  })
90
- })) : null;
47
+ }) : null) : null;
91
48
  });
92
49
  _defineProperty(this, "renderPc", function () {
93
50
  return null;
@@ -171,24 +128,7 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
171
128
  id: "".concat(options.id, "_bsReissueGoods"),
172
129
  name: '商品信息'
173
130
  }));
174
- this.children = [this.bsType, this.bsMemo, this.reissueGoods
175
- // ...(options?.componentConfig?.showHeader || []).reduce(
176
- // (prv: any, next: string) => {
177
- // if (childHeaderMap[next]) {
178
- // prv.push(
179
- // new childHeaderMap[next].component({
180
- // ...options,
181
- // name: childHeaderMap[next].name,
182
- // id: `${options.id}_bsReissueGoods_${childHeaderMap[next].key}`,
183
- // }),
184
- // );
185
- // }
186
- // return prv;
187
- // },
188
- // [],
189
- // ),
190
- ];
191
-
131
+ this.children = [this.bsType, this.bsMemo, this.reissueGoods];
192
132
  this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
193
133
  this.rules = this !== null && this !== void 0 && (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
194
134
  required: true,
@@ -1,18 +1,18 @@
1
- import { ComponentInterface, PickOption, ALignType, Record } from "../../../type";
2
- import React from "react";
1
+ import { ComponentInterface, PickOption, ALignType, Record } from '../../../type';
2
+ import React from 'react';
3
3
  declare class BsHeaderChild implements ComponentInterface {
4
4
  name: string;
5
5
  id: string;
6
6
  sortField: string;
7
7
  type: string;
8
- componentConfig: ComponentInterface["componentConfig"];
8
+ componentConfig: ComponentInterface['componentConfig'];
9
9
  align: ALignType;
10
10
  width: number;
11
11
  isCombinationComponent: boolean;
12
12
  formField: string;
13
13
  canSort: boolean;
14
14
  children: ComponentInterface[];
15
- dataType: ComponentInterface["dataType"];
15
+ dataType: ComponentInterface['dataType'];
16
16
  constructor(options: PickOption);
17
17
  getParentId: () => string;
18
18
  renderClient: (record: any) => React.JSX.Element | null;