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

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 (43) hide show
  1. package/dist/esm/components/BS/BsExchange/index.d.ts +22 -6
  2. package/dist/esm/components/BS/BsExchange/index.js +175 -39
  3. package/dist/esm/components/BS/BsGoods/index.d.ts +4 -5
  4. package/dist/esm/components/BS/BsGoods/index.js +43 -29
  5. package/dist/esm/components/BS/BsReissue/index.d.ts +17 -6
  6. package/dist/esm/components/BS/BsReissue/index.js +61 -34
  7. package/dist/esm/components/BS/common/BsChildCode.d.ts +25 -0
  8. package/dist/esm/components/BS/common/BsChildCode.js +71 -0
  9. package/dist/esm/components/BS/common/BsChildMoney.d.ts +25 -0
  10. package/dist/esm/components/BS/common/BsChildMoney.js +71 -0
  11. package/dist/esm/components/BS/common/BsChildName.d.ts +25 -0
  12. package/dist/esm/components/BS/common/BsChildName.js +71 -0
  13. package/dist/esm/components/BS/common/BsChildNumber.d.ts +25 -0
  14. package/dist/esm/components/BS/common/BsChildNumber.js +71 -0
  15. package/dist/esm/components/BS/common/BsChildPic.d.ts +25 -0
  16. package/dist/esm/components/BS/common/BsChildPic.js +72 -0
  17. package/dist/esm/components/BS/common/BsChildShare.d.ts +25 -0
  18. package/dist/esm/components/BS/common/BsChildShare.js +71 -0
  19. package/dist/esm/components/BS/common/BsChildSku.d.ts +25 -0
  20. package/dist/esm/components/BS/common/BsChildSku.js +71 -0
  21. package/dist/esm/components/BS/common/BsChildType.d.ts +25 -0
  22. package/dist/esm/components/BS/common/BsChildType.js +71 -0
  23. package/dist/esm/components/BS/common/BsExchangeImage.d.ts +31 -0
  24. package/dist/esm/components/BS/common/BsExchangeImage.js +126 -0
  25. package/dist/esm/components/BS/common/BsGoodImage.d.ts +31 -0
  26. package/dist/esm/components/BS/common/BsGoodImage.js +88 -0
  27. package/dist/esm/components/BS/common/BsMemo.d.ts +25 -0
  28. package/dist/esm/components/BS/common/BsMemo.js +76 -0
  29. package/dist/esm/components/BS/common/BsType.d.ts +35 -0
  30. package/dist/esm/components/BS/common/{BsPic.js → BsType.js} +40 -49
  31. package/dist/esm/components/BS/common/index.d.ts +10 -0
  32. package/dist/esm/components/BS/common/index.js +10 -0
  33. package/dist/esm/components/Common/index.d.ts +12 -6
  34. package/dist/esm/components/Common/index.js +115 -50
  35. package/dist/esm/components/Common/index.module.less +8 -0
  36. package/dist/esm/components/File/index.d.ts +7 -8
  37. package/dist/esm/components/File/index.js +18 -47
  38. package/dist/esm/components/Input/index.js +3 -0
  39. package/dist/esm/components/LogisticsTrajectory/index.js +6 -16
  40. package/dist/esm/factory.d.ts +1 -1
  41. package/dist/esm/type.d.ts +1 -0
  42. package/package.json +4 -4
  43. package/dist/esm/components/BS/common/BsPic.d.ts +0 -43
@@ -1,5 +1,7 @@
1
1
  import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../../type";
2
2
  import React from "react";
3
+ import BsExchangeImage from "../common/BsExchangeImage";
4
+ import { BsType, BsMemo } from "../common/index";
3
5
  declare class BsExchange implements ComponentInterface {
4
6
  name: string;
5
7
  id: string;
@@ -13,20 +15,34 @@ declare class BsExchange implements ComponentInterface {
13
15
  canSort: boolean;
14
16
  children: ComponentInterface[];
15
17
  dataType: ComponentInterface["dataType"];
18
+ goodImage: BsExchangeImage;
19
+ bsType: BsType;
20
+ bsMemo: BsMemo;
16
21
  constructor(options: PickOption);
17
22
  renderClient: (record: any) => React.JSX.Element | null;
18
- renderPc: (value: unknown, record: Record) => React.JSX.Element;
19
- renderLog: (r: Record) => React.JSX.Element | null;
23
+ renderPc: () => null;
24
+ renderLog: (r: Record) => null;
20
25
  getComponentValue: (r: Record) => any;
21
- renderExport: (value: any, record: any) => any;
26
+ renderExport: (value: any, record: any) => null;
22
27
  editRender: (p: any) => React.JSX.Element;
23
- filterConfig: (item: ColumnConfig) => {
28
+ filterConfig: (item: ColumnConfig) => ({
29
+ searchDefaultConditions: "eq";
30
+ type: string;
31
+ id: string;
32
+ name: string;
33
+ filterComponentType: "Cascader";
34
+ props: {
35
+ options: any[] | undefined;
36
+ };
37
+ filterFn: (value: string) => (i: Record) => boolean;
38
+ } | {
24
39
  searchDefaultConditions: "like";
25
40
  type: string;
26
41
  id: string;
27
42
  name: string;
28
43
  filterComponentType: "Input";
29
- filterFn: (value: string) => (i: Record) => any;
30
- };
44
+ props?: undefined;
45
+ filterFn?: undefined;
46
+ })[];
31
47
  }
32
48
  export default BsExchange;
@@ -1,4 +1,6 @@
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 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
+ 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; }
2
4
  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); }
3
5
  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); } }
4
6
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
@@ -13,9 +15,10 @@ import ItemView from "../../../commonComponents/ItemView";
13
15
  import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
14
16
  import { BsExchange as Exchange } from "@kmkf-fe-packages/basic-components";
15
17
  import { SYMBOL } from "../../../constant";
18
+ import BsExchangeImage from "../common/BsExchangeImage";
19
+ import { BsType, BsMemo, BsChildPic, BsChildName, BsChildCode, BsChildSku, BsChildMoney, BsChildNumber, BsChildShare, BsChildType } from "../common/index";
16
20
  var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
17
- var _this = this,
18
- _this$componentConfig2;
21
+ var _this = this;
19
22
  _classCallCheck(this, BsExchange);
20
23
  _defineProperty(this, "name", void 0);
21
24
  _defineProperty(this, "id", void 0);
@@ -29,38 +32,30 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
29
32
  _defineProperty(this, "canSort", void 0);
30
33
  _defineProperty(this, "children", void 0);
31
34
  _defineProperty(this, "dataType", void 0);
35
+ _defineProperty(this, "goodImage", void 0);
36
+ _defineProperty(this, "bsType", void 0);
37
+ _defineProperty(this, "bsMemo", void 0);
32
38
  _defineProperty(this, "renderClient", function (record) {
33
39
  return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
34
40
  id: _this.id,
35
41
  label: _this.name,
36
42
  value: /*#__PURE__*/React.createElement(GoodImage, {
37
- list: record === null || record === void 0 ? void 0 : record[_this.id],
43
+ list: _this.getComponentValue(record),
38
44
  type: "itemId"
39
45
  })
40
46
  }) : null;
41
47
  });
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 /*#__PURE__*/React.createElement(GoodImage, {
48
- list: record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsGoods")],
49
- type: "itemId"
50
- });
48
+ _defineProperty(this, "renderPc", function () {
49
+ return null;
51
50
  });
52
51
  _defineProperty(this, "renderLog", function (r) {
53
- if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_bsGoods")])) return null;
54
- return _this.renderPc(undefined, r);
52
+ return null;
55
53
  });
56
54
  _defineProperty(this, "getComponentValue", function (r) {
57
- return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_bsGoods")];
55
+ return r === null || r === void 0 ? void 0 : r["".concat(_this.id)];
58
56
  });
59
57
  _defineProperty(this, "renderExport", function (value, record) {
60
- var _ref;
61
- return (_ref = (record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsGoods")]) || []) === null || _ref === void 0 ? void 0 : _ref.map(function (i) {
62
- return i.numIid;
63
- }).join("\n");
58
+ return null;
64
59
  });
65
60
  _defineProperty(this, "editRender", function (p) {
66
61
  var _this$componentConfig, _this$effects, _this$effects2;
@@ -79,44 +74,185 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
79
74
  });
80
75
  });
81
76
  _defineProperty(this, "filterConfig", function (item) {
82
- return {
83
- searchDefaultConditions: SYMBOL.like,
77
+ var _item$config;
78
+ return [{
79
+ searchDefaultConditions: SYMBOL.eq,
84
80
  type: item.type,
85
- id: "".concat(item.id, "_bsGoods"),
86
- // 过滤组件id
87
- name: item.name,
88
- // 过滤组件名称
89
- filterComponentType: "Input",
81
+ id: "".concat(item.id, "_bsReissueType"),
82
+ name: "".concat(item.name, "-\u6362\u8D27\u7C7B\u578B"),
83
+ filterComponentType: "Cascader",
84
+ props: {
85
+ options: item === null || item === void 0 ? void 0 : (_item$config = item.config) === null || _item$config === void 0 ? void 0 : _item$config.reasonList
86
+ },
90
87
  filterFn: function filterFn(value) {
91
88
  return function (i) {
92
- var _ref2;
93
- return (_ref2 = _filterFn.filterTableListItemColumnValue(i, item.id, "bsGoods") || []) === null || _ref2 === void 0 ? void 0 : _ref2.some(function (item) {
94
- var _String;
95
- return item !== null && item !== void 0 && item.numIid ? (_String = String(item === null || item === void 0 ? void 0 : item.numIid)) === null || _String === void 0 ? void 0 : _String.includes(value) : false;
96
- });
89
+ return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, "bsReissueType"), value);
97
90
  };
98
91
  }
99
- };
92
+ }, {
93
+ searchDefaultConditions: SYMBOL.like,
94
+ type: item.type,
95
+ id: "".concat(item.id, "_bsExchangeReturnGoods"),
96
+ name: "".concat(_this.name, "-\u9000\u56DE"),
97
+ filterComponentType: "Input"
98
+ }, {
99
+ searchDefaultConditions: SYMBOL.like,
100
+ type: item.type,
101
+ id: "".concat(item.id, "_bsExchangeSwapOutGoods"),
102
+ name: "".concat(_this.name, "-\u6362\u51FA"),
103
+ filterComponentType: "Input"
104
+ }, {
105
+ searchDefaultConditions: SYMBOL.like,
106
+ type: item.type,
107
+ id: "".concat(item.id, "_bsExchangeGiftGoods"),
108
+ name: "".concat(_this.name, "-\u8D60\u54C1"),
109
+ filterComponentType: "Input"
110
+ }];
100
111
  });
101
112
  this.name = options.name;
102
113
  this.id = options.id;
103
- this.sortField = "".concat(options.id, "_bsGoods");
104
- this.formField = "".concat(options.id, "_bsGoods");
114
+ this.sortField = "".concat(options.id);
115
+ this.formField = "".concat(options.id);
105
116
  this.type = options.type;
106
117
  this.effects = options === null || options === void 0 ? void 0 : options.effects;
107
118
  this.isCombinationComponent = false;
108
119
  this.canSort = false;
109
- this.children = [];
120
+ this.goodImage = new BsExchangeImage(_objectSpread(_objectSpread({}, options), {}, {
121
+ id: "".concat(options.id),
122
+ name: "换货商品"
123
+ }));
124
+ this.bsType = new BsType(_objectSpread(_objectSpread({}, options), {}, {
125
+ id: "".concat(options.id, "_bsReissueType"),
126
+ name: "换货类型"
127
+ }));
128
+ this.bsMemo = new BsMemo(_objectSpread(_objectSpread({}, options), {}, {
129
+ id: "".concat(options.id, "_bsReissueType"),
130
+ name: "换货备注"
131
+ }));
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
+ }))];
110
211
  this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
111
- this.rules = this !== null && this !== void 0 && (_this$componentConfig2 = this.componentConfig) !== null && _this$componentConfig2 !== void 0 && _this$componentConfig2.required ? [{
212
+ this.rules = [{
112
213
  required: true,
113
214
  validator: function validator(_, value) {
114
- if (!value || !value.length) {
115
- return Promise.reject(new Error("请选择bs商品"));
215
+ var _value$bsExchangeRetu;
216
+ if (!value || !(value !== null && value !== void 0 && (_value$bsExchangeRetu = value.bsExchangeReturnGoods) !== null && _value$bsExchangeRetu !== void 0 && _value$bsExchangeRetu.length)) {
217
+ return Promise.reject(new Error("请选择bs换货商品"));
218
+ }
219
+ return Promise.resolve();
220
+ }
221
+ }, {
222
+ validator: function validator(_, value) {
223
+ var _value$bsExchangeType;
224
+ console.log(value);
225
+ 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])) {
226
+ var hasNoGood = ((value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods) || []).some(function (item) {
227
+ return !(item !== null && item !== void 0 && item.bsExchangeReturnGoods.length);
228
+ });
229
+ if (hasNoGood) {
230
+ return Promise.reject(new Error("请选择退回商品后再提交工单"));
231
+ }
232
+ var hasMore = ((value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods) || []).some(function (item) {
233
+ var returnMoney = ((item === null || item === void 0 ? void 0 : item.bsExchangeReturnGoods) || []).reduce(function (prv, next) {
234
+ prv += Number(next.money || 0);
235
+ return prv;
236
+ }, 0);
237
+ var swapOutMoney = ((item === null || item === void 0 ? void 0 : item.bsExchangeSwapOutGoods) || []).reduce(function (prv, next) {
238
+ prv += Number(next.money || 0);
239
+ return prv;
240
+ }, 0);
241
+ return returnMoney < swapOutMoney;
242
+ });
243
+ if (hasMore) {
244
+ return Promise.reject(new Error("换货商品的金额不能大于退回商品的金额"));
245
+ }
246
+ var hasLen = ((value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods) || []).some(function (item) {
247
+ return (item === null || item === void 0 ? void 0 : item.bsExchangeReturnGoods.length) !== (item === null || item === void 0 ? void 0 : item.bsExchangeSwapOutGoods.length);
248
+ });
249
+ if (hasLen) {
250
+ return Promise.reject(new Error("请核对商品数据,再提交工单"));
251
+ }
116
252
  }
117
253
  return Promise.resolve();
118
254
  }
119
- }] : [];
255
+ }];
120
256
  this.dataType = "object";
121
257
  });
122
258
  export default BsExchange;
@@ -14,11 +14,11 @@ declare class BsGoods implements ComponentInterface {
14
14
  children: ComponentInterface[];
15
15
  dataType: ComponentInterface["dataType"];
16
16
  constructor(options: PickOption);
17
- renderClient: (record: any) => React.JSX.Element | null;
18
- renderPc: (value: unknown, record: Record) => React.JSX.Element;
19
- renderLog: (r: Record) => React.JSX.Element | null;
17
+ renderClient: (record: any) => any;
18
+ renderPc: (value: unknown, record: Record) => any;
19
+ renderLog: (r: Record) => any;
20
20
  getComponentValue: (r: Record) => any;
21
- renderExport: (value: any, record: any) => any;
21
+ renderExport: () => null;
22
22
  editRender: (p: any) => React.JSX.Element;
23
23
  filterConfig: (item: ColumnConfig) => {
24
24
  searchDefaultConditions: "like";
@@ -26,7 +26,6 @@ declare class BsGoods implements ComponentInterface {
26
26
  id: string;
27
27
  name: string;
28
28
  filterComponentType: "Input";
29
- filterFn: (value: string) => (i: Record) => any;
30
29
  };
31
30
  }
32
31
  export default BsGoods;
@@ -1,4 +1,6 @@
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 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
+ 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; }
2
4
  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); }
3
5
  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); } }
4
6
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
@@ -8,9 +10,9 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
8
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); }
9
11
  import React from "react";
10
12
  import GetFormItem from "../../GetFormItem";
11
- import { GoodImage } from "../../Common";
12
- import ItemView from "../../../commonComponents/ItemView";
13
- import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
13
+ import { BsGoodImage } from "../../Common";
14
+ import { BsChildPic, BsChildName, BsChildCode, BsChildSku, BsChildMoney, BsChildNumber, BsChildShare, BsChildType } from "../common/index";
15
+ import { isNull } from "@kmkf-fe-packages/kmkf-utils";
14
16
  import { BsGoods as Goods } from "@kmkf-fe-packages/basic-components";
15
17
  import { SYMBOL } from "../../../constant";
16
18
  var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
@@ -30,13 +32,11 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
30
32
  _defineProperty(this, "children", void 0);
31
33
  _defineProperty(this, "dataType", void 0);
32
34
  _defineProperty(this, "renderClient", function (record) {
33
- return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
34
- id: _this.id,
35
- label: _this.name,
36
- value: /*#__PURE__*/React.createElement(GoodImage, {
37
- list: record === null || record === void 0 ? void 0 : record[_this.id],
38
- type: "itemId"
39
- })
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
40
  }) : null;
41
41
  });
42
42
  _defineProperty(this, "renderPc", function (value, record) {
@@ -44,9 +44,11 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
44
44
  return /*#__PURE__*/React.createElement("span", null, "--");
45
45
  }
46
46
  //兼容多个商品
47
- return /*#__PURE__*/React.createElement(GoodImage, {
48
- list: record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsGoods")],
49
- type: "itemId"
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
+ });
50
52
  });
51
53
  });
52
54
  _defineProperty(this, "renderLog", function (r) {
@@ -56,11 +58,8 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
56
58
  _defineProperty(this, "getComponentValue", function (r) {
57
59
  return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_bsGoods")];
58
60
  });
59
- _defineProperty(this, "renderExport", function (value, record) {
60
- var _ref;
61
- return (_ref = (record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsGoods")]) || []) === null || _ref === void 0 ? void 0 : _ref.map(function (i) {
62
- return i.numIid;
63
- }).join("\n");
61
+ _defineProperty(this, "renderExport", function () {
62
+ return null;
64
63
  });
65
64
  _defineProperty(this, "editRender", function (p) {
66
65
  var _this$componentConfig, _this$effects, _this$effects2;
@@ -86,16 +85,7 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
86
85
  // 过滤组件id
87
86
  name: item.name,
88
87
  // 过滤组件名称
89
- filterComponentType: "Input",
90
- filterFn: function filterFn(value) {
91
- return function (i) {
92
- var _ref2;
93
- return (_ref2 = _filterFn.filterTableListItemColumnValue(i, item.id, "bsGoods") || []) === null || _ref2 === void 0 ? void 0 : _ref2.some(function (item) {
94
- var _String;
95
- return item !== null && item !== void 0 && item.numIid ? (_String = String(item === null || item === void 0 ? void 0 : item.numIid)) === null || _String === void 0 ? void 0 : _String.includes(value) : false;
96
- });
97
- };
98
- }
88
+ filterComponentType: "Input"
99
89
  };
100
90
  });
101
91
  this.name = options.name;
@@ -106,7 +96,31 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
106
96
  this.effects = options === null || options === void 0 ? void 0 : options.effects;
107
97
  this.isCombinationComponent = false;
108
98
  this.canSort = false;
109
- this.children = [];
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
+ }))];
110
124
  this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
111
125
  this.rules = this !== null && this !== void 0 && (_this$componentConfig2 = this.componentConfig) !== null && _this$componentConfig2 !== void 0 && _this$componentConfig2.required ? [{
112
126
  required: true,
@@ -15,18 +15,29 @@ declare class BsReissue implements ComponentInterface {
15
15
  dataType: ComponentInterface["dataType"];
16
16
  constructor(options: PickOption);
17
17
  renderClient: (record: any) => React.JSX.Element | null;
18
- renderPc: (value: unknown, record: Record) => React.JSX.Element;
19
- renderLog: (r: Record) => React.JSX.Element | null;
18
+ renderPc: () => null;
19
+ renderLog: (r: Record) => null;
20
20
  getComponentValue: (r: Record) => any;
21
- renderExport: (value: any, record: any) => any;
21
+ renderExport: () => null;
22
22
  editRender: (p: any) => React.JSX.Element;
23
- filterConfig: (item: ColumnConfig) => {
23
+ filterConfig: (item: ColumnConfig) => ({
24
+ searchDefaultConditions: "eq";
25
+ type: string;
26
+ id: string;
27
+ name: string;
28
+ filterComponentType: "Cascader";
29
+ props: {
30
+ options: any[] | undefined;
31
+ };
32
+ filterFn: (value: string) => (i: Record) => boolean;
33
+ } | {
24
34
  searchDefaultConditions: "like";
25
35
  type: string;
26
36
  id: string;
27
37
  name: string;
28
38
  filterComponentType: "Input";
29
- filterFn: (value: string) => (i: Record) => any;
30
- };
39
+ props?: undefined;
40
+ filterFn?: undefined;
41
+ })[];
31
42
  }
32
43
  export default BsReissue;
@@ -1,4 +1,6 @@
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 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
+ 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; }
2
4
  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); }
3
5
  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); } }
4
6
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
@@ -13,6 +15,7 @@ import ItemView from "../../../commonComponents/ItemView";
13
15
  import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
14
16
  import { BsReissue as Reissue } from "@kmkf-fe-packages/basic-components";
15
17
  import { SYMBOL } from "../../../constant";
18
+ import { BsType, BsMemo, BsChildPic, BsChildName, BsChildCode, BsChildSku, BsChildMoney, BsChildNumber, BsChildShare, BsChildType } from "../common/index";
16
19
  var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
17
20
  var _this = this,
18
21
  _this$componentConfig2;
@@ -39,28 +42,17 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
39
42
  })
40
43
  }) : null;
41
44
  });
42
- _defineProperty(this, "renderPc", function (value, record) {
43
- if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsReissueGoods")]) === undefined) {
44
- return /*#__PURE__*/React.createElement("span", null, "--");
45
- }
46
- //兼容多个商品
47
- return /*#__PURE__*/React.createElement(GoodImage, {
48
- list: record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsReissueGoods")],
49
- type: "itemId"
50
- });
45
+ _defineProperty(this, "renderPc", function () {
46
+ return null;
51
47
  });
52
48
  _defineProperty(this, "renderLog", function (r) {
53
- if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_bsReissueGoods")])) return null;
54
- return _this.renderPc(undefined, r);
49
+ return null;
55
50
  });
56
51
  _defineProperty(this, "getComponentValue", function (r) {
57
52
  return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_bsReissueGoods")];
58
53
  });
59
- _defineProperty(this, "renderExport", function (value, record) {
60
- var _ref;
61
- return (_ref = (record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsReissueGoods")]) || []) === null || _ref === void 0 ? void 0 : _ref.map(function (i) {
62
- return i.numIid;
63
- }).join("\n");
54
+ _defineProperty(this, "renderExport", function () {
55
+ return null;
64
56
  });
65
57
  _defineProperty(this, "editRender", function (p) {
66
58
  var _this$componentConfig, _this$effects, _this$effects2;
@@ -79,40 +71,75 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
79
71
  });
80
72
  });
81
73
  _defineProperty(this, "filterConfig", function (item) {
82
- return {
83
- searchDefaultConditions: SYMBOL.like,
74
+ var _item$config;
75
+ return [{
76
+ searchDefaultConditions: SYMBOL.eq,
84
77
  type: item.type,
85
- id: "".concat(item.id, "_bsReissueGoods"),
86
- // 过滤组件id
87
- name: item.name,
88
- // 过滤组件名称
89
- filterComponentType: "Input",
78
+ id: "".concat(item.id, "_bsReissueType"),
79
+ name: "".concat(item.name, "-\u6362\u8D27\u7C7B\u578B"),
80
+ filterComponentType: "Cascader",
81
+ props: {
82
+ options: item === null || item === void 0 ? void 0 : (_item$config = item.config) === null || _item$config === void 0 ? void 0 : _item$config.reasonList
83
+ },
90
84
  filterFn: function filterFn(value) {
91
85
  return function (i) {
92
- var _ref2;
93
- return (_ref2 = _filterFn.filterTableListItemColumnValue(i, item.id, "bsGoods") || []) === null || _ref2 === void 0 ? void 0 : _ref2.some(function (item) {
94
- var _String;
95
- return item !== null && item !== void 0 && item.numIid ? (_String = String(item === null || item === void 0 ? void 0 : item.numIid)) === null || _String === void 0 ? void 0 : _String.includes(value) : false;
96
- });
86
+ return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, "bsReissueType"), value);
97
87
  };
98
88
  }
99
- };
89
+ }, {
90
+ searchDefaultConditions: SYMBOL.like,
91
+ type: item.type,
92
+ id: "".concat(item.id, "_bsReissueGoods"),
93
+ name: "".concat(_this.name),
94
+ filterComponentType: "Input"
95
+ }];
100
96
  });
101
97
  this.name = options.name;
102
98
  this.id = options.id;
103
- this.sortField = "".concat(options.id, "_bsReissueGoods");
104
- this.formField = "".concat(options.id, "_bsReissueGoods");
99
+ this.sortField = "".concat(options.id);
100
+ this.formField = "".concat(options.id);
105
101
  this.type = options.type;
106
102
  this.effects = options === null || options === void 0 ? void 0 : options.effects;
107
103
  this.isCombinationComponent = false;
108
104
  this.canSort = false;
109
- this.children = [];
105
+ this.children = [new BsType(_objectSpread(_objectSpread({}, options), {}, {
106
+ id: "".concat(options.id, "_bsReissueType"),
107
+ name: "补发类型"
108
+ })), new BsMemo(_objectSpread(_objectSpread({}, options), {}, {
109
+ id: "".concat(options.id, "_bsReissueType"),
110
+ name: "补发备注"
111
+ })), new BsChildPic(_objectSpread(_objectSpread({}, options), {}, {
112
+ name: "bs图片",
113
+ id: "".concat(options.id, "_bsReissueGoods")
114
+ })), new BsChildName(_objectSpread(_objectSpread({}, options), {}, {
115
+ name: "名称",
116
+ id: "".concat(options.id, "_bsReissueGoods")
117
+ })), new BsChildCode(_objectSpread(_objectSpread({}, options), {}, {
118
+ name: "编码",
119
+ id: "".concat(options.id, "_bsReissueGoods")
120
+ })), new BsChildSku(_objectSpread(_objectSpread({}, options), {}, {
121
+ name: "sku编码",
122
+ id: "".concat(options.id, "_bsReissueGoods")
123
+ })), new BsChildMoney(_objectSpread(_objectSpread({}, options), {}, {
124
+ name: "实付金额",
125
+ id: "".concat(options.id, "_bsReissueGoods")
126
+ })), new BsChildNumber(_objectSpread(_objectSpread({}, options), {}, {
127
+ name: "数量",
128
+ id: "".concat(options.id, "_bsReissueGoods")
129
+ })), new BsChildShare(_objectSpread(_objectSpread({}, options), {}, {
130
+ name: "分摊价",
131
+ id: "".concat(options.id, "_bsReissueGoods")
132
+ })), new BsChildType(_objectSpread(_objectSpread({}, options), {}, {
133
+ name: "赠品类型",
134
+ id: "".concat(options.id, "_bsReissueGoods")
135
+ }))];
110
136
  this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
111
137
  this.rules = this !== null && this !== void 0 && (_this$componentConfig2 = this.componentConfig) !== null && _this$componentConfig2 !== void 0 && _this$componentConfig2.required ? [{
112
138
  required: true,
113
139
  validator: function validator(_, value) {
114
- if (!value || !value.length) {
115
- return Promise.reject(new Error("请选择bs商品"));
140
+ var _value$bsReissueGoods;
141
+ if (!value || !(value !== null && value !== void 0 && (_value$bsReissueGoods = value.bsReissueGoods) !== null && _value$bsReissueGoods !== void 0 && _value$bsReissueGoods.length)) {
142
+ return Promise.reject(new Error("请选择bs补发商品"));
116
143
  }
117
144
  return Promise.resolve();
118
145
  }