@fonixtree/magic-design 2.0.71 → 2.0.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/es/common/AffiliateProductModal/index.js +1 -1
  2. package/es/common/AffiliateProductModal/index.less +1 -1
  3. package/es/common/Button/index.less +0 -1
  4. package/es/common/LinkModal/FilteredProductModal/index.js +154 -104
  5. package/es/common/LinkModal/FilteredProductModal/index.less +7 -0
  6. package/es/common/LinkModal/ProductDetailPage/index.js +92 -57
  7. package/es/common/LinkModal/ProductDetailPage/index.less +6 -1
  8. package/es/common/ProductModal/index.js +124 -87
  9. package/es/common/ProductModal/index.less +7 -1
  10. package/es/common/ProductSource/index.js +82 -21
  11. package/es/composite-comp/dito/components/HeadNavigation/defaultJSON.js +22 -17
  12. package/es/composite-comp/dito/components/HeadNavigation/mobile/index.js +2 -2
  13. package/es/composite-comp/dito/components/Recommend/mobile/index.js +26 -23
  14. package/es/composite-comp/dito/config-panels/HeadNavigationConfig/index.js +25 -27
  15. package/es/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.js +4 -2
  16. package/es/constants/index.js +12 -3
  17. package/es/core/Designer/QuickMenuBar/index.js +9 -1
  18. package/es/core/Designer/index.js +11 -1
  19. package/es/locale/en/en.json +4 -1
  20. package/es/locale/es/es.json +4 -1
  21. package/es/locale/id/id.json +4 -1
  22. package/es/utils/commonUtil.js +14 -6
  23. package/lib/common/AffiliateProductModal/index.js +1 -1
  24. package/lib/common/AffiliateProductModal/index.less +1 -1
  25. package/lib/common/Button/index.less +0 -1
  26. package/lib/common/LinkModal/FilteredProductModal/index.js +154 -104
  27. package/lib/common/LinkModal/FilteredProductModal/index.less +7 -0
  28. package/lib/common/LinkModal/ProductDetailPage/index.js +92 -57
  29. package/lib/common/LinkModal/ProductDetailPage/index.less +6 -1
  30. package/lib/common/ProductModal/index.js +124 -87
  31. package/lib/common/ProductModal/index.less +7 -1
  32. package/lib/common/ProductSource/index.js +82 -21
  33. package/lib/composite-comp/dito/components/HeadNavigation/defaultJSON.js +22 -17
  34. package/lib/composite-comp/dito/components/HeadNavigation/mobile/index.js +2 -2
  35. package/lib/composite-comp/dito/components/Recommend/mobile/index.js +26 -23
  36. package/lib/composite-comp/dito/config-panels/HeadNavigationConfig/index.js +25 -27
  37. package/lib/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.js +4 -2
  38. package/lib/constants/index.js +12 -3
  39. package/lib/core/Designer/QuickMenuBar/index.js +9 -1
  40. package/lib/core/Designer/index.js +11 -1
  41. package/lib/locale/en/en.json +4 -1
  42. package/lib/locale/es/es.json +4 -1
  43. package/lib/locale/id/id.json +4 -1
  44. package/lib/utils/commonUtil.js +14 -6
  45. package/package.json +1 -1
@@ -431,7 +431,7 @@ var AffiliateProductModal = function AffiliateProductModal(props) {
431
431
  title: (0, _locale.i18n)('PRODUCT_SELECT'),
432
432
  visible: visible,
433
433
  width: "1200px",
434
- wrapClassName: "modalCot"
434
+ wrapClassName: "affiliateModalCot"
435
435
  }, /*#__PURE__*/_react["default"].createElement("div", {
436
436
  className: "proModalWrap"
437
437
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -1,4 +1,4 @@
1
- .modalCot {
1
+ .affiliateModalCot {
2
2
  width: 1200px;
3
3
  right: unset !important;
4
4
  left: unset !important;
@@ -44,7 +44,6 @@
44
44
  }
45
45
 
46
46
  &.text {
47
- background: #F5F6F7;
48
47
  color: #2F54EB;
49
48
  font-weight: 400;
50
49
  }
@@ -184,6 +184,14 @@ var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
184
184
  }
185
185
  };
186
186
 
187
+ var proTypeOption = [{
188
+ label: 'SKU',
189
+ value: 'sku'
190
+ }, {
191
+ label: 'SPU',
192
+ value: 'spu'
193
+ }];
194
+
187
195
  var FilteredProductModal = function FilteredProductModal(props) {
188
196
  var onDataChange = props.onDataChange;
189
197
  var Option = _antd.Select.Option;
@@ -213,41 +221,41 @@ var FilteredProductModal = function FilteredProductModal(props) {
213
221
  labelData = _f[0],
214
222
  setLabelData = _f[1];
215
223
 
216
- var _g = (0, _react.useState)(''),
217
- storeName = _g[0],
218
- setStoreName = _g[1];
224
+ var _g = (0, _react.useState)(window.magicDesign.storeId || ''),
225
+ storeId = _g[0],
226
+ setStoreId = _g[1];
219
227
 
220
- var _h = (0, _react.useState)(window.magicDesign.storeId || ''),
221
- storeId = _h[0],
222
- setStoreId = _h[1];
228
+ var _h = (0, _react.useState)([]),
229
+ storeList = _h[0],
230
+ setStoreList = _h[1];
223
231
 
224
- var _j = (0, _react.useState)([]),
225
- storeList = _j[0],
226
- setStoreList = _j[1];
232
+ var _j = (0, _react.useState)(''),
233
+ productName = _j[0],
234
+ setProductName = _j[1];
227
235
 
228
236
  var _k = (0, _react.useState)(''),
229
- productName = _k[0],
230
- setProductName = _k[1];
237
+ minimum = _k[0],
238
+ setMinimum = _k[1];
231
239
 
232
240
  var _l = (0, _react.useState)(''),
233
- minimum = _l[0],
234
- setMinimum = _l[1];
241
+ maximum = _l[0],
242
+ setMaximum = _l[1];
235
243
 
236
- var _m = (0, _react.useState)(''),
237
- maximum = _m[0],
238
- setMaximum = _m[1];
244
+ var _m = (0, _react.useState)([]),
245
+ dataSource = _m[0],
246
+ setDataSource = _m[1];
239
247
 
240
- var _o = (0, _react.useState)([]),
241
- dataSource = _o[0],
242
- setDataSource = _o[1];
248
+ var _o = (0, _react.useState)({}),
249
+ promotions = _o[0],
250
+ setPromotions = _o[1];
243
251
 
244
- var _p = (0, _react.useState)({}),
245
- promotions = _p[0],
246
- setPromotions = _p[1];
252
+ var _p = (0, _react.useState)(false),
253
+ loading = _p[0],
254
+ setLoading = _p[1];
247
255
 
248
- var _q = (0, _react.useState)(false),
249
- loading = _q[0],
250
- setLoading = _q[1];
256
+ var _q = (0, _react.useState)('sku'),
257
+ proType = _q[0],
258
+ setProType = _q[1];
251
259
 
252
260
  var _r = (0, _react.useState)({
253
261
  pageSize: 20,
@@ -282,7 +290,6 @@ var FilteredProductModal = function FilteredProductModal(props) {
282
290
  settBrandId([]);
283
291
  settLabelId({});
284
292
  setStoreId(window.magicDesign.storeId || '');
285
- setStoreName('');
286
293
  setProductName('');
287
294
  setMinimum('');
288
295
  setMaximum('');
@@ -293,14 +300,14 @@ var FilteredProductModal = function FilteredProductModal(props) {
293
300
 
294
301
  var columns = [{
295
302
  title: 'Image',
296
- dataIndex: 'imgUrl',
303
+ dataIndex: 'productImageUrl',
297
304
  key: 'imgUrl',
298
305
  width: 100,
299
306
  render: function render(imgUrl, record) {
300
307
  return /*#__PURE__*/_react["default"].createElement("div", {
301
308
  className: "prodImage",
302
309
  style: {
303
- backgroundImage: "url(\"" + (0, _commonUtil.convertImageUrl)(record.productImg || record.imgUrlContent || record.productImgContent) + "\")"
310
+ backgroundImage: "url(\"" + (imgUrl || (0, _commonUtil.convertImageUrl)(record.productImg || record.imgUrlContent || record.productImgContent)) + "\")"
304
311
  }
305
312
  });
306
313
  }
@@ -309,13 +316,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
309
316
  dataIndex: 'offerName',
310
317
  key: 'offerName',
311
318
  ellipsis: true
312
- }, // {
313
- // title: 'SKU',
314
- // dataIndex: 'attrValues',
315
- // key: 'attrValues',
316
- // ellipsis: true,
317
- // },
318
- {
319
+ }, {
319
320
  title: 'Price',
320
321
  dataIndex: 'salesPrice',
321
322
  key: 'salesPrice',
@@ -439,72 +440,106 @@ var FilteredProductModal = function FilteredProductModal(props) {
439
440
  };
440
441
 
441
442
  var loadGoods = function loadGoods() {
442
- setLoading(true);
443
- return new Promise(function (resolve, reject) {
444
- return __awaiter(void 0, void 0, void 0, function () {
445
- var precision, params, res;
446
- return __generator(this, function (_a) {
447
- switch (_a.label) {
448
- case 0:
449
- precision = Math.pow(10, (0, _commonUtil.ensure)(function () {
450
- return window.systemParams.precision;
451
- }, '0'));
452
- params = {
453
- catgIds: tValue.join(','),
454
- brandIds: brandId.map(function (v) {
455
- return v.key;
456
- }).join(','),
457
- labelIds: labelId.key,
458
- q: productName,
459
- // productName,
460
- storeId: storeId,
461
- startPrice: minimum * precision || '',
462
- endPrice: maximum * precision || '',
463
- // storeName:storeName,
464
- campaignType: promotions.key || '',
465
- pageSize: paginationParams.pageSize,
466
- pageIndex: paginationParams.current,
467
- state: 'A'
468
- };
469
- return [4
470
- /*yield*/
471
- , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers/es", params, 'POST')];
472
-
473
- case 1:
474
- res = _a.sent();
475
- setLoading(false);
476
- paginationParams.total = res.total;
477
-
478
- if (res && res.list && res.list.length > 0) {
479
- setDataSource(res.list);
480
- resolve({
481
- url: JsonToUrl({
482
- catgIds: tValue.join(',') || '',
483
- brandIds: brandId.map(function (v) {
484
- return v.key;
485
- }).join(',') || '',
486
- labelIds: labelId.key || '',
487
- q: productName || '',
488
- minPrice: minimum * precision || '',
489
- maxPrice: maximum * precision || '',
490
- storeId: storeId || '',
491
- campaignType: promotions.key || '',
492
- state: 'A'
493
- }),
494
- total: res.total
495
- });
496
- } else {
497
- setDataSource([]);
498
- resolve({
499
- total: 0
500
- });
501
- }
502
-
503
- return [2
504
- /*return*/
505
- ];
506
- }
507
- });
443
+ return __awaiter(void 0, void 0, void 0, function () {
444
+ var _list, total, params, res, params, res_1, h5UrlStr;
445
+
446
+ return __generator(this, function (_a) {
447
+ switch (_a.label) {
448
+ case 0:
449
+ setLoading(true);
450
+ _list = [];
451
+ total = 0;
452
+ if (!(proType === 'sku')) return [3
453
+ /*break*/
454
+ , 2];
455
+ params = {
456
+ catgIds: tValue.join(','),
457
+ brandIds: brandId.map(function (v) {
458
+ return v.key;
459
+ }).join(','),
460
+ labelIds: labelId.key,
461
+ q: productName,
462
+ storeId: storeId,
463
+ startPrice: (0, _currencyUtil.formatBackendCurrency)(minimum),
464
+ endPrice: (0, _currencyUtil.formatBackendCurrency)(maximum),
465
+ campaignType: promotions.key || '',
466
+ state: 'A',
467
+ pageSize: paginationParams.pageSize,
468
+ pageIndex: paginationParams.current
469
+ };
470
+ return [4
471
+ /*yield*/
472
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers/es", params, 'POST')];
473
+
474
+ case 1:
475
+ res = _a.sent();
476
+ _list = res.list || [];
477
+ total = res.total;
478
+ return [3
479
+ /*break*/
480
+ , 4];
481
+
482
+ case 2:
483
+ params = {
484
+ catgIds: tValue.join(','),
485
+ brandIds: brandId.map(function (v) {
486
+ return v.key;
487
+ }).join(','),
488
+ labelIds: labelId.key,
489
+ productName: productName,
490
+ storeId: storeId,
491
+ minPrice: (0, _currencyUtil.formatBackendCurrency)(minimum),
492
+ maxPrice: (0, _currencyUtil.formatBackendCurrency)(maximum),
493
+ cmpTypeId: promotions.key || '',
494
+ state: 'A',
495
+ pageSize: paginationParams.pageSize,
496
+ pageIndex: paginationParams.current
497
+ };
498
+ return [4
499
+ /*yield*/
500
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers", __assign(__assign({}, params), {
501
+ isDefaultCover: 'Y',
502
+ onlyQryPublishSku: true,
503
+ auditState: 'S',
504
+ crmFlag: 'on'
505
+ }), 'GET')];
506
+
507
+ case 3:
508
+ res_1 = _a.sent();
509
+ _list = (0, _commonUtil.ensure)(function () {
510
+ return res_1.list.map(function (m) {
511
+ return __assign(__assign({}, m.products[0]), m);
512
+ });
513
+ }, []);
514
+ total = res_1.total;
515
+ _a.label = 4;
516
+
517
+ case 4:
518
+ paginationParams.total = total;
519
+ setLoading(false);
520
+ setPaginationParams(__assign({}, paginationParams));
521
+ h5UrlStr = JsonToUrl({
522
+ catgIds: tValue.join(',') || '',
523
+ brandIds: brandId.map(function (v) {
524
+ return v.key;
525
+ }).join(',') || '',
526
+ labelIds: labelId.key || '',
527
+ q: productName || '',
528
+ storeId: storeId || '',
529
+ minPrice: (0, _currencyUtil.formatBackendCurrency)(minimum),
530
+ maxPrice: (0, _currencyUtil.formatBackendCurrency)(maximum),
531
+ campaignType: promotions.key || '',
532
+ state: 'A',
533
+ proType: proType
534
+ });
535
+ setDataSource(_list);
536
+ return [2
537
+ /*return*/
538
+ , {
539
+ url: h5UrlStr,
540
+ total: total
541
+ }];
542
+ }
508
543
  });
509
544
  });
510
545
  };
@@ -518,6 +553,10 @@ var FilteredProductModal = function FilteredProductModal(props) {
518
553
  queryStore();
519
554
  }
520
555
  }, []);
556
+ (0, _react.useEffect)(function () {
557
+ paginationParams.current = 1;
558
+ loadGoods();
559
+ }, [proType]);
521
560
  return /*#__PURE__*/_react["default"].createElement("div", {
522
561
  className: "mFilteredProductModal"
523
562
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -664,13 +703,15 @@ var FilteredProductModal = function FilteredProductModal(props) {
664
703
  onClick: function onClick() {
665
704
  paginationParams.current = 1;
666
705
  loadGoods().then(function (res) {
706
+ console.log('res', res);
707
+
667
708
  if (res.total !== 0) {
668
709
  onDataChange({
669
710
  value: res.url,
670
711
  name: res.url
671
712
  }, res.total);
672
713
  } else {
673
- onDataChange('', res.total); // message.warn('no goods!');
714
+ onDataChange('', res.total);
674
715
  }
675
716
  });
676
717
  },
@@ -686,7 +727,16 @@ var FilteredProductModal = function FilteredProductModal(props) {
686
727
  size: "small"
687
728
  }, (0, _locale.i18n)('CANCEL'))))), /*#__PURE__*/_react["default"].createElement("div", {
688
729
  className: "rightCot"
689
- }, /*#__PURE__*/_react["default"].createElement(_antd.Table, {
730
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Radio.Group, {
731
+ buttonStyle: "solid",
732
+ className: "btn-select-type",
733
+ onChange: function onChange(e) {
734
+ setProType(e.target.value);
735
+ },
736
+ options: proTypeOption,
737
+ optionType: "button",
738
+ value: proType
739
+ }), /*#__PURE__*/_react["default"].createElement(_antd.Table, {
690
740
  columns: columns,
691
741
  dataSource: dataSource,
692
742
  loading: loading,
@@ -697,7 +747,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
697
747
  }
698
748
  }),
699
749
  scroll: {
700
- y: 400
750
+ y: 340
701
751
  }
702
752
  })))));
703
753
  };
@@ -1,5 +1,6 @@
1
1
  .mFilteredProductModal {
2
2
  height: 550px;
3
+
3
4
  .proModalWrap {
4
5
  .info {
5
6
  background: #ecf1fd;
@@ -24,6 +25,12 @@
24
25
  width: calc(100% - 240px);
25
26
  margin-left: 16px;
26
27
 
28
+ .btn-select-type {
29
+ display: block;
30
+ text-align: right;
31
+ margin-bottom: 10px;
32
+ }
33
+
27
34
  .selectedCot {
28
35
  width: 722px;
29
36
  margin-left: 4px;
@@ -17,6 +17,8 @@ var _commonUtil = require("../../../utils/commonUtil");
17
17
 
18
18
  var _businessUtil = require("../../../utils/businessUtil");
19
19
 
20
+ var _ProductModal = require("../../ProductModal");
21
+
20
22
  require("./index.less");
21
23
 
22
24
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -182,19 +184,6 @@ var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
182
184
  }
183
185
  };
184
186
 
185
- var __rest = void 0 && (void 0).__rest || function (s, e) {
186
- var t = {};
187
-
188
- for (var p in s) {
189
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
190
- }
191
-
192
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
193
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
194
- }
195
- return t;
196
- };
197
-
198
187
  var Option = _antd.Select.Option;
199
188
 
200
189
  var ProductDetailPage = function ProductDetailPage(props) {
@@ -232,12 +221,17 @@ var ProductDetailPage = function ProductDetailPage(props) {
232
221
  loading = _h[0],
233
222
  setLoading = _h[1];
234
223
 
235
- var _j = (0, _react.useState)({
224
+ var _j = (0, _react.useState)('sku'),
225
+ proType = _j[0],
226
+ setProType = _j[1];
227
+
228
+ var _k = (0, _react.useState)({
236
229
  pageSize: 20,
237
- pageIndex: 1
230
+ current: 1,
231
+ total: 0
238
232
  }),
239
- paginationParams = _j[0],
240
- setPaginationParams = _j[1];
233
+ paginationParams = _k[0],
234
+ setPaginationParams = _k[1];
241
235
 
242
236
  var columns = [{
243
237
  title: 'Image',
@@ -276,22 +270,68 @@ var ProductDetailPage = function ProductDetailPage(props) {
276
270
  type: 'radio'
277
271
  };
278
272
 
279
- var queryGoods = function queryGoods(params) {
273
+ var queryGoods = function queryGoods() {
280
274
  return __awaiter(void 0, void 0, void 0, function () {
281
- var res;
275
+ var _list, total, params, res, res_1;
276
+
282
277
  return __generator(this, function (_a) {
283
278
  switch (_a.label) {
284
279
  case 0:
280
+ _list = [];
281
+ total = 0;
282
+ params = {
283
+ productName: productName,
284
+ brandIds: brandId.map(function (v) {
285
+ return v.key;
286
+ }).join(',') || '',
287
+ storeId: storeId,
288
+ pageSize: paginationParams.pageSize,
289
+ pageIndex: paginationParams.current
290
+ };
291
+ if (!(proType === 'sku')) return [3
292
+ /*break*/
293
+ , 2];
285
294
  return [4
286
295
  /*yield*/
287
- , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", params, 'GET')];
296
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", __assign(__assign({}, params), {
297
+ productCode: productCode
298
+ }), 'GET')];
288
299
 
289
300
  case 1:
290
301
  res = _a.sent();
302
+ _list = (0, _ProductModal.formatData)(res.list || []);
303
+ total = res.total;
304
+ return [3
305
+ /*break*/
306
+ , 4];
307
+
308
+ case 2:
309
+ return [4
310
+ /*yield*/
311
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers", __assign(__assign({}, params), {
312
+ offerCode: productCode,
313
+ isDefaultCover: 'Y',
314
+ onlyQryPublishSku: true,
315
+ auditState: 'S',
316
+ crmFlag: 'on'
317
+ }), 'GET')];
318
+
319
+ case 3:
320
+ res_1 = _a.sent();
321
+ _list = (0, _ProductModal.formatData)((0, _commonUtil.ensure)(function () {
322
+ return res_1.list.map(function (m) {
323
+ return __assign(__assign({}, m.products[0]), m);
324
+ });
325
+ }, []), proType);
326
+ total = res_1.total;
327
+ _a.label = 4;
328
+
329
+ case 4:
330
+ setProductList(_list);
291
331
  setLoading(false);
292
- paginationParams.total = res.total;
293
- setProductList(res.list);
294
- window.MProductList = res.list;
332
+ window.MProductList = _list;
333
+ paginationParams.total = total;
334
+ setPaginationParams(__assign({}, paginationParams));
295
335
  return [2
296
336
  /*return*/
297
337
  ];
@@ -362,17 +402,20 @@ var ProductDetailPage = function ProductDetailPage(props) {
362
402
 
363
403
  (0, _react.useEffect)(function () {
364
404
  setLoading(true);
365
-
366
- var total = paginationParams.total,
367
- params = __rest(paginationParams, ["total"]);
368
-
369
- queryGoods(params);
405
+ queryGoods();
370
406
  queryBrand();
371
407
 
372
408
  if ((0, _businessUtil.isPlatform)()) {
373
409
  queryStore();
374
410
  }
375
411
  }, []);
412
+ var proTypeOption = [{
413
+ label: 'SKU',
414
+ value: 'sku'
415
+ }, {
416
+ label: 'SPU',
417
+ value: 'spu'
418
+ }];
376
419
  return /*#__PURE__*/_react["default"].createElement("div", {
377
420
  className: "productDetailPage"
378
421
  }, /*#__PURE__*/_react["default"].createElement(_antd.Form, {
@@ -382,6 +425,20 @@ var ProductDetailPage = function ProductDetailPage(props) {
382
425
  layout: "horizontal"
383
426
  }, /*#__PURE__*/_react["default"].createElement(_antd.Row, {
384
427
  gutter: 24
428
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Col, {
429
+ offset: 20,
430
+ span: 4
431
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Radio.Group, {
432
+ buttonStyle: "solid",
433
+ className: "btn-select-type",
434
+ onChange: function onChange(e) {
435
+ setProType(e.target.value);
436
+ },
437
+ options: proTypeOption,
438
+ optionType: "button",
439
+ value: proType
440
+ }))), /*#__PURE__*/_react["default"].createElement(_antd.Row, {
441
+ gutter: 24
385
442
  }, /*#__PURE__*/_react["default"].createElement(_antd.Col, {
386
443
  span: 9
387
444
  }, /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
@@ -395,7 +452,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
395
452
  }))), /*#__PURE__*/_react["default"].createElement(_antd.Col, {
396
453
  span: 9
397
454
  }, /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
398
- label: "SKU Code"
455
+ label: proType === 'sku' ? 'SKU Code' : 'SPU Code'
399
456
  }, /*#__PURE__*/_react["default"].createElement(_antd.Input, {
400
457
  onChange: function onChange(e) {
401
458
  return setProductCode(e.target.value);
@@ -444,19 +501,8 @@ var ProductDetailPage = function ProductDetailPage(props) {
444
501
  }, /*#__PURE__*/_react["default"].createElement(_antd.Button, {
445
502
  onClick: function onClick() {
446
503
  setLoading(true);
447
- paginationParams.pageIndex = 1;
448
-
449
- var total = paginationParams.total,
450
- params = __rest(paginationParams, ["total"]);
451
-
452
- queryGoods(__assign({
453
- productName: productName,
454
- productCode: productCode,
455
- brandIds: brandId.map(function (v) {
456
- return v.key;
457
- }).join(',') || '',
458
- storeId: storeId
459
- }, params));
504
+ paginationParams.current = 1;
505
+ queryGoods();
460
506
  },
461
507
  size: "small",
462
508
  style: {
@@ -476,26 +522,15 @@ var ProductDetailPage = function ProductDetailPage(props) {
476
522
  pagination: __assign(__assign({}, paginationParams), {
477
523
  onChange: function onChange(page) {
478
524
  setLoading(true);
479
- paginationParams.pageIndex = page;
480
-
481
- var total = paginationParams.total,
482
- params = __rest(paginationParams, ["total"]);
483
-
484
- queryGoods(__assign({
485
- productName: productName,
486
- productCode: productCode,
487
- brandIds: brandId.map(function (v) {
488
- return v.key;
489
- }).join(',') || '',
490
- storeId: storeId
491
- }, params));
525
+ paginationParams.current = page;
526
+ queryGoods();
492
527
  },
493
528
  showSizeChanger: false
494
529
  }),
495
- rowKey: "productId",
530
+ rowKey: "id",
496
531
  rowSelection: rowSelection,
497
532
  scroll: {
498
- y: 340
533
+ y: 300
499
534
  }
500
535
  }));
501
536
  };
@@ -1,5 +1,10 @@
1
1
  .productDetailPage {
2
2
  height: 550px;
3
+
4
+ .btn-select-type {
5
+ margin-bottom: 10px;
6
+ }
7
+
3
8
  .prodImage {
4
9
  width: 36px;
5
10
  height: 36px;
@@ -7,4 +12,4 @@
7
12
  background-position: 50% 50%;
8
13
  background-size: contain;
9
14
  }
10
- }
15
+ }