@kmkf-fe-packages/services-components 0.7.15-alpha.60 → 0.7.15-alpha.62

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.
@@ -1,21 +1,24 @@
1
- import { ComponentInterface, PickOption, ColumnConfig, Record } from '../../../type';
2
- import React from 'react';
3
- import { BsType, BsMemo } 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
+ returnGoods: BsHeaderGood;
20
+ swapOutGoods: BsHeaderGood;
21
+ giftGoods: BsHeaderGood;
19
22
  constructor(options: PickOption);
20
23
  renderClient: (record: any) => React.JSX.Element | null;
21
24
  renderPc: () => null;
@@ -1,10 +1,4 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
7
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
8
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; }
9
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; }
10
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); }
@@ -14,145 +8,142 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
14
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; }
15
9
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
16
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); }
17
- import React from 'react';
11
+ import React from "react";
18
12
  import GetFormItem from "../../GetFormItem";
19
13
  import { BsGoodsTable, BsExchangeList } from "../../Common";
20
14
  import ItemView from "../../../commonComponents/ItemView";
21
- import { isNull } from '@kmkf-fe-packages/kmkf-utils';
22
- 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";
23
17
  import { SYMBOL } from "../../../constant";
24
- import { BsType, BsMemo, BsHeaderPic, BsHeaderName, BsHeaderCode, BsHeaderSku, BsHeaderMoney, BsHeaderNumber, BsHeaderShare, BsHeaderType } from "../common/index";
18
+ import { BsType, BsMemo, BsHeaderPic, BsHeaderName, BsHeaderCode, BsHeaderSku, BsHeaderMoney, BsHeaderNumber, BsHeaderShare, BsHeaderType, BsHeaderGood } from "../common/index";
25
19
  var returnHeaderMap = {
26
20
  pic: {
27
21
  component: BsHeaderPic,
28
- name: '退回图片',
29
- key: 'pic'
22
+ name: "退回图片",
23
+ key: "pic"
30
24
  },
31
25
  name: {
32
26
  component: BsHeaderName,
33
- name: '退回名称',
34
- key: 'name'
27
+ name: "退回名称",
28
+ key: "name"
35
29
  },
36
30
  code: {
37
31
  component: BsHeaderCode,
38
- name: '退回编码',
39
- key: 'code'
32
+ name: "退回编码",
33
+ key: "code"
40
34
  },
41
35
  sku: {
42
36
  component: BsHeaderSku,
43
- name: '退回sku编码',
44
- key: 'sku'
37
+ name: "退回sku编码",
38
+ key: "sku"
45
39
  },
46
40
  money: {
47
41
  component: BsHeaderMoney,
48
- name: '退回实付金额',
49
- key: 'money'
42
+ name: "退回实付金额",
43
+ key: "money"
50
44
  },
51
45
  number: {
52
46
  component: BsHeaderNumber,
53
- name: '退回数量',
54
- key: 'number'
47
+ name: "退回数量",
48
+ key: "number"
55
49
  },
56
50
  share: {
57
51
  component: BsHeaderShare,
58
- name: '退回分摊价',
59
- key: 'share'
52
+ name: "退回分摊价",
53
+ key: "share"
60
54
  },
61
55
  type: {
62
56
  component: BsHeaderType,
63
- name: '退回赠品类型',
64
- key: 'giftType'
57
+ name: "退回赠品类型",
58
+ key: "giftType"
65
59
  }
66
60
  };
67
61
  var swapOutHeaderMap = {
68
62
  pic: {
69
63
  component: BsHeaderPic,
70
- name: '换出图片',
71
- key: 'pic'
64
+ name: "换出图片",
65
+ key: "pic"
72
66
  },
73
67
  name: {
74
68
  component: BsHeaderName,
75
- name: '换出名称',
76
- key: 'name'
69
+ name: "换出名称",
70
+ key: "name"
77
71
  },
78
72
  code: {
79
73
  component: BsHeaderCode,
80
- name: '换出编码',
81
- key: 'code'
74
+ name: "换出编码",
75
+ key: "code"
82
76
  },
83
77
  sku: {
84
78
  component: BsHeaderSku,
85
- name: '换出sku编码',
86
- key: 'sku'
79
+ name: "换出sku编码",
80
+ key: "sku"
87
81
  },
88
82
  money: {
89
83
  component: BsHeaderMoney,
90
- name: '换出实付金额',
91
- key: 'money'
84
+ name: "换出实付金额",
85
+ key: "money"
92
86
  },
93
87
  number: {
94
88
  component: BsHeaderNumber,
95
- name: '换出数量',
96
- key: 'number'
89
+ name: "换出数量",
90
+ key: "number"
97
91
  },
98
92
  share: {
99
93
  component: BsHeaderShare,
100
- name: '换出分摊价',
101
- key: 'share'
94
+ name: "换出分摊价",
95
+ key: "share"
102
96
  },
103
97
  type: {
104
98
  component: BsHeaderType,
105
- name: '换出赠品类型',
106
- key: 'type'
99
+ name: "换出赠品类型",
100
+ key: "type"
107
101
  }
108
102
  };
109
103
  var giftHeaderMap = {
110
104
  pic: {
111
105
  component: BsHeaderPic,
112
- name: '赠品图片',
113
- key: 'pic'
106
+ name: "赠品图片",
107
+ key: "pic"
114
108
  },
115
109
  name: {
116
110
  component: BsHeaderName,
117
- name: '赠品名称',
118
- key: 'name'
111
+ name: "赠品名称",
112
+ key: "name"
119
113
  },
120
114
  code: {
121
115
  component: BsHeaderCode,
122
- name: '赠品编码',
123
- key: 'code'
116
+ name: "赠品编码",
117
+ key: "code"
124
118
  },
125
119
  sku: {
126
120
  component: BsHeaderSku,
127
- name: '赠品sku编码',
128
- key: 'sku'
121
+ name: "赠品sku编码",
122
+ key: "sku"
129
123
  },
130
124
  money: {
131
125
  component: BsHeaderMoney,
132
- name: '赠品实付金额',
133
- key: 'money'
126
+ name: "赠品实付金额",
127
+ key: "money"
134
128
  },
135
129
  number: {
136
130
  component: BsHeaderNumber,
137
- name: '赠品数量',
138
- key: 'number'
131
+ name: "赠品数量",
132
+ key: "number"
139
133
  },
140
134
  share: {
141
135
  component: BsHeaderShare,
142
- name: '赠品分摊价',
143
- key: 'share'
136
+ name: "赠品分摊价",
137
+ key: "share"
144
138
  },
145
139
  type: {
146
140
  component: BsHeaderType,
147
- name: '赠品赠品类型',
148
- key: 'giftType'
141
+ name: "赠品赠品类型",
142
+ key: "giftType"
149
143
  }
150
144
  };
151
145
  var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
152
- var _this = this,
153
- _options$componentCon,
154
- _options$componentCon2,
155
- _options$componentCon3;
146
+ var _this = this;
156
147
  _classCallCheck(this, BsExchange);
157
148
  _defineProperty(this, "name", void 0);
158
149
  _defineProperty(this, "id", void 0);
@@ -168,23 +159,26 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
168
159
  _defineProperty(this, "dataType", void 0);
169
160
  _defineProperty(this, "bsType", void 0);
170
161
  _defineProperty(this, "bsMemo", void 0);
162
+ _defineProperty(this, "returnGoods", void 0);
163
+ _defineProperty(this, "swapOutGoods", void 0);
164
+ _defineProperty(this, "giftGoods", void 0);
171
165
  _defineProperty(this, "renderClient", function (record) {
172
166
  var _record, _record$bsExchangeTyp, _this$componentConfig, _record2, _record2$bsExchangeTy, _this$componentConfig2, _record3, _record3$bsExchangeTy, _this$componentConfig3;
173
- 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, {
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, {
174
168
  id: _this.id,
175
169
  label: "".concat(_this.name),
176
170
  value: /*#__PURE__*/React.createElement(BsGoodsTable, {
177
171
  list: (record === null || record === void 0 ? void 0 : record["".concat(_this.id)].bsExchangeReturnGoods) || [],
178
172
  showHeader: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.showHeader) || []
179
173
  })
180
- }) : 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, {
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, {
181
175
  id: _this.id,
182
176
  label: "".concat(_this.name),
183
177
  value: /*#__PURE__*/React.createElement(BsExchangeList, {
184
178
  list: (record === null || record === void 0 ? void 0 : record["".concat(_this.id)].bsExchangeSwapOutGoods) || [],
185
179
  showHeader: ((_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.showHeader) || []
186
180
  })
187
- }) : 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, {
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, {
188
182
  id: _this.id,
189
183
  label: "".concat(_this.name, "-\u8D60\u54C1"),
190
184
  value: /*#__PURE__*/React.createElement(BsGoodsTable, {
@@ -228,13 +222,13 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
228
222
  type: item.type,
229
223
  id: "".concat(item.id, "_bsExchangeType"),
230
224
  name: "".concat(item.name, "-\u6362\u8D27\u7C7B\u578B"),
231
- filterComponentType: 'Cascader',
225
+ filterComponentType: "Cascader",
232
226
  props: {
233
227
  options: item === null || item === void 0 ? void 0 : (_item$templateConfig = item.templateConfig) === null || _item$templateConfig === void 0 ? void 0 : _item$templateConfig.reasonList,
234
228
  fieldNames: {
235
- label: 'label',
236
- value: 'value',
237
- children: 'children'
229
+ label: "label",
230
+ value: "value",
231
+ children: "children"
238
232
  }
239
233
  },
240
234
  formatFilterValue: function formatFilterValue(val) {
@@ -247,19 +241,19 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
247
241
  type: item.type,
248
242
  id: "".concat(item.id, "_bsExchangeReturnGoods"),
249
243
  name: "".concat(_this.name, "-\u9000\u56DE"),
250
- filterComponentType: 'Input'
244
+ filterComponentType: "Input"
251
245
  }, {
252
246
  searchDefaultConditions: SYMBOL.like,
253
247
  type: item.type,
254
248
  id: "".concat(item.id, "_bsExchangeSwapOutGoods"),
255
249
  name: "".concat(_this.name, "-\u6362\u51FA"),
256
- filterComponentType: 'Input'
250
+ filterComponentType: "Input"
257
251
  }, {
258
252
  searchDefaultConditions: SYMBOL.like,
259
253
  type: item.type,
260
254
  id: "".concat(item.id, "_bsExchangeGiftGoods"),
261
255
  name: "".concat(_this.name, "-\u8D60\u54C1"),
262
- filterComponentType: 'Input'
256
+ filterComponentType: "Input"
263
257
  }];
264
258
  });
265
259
  this.name = options.name;
@@ -272,55 +266,90 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
272
266
  this.canSort = false;
273
267
  this.bsType = new BsType(_objectSpread(_objectSpread({}, options), {}, {
274
268
  id: "".concat(options.id, "_bsExchangeType_type"),
275
- name: '换货类型'
269
+ name: "换货类型"
276
270
  }));
277
271
  this.bsMemo = new BsMemo(_objectSpread(_objectSpread({}, options), {}, {
278
272
  id: "".concat(options.id, "_bsExchangeType_memo"),
279
- name: '换货备注'
273
+ name: "换货备注"
280
274
  }));
281
- this.children = [this.bsType, this.bsMemo].concat(_toConsumableArray(((options === null || options === void 0 ? void 0 : (_options$componentCon = options.componentConfig) === null || _options$componentCon === void 0 ? void 0 : _options$componentCon.showHeader) || []).reduce(function (prv, next) {
282
- if (returnHeaderMap[next]) {
283
- prv.push(new returnHeaderMap[next].component(_objectSpread(_objectSpread({}, options), {}, {
284
- name: returnHeaderMap[next].name,
285
- id: "".concat(options.id, "_bsExchangeReturnGoods_").concat(returnHeaderMap[next].key)
286
- })));
287
- }
288
- return prv;
289
- }, [])), _toConsumableArray(((options === null || options === void 0 ? void 0 : (_options$componentCon2 = options.componentConfig) === null || _options$componentCon2 === void 0 ? void 0 : _options$componentCon2.showHeader) || []).reduce(function (prv, next) {
290
- if (swapOutHeaderMap[next]) {
291
- prv.push(new swapOutHeaderMap[next].component(_objectSpread(_objectSpread({}, options), {}, {
292
- name: swapOutHeaderMap[next].name,
293
- id: "".concat(options.id, "_bsExchangeSwapOutGoods_").concat(swapOutHeaderMap[next].key)
294
- })));
295
- }
296
- return prv;
297
- }, [])), _toConsumableArray(((options === null || options === void 0 ? void 0 : (_options$componentCon3 = options.componentConfig) === null || _options$componentCon3 === void 0 ? void 0 : _options$componentCon3.showHeader) || []).reduce(function (prv, next) {
298
- if (giftHeaderMap[next]) {
299
- prv.push(new giftHeaderMap[next].component(_objectSpread(_objectSpread({}, options), {}, {
300
- name: giftHeaderMap[next].name,
301
- id: "".concat(options.id, "_bsExchangeGiftGoods_").concat(giftHeaderMap[next].key)
302
- })));
303
- }
304
- return prv;
305
- }, [])));
275
+ this.returnGoods = new BsHeaderGood(_objectSpread(_objectSpread({}, options), {}, {
276
+ id: "".concat(options.id, "_bsExchangeReturnGoods"),
277
+ name: "退回商品"
278
+ }));
279
+ this.swapOutGoods = new BsHeaderGood(_objectSpread(_objectSpread({}, options), {}, {
280
+ id: "".concat(options.id, "_bsExchangeSwapOutGoods"),
281
+ name: "换出商品"
282
+ }));
283
+ this.giftGoods = new BsHeaderGood(_objectSpread(_objectSpread({}, options), {}, {
284
+ id: "".concat(options.id, "_bsExchangeGiftGoods"),
285
+ name: "赠品商品"
286
+ }));
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
+
306
335
  this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
307
336
  this.rules = [{
308
337
  validator: function validator(_, value) {
309
338
  var _this$componentConfig5, _value$bsExchangeRetu;
310
339
  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)) {
311
- return Promise.reject(new Error('请选择bs换货商品'));
340
+ return Promise.reject(new Error("请选择bs换货商品"));
312
341
  }
313
342
  return Promise.resolve();
314
343
  }
315
344
  }, {
316
345
  validator: function validator(_, value) {
317
346
  var _value$bsExchangeType;
318
- 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])) {
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])) {
319
348
  var hasNoGood = ((value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods) || []).some(function (item) {
320
349
  return !(item !== null && item !== void 0 && item.bsExchangeReturnGoods.length);
321
350
  });
322
351
  if (hasNoGood) {
323
- return Promise.reject(new Error('请选择退回商品后再提交工单'));
352
+ return Promise.reject(new Error("请选择退回商品后再提交工单"));
324
353
  }
325
354
  var hasMore = ((value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods) || []).some(function (item) {
326
355
  var returnMoney = ((item === null || item === void 0 ? void 0 : item.bsExchangeReturnGoods) || []).reduce(function (prv, next) {
@@ -334,18 +363,18 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
334
363
  return returnMoney < swapOutMoney;
335
364
  });
336
365
  if (hasMore) {
337
- return Promise.reject(new Error('换货商品的金额不能大于退回商品的金额'));
366
+ return Promise.reject(new Error("换货商品的金额不能大于退回商品的金额"));
338
367
  }
339
368
  var hasLen = ((value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods) || []).some(function (item) {
340
369
  return (item === null || item === void 0 ? void 0 : item.bsExchangeReturnGoods.length) !== (item === null || item === void 0 ? void 0 : item.bsExchangeSwapOutGoods.length);
341
370
  });
342
371
  if (hasLen) {
343
- return Promise.reject(new Error('请核对商品数据,再提交工单'));
372
+ return Promise.reject(new Error("请核对商品数据,再提交工单"));
344
373
  }
345
374
  }
346
375
  return Promise.resolve();
347
376
  }
348
377
  }];
349
- this.dataType = 'object';
378
+ this.dataType = "object";
350
379
  });
351
380
  export default BsExchange;
@@ -0,0 +1,27 @@
1
+ import { ComponentInterface, PickOption, ALignType, Record } from '../../../type';
2
+ import React from 'react';
3
+ declare class BsHeaderGods 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 BsHeaderGods;
@@ -0,0 +1,156 @@
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; }
4
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
5
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
6
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
7
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
8
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
9
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
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
+ 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
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
+ 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
+ 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
+ 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
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
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); }
20
+ import React from 'react';
21
+ import ItemView from "../../../commonComponents/ItemView";
22
+ import { isNull } from '@kmkf-fe-packages/kmkf-utils';
23
+ import { BsHeaderPic, BsHeaderName, BsHeaderCode, BsHeaderSku, BsHeaderMoney, BsHeaderNumber, BsHeaderShare, BsHeaderType } from "./index";
24
+ var HeaderMap = {
25
+ pic: {
26
+ component: BsHeaderPic,
27
+ name: '图片',
28
+ key: 'pic'
29
+ },
30
+ name: {
31
+ component: BsHeaderName,
32
+ name: '名称',
33
+ key: 'name'
34
+ },
35
+ code: {
36
+ component: BsHeaderCode,
37
+ name: '编码',
38
+ key: 'code'
39
+ },
40
+ sku: {
41
+ component: BsHeaderSku,
42
+ name: 'sku编码',
43
+ key: 'sku'
44
+ },
45
+ money: {
46
+ component: BsHeaderMoney,
47
+ name: '实付金额',
48
+ key: 'money'
49
+ },
50
+ number: {
51
+ component: BsHeaderNumber,
52
+ name: '数量',
53
+ key: 'number'
54
+ },
55
+ share: {
56
+ component: BsHeaderShare,
57
+ name: '分摊价',
58
+ key: 'share'
59
+ },
60
+ type: {
61
+ component: BsHeaderType,
62
+ name: '赠品类型',
63
+ key: 'giftType'
64
+ }
65
+ };
66
+ var BsHeaderGods = /*#__PURE__*/_createClass(function BsHeaderGods(options) {
67
+ var _this = this,
68
+ _options$componentCon;
69
+ _classCallCheck(this, BsHeaderGods);
70
+ _defineProperty(this, "name", void 0);
71
+ _defineProperty(this, "id", void 0);
72
+ _defineProperty(this, "sortField", void 0);
73
+ _defineProperty(this, "type", void 0);
74
+ _defineProperty(this, "componentConfig", void 0);
75
+ _defineProperty(this, "align", void 0);
76
+ _defineProperty(this, "width", void 0);
77
+ _defineProperty(this, "isCombinationComponent", void 0);
78
+ _defineProperty(this, "formField", void 0);
79
+ _defineProperty(this, "canSort", void 0);
80
+ _defineProperty(this, "children", void 0);
81
+ _defineProperty(this, "dataType", void 0);
82
+ _defineProperty(this, "itemKey", void 0);
83
+ _defineProperty(this, "getParentId", function () {
84
+ var _this$id$split = _this.id.split('_'),
85
+ _this$id$split2 = _slicedToArray(_this$id$split, 3),
86
+ key = _this$id$split2[0],
87
+ name = _this$id$split2[1],
88
+ code = _this$id$split2[2];
89
+ return "".concat(key, "_").concat(name);
90
+ });
91
+ _defineProperty(this, "renderClient", function (record) {
92
+ return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
93
+ id: _this.id,
94
+ label: _this.name,
95
+ value: _this.getComponentValue(record)
96
+ }) : null;
97
+ });
98
+ _defineProperty(this, "renderPc", function (value, record) {
99
+ var _this$getComponentVal;
100
+ return /*#__PURE__*/React.createElement("span", null, (_this$getComponentVal = _this.getComponentValue(record)) !== null && _this$getComponentVal !== void 0 ? _this$getComponentVal : '--');
101
+ });
102
+ _defineProperty(this, "renderLog", function (r) {
103
+ var id = _this.getParentId();
104
+ if (isNull(r === null || r === void 0 ? void 0 : r[id])) return null;
105
+ return _this.renderPc(undefined, r);
106
+ });
107
+ _defineProperty(this, "getComponentValue", function (r) {
108
+ var id = _this.getParentId();
109
+ var list = ((r === null || r === void 0 ? void 0 : r[id]) || []).reduce(function (prv, next) {
110
+ next['money'] && prv.push(next['money']);
111
+ return prv;
112
+ }, []);
113
+ return list.join(',');
114
+ });
115
+ _defineProperty(this, "renderExport", function (value, record) {
116
+ var _this$getComponentVal2;
117
+ return (_this$getComponentVal2 = _this.getComponentValue(record)) !== null && _this$getComponentVal2 !== void 0 ? _this$getComponentVal2 : '--';
118
+ });
119
+ _defineProperty(this, "editRender", function () {
120
+ return null;
121
+ });
122
+ _defineProperty(this, "filterConfig", function () {
123
+ return [];
124
+ });
125
+ this.name = options.name;
126
+ this.id = options.id;
127
+ this.sortField = options.id;
128
+ this.formField = options.id;
129
+ this.type = options.type;
130
+ this.componentConfig = options.componentConfig;
131
+ this.align = 'left';
132
+ this.width = 200;
133
+ this.isCombinationComponent = true;
134
+ this.canSort = false;
135
+ this.dataType = 'string';
136
+ this.itemKey = {
137
+ pic: '图片',
138
+ name: '名称',
139
+ code: '编码',
140
+ sku: 'sku编码',
141
+ money: '实付金额',
142
+ number: '数量',
143
+ share: '分摊价',
144
+ type: '赠品类型'
145
+ };
146
+ this.children = _toConsumableArray(((options === null || options === void 0 ? void 0 : (_options$componentCon = options.componentConfig) === null || _options$componentCon === void 0 ? void 0 : _options$componentCon.showHeader) || []).reduce(function (prv, next) {
147
+ if (HeaderMap[next]) {
148
+ prv.push(new HeaderMap[next].component(_objectSpread(_objectSpread({}, options), {}, {
149
+ name: _this.itemKey[next],
150
+ id: "".concat(options.id, "_").concat(HeaderMap[next].key)
151
+ })));
152
+ }
153
+ return prv;
154
+ }, []));
155
+ });
156
+ export default BsHeaderGods;
@@ -1,10 +1,11 @@
1
- export { default as BsType } from './BsType';
2
- export { default as BsMemo } from './BsMemo';
3
- export { default as BsHeaderPic } from './BsHeaderPic';
4
- export { default as BsHeaderName } from './BsHeaderName';
5
- export { default as BsHeaderCode } from './BsHeaderCode';
6
- export { default as BsHeaderSku } from './BsHeaderSku';
7
- export { default as BsHeaderMoney } from './BsHeaderMoney';
8
- export { default as BsHeaderNumber } from './BsHeaderNumber';
9
- export { default as BsHeaderShare } from './BsHeaderShare';
10
- export { default as BsHeaderType } from './BsHeaderType';
1
+ export { default as BsType } from "./BsType";
2
+ export { default as BsMemo } from "./BsMemo";
3
+ export { default as BsHeaderPic } from "./BsHeaderPic";
4
+ export { default as BsHeaderName } from "./BsHeaderName";
5
+ export { default as BsHeaderCode } from "./BsHeaderCode";
6
+ export { default as BsHeaderSku } from "./BsHeaderSku";
7
+ export { default as BsHeaderMoney } from "./BsHeaderMoney";
8
+ export { default as BsHeaderNumber } from "./BsHeaderNumber";
9
+ export { default as BsHeaderShare } from "./BsHeaderShare";
10
+ export { default as BsHeaderType } from "./BsHeaderType";
11
+ export { default as BsHeaderGood } from "./BsHeaderGood";
@@ -7,4 +7,5 @@ export { default as BsHeaderSku } from "./BsHeaderSku";
7
7
  export { default as BsHeaderMoney } from "./BsHeaderMoney";
8
8
  export { default as BsHeaderNumber } from "./BsHeaderNumber";
9
9
  export { default as BsHeaderShare } from "./BsHeaderShare";
10
- export { default as BsHeaderType } from "./BsHeaderType";
10
+ export { default as BsHeaderType } from "./BsHeaderType";
11
+ export { default as BsHeaderGood } from "./BsHeaderGood";
@@ -19,7 +19,7 @@ declare class ExpressCode implements ComponentInterface {
19
19
  renderPc: (value: unknown, record: Record) => React.JSX.Element;
20
20
  renderLog: (r: Record) => React.JSX.Element | null;
21
21
  getComponentValue: (r: Record) => any;
22
- renderExport: (value: string, record: Record) => any;
22
+ renderExport: (value: string, record: Record) => string;
23
23
  editRender: (p: any) => React.JSX.Element;
24
24
  filterConfig: (item: ColumnConfig) => {
25
25
  searchDefaultConditions: "like";
@@ -47,8 +47,8 @@ var ExpressCode = /*#__PURE__*/_createClass(function ExpressCode(options) {
47
47
  return r === null || r === void 0 ? void 0 : r[_this.id];
48
48
  });
49
49
  _defineProperty(this, "renderExport", function (value, record) {
50
- var _record$_this$id2;
51
- return (_record$_this$id2 = record === null || record === void 0 ? void 0 : record[_this.id]) !== null && _record$_this$id2 !== void 0 ? _record$_this$id2 : "--";
50
+ var _ref;
51
+ return (_ref = "".concat(record === null || record === void 0 ? void 0 : record[_this.id])) !== null && _ref !== void 0 ? _ref : "--";
52
52
  });
53
53
  _defineProperty(this, "editRender", function (p) {
54
54
  var _this$componentConfig, _this$componentConfig2, _this$componentConfig3, _this$componentConfig4;
@@ -1,5 +1,5 @@
1
- import { ComponentInterface, PickOption, Record } from '../../type';
2
- import React from 'react';
1
+ import { ComponentInterface, PickOption, Record } from "../../type";
2
+ import React from "react";
3
3
  declare class BasicFile implements ComponentInterface {
4
4
  name: string;
5
5
  id: string;
@@ -7,17 +7,17 @@ declare class BasicFile implements ComponentInterface {
7
7
  formField: string;
8
8
  type: string;
9
9
  rules: any[];
10
- componentConfig: ComponentInterface['componentConfig'];
10
+ componentConfig: ComponentInterface["componentConfig"];
11
11
  isCombinationComponent: boolean;
12
12
  canSort: boolean;
13
13
  children: ComponentInterface[];
14
- dataType: ComponentInterface['dataType'];
14
+ dataType: ComponentInterface["dataType"];
15
15
  constructor(options: PickOption);
16
16
  renderPc: (value: any, record: Record) => any;
17
17
  renderLog: (r: Record) => any;
18
18
  getComponentValue: (r: Record) => any;
19
19
  renderClient: (record: any) => React.JSX.Element | null;
20
- editRender: () => React.JSX.Element;
20
+ editRender: (p: any) => React.JSX.Element;
21
21
  /**
22
22
  *
23
23
  * @returns
@@ -12,11 +12,11 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
12
12
  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; }
13
13
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
14
14
  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); }
15
- import React from 'react';
16
- import { ApaasUploadFile } from '@kmkf-fe-packages/basic-components';
15
+ import React from "react";
16
+ import { ApaasUploadFile } from "@kmkf-fe-packages/basic-components";
17
17
  import GetFormItem from "../GetFormItem";
18
18
  import ItemView from "../../commonComponents/ItemView";
19
- import { isNull } from '@kmkf-fe-packages/kmkf-utils';
19
+ import { isNull } from "@kmkf-fe-packages/kmkf-utils";
20
20
  var BasicFile = /*#__PURE__*/_createClass(function BasicFile(options) {
21
21
  var _this = this;
22
22
  _classCallCheck(this, BasicFile);
@@ -40,7 +40,7 @@ var BasicFile = /*#__PURE__*/_createClass(function BasicFile(options) {
40
40
  return /*#__PURE__*/React.createElement("a", {
41
41
  href: file.url,
42
42
  style: {
43
- display: 'block'
43
+ display: "block"
44
44
  }
45
45
  }, file.name);
46
46
  });
@@ -54,7 +54,7 @@ var BasicFile = /*#__PURE__*/_createClass(function BasicFile(options) {
54
54
  });
55
55
  _defineProperty(this, "renderClient", function (record) {
56
56
  var _record$id;
57
- var _this$id$split = _this.id.split('_'),
57
+ var _this$id$split = _this.id.split("_"),
58
58
  _this$id$split2 = _slicedToArray(_this$id$split, 1),
59
59
  id = _this$id$split2[0];
60
60
  return !isNull(record === null || record === void 0 ? void 0 : record[id]) ? /*#__PURE__*/React.createElement(ItemView, {
@@ -64,18 +64,19 @@ var BasicFile = /*#__PURE__*/_createClass(function BasicFile(options) {
64
64
  return /*#__PURE__*/React.createElement("a", {
65
65
  href: file.url,
66
66
  style: {
67
- display: 'block'
67
+ display: "block"
68
68
  }
69
69
  }, file.name);
70
70
  })
71
71
  }) : null;
72
72
  });
73
- _defineProperty(this, "editRender", function () {
73
+ _defineProperty(this, "editRender", function (p) {
74
74
  var _this$componentConfig, _this$componentConfig2;
75
75
  return /*#__PURE__*/React.createElement(GetFormItem, {
76
76
  title: _this.name,
77
77
  name: _this.id,
78
78
  rules: _this.rules,
79
+ hidden: p === null || p === void 0 ? void 0 : p.hidden,
79
80
  required: (_this$componentConfig = (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.required) !== null && _this$componentConfig !== void 0 ? _this$componentConfig : false,
80
81
  component: /*#__PURE__*/React.createElement(ApaasUploadFile, _extends({}, _this.componentConfig, {
81
82
  uniqueKey: _this.id,
@@ -88,7 +89,7 @@ var BasicFile = /*#__PURE__*/_createClass(function BasicFile(options) {
88
89
  prv.push(next.url);
89
90
  return prv;
90
91
  }, []);
91
- return textArr === null || textArr === void 0 ? void 0 : textArr.join(',');
92
+ return textArr === null || textArr === void 0 ? void 0 : textArr.join(",");
92
93
  });
93
94
  _defineProperty(this, "filterConfig", function () {
94
95
  return [];
@@ -103,6 +104,6 @@ var BasicFile = /*#__PURE__*/_createClass(function BasicFile(options) {
103
104
  this.isCombinationComponent = false;
104
105
  this.canSort = false;
105
106
  this.children = [];
106
- this.dataType = 'array';
107
+ this.dataType = "array";
107
108
  });
108
109
  export default BasicFile;
@@ -29,14 +29,6 @@ declare class JstLogistics implements ComponentInterface {
29
29
  renderExport: (value: any, record: any) => any;
30
30
  editRender: (p: any) => React.JSX.Element;
31
31
  filterConfig: (item: ColumnConfig) => ({
32
- searchDefaultConditions: "like";
33
- type: string;
34
- id: string;
35
- name: string;
36
- filterComponentType: "Input";
37
- filterFn: (value: string) => (i: Record) => boolean;
38
- props?: undefined;
39
- } | {
40
32
  searchDefaultConditions: "in";
41
33
  type: string;
42
34
  id: string;
@@ -46,6 +38,14 @@ declare class JstLogistics implements ComponentInterface {
46
38
  options: any[];
47
39
  };
48
40
  filterFn: (value: string) => (i: Record) => any;
41
+ } | {
42
+ searchDefaultConditions: "like";
43
+ type: string;
44
+ id: string;
45
+ name: string;
46
+ filterComponentType: "Input";
47
+ filterFn: (value: string) => (i: Record) => boolean;
48
+ props?: undefined;
49
49
  })[];
50
50
  }
51
51
  export default JstLogistics;
@@ -18,18 +18,24 @@ import { SYMBOL } from "../../../constant";
18
18
  var typeMap = {
19
19
  JST_LOGISTICS: {
20
20
  key: 'jstItemList',
21
- name: 'jst'
21
+ name: 'jst',
22
+ company: 'logisticsCompany',
23
+ code: 'logisticsCode'
22
24
  },
23
25
  BS_LOGISTICS: {
24
26
  key: 'bsLogisticsList',
25
- name: 'bs'
27
+ name: 'bs',
28
+ company: 'bsLogisticsCompany',
29
+ code: 'bsLogisticsCode'
26
30
  }
27
31
  };
28
32
  var JstLogistics = /*#__PURE__*/_createClass(function JstLogistics(options) {
29
33
  var _this = this,
30
34
  _typeMap$options$type,
31
35
  _typeMap$options$type2,
32
- _this$componentConfig3;
36
+ _this$componentConfig3,
37
+ _typeMap$options$type3,
38
+ _typeMap$options$type4;
33
39
  _classCallCheck(this, JstLogistics);
34
40
  _defineProperty(this, "name", void 0);
35
41
  _defineProperty(this, "id", void 0);
@@ -99,22 +105,11 @@ var JstLogistics = /*#__PURE__*/_createClass(function JstLogistics(options) {
99
105
  });
100
106
  });
101
107
  _defineProperty(this, "filterConfig", function (item) {
102
- var _typeMap$_this$type5, _typeMap$_this$type6;
108
+ var _typeMap$_this$type5, _typeMap$_this$type6, _typeMap$_this$type7, _typeMap$_this$type8;
103
109
  return [{
104
- searchDefaultConditions: SYMBOL.like,
105
- type: item.type,
106
- id: "".concat(item.id, "_logisticsCode"),
107
- name: "".concat((_typeMap$_this$type5 = typeMap[_this.type]) === null || _typeMap$_this$type5 === void 0 ? void 0 : _typeMap$_this$type5.name, "\u7269\u6D41\u5355\u53F7"),
108
- filterComponentType: 'Input',
109
- filterFn: function filterFn(value) {
110
- return function (i) {
111
- return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, 'logisticsCode'), value);
112
- };
113
- }
114
- }, {
115
110
  searchDefaultConditions: SYMBOL.in,
116
111
  type: item.type,
117
- id: "".concat(item.id, "_logisticsCompany"),
112
+ id: "".concat(item.id, "_").concat((_typeMap$_this$type5 = typeMap[_this.type]) === null || _typeMap$_this$type5 === void 0 ? void 0 : _typeMap$_this$type5.company),
118
113
  name: "".concat((_typeMap$_this$type6 = typeMap[_this.type]) === null || _typeMap$_this$type6 === void 0 ? void 0 : _typeMap$_this$type6.name, "\u7269\u6D41\u516C\u53F8"),
119
114
  filterComponentType: 'MultipleSelect',
120
115
  props: {
@@ -130,6 +125,17 @@ var JstLogistics = /*#__PURE__*/_createClass(function JstLogistics(options) {
130
125
  });
131
126
  };
132
127
  }
128
+ }, {
129
+ searchDefaultConditions: SYMBOL.like,
130
+ type: item.type,
131
+ id: "".concat(item.id, "_").concat((_typeMap$_this$type7 = typeMap[_this.type]) === null || _typeMap$_this$type7 === void 0 ? void 0 : _typeMap$_this$type7.code),
132
+ name: "".concat((_typeMap$_this$type8 = typeMap[_this.type]) === null || _typeMap$_this$type8 === void 0 ? void 0 : _typeMap$_this$type8.name, "\u7269\u6D41\u5355\u53F7"),
133
+ filterComponentType: 'Input',
134
+ filterFn: function filterFn(value) {
135
+ return function (i) {
136
+ return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, 'logisticsCode'), value);
137
+ };
138
+ }
133
139
  }];
134
140
  });
135
141
  this.name = options.name;
@@ -158,12 +164,12 @@ var JstLogistics = /*#__PURE__*/_createClass(function JstLogistics(options) {
158
164
  this.expressDateInstance = ExpressData.getInstance();
159
165
  this.sortChildField = [{
160
166
  name: '物流公司',
161
- key: "".concat(options.id, "_logisticsCompany"),
167
+ key: "".concat(options.id, "_").concat((_typeMap$options$type3 = typeMap[options.type]) === null || _typeMap$options$type3 === void 0 ? void 0 : _typeMap$options$type3.company),
162
168
  options: this.expressDateInstance.getExpressData(),
163
169
  dataType: 'string'
164
170
  }, {
165
171
  name: '物流单号',
166
- key: "".concat(options.id, "_logisticsCode"),
172
+ key: "".concat(options.id, "_").concat((_typeMap$options$type4 = typeMap[options.type]) === null || _typeMap$options$type4 === void 0 ? void 0 : _typeMap$options$type4.code),
167
173
  dataType: 'string'
168
174
  }];
169
175
  });
@@ -1,3 +1,3 @@
1
1
  import { JstLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, CommonDataTime, TradeId, ShopName, ErpTradeId, BuyerNick, ReceiverName, ReceiverMobile, ReceiverAddress, TradeDateTime, Logistics, ReturnLogistics, ActualPayment, ERemark, AliPay, ItemSelect, ItemId, ItemEnCode, SystemOrderNo, Ordinary, ThirdItemSelect, FlowStatusSelect, Payment, TemplateSelect, WorkOrderId, PlatForm, ShopInput, Submitter, Handler, CompletedUser, LogisticsInterception, LogisticsTrajectory, FlowWorkOrderId, BsGoods, BsExchange, BsReissue } from "./index";
2
2
  import { PickOption } from "./type";
3
- export declare const factory: (type: string, options: PickOption) => ShopInput | BasicInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | BasicFile | BasicPosting | CommonDataTime | TradeId | ErpTradeId | ShopName | BuyerNick | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | JstLogistics | JstItemSelect | JstSendGood | JstSupply | BsGoods | BsExchange | BsReissue | FlowStatusSelect | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsTrajectory | PlatForm | Submitter | Handler | CompletedUser | FlowWorkOrderId;
3
+ export declare const factory: (type: string, options: PickOption) => BsExchange | BasicFile | JstLogistics | BasicInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | BasicPosting | CommonDataTime | TradeId | ErpTradeId | ShopName | BuyerNick | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | JstItemSelect | JstSendGood | JstSupply | BsGoods | BsReissue | FlowStatusSelect | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsTrajectory | PlatForm | ShopInput | Submitter | Handler | CompletedUser | FlowWorkOrderId;
@@ -37,7 +37,6 @@ export { default as JstLogistics } from "./components/JST/JstLogistics";
37
37
  export { default as JstItemSelect } from "./components/JST/JstItemSelect";
38
38
  export { default as JstSendGood } from "./components/JST/JstSendGood";
39
39
  export { default as JstSupply } from "./components/JST/JstSupply";
40
- export { default as BsLogistics } from "./components/BS/BsLogistics";
41
40
  export { default as BsGoods } from "./components/BS/BsGoods";
42
41
  export { default as BsExchange } from "./components/BS/BsExchange";
43
42
  export { default as BsReissue } from "./components/BS/BsReissue";
package/dist/esm/index.js CHANGED
@@ -37,7 +37,6 @@ export { default as JstLogistics } from "./components/JST/JstLogistics";
37
37
  export { default as JstItemSelect } from "./components/JST/JstItemSelect";
38
38
  export { default as JstSendGood } from "./components/JST/JstSendGood";
39
39
  export { default as JstSupply } from "./components/JST/JstSupply";
40
- export { default as BsLogistics } from "./components/BS/BsLogistics";
41
40
  export { default as BsGoods } from "./components/BS/BsGoods";
42
41
  export { default as BsExchange } from "./components/BS/BsExchange";
43
42
  export { default as BsReissue } from "./components/BS/BsReissue";
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
- import type { FormInstance } from 'antd';
3
- import { SYMBOL } from './constant';
4
- export declare type DataType = 'string' | 'number' | 'array' | 'dateArray' | 'date' | 'tradeId';
5
- export declare type ALignType = 'left' | 'right' | 'center';
2
+ import type { FormInstance } from "antd";
3
+ import { SYMBOL } from "./constant";
4
+ export declare type DataType = "string" | "number" | "array" | "dateArray" | "date" | "tradeId";
5
+ export declare type ALignType = "left" | "right" | "center";
6
6
  export declare type QuerySymbol = keyof typeof SYMBOL;
7
7
  export declare type Record = {
8
8
  [props in string]: any;
@@ -18,7 +18,7 @@ export declare type FilterConfigType = {
18
18
  filterFn?: (p: any) => (r: Record) => unknown;
19
19
  formatFilterValue?: (p: any) => any;
20
20
  };
21
- export declare type FilterComponentType = 'MultipleSelect' | 'Input' | 'Date' | 'Cascader' | 'ShopList' | 'Rate';
21
+ export declare type FilterComponentType = "MultipleSelect" | "Input" | "Date" | "Cascader" | "ShopList" | "Rate";
22
22
  export interface ComponentInterface {
23
23
  id: string;
24
24
  sortField: string;
@@ -38,8 +38,8 @@ export interface ComponentInterface {
38
38
  rules?: any[];
39
39
  width?: number;
40
40
  align?: ALignType;
41
- dataType: 'string' | 'number' | 'boolean' | 'array' | 'range' | 'object';
42
- format?: 'dateTime' | 'date' | 'time' | 'cascader';
41
+ dataType: "string" | "number" | "boolean" | "array" | "range" | "object";
42
+ format?: "dateTime" | "date" | "time" | "cascader";
43
43
  options?: Array<any>;
44
44
  /**
45
45
  * @description 组件下标
@@ -62,7 +62,7 @@ export interface ComponentInterface {
62
62
  /**
63
63
  * @description 显示字段名称
64
64
  */
65
- showField?: 'EXPRESS_COMPANY' | 'EXPRESS_WAYBILL_CODE' | 'EXPRESS_SNAPSHOT' | 'all';
65
+ showField?: "EXPRESS_COMPANY" | "EXPRESS_WAYBILL_CODE" | "EXPRESS_SNAPSHOT" | "all";
66
66
  /**
67
67
  * @description 是否选择SKU
68
68
  */
@@ -82,7 +82,7 @@ export interface ComponentInterface {
82
82
  /**
83
83
  * @description 备注状态
84
84
  */
85
- associatedType?: 'APPEND';
85
+ associatedType?: "APPEND";
86
86
  isAssociated?: boolean;
87
87
  isShowFlag?: boolean;
88
88
  /**
@@ -123,7 +123,7 @@ export interface ComponentInterface {
123
123
  * @description 时间初始值
124
124
  */
125
125
  dateTime?: string;
126
- dateType?: 'DATE' | 'DATE_TIME' | 'DATE_RANGE' | 'DATE_TIME_RANGE';
126
+ dateType?: "DATE" | "DATE_TIME" | "DATE_RANGE" | "DATE_TIME_RANGE";
127
127
  maxSize?: number;
128
128
  basicGrade?: number;
129
129
  range?: number;
@@ -212,13 +212,13 @@ export interface ComponentInterface {
212
212
  getComponentValue: (r: Record) => any;
213
213
  formDataTransform?: (r: any) => any;
214
214
  }
215
- export declare type PickOption = Pick<ComponentInterface, 'name' | 'id' | 'type' | 'componentConfig' | 'effects' | 'columnHeader'>;
215
+ export declare type PickOption = Pick<ComponentInterface, "name" | "id" | "type" | "componentConfig" | "effects" | "columnHeader">;
216
216
  export declare type ColumnConfig = {
217
217
  id: string;
218
218
  name: string;
219
219
  type: string;
220
220
  subKey?: string;
221
- mode?: 'multiple';
222
- config?: ComponentInterface['componentConfig'];
223
- templateConfig?: ComponentInterface['componentConfig'];
221
+ mode?: "multiple";
222
+ config?: ComponentInterface["componentConfig"];
223
+ templateConfig?: ComponentInterface["componentConfig"];
224
224
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "0.7.15-alpha.60",
3
+ "version": "0.7.15-alpha.62",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -26,8 +26,8 @@
26
26
  "father": "^4.1.7"
27
27
  },
28
28
  "dependencies": {
29
- "@kmkf-fe-packages/basic-components": "^0.7.15-alpha.60",
30
- "@kmkf-fe-packages/kmkf-utils": "^0.7.15-alpha.59"
29
+ "@kmkf-fe-packages/basic-components": "^0.7.15-alpha.62",
30
+ "@kmkf-fe-packages/kmkf-utils": "^0.7.15-alpha.62"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@ant-design/icons": "^4.7.0",
@@ -40,5 +40,5 @@
40
40
  "gitHooks": {
41
41
  "pre-commit": "lint-staged"
42
42
  },
43
- "gitHead": "251c86791a81cf4bbf3d475341d482286e6179ae"
43
+ "gitHead": "6b726e827ca34ded9025522623713130f0f77037"
44
44
  }
@@ -1,50 +0,0 @@
1
- import { ComponentInterface, PickOption, ColumnConfig, Record } from '../../../type';
2
- import React from 'react';
3
- import { ExpressData } from '@kmkf-fe-packages/kmkf-utils';
4
- import Express from '../../Express';
5
- import ExpressCode from '../../ExpressCode';
6
- declare class BsLogistics implements ComponentInterface {
7
- name: string;
8
- id: string;
9
- sortField: string;
10
- type: string;
11
- rules: any[];
12
- componentConfig: ComponentInterface['componentConfig'];
13
- expressDateInstance: InstanceType<typeof ExpressData>;
14
- express: Express;
15
- expressCode: ExpressCode;
16
- isCombinationComponent: boolean;
17
- formField: string;
18
- canSort: boolean;
19
- children: ComponentInterface[];
20
- dataType: ComponentInterface['dataType'];
21
- constructor(options: PickOption);
22
- editRender: (p: any) => React.JSX.Element;
23
- renderClient: (record: Record) => React.JSX.Element;
24
- renderPc: () => null;
25
- renderLog: (r: Record) => React.JSX.Element;
26
- getComponentValue: (r: Record) => {
27
- company: any;
28
- order: any;
29
- };
30
- renderExport: () => null;
31
- filterConfig: (item: ColumnConfig) => ({
32
- searchDefaultConditions: "in";
33
- type: string;
34
- id: string;
35
- name: string;
36
- filterComponentType: "MultipleSelect";
37
- props: {
38
- options: any[];
39
- };
40
- filterFn: (value: string) => (i: Record) => boolean;
41
- } | {
42
- searchDefaultConditions: "like";
43
- type: string;
44
- id: string;
45
- name: string;
46
- filterComponentType: "Input";
47
- filterFn: (value: string) => (i: Record) => boolean;
48
- })[];
49
- }
50
- export default BsLogistics;
@@ -1,115 +0,0 @@
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; }
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); }
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); } }
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; }
7
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
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';
12
- import { ExpressData } from '@kmkf-fe-packages/kmkf-utils';
13
- import { ExpressLogistics } from '@kmkf-fe-packages/basic-components';
14
- import Express from "../../Express";
15
- import ExpressCode from "../../ExpressCode";
16
- import GetFormItem from "../../GetFormItem";
17
- var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(options) {
18
- var _this = this,
19
- _this$componentConfig3;
20
- _classCallCheck(this, BsLogistics);
21
- _defineProperty(this, "name", void 0);
22
- _defineProperty(this, "id", void 0);
23
- _defineProperty(this, "sortField", void 0);
24
- _defineProperty(this, "type", void 0);
25
- _defineProperty(this, "rules", void 0);
26
- _defineProperty(this, "componentConfig", void 0);
27
- _defineProperty(this, "expressDateInstance", void 0);
28
- _defineProperty(this, "express", void 0);
29
- _defineProperty(this, "expressCode", void 0);
30
- _defineProperty(this, "isCombinationComponent", void 0);
31
- _defineProperty(this, "formField", void 0);
32
- _defineProperty(this, "canSort", void 0);
33
- _defineProperty(this, "children", void 0);
34
- _defineProperty(this, "dataType", void 0);
35
- _defineProperty(this, "editRender", function (p) {
36
- var _this$componentConfig, _this$componentConfig2;
37
- return /*#__PURE__*/React.createElement(GetFormItem, {
38
- title: _this.name,
39
- name: _this.id,
40
- rules: _this.rules,
41
- hidden: p === null || p === void 0 ? void 0 : p.hidden,
42
- required: (_this$componentConfig = (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.required) !== null && _this$componentConfig !== void 0 ? _this$componentConfig : false,
43
- component: /*#__PURE__*/React.createElement(ExpressLogistics, _extends({}, _this.componentConfig, {
44
- options: _this.expressDateInstance.getExpressData(),
45
- onBlur: p === null || p === void 0 ? void 0 : p.onBlur
46
- }))
47
- });
48
- });
49
- _defineProperty(this, "renderClient", function (record) {
50
- return /*#__PURE__*/React.createElement(React.Fragment, null, _this.express.renderClient(record), _this.expressCode.renderClient(record));
51
- });
52
- _defineProperty(this, "renderPc", function () {
53
- return null;
54
- });
55
- _defineProperty(this, "renderLog", function (r) {
56
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, _this.express.name, ": ", _this.express.renderLog(r)), /*#__PURE__*/React.createElement("div", null, _this.expressCode.name, ": ", _this.expressCode.renderLog(r)));
57
- });
58
- _defineProperty(this, "getComponentValue", function (r) {
59
- return {
60
- company: _this.express.getComponentValue(r),
61
- order: _this.expressCode.getComponentValue(r)
62
- };
63
- });
64
- _defineProperty(this, "renderExport", function () {
65
- return null;
66
- });
67
- _defineProperty(this, "filterConfig", function (item) {
68
- return [_this.express.filterConfig(_objectSpread(_objectSpread({}, item), {}, {
69
- subKey: 'bsLogisticsCompany'
70
- })), _this.expressCode.filterConfig(_objectSpread(_objectSpread({}, item), {}, {
71
- subKey: 'bsLogisticsCode'
72
- }))];
73
- });
74
- this.name = options.name;
75
- this.id = options.id;
76
- this.sortField = options.id;
77
- this.formField = options.id;
78
- this.type = options.type;
79
- this.componentConfig = options.componentConfig;
80
- this.expressDateInstance = ExpressData.getInstance();
81
- this.express = new Express(_objectSpread(_objectSpread({}, options), {}, {
82
- name: '快递物流公司',
83
- id: "".concat(this.id, "_bsLogisticsCompany")
84
- }));
85
- this.expressCode = new ExpressCode(_objectSpread(_objectSpread({}, options), {}, {
86
- name: '快递物流单号',
87
- id: "".concat(this.id, "_bsLogisticsCode")
88
- }));
89
- this.isCombinationComponent = true;
90
- this.canSort = false;
91
- this.dataType = 'object';
92
- this.children = [this.express, this.expressCode];
93
- this.rules = (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
94
- validator: function validator(_, value) {
95
- var _this$componentConfig4;
96
- if ((_this$componentConfig4 = _this.componentConfig) !== null && _this$componentConfig4 !== void 0 && _this$componentConfig4.isSingle) {
97
- var _this$componentConfig5, _this$componentConfig6;
98
- if (((_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.showHeader) === 'EXPRESS_COMPANY' && !(value !== null && value !== void 0 && value.company)) {
99
- return Promise.reject(new Error('请选择物流公司'));
100
- } else if (((_this$componentConfig6 = _this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.showHeader) === 'EXPRESS_WAYBILL_CODE' && !(value !== null && value !== void 0 && value.order)) {
101
- return Promise.reject(new Error('请输入物流单号'));
102
- }
103
- } else {
104
- if (!(value !== null && value !== void 0 && value.company)) {
105
- return Promise.reject(new Error('请选择物流公司'));
106
- }
107
- if (!(value !== null && value !== void 0 && value.order)) {
108
- return Promise.reject(new Error('请输入物流单号'));
109
- }
110
- }
111
- return Promise.resolve();
112
- }
113
- }] : [];
114
- });
115
- export default BsLogistics;