@fonixtree/magic-design 1.0.37 → 1.0.38

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.
@@ -184,14 +184,6 @@ 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
-
195
187
  var FilteredProductModal = function FilteredProductModal(props) {
196
188
  var onDataChange = props.onDataChange;
197
189
  var Option = _antd.Select.Option;
@@ -253,17 +245,13 @@ var FilteredProductModal = function FilteredProductModal(props) {
253
245
  loading = _p[0],
254
246
  setLoading = _p[1];
255
247
 
256
- var _q = (0, _react.useState)('sku'),
257
- proType = _q[0],
258
- setProType = _q[1];
259
-
260
- var _r = (0, _react.useState)({
248
+ var _q = (0, _react.useState)({
261
249
  pageSize: 20,
262
250
  current: 1,
263
251
  total: 0
264
252
  }),
265
- paginationParams = _r[0],
266
- setPaginationParams = _r[1];
253
+ paginationParams = _q[0],
254
+ setPaginationParams = _q[1];
267
255
 
268
256
  var onChange = function onChange(value) {
269
257
  settVal(value);
@@ -307,7 +295,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
307
295
  return /*#__PURE__*/_react["default"].createElement("div", {
308
296
  className: "prodImage",
309
297
  style: {
310
- backgroundImage: "url(\"" + (imgUrl || (0, _commonUtil.convertImageUrl)(record.productImg || record.imgUrlContent || record.productImgContent)) + "\")"
298
+ backgroundImage: "url(\"" + (0, _commonUtil.convertImageUrl)(record.productImg || record.imgUrlContent || record.productImgContent) + "\")"
311
299
  }
312
300
  });
313
301
  }
@@ -441,17 +429,11 @@ var FilteredProductModal = function FilteredProductModal(props) {
441
429
 
442
430
  var loadGoods = function loadGoods() {
443
431
  return __awaiter(void 0, void 0, void 0, function () {
444
- var _list, total, params, res, params, res_1, h5UrlStr;
445
-
432
+ var params, res, h5UrlStr;
446
433
  return __generator(this, function (_a) {
447
434
  switch (_a.label) {
448
435
  case 0:
449
436
  setLoading(true);
450
- _list = [];
451
- total = 0;
452
- if (!(proType === 'sku')) return [3
453
- /*break*/
454
- , 2];
455
437
  params = {
456
438
  catgIds: tValue.join(','),
457
439
  brandIds: brandId.map(function (v) {
@@ -473,51 +455,10 @@ var FilteredProductModal = function FilteredProductModal(props) {
473
455
 
474
456
  case 1:
475
457
  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);
458
+ setDataSource(res.list || []);
459
+ paginationParams.total = res.total;
520
460
  setPaginationParams(__assign({}, paginationParams));
461
+ setLoading(false);
521
462
  h5UrlStr = JsonToUrl({
522
463
  catgIds: tValue.join(',') || '',
523
464
  brandIds: brandId.map(function (v) {
@@ -529,15 +470,13 @@ var FilteredProductModal = function FilteredProductModal(props) {
529
470
  minPrice: (0, _currencyUtil.formatBackendCurrency)(minimum),
530
471
  maxPrice: (0, _currencyUtil.formatBackendCurrency)(maximum),
531
472
  campaignType: promotions.key || '',
532
- state: 'A',
533
- proType: proType
473
+ state: 'A'
534
474
  });
535
- setDataSource(_list);
536
475
  return [2
537
476
  /*return*/
538
477
  , {
539
478
  url: h5UrlStr,
540
- total: total
479
+ total: res.total
541
480
  }];
542
481
  }
543
482
  });
@@ -553,10 +492,6 @@ var FilteredProductModal = function FilteredProductModal(props) {
553
492
  queryStore();
554
493
  }
555
494
  }, []);
556
- (0, _react.useEffect)(function () {
557
- paginationParams.current = 1;
558
- loadGoods();
559
- }, [proType]);
560
495
  return /*#__PURE__*/_react["default"].createElement("div", {
561
496
  className: "mFilteredProductModal"
562
497
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -727,16 +662,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
727
662
  size: "small"
728
663
  }, (0, _locale.i18n)('CANCEL'))))), /*#__PURE__*/_react["default"].createElement("div", {
729
664
  className: "rightCot"
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, {
665
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Table, {
740
666
  columns: columns,
741
667
  dataSource: dataSource,
742
668
  loading: loading,
@@ -747,7 +673,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
747
673
  }
748
674
  }),
749
675
  scroll: {
750
- y: 340
676
+ y: 400
751
677
  }
752
678
  })))));
753
679
  };
@@ -25,12 +25,6 @@
25
25
  width: calc(100% - 240px);
26
26
  margin-left: 16px;
27
27
 
28
- .btn-select-type {
29
- display: block;
30
- text-align: right;
31
- margin-bottom: 10px;
32
- }
33
-
34
28
  .selectedCot {
35
29
  width: 722px;
36
30
  margin-left: 4px;
@@ -184,14 +184,6 @@ 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
-
195
187
  var FilteredProductModal = function FilteredProductModal(props) {
196
188
  var onDataChange = props.onDataChange;
197
189
  var Option = _antd.Select.Option;
@@ -253,17 +245,13 @@ var FilteredProductModal = function FilteredProductModal(props) {
253
245
  loading = _p[0],
254
246
  setLoading = _p[1];
255
247
 
256
- var _q = (0, _react.useState)('sku'),
257
- proType = _q[0],
258
- setProType = _q[1];
259
-
260
- var _r = (0, _react.useState)({
248
+ var _q = (0, _react.useState)({
261
249
  pageSize: 20,
262
250
  current: 1,
263
251
  total: 0
264
252
  }),
265
- paginationParams = _r[0],
266
- setPaginationParams = _r[1];
253
+ paginationParams = _q[0],
254
+ setPaginationParams = _q[1];
267
255
 
268
256
  var onChange = function onChange(value) {
269
257
  settVal(value);
@@ -307,7 +295,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
307
295
  return /*#__PURE__*/_react["default"].createElement("div", {
308
296
  className: "prodImage",
309
297
  style: {
310
- backgroundImage: "url(\"" + (imgUrl || (0, _commonUtil.convertImageUrl)(record.productImg || record.imgUrlContent || record.productImgContent)) + "\")"
298
+ backgroundImage: "url(\"" + (0, _commonUtil.convertImageUrl)(record.productImg || record.imgUrlContent || record.productImgContent) + "\")"
311
299
  }
312
300
  });
313
301
  }
@@ -441,17 +429,11 @@ var FilteredProductModal = function FilteredProductModal(props) {
441
429
 
442
430
  var loadGoods = function loadGoods() {
443
431
  return __awaiter(void 0, void 0, void 0, function () {
444
- var _list, total, params, res, params, res_1, h5UrlStr;
445
-
432
+ var params, res, h5UrlStr;
446
433
  return __generator(this, function (_a) {
447
434
  switch (_a.label) {
448
435
  case 0:
449
436
  setLoading(true);
450
- _list = [];
451
- total = 0;
452
- if (!(proType === 'sku')) return [3
453
- /*break*/
454
- , 2];
455
437
  params = {
456
438
  catgIds: tValue.join(','),
457
439
  brandIds: brandId.map(function (v) {
@@ -473,51 +455,10 @@ var FilteredProductModal = function FilteredProductModal(props) {
473
455
 
474
456
  case 1:
475
457
  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);
458
+ setDataSource(res.list || []);
459
+ paginationParams.total = res.total;
520
460
  setPaginationParams(__assign({}, paginationParams));
461
+ setLoading(false);
521
462
  h5UrlStr = JsonToUrl({
522
463
  catgIds: tValue.join(',') || '',
523
464
  brandIds: brandId.map(function (v) {
@@ -529,15 +470,13 @@ var FilteredProductModal = function FilteredProductModal(props) {
529
470
  minPrice: (0, _currencyUtil.formatBackendCurrency)(minimum),
530
471
  maxPrice: (0, _currencyUtil.formatBackendCurrency)(maximum),
531
472
  campaignType: promotions.key || '',
532
- state: 'A',
533
- proType: proType
473
+ state: 'A'
534
474
  });
535
- setDataSource(_list);
536
475
  return [2
537
476
  /*return*/
538
477
  , {
539
478
  url: h5UrlStr,
540
- total: total
479
+ total: res.total
541
480
  }];
542
481
  }
543
482
  });
@@ -553,10 +492,6 @@ var FilteredProductModal = function FilteredProductModal(props) {
553
492
  queryStore();
554
493
  }
555
494
  }, []);
556
- (0, _react.useEffect)(function () {
557
- paginationParams.current = 1;
558
- loadGoods();
559
- }, [proType]);
560
495
  return /*#__PURE__*/_react["default"].createElement("div", {
561
496
  className: "mFilteredProductModal"
562
497
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -727,16 +662,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
727
662
  size: "small"
728
663
  }, (0, _locale.i18n)('CANCEL'))))), /*#__PURE__*/_react["default"].createElement("div", {
729
664
  className: "rightCot"
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, {
665
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Table, {
740
666
  columns: columns,
741
667
  dataSource: dataSource,
742
668
  loading: loading,
@@ -747,7 +673,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
747
673
  }
748
674
  }),
749
675
  scroll: {
750
- y: 340
676
+ y: 400
751
677
  }
752
678
  })))));
753
679
  };
@@ -25,12 +25,6 @@
25
25
  width: calc(100% - 240px);
26
26
  margin-left: 16px;
27
27
 
28
- .btn-select-type {
29
- display: block;
30
- text-align: right;
31
- margin-bottom: 10px;
32
- }
33
-
34
28
  .selectedCot {
35
29
  width: 722px;
36
30
  margin-left: 4px;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fonixtree/magic-design",
3
3
  "author": "Cylon Team",
4
- "version": "1.0.37",
4
+ "version": "1.0.38",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",