@kmkf-fe-packages/services-components 0.24.0 → 0.24.1-alpha.1

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.
@@ -8,10 +8,10 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
8
8
  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; }
9
9
  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; } }
10
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
- import { Form, Button, Modal, Tooltip, Space, Image, Popover, Table, message } from 'antd';
12
- import React, { useState, useMemo } from 'react';
13
- import { ExpressData } from '@kmkf-fe-packages/kmkf-utils';
14
- import { CopyToClipboard } from 'react-copy-to-clipboard';
11
+ import { Form, Button, Modal, Tooltip, Space, Image, Popover, Table, message } from "antd";
12
+ import React, { useState, useMemo } from "react";
13
+ import { ExpressData } from "@kmkf-fe-packages/kmkf-utils";
14
+ import { CopyToClipboard } from "react-copy-to-clipboard";
15
15
  import styles from "./index.module.less";
16
16
  import defaultImg from "./img/default-img.png";
17
17
  export var getFormItem = function getFormItem(_ref) {
@@ -31,7 +31,7 @@ export var getFormItem = function getFormItem(_ref) {
31
31
  return /*#__PURE__*/React.createElement("div", {
32
32
  className: "form-item--wrap",
33
33
  style: {
34
- position: 'relative'
34
+ position: "relative"
35
35
  }
36
36
  }, /*#__PURE__*/React.createElement(Form.Item, {
37
37
  name: name,
@@ -44,44 +44,60 @@ export var getFormItem = function getFormItem(_ref) {
44
44
  export var showImage = function showImage(_ref2) {
45
45
  var item = _ref2.item,
46
46
  type = _ref2.type,
47
- index = _ref2.index;
48
- var picUrl = item.picUrl ? (item === null || item === void 0 ? void 0 : item.platform) !== 'tabao' ? item.picUrl : item.picUrl + '_40x40.jpg' : defaultImg;
47
+ index = _ref2.index,
48
+ showHeader = _ref2.showHeader;
49
+ var picUrl = item.picUrl ? (item === null || item === void 0 ? void 0 : item.platform) !== "tabao" ? item.picUrl : item.picUrl + "_40x40.jpg" : defaultImg;
49
50
  return /*#__PURE__*/React.createElement("div", {
50
51
  className: styles.goodImgBox,
51
52
  key: index
52
- }, (item === null || item === void 0 ? void 0 : item.platform) === 'taobao' ? /*#__PURE__*/React.createElement("a", {
53
+ }, type === "itemCode" && !showHeader.includes("picUrl") ? null : (item === null || item === void 0 ? void 0 : item.platform) === "taobao" ? /*#__PURE__*/React.createElement("a", {
53
54
  target: "_blank",
54
- href: "https://item.taobao.com/item.htm?id=".concat(item.numIid)
55
+ href: item.numIid ? "https://item.taobao.com/item.htm?id=".concat(item.numIid) : 'javascript:void(0);'
55
56
  }, /*#__PURE__*/React.createElement("img", {
56
57
  style: {
57
- width: '40px',
58
- height: '40px',
59
- objectFit: 'contain'
58
+ width: "40px",
59
+ height: "40px",
60
+ objectFit: "contain"
60
61
  },
61
62
  src: picUrl
62
63
  })) : /*#__PURE__*/React.createElement("img", {
63
64
  style: {
64
- width: '40px',
65
- height: '40px',
66
- objectFit: 'contain'
65
+ width: "40px",
66
+ height: "40px",
67
+ objectFit: "contain"
67
68
  },
68
69
  src: picUrl
69
70
  }), /*#__PURE__*/React.createElement("div", {
70
71
  className: styles.options
71
- }, type === 'itemId' && /*#__PURE__*/React.createElement(TextTool, {
72
- title: '商品id',
72
+ }, type === "itemId" && /*#__PURE__*/React.createElement(TextTool, {
73
+ title: "商品id",
73
74
  text: item.numIid
74
- }), type === 'itemCode' && /*#__PURE__*/React.createElement(TextTool, {
75
- title: '商品编码',
75
+ }), type === "itemCode" && /*#__PURE__*/React.createElement(React.Fragment, null, showHeader.includes("title") && /*#__PURE__*/React.createElement(TextTool, {
76
+ title: "商品名称",
77
+ text: item.title
78
+ }), showHeader.includes("outerId") && /*#__PURE__*/React.createElement(TextTool, {
79
+ title: "商品编码",
76
80
  text: item.outerId
77
- }), (type === 'itemThird' || type === 'jstItemThird') && (item.itemId || item.supplierItemOuterId) && /*#__PURE__*/React.createElement(TextTool, {
78
- title: '供应商编码',
81
+ }), showHeader.includes("numIid") && /*#__PURE__*/React.createElement(TextTool, {
82
+ title: "商品id",
83
+ text: item.numIid
84
+ }), showHeader.includes("skuId") && /*#__PURE__*/React.createElement(TextTool, {
85
+ title: "SKU ID",
86
+ text: item.skuId
87
+ }), showHeader.includes("outerSkuId") && /*#__PURE__*/React.createElement(TextTool, {
88
+ title: "SKU 编码",
89
+ text: item.outerSkuId
90
+ }), showHeader.includes("propertiesName") && /*#__PURE__*/React.createElement(TextTool, {
91
+ title: "SKU 信息",
92
+ text: item.propertiesName
93
+ })), (type === "itemThird" || type === "jstItemThird") && (item.itemId || item.supplierItemOuterId) && /*#__PURE__*/React.createElement(TextTool, {
94
+ title: "供应商编码",
79
95
  text: item.itemId || item.supplierItemOuterId
80
- }), (type === 'itemThird' || type === 'jstItemThird') && item.supplierName && /*#__PURE__*/React.createElement(TextTool, {
81
- title: '供应商名称',
96
+ }), (type === "itemThird" || type === "jstItemThird") && item.supplierName && /*#__PURE__*/React.createElement(TextTool, {
97
+ title: "供应商名称",
82
98
  text: item.supplierName
83
- }), item.propertiesName && /*#__PURE__*/React.createElement(TextTool, {
84
- title: '规格',
99
+ }), type !== "itemCode" && item.propertiesName && /*#__PURE__*/React.createElement(TextTool, {
100
+ title: "规格",
85
101
  text: item.propertiesName
86
102
  })));
87
103
  };
@@ -94,9 +110,9 @@ var TextTool = function TextTool(_ref3) {
94
110
  title: text
95
111
  }, /*#__PURE__*/React.createElement("div", {
96
112
  style: {
97
- overflow: 'hidden',
98
- whiteSpace: 'nowrap',
99
- textOverflow: 'ellipsis'
113
+ overflow: "hidden",
114
+ whiteSpace: "nowrap",
115
+ textOverflow: "ellipsis"
100
116
  }
101
117
  }, title, ":", text));
102
118
  };
@@ -105,7 +121,9 @@ export var ShowTotalImage = function ShowTotalImage(_ref4) {
105
121
  var total = _ref4.total,
106
122
  _ref4$allImage = _ref4.allImage,
107
123
  allImage = _ref4$allImage === void 0 ? [] : _ref4$allImage,
108
- type = _ref4.type;
124
+ type = _ref4.type,
125
+ _ref4$showHeader = _ref4.showHeader,
126
+ showHeader = _ref4$showHeader === void 0 ? [] : _ref4$showHeader;
109
127
  var _useState = useState(false),
110
128
  _useState2 = _slicedToArray(_useState, 2),
111
129
  visible = _useState2[0],
@@ -124,47 +142,62 @@ export var ShowTotalImage = function ShowTotalImage(_ref4) {
124
142
  title: "\u6240\u6709\u9009\u62E9\u5B9D\u8D1D"
125
143
  }, /*#__PURE__*/React.createElement("div", {
126
144
  style: {
127
- display: 'flex',
128
- flexWrap: 'wrap'
145
+ display: "flex",
146
+ flexWrap: "wrap"
129
147
  }
130
148
  }, allImage.map(function (i, index) {
131
149
  return /*#__PURE__*/React.createElement("div", {
132
150
  style: {
133
- width: '50%'
151
+ width: "50%"
134
152
  },
135
153
  key: index
136
- }, /*#__PURE__*/React.createElement("a", {
137
- href: i.link,
154
+ }, type === "itemCode" && !showHeader.includes("picUrl") ? null : /*#__PURE__*/React.createElement("a", {
155
+ href: i.link || ((i === null || i === void 0 ? void 0 : i.platform) === "taobao" && i.numIid ? "https://item.taobao.com/item.htm?id=".concat(i.numIid) : 'javascript:void(0);'),
138
156
  target: "__blank",
139
157
  style: {
140
- marginRight: '12px',
141
- marginTop: '8px',
142
- padding: '2px',
143
- border: '1px dashed #ccc',
144
- display: 'inline-block'
158
+ marginRight: "12px",
159
+ marginTop: "8px",
160
+ padding: "2px",
161
+ border: "1px dashed #ccc",
162
+ display: "inline-block"
145
163
  }
146
164
  }, /*#__PURE__*/React.createElement("img", {
147
165
  alt: "",
148
166
  src: i.picUrl || defaultImg,
149
167
  style: {
150
- width: '72px',
151
- height: '72px',
152
- objectFit: 'contain'
168
+ width: "72px",
169
+ height: "72px",
170
+ objectFit: "contain"
153
171
  }
154
- })), /*#__PURE__*/React.createElement("div", null, type === 'itemId' && /*#__PURE__*/React.createElement(TextTool, {
155
- title: '商品id',
172
+ })), /*#__PURE__*/React.createElement("div", null, type === "itemId" && /*#__PURE__*/React.createElement(TextTool, {
173
+ title: "商品id",
156
174
  text: i.numIid
157
- }), type === 'itemCode' && /*#__PURE__*/React.createElement(TextTool, {
158
- title: '商品编码',
175
+ }), type === "itemCode" && /*#__PURE__*/React.createElement(React.Fragment, null, showHeader.includes("title") && /*#__PURE__*/React.createElement(TextTool, {
176
+ title: "商品名称",
177
+ text: i.title
178
+ }), showHeader.includes("outerId") && /*#__PURE__*/React.createElement(TextTool, {
179
+ title: "商品编码",
159
180
  text: i.outerId
160
- }), (type === 'itemThird' || type === 'jstItemThird') && (i.itemId || i.supplierItemOuterId) && /*#__PURE__*/React.createElement(TextTool, {
161
- title: '供应商编码',
181
+ }), showHeader.includes("numIid") && /*#__PURE__*/React.createElement(TextTool, {
182
+ title: "商品id",
183
+ text: i.numIid
184
+ }), showHeader.includes("skuId") && /*#__PURE__*/React.createElement(TextTool, {
185
+ title: "SKU ID",
186
+ text: i.skuId
187
+ }), showHeader.includes("outerSkuId") && /*#__PURE__*/React.createElement(TextTool, {
188
+ title: "SKU 编码",
189
+ text: i.outerSkuId
190
+ }), showHeader.includes("propertiesName") && /*#__PURE__*/React.createElement(TextTool, {
191
+ title: "SKU 信息",
192
+ text: i.propertiesName
193
+ })), (type === "itemThird" || type === "jstItemThird") && (i.itemId || i.supplierItemOuterId) && /*#__PURE__*/React.createElement(TextTool, {
194
+ title: "供应商编码",
162
195
  text: i.itemId || i.supplierItemOuterId
163
- }), (type === 'itemThird' || type === 'jstItemThird') && i.supplierName && /*#__PURE__*/React.createElement(TextTool, {
164
- title: '供应商名称',
196
+ }), (type === "itemThird" || type === "jstItemThird") && i.supplierName && /*#__PURE__*/React.createElement(TextTool, {
197
+ title: "供应商名称",
165
198
  text: i.supplierName
166
- }), i.propertiesName && /*#__PURE__*/React.createElement(TextTool, {
167
- title: '规格',
199
+ }), type !== "itemCode" && i.propertiesName && /*#__PURE__*/React.createElement(TextTool, {
200
+ title: "规格",
168
201
  text: i.propertiesName
169
202
  })));
170
203
  }))));
@@ -174,29 +207,33 @@ export var GoodImage = function GoodImage(_ref5) {
174
207
  var _list$slice;
175
208
  var list = _ref5.list,
176
209
  _ref5$type = _ref5.type,
177
- type = _ref5$type === void 0 ? '' : _ref5$type;
210
+ type = _ref5$type === void 0 ? "" : _ref5$type,
211
+ _ref5$showHeader = _ref5.showHeader,
212
+ showHeader = _ref5$showHeader === void 0 ? [] : _ref5$showHeader;
178
213
  var total = (list === null || list === void 0 ? void 0 : list.length) || 0;
179
214
  var initShowTotal = 3;
180
215
  return (list === null || list === void 0 ? void 0 : list.length) > 0 ? /*#__PURE__*/React.createElement("div", {
181
216
  style: {
182
- display: type === 'itemSelect' ? 'flex' : 'block'
217
+ display: type === "itemSelect" ? "flex" : "block"
183
218
  }
184
219
  }, list === null || list === void 0 ? void 0 : (_list$slice = list.slice(0, initShowTotal)) === null || _list$slice === void 0 ? void 0 : _list$slice.map(function (item, index) {
185
220
  return showImage({
186
221
  item: item,
187
222
  type: type,
188
- index: index
223
+ index: index,
224
+ showHeader: showHeader
189
225
  });
190
226
  }), total > initShowTotal && /*#__PURE__*/React.createElement(ShowTotalImage, {
191
227
  total: total,
192
228
  allImage: list,
229
+ showHeader: showHeader,
193
230
  type: type
194
231
  })) : null;
195
232
  };
196
233
  var content = function content(item, index) {
197
234
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
198
235
  style: {
199
- textAlign: 'center'
236
+ textAlign: "center"
200
237
  }
201
238
  }, "\u5305\u88F9".concat(index + 1, "\u5546\u54C1\u4FE1\u606F")), ((item === null || item === void 0 ? void 0 : item.items) || []).map(function (t, index) {
202
239
  return /*#__PURE__*/React.createElement("div", {
@@ -223,17 +260,17 @@ export var JstGoodImage = function JstGoodImage(_ref6) {
223
260
  }, /*#__PURE__*/React.createElement("span", {
224
261
  key: index,
225
262
  style: {
226
- color: '#1890ff',
227
- cursor: 'pointer'
263
+ color: "#1890ff",
264
+ cursor: "pointer"
228
265
  }
229
- }, "\u5305\u88F9".concat(index + 1), ":")), type === 1 ? /*#__PURE__*/React.createElement("span", null, company && item.logisticsCode ? [company, item.logisticsCode].join('/') : company ? company : item.logisticsCode) : null, type === 2 ? /*#__PURE__*/React.createElement("span", null, item.supplyName && item.supplyId ? [item.supplyId, item.supplyName].join('/') : item.supplyId ? item.supplyId : item.supplyName) : null, type === 3 ? /*#__PURE__*/React.createElement("span", null, item.sendName && item.sendId ? [item.sendId, item.sendName].join('/') : item.sendId ? item.sendId : item.sendName) : null, type === 4 ? /*#__PURE__*/React.createElement("span", null, (item === null || item === void 0 ? void 0 : item.deliveryNo) || '') : null));
266
+ }, "\u5305\u88F9".concat(index + 1), ":")), type === 1 ? /*#__PURE__*/React.createElement("span", null, company && item.logisticsCode ? [company, item.logisticsCode].join("/") : company ? company : item.logisticsCode) : null, type === 2 ? /*#__PURE__*/React.createElement("span", null, item.supplyName && item.supplyId ? [item.supplyId, item.supplyName].join("/") : item.supplyId ? item.supplyId : item.supplyName) : null, type === 3 ? /*#__PURE__*/React.createElement("span", null, item.sendName && item.sendId ? [item.sendId, item.sendName].join("/") : item.sendId ? item.sendId : item.sendName) : null, type === 4 ? /*#__PURE__*/React.createElement("span", null, (item === null || item === void 0 ? void 0 : item.deliveryNo) || "") : null));
230
267
  }) : null;
231
268
  };
232
269
  export var BsExpressRender = function BsExpressRender(_ref7) {
233
270
  var _ref7$list = _ref7.list,
234
271
  list = _ref7$list === void 0 ? [] : _ref7$list,
235
272
  _ref7$showField = _ref7.showField,
236
- showField = _ref7$showField === void 0 ? '' : _ref7$showField;
273
+ showField = _ref7$showField === void 0 ? "" : _ref7$showField;
237
274
  return list !== null && list !== void 0 && list.length ? (list || []).map(function (item, index) {
238
275
  var logisticsCompany = item.logisticsCompany;
239
276
  var company = ExpressData.getInstance().getExpressNameByCode(logisticsCompany);
@@ -245,10 +282,10 @@ export var BsExpressRender = function BsExpressRender(_ref7) {
245
282
  }, /*#__PURE__*/React.createElement("span", {
246
283
  key: index,
247
284
  style: {
248
- color: '#1890ff',
249
- cursor: 'pointer'
285
+ color: "#1890ff",
286
+ cursor: "pointer"
250
287
  }
251
- }, "\u5305\u88F9", ":")), showField === 'company' ? /*#__PURE__*/React.createElement("span", null, company ? company : null) : null, showField === 'code' ? /*#__PURE__*/React.createElement("span", null, item.logisticsCode ? item.logisticsCode : null) : null));
288
+ }, "\u5305\u88F9", ":")), showField === "company" ? /*#__PURE__*/React.createElement("span", null, company ? company : null) : null, showField === "code" ? /*#__PURE__*/React.createElement("span", null, item.logisticsCode ? item.logisticsCode : null) : null));
252
289
  }) : null;
253
290
  };
254
291
  export var CommonOrderContent = function CommonOrderContent(_ref8) {
@@ -261,7 +298,7 @@ export var CommonOrderContent = function CommonOrderContent(_ref8) {
261
298
  var orderContent = function orderContent(item, index) {
262
299
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
263
300
  style: {
264
- textAlign: 'center'
301
+ textAlign: "center"
265
302
  }
266
303
  }, "\u7CFB\u7EDF\u8BA2\u5355\u53F7", index + 1, "\uFF1A", item.systemOrderId));
267
304
  };
@@ -269,7 +306,7 @@ export var CommonOrderContent = function CommonOrderContent(_ref8) {
269
306
  var _options$find;
270
307
  var color = ((_options$find = options.find(function (it) {
271
308
  return item[valueKey] === it.value;
272
- })) === null || _options$find === void 0 ? void 0 : _options$find.color) || '#000';
309
+ })) === null || _options$find === void 0 ? void 0 : _options$find.color) || "#000";
273
310
  var currentOption = options.find(function (option) {
274
311
  return item[valueKey] === option.value;
275
312
  });
@@ -281,14 +318,14 @@ export var CommonOrderContent = function CommonOrderContent(_ref8) {
281
318
  }, /*#__PURE__*/React.createElement("span", {
282
319
  key: index,
283
320
  style: {
284
- color: '#1890ff',
285
- cursor: 'pointer'
321
+ color: "#1890ff",
322
+ cursor: "pointer"
286
323
  }
287
324
  }, "\u7CFB\u7EDF\u8BA2\u5355\u53F7".concat(index + 1), ":")), /*#__PURE__*/React.createElement("span", {
288
325
  style: {
289
326
  color: color
290
327
  }
291
- }, currentOption ? currentOption.label : (item === null || item === void 0 ? void 0 : item[valueKey]) || '')), item.reason && (item === null || item === void 0 ? void 0 : item[valueKey]) !== '成功' && /*#__PURE__*/React.createElement("div", {
328
+ }, currentOption ? currentOption.label : (item === null || item === void 0 ? void 0 : item[valueKey]) || "")), item.reason && (item === null || item === void 0 ? void 0 : item[valueKey]) !== "成功" && /*#__PURE__*/React.createElement("div", {
292
329
  className: "c-red"
293
330
  }, item.reason));
294
331
  }) : null;
@@ -300,22 +337,22 @@ export var BsGoodImage = function BsGoodImage(_ref9) {
300
337
  index = _ref9.index;
301
338
  var picUrl = item.picUrl || defaultImg;
302
339
  var keyMap = {
303
- name: 'bs名称',
304
- code: 'bs编码',
305
- skuId: 'bssku编码',
306
- money: 'bs实付金额',
307
- number: 'bs数量',
308
- share: 'bs分摊价',
309
- type: 'bs赠品类型'
340
+ name: "bs名称",
341
+ code: "bs编码",
342
+ skuId: "bssku编码",
343
+ money: "bs实付金额",
344
+ number: "bs数量",
345
+ share: "bs分摊价",
346
+ type: "bs赠品类型"
310
347
  };
311
348
  return /*#__PURE__*/React.createElement("div", {
312
349
  className: styles.goodImgBox,
313
350
  key: index
314
351
  }, /*#__PURE__*/React.createElement("img", {
315
352
  style: {
316
- width: '40px',
317
- height: '40px',
318
- objectFit: 'contain'
353
+ width: "40px",
354
+ height: "40px",
355
+ objectFit: "contain"
319
356
  },
320
357
  src: picUrl
321
358
  }), /*#__PURE__*/React.createElement("div", {
@@ -337,11 +374,11 @@ export var BsExchangeList = function BsExchangeList(_ref10) {
337
374
  return /*#__PURE__*/React.createElement(React.Fragment, null, BsGoodsTable({
338
375
  list: (item === null || item === void 0 ? void 0 : item.bsExchangeReturnGoods) || [],
339
376
  showHeader: showHeader,
340
- text: '退回'
377
+ text: "退回"
341
378
  }), BsGoodsTable({
342
379
  list: item === null || item === void 0 ? void 0 : item.bsExchangeSwapOutGoods,
343
380
  showHeader: showHeader,
344
- text: '换出'
381
+ text: "换出"
345
382
  }));
346
383
  }));
347
384
  };
@@ -354,111 +391,171 @@ export var BsGoodPic = function BsGoodPic(list) {
354
391
  });
355
392
  });
356
393
  };
357
- export var BsGoodsTable = function BsGoodsTable(_ref11) {
358
- var list = _ref11.list,
359
- showHeader = _ref11.showHeader,
360
- _ref11$text = _ref11.text,
361
- text = _ref11$text === void 0 ? '' : _ref11$text;
362
- //商品信息
363
- var GOODS_INFO_COLUMNS = function GOODS_INFO_COLUMNS() {
364
- var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
365
- return [{
366
- dataIndex: 'mark',
367
- title: "\u5546\u54C1\u6807\u8BB0",
368
- align: 'center',
369
- ellipsis: true,
370
- width: 100
371
- }, {
372
- dataIndex: 'skuName',
373
- title: "".concat(text, "sku\u540D\u79F0"),
374
- align: 'center',
375
- ellipsis: true,
376
- width: 200
377
- }, {
378
- dataIndex: 'sku',
379
- title: "".concat(text, "sku\u7F16\u7801"),
380
- align: 'center',
381
- ellipsis: true,
382
- width: 100
383
- }, {
384
- dataIndex: 'name',
385
- title: "".concat(text, "\u540D\u79F0"),
386
- align: 'center',
387
- ellipsis: true,
388
- width: 200
389
- }, {
390
- dataIndex: 'pic',
391
- title: "\u56FE\u7247",
392
- align: 'center',
393
- ellipsis: true,
394
- width: 100,
395
- render: function render(val) {
396
- return /*#__PURE__*/React.createElement(Image, {
397
- width: 60,
398
- src: val
399
- });
394
+ var getTable = function getTable(GOODS_INFO_COLUMNS) {
395
+ return function (_ref11) {
396
+ var list = _ref11.list,
397
+ showHeader = _ref11.showHeader,
398
+ _ref11$text = _ref11.text,
399
+ text = _ref11$text === void 0 ? "" : _ref11$text;
400
+ var newColumns = useMemo(function () {
401
+ var columnList = [{
402
+ dataIndex: "",
403
+ title: "序号",
404
+ align: "center",
405
+ ellipsis: true,
406
+ width: 50,
407
+ render: function render(val, record, index) {
408
+ return /*#__PURE__*/React.createElement("span", null, index + 1);
409
+ }
410
+ }].concat(_toConsumableArray(GOODS_INFO_COLUMNS(text).filter(function (t) {
411
+ return showHeader.includes(t === null || t === void 0 ? void 0 : t.dataIndex);
412
+ })));
413
+ return columnList;
414
+ }, [showHeader, list]);
415
+ return /*#__PURE__*/React.createElement(Table, {
416
+ columns: newColumns,
417
+ dataSource: list,
418
+ rowKey: "uuid",
419
+ size: "small",
420
+ pagination: false,
421
+ scroll: {
422
+ x: "100%"
423
+ },
424
+ locale: {
425
+ emptyText: "暂无数据"
400
426
  }
401
- }, {
402
- dataIndex: 'code',
403
- title: "".concat(text, "\u7F16\u7801"),
404
- align: 'center',
405
- ellipsis: true,
406
- width: 100
407
- }, {
408
- dataIndex: 'money',
409
- title: "\u5B9E\u4ED8\u91D1\u989D",
410
- align: 'center',
411
- ellipsis: true,
412
- width: 100
413
- }, {
414
- dataIndex: 'number',
415
- title: "".concat(text, "\u6570\u91CF"),
416
- align: 'center',
417
- ellipsis: true,
418
- width: 100
419
- }, {
420
- dataIndex: 'share',
421
- title: "\u5206\u644A\u4EF7",
422
- align: 'center',
423
- ellipsis: true,
424
- width: 70
425
- }, {
426
- dataIndex: 'type',
427
- title: "\u8D60\u54C1\u7C7B\u578B",
428
- align: 'center',
429
- ellipsis: true,
430
- width: 100
431
- }];
427
+ });
432
428
  };
433
- var newColumns = useMemo(function () {
434
- var columnList = [{
435
- dataIndex: '',
436
- title: '序号',
437
- align: 'center',
438
- ellipsis: true,
439
- width: 50,
440
- render: function render(val, record, index) {
441
- return /*#__PURE__*/React.createElement("span", null, index + 1);
442
- }
443
- }].concat(_toConsumableArray(GOODS_INFO_COLUMNS(text).filter(function (t) {
444
- return showHeader.includes(t === null || t === void 0 ? void 0 : t.dataIndex);
445
- })));
446
- return columnList;
447
- }, [showHeader, list]);
448
- return /*#__PURE__*/React.createElement(Table, {
449
- columns: newColumns,
450
- dataSource: list,
451
- rowKey: 'uuid',
452
- size: "small",
453
- pagination: false,
454
- scroll: {
455
- x: '100%'
456
- },
457
- locale: {
458
- emptyText: '暂无数据'
459
- }
460
- });
461
429
  };
430
+ export var BsGoodsTable = getTable(function () {
431
+ var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
432
+ return [{
433
+ dataIndex: "mark",
434
+ title: "\u5546\u54C1\u6807\u8BB0",
435
+ align: "center",
436
+ ellipsis: true,
437
+ width: 100
438
+ }, {
439
+ dataIndex: "skuName",
440
+ title: "".concat(text, "sku\u540D\u79F0"),
441
+ align: "center",
442
+ ellipsis: true,
443
+ width: 200
444
+ }, {
445
+ dataIndex: "sku",
446
+ title: "".concat(text, "sku\u7F16\u7801"),
447
+ align: "center",
448
+ ellipsis: true,
449
+ width: 100
450
+ }, {
451
+ dataIndex: "name",
452
+ title: "".concat(text, "\u540D\u79F0"),
453
+ align: "center",
454
+ ellipsis: true,
455
+ width: 200
456
+ }, {
457
+ dataIndex: "pic",
458
+ title: "\u56FE\u7247",
459
+ align: "center",
460
+ ellipsis: true,
461
+ width: 100,
462
+ render: function render(val) {
463
+ return /*#__PURE__*/React.createElement(Image, {
464
+ width: 60,
465
+ src: val
466
+ });
467
+ }
468
+ }, {
469
+ dataIndex: "code",
470
+ title: "".concat(text, "\u7F16\u7801"),
471
+ align: "center",
472
+ ellipsis: true,
473
+ width: 100
474
+ }, {
475
+ dataIndex: "money",
476
+ title: "\u5B9E\u4ED8\u91D1\u989D",
477
+ align: "center",
478
+ ellipsis: true,
479
+ width: 100
480
+ }, {
481
+ dataIndex: "number",
482
+ title: "".concat(text, "\u6570\u91CF"),
483
+ align: "center",
484
+ ellipsis: true,
485
+ width: 100
486
+ }, {
487
+ dataIndex: "share",
488
+ title: "\u5206\u644A\u4EF7",
489
+ align: "center",
490
+ ellipsis: true,
491
+ width: 70
492
+ }, {
493
+ dataIndex: "type",
494
+ title: "\u8D60\u54C1\u7C7B\u578B",
495
+ align: "center",
496
+ ellipsis: true,
497
+ width: 100
498
+ }];
499
+ });
500
+ export var TBGoodTable = getTable(function () {
501
+ return [{
502
+ dataIndex: "title",
503
+ title: "商品名称",
504
+ align: "center",
505
+ ellipsis: true,
506
+ width: 200
507
+ }, {
508
+ dataIndex: "outerId",
509
+ title: "商品编码",
510
+ align: "center",
511
+ ellipsis: true,
512
+ width: 140
513
+ }, {
514
+ dataIndex: "picUrl",
515
+ title: "图片",
516
+ align: "center",
517
+ ellipsis: true,
518
+ width: 100,
519
+ render: function render(val) {
520
+ return /*#__PURE__*/React.createElement(Image, {
521
+ width: 60,
522
+ src: val
523
+ });
524
+ }
525
+ }, {
526
+ dataIndex: "numIid",
527
+ title: "商品id",
528
+ align: "center",
529
+ ellipsis: true,
530
+ width: 200
531
+ }, {
532
+ dataIndex: "skuId",
533
+ title: "SKU ID",
534
+ align: "center",
535
+ ellipsis: true,
536
+ width: 200
537
+ }, {
538
+ dataIndex: "outerSkuId",
539
+ title: "SKU 编码",
540
+ align: "center",
541
+ ellipsis: true,
542
+ width: 100
543
+ }, {
544
+ dataIndex: "propertiesName",
545
+ title: "SKU 信息",
546
+ align: "center",
547
+ ellipsis: true,
548
+ width: 200
549
+ }];
550
+ // title: '商品名称',
551
+ // outerId: '商品编码',
552
+ // picUrl: '图片',
553
+ // numIid: '商品id',
554
+ // skuId: 'SKU ID',
555
+ // outerSkuId: 'SKU 编码',
556
+ // propertiesName: 'SKU 信息',
557
+ });
558
+
462
559
  export var FileRender = function FileRender(_ref12) {
463
560
  var _ref12$fileList = _ref12.fileList,
464
561
  fileList = _ref12$fileList === void 0 ? [] : _ref12$fileList,
@@ -468,15 +565,15 @@ export var FileRender = function FileRender(_ref12) {
468
565
  _useState4 = _slicedToArray(_useState3, 2),
469
566
  visible = _useState4[0],
470
567
  setVisible = _useState4[1];
471
- var _useState5 = useState(''),
568
+ var _useState5 = useState(""),
472
569
  _useState6 = _slicedToArray(_useState5, 2),
473
570
  fileUrl = _useState6[0],
474
571
  setFileUrl = _useState6[1];
475
- var _useState7 = useState(''),
572
+ var _useState7 = useState(""),
476
573
  _useState8 = _slicedToArray(_useState7, 2),
477
574
  fileType = _useState8[0],
478
575
  setFileType = _useState8[1];
479
- var _useState9 = useState(''),
576
+ var _useState9 = useState(""),
480
577
  _useState10 = _slicedToArray(_useState9, 2),
481
578
  fileName = _useState10[0],
482
579
  setFileName = _useState10[1];
@@ -485,24 +582,24 @@ export var FileRender = function FileRender(_ref12) {
485
582
  downloading = _useState12[0],
486
583
  setDownloading = _useState12[1];
487
584
  var handleCancel = function handleCancel() {
488
- setFileUrl('');
489
- setFileName('');
585
+ setFileUrl("");
586
+ setFileName("");
490
587
  setVisible(false);
491
588
  setDownloading(false);
492
589
  };
493
590
  var onPreview = function onPreview(file) {
494
591
  var _file$url;
495
- var fileArr = file === null || file === void 0 ? void 0 : (_file$url = file.url) === null || _file$url === void 0 ? void 0 : _file$url.split('.');
592
+ var fileArr = file === null || file === void 0 ? void 0 : (_file$url = file.url) === null || _file$url === void 0 ? void 0 : _file$url.split(".");
496
593
  var fileType = fileArr[fileArr.length - 1];
497
- if (['png', 'jpg', 'jpeg', 'gif', 'bmp', 'svg'].includes(fileType.toLowerCase())) {
594
+ if (["png", "jpg", "jpeg", "gif", "bmp", "svg"].includes(fileType.toLowerCase())) {
498
595
  setFileUrl(file === null || file === void 0 ? void 0 : file.url);
499
596
  setFileName(file === null || file === void 0 ? void 0 : file.name);
500
- setFileType('pic');
597
+ setFileType("pic");
501
598
  setVisible(true);
502
- } else if (['mp4', 'avi', 'mpeg', 'asf', 'mov', '3gp', 'wmv', 'rmvb'].includes(fileType.toLowerCase())) {
599
+ } else if (["mp4", "avi", "mpeg", "asf", "mov", "3gp", "wmv", "rmvb"].includes(fileType.toLowerCase())) {
503
600
  setFileUrl(file === null || file === void 0 ? void 0 : file.url);
504
601
  setFileName(file === null || file === void 0 ? void 0 : file.name);
505
- setFileType('video');
602
+ setFileType("video");
506
603
  setVisible(true);
507
604
  } else {
508
605
  window.open(file === null || file === void 0 ? void 0 : file.url);
@@ -513,9 +610,9 @@ export var FileRender = function FileRender(_ref12) {
513
610
  fetch(url).then(function (res) {
514
611
  return res.blob();
515
612
  }).then(function (blob) {
516
- var a = document.createElement('a');
613
+ var a = document.createElement("a");
517
614
  document.body.appendChild(a);
518
- a.style.display = 'none';
615
+ a.style.display = "none";
519
616
  var url = window.URL.createObjectURL(blob);
520
617
  a.href = url;
521
618
  a.download = name;
@@ -529,9 +626,9 @@ export var FileRender = function FileRender(_ref12) {
529
626
  return /*#__PURE__*/React.createElement(React.Fragment, null, fileList.map(function (item) {
530
627
  return /*#__PURE__*/React.createElement("a", {
531
628
  style: {
532
- color: '#1890ff',
533
- cursor: 'pointer',
534
- display: 'block'
629
+ color: "#1890ff",
630
+ cursor: "pointer",
631
+ display: "block"
535
632
  },
536
633
  onClick: function onClick(e) {
537
634
  e.preventDefault();
@@ -553,20 +650,20 @@ export var FileRender = function FileRender(_ref12) {
553
650
  }, "\u4E0B\u8F7D") : /*#__PURE__*/React.createElement(CopyToClipboard, {
554
651
  text: fileUrl,
555
652
  onCopy: function onCopy() {
556
- message.success('复制成功');
653
+ message.success("复制成功");
557
654
  }
558
655
  }, /*#__PURE__*/React.createElement(Button, {
559
656
  type: "link"
560
- }, "\u4E0B\u8F7D\u5730\u5740")), fileType === 'pic' ? /*#__PURE__*/React.createElement("img", {
657
+ }, "\u4E0B\u8F7D\u5730\u5740")), fileType === "pic" ? /*#__PURE__*/React.createElement("img", {
561
658
  alt: "example",
562
659
  style: {
563
- width: '100%'
660
+ width: "100%"
564
661
  },
565
662
  src: fileUrl
566
663
  }) : /*#__PURE__*/React.createElement("video", {
567
664
  style: {
568
- width: '100%',
569
- height: '100%'
665
+ width: "100%",
666
+ height: "100%"
570
667
  },
571
668
  autoPlay: true,
572
669
  controls: true,
@@ -576,24 +673,24 @@ export var FileRender = function FileRender(_ref12) {
576
673
  export var BsSystemOrderTable = function BsSystemOrderTable(_ref13) {
577
674
  var value = _ref13.value,
578
675
  type = _ref13.type;
579
- var columns = type === 'WLN_SYSTEM_ORDER' ? [{
580
- dataIndex: 'billType',
581
- title: '单据类型'
676
+ var columns = type === "WLN_SYSTEM_ORDER" ? [{
677
+ dataIndex: "billType",
678
+ title: "单据类型"
582
679
  }, {
583
- dataIndex: 'billNo',
584
- title: '系统订单号'
680
+ dataIndex: "billNo",
681
+ title: "系统订单号"
585
682
  }, {
586
- dataIndex: 'billTag',
587
- title: '标签'
683
+ dataIndex: "billTag",
684
+ title: "标签"
588
685
  }] : [{
589
- dataIndex: 'billType',
590
- title: '订单类型'
686
+ dataIndex: "billType",
687
+ title: "订单类型"
591
688
  }, {
592
- dataIndex: 'billNo',
593
- title: '系统订单号'
689
+ dataIndex: "billNo",
690
+ title: "系统订单号"
594
691
  }, {
595
- dataIndex: 'billTag',
596
- title: '标记'
692
+ dataIndex: "billTag",
693
+ title: "标记"
597
694
  }];
598
695
  var rowSelection = {
599
696
  selectedRowKeys: (value === null || value === void 0 ? void 0 : value.selectIds) || ((value === null || value === void 0 ? void 0 : value.showOrderInfo) || []).reduce(function (prv, next) {
@@ -614,14 +711,14 @@ export var BsSystemOrderTable = function BsSystemOrderTable(_ref13) {
614
711
  dataSource: (value === null || value === void 0 ? void 0 : value.showOrderInfo) || [],
615
712
  columns: columns,
616
713
  rowSelection: rowSelection,
617
- rowKey: 'billNo',
714
+ rowKey: "billNo",
618
715
  size: "small",
619
716
  pagination: false,
620
717
  scroll: {
621
- x: '100%'
718
+ x: "100%"
622
719
  },
623
720
  locale: {
624
- emptyText: '暂无数据'
721
+ emptyText: "暂无数据"
625
722
  }
626
723
  });
627
724
  };
@@ -641,33 +738,33 @@ export var MsgContent = function MsgContent(_ref14) {
641
738
  _ref14$options = _ref14.options,
642
739
  options = _ref14$options === void 0 ? [] : _ref14$options;
643
740
  var msgTypeCh = {
644
- ding: '钉钉',
645
- wechat: '微信',
646
- qq: 'QQ',
647
- qywx: '企业微信'
741
+ ding: "钉钉",
742
+ wechat: "微信",
743
+ qq: "QQ",
744
+ qywx: "企业微信"
648
745
  };
649
746
  var detailContent = function detailContent(item) {
650
747
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
651
748
  style: {
652
- textAlign: 'left'
749
+ textAlign: "left"
653
750
  }
654
751
  }, /*#__PURE__*/React.createElement("div", null, item.ruleName)));
655
752
  };
656
753
  return /*#__PURE__*/React.createElement(Space, {
657
- direction: !horizontal ? 'vertical' : 'horizontal'
754
+ direction: !horizontal ? "vertical" : "horizontal"
658
755
  }, Array.isArray(list) ? (list || []).map(function (item, index) {
659
756
  var _options$find2;
660
757
  var color = ((_options$find2 = options.find(function (innerItem) {
661
758
  return item[valueKey] === innerItem.label;
662
- })) === null || _options$find2 === void 0 ? void 0 : _options$find2.color) || '#000';
759
+ })) === null || _options$find2 === void 0 ? void 0 : _options$find2.color) || "#000";
663
760
  var currentOption = options.find(function (option) {
664
761
  return item[valueKey] === option.value;
665
762
  });
666
- var key = item.msgType || 'ding';
763
+ var key = item.msgType || "ding";
667
764
  return /*#__PURE__*/React.createElement("div", {
668
765
  style: {
669
766
  color: color,
670
- cursor: 'pointer'
767
+ cursor: "pointer"
671
768
  }
672
769
  }, /*#__PURE__*/React.createElement(Popover, {
673
770
  content: detailContent(item),
@@ -676,6 +773,6 @@ export var MsgContent = function MsgContent(_ref14) {
676
773
  }
677
774
  }, /*#__PURE__*/React.createElement("span", {
678
775
  key: index
679
- }, msgTypeCh[key], "-", currentOption ? currentOption.label : (item === null || item === void 0 ? void 0 : item[valueKey]) || '')));
776
+ }, msgTypeCh[key], "-", currentOption ? currentOption.label : (item === null || item === void 0 ? void 0 : item[valueKey]) || "")));
680
777
  }) : null);
681
778
  };