@kmkf-fe-packages/basic-components 1.8.0-beta.3 → 1.8.0-beta.5

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.
package/dist/index.esm.js CHANGED
@@ -9082,6 +9082,8 @@ var Goods = function Goods(props) {
9082
9082
  outerSkuId = _ref3.outerSkuId;
9083
9083
  if (numIndex < 0) return;
9084
9084
  var newList = JSON.parse(JSON.stringify(imgList));
9085
+ // 判断抖音是否需要用code覆盖商品编码
9086
+ var needSetOuterId = !(newList[numIndex].outerId || newList[numIndex].outerId !== newList[numIndex].outerSkuId);
9085
9087
  if (type === 4) {
9086
9088
  newList[numIndex].itemId = enableItemId;
9087
9089
  newList[numIndex].supplierName = enableSupplierName;
@@ -9091,7 +9093,7 @@ var Goods = function Goods(props) {
9091
9093
  if (type === 1 && outerSkuId) {
9092
9094
  newList[numIndex].outerId = outerSkuId;
9093
9095
  }
9094
- if (type === 1 && code) {
9096
+ if (type === 1 && code && needSetOuterId) {
9095
9097
  newList[numIndex].outerId = code;
9096
9098
  }
9097
9099
  //替换成sku的图片
@@ -9303,7 +9305,7 @@ var Goods = function Goods(props) {
9303
9305
  disabled: disabled,
9304
9306
  value: img.supplierName,
9305
9307
  onChange: handleChangeValue('supplierName', index)
9306
- })) : null, type !== 4 && changeSku ? /*#__PURE__*/React.createElement(Button, {
9308
+ })) : null, !disabled && type !== 4 && changeSku ? /*#__PURE__*/React.createElement(Button, {
9307
9309
  style: {
9308
9310
  marginTop: '4px'
9309
9311
  },
@@ -9454,6 +9456,8 @@ var GoodItem = function GoodItem(props) {
9454
9456
  skuId = _ref3.skuId;
9455
9457
  if (numIndex < 0) return;
9456
9458
  var newList = JSON.parse(JSON.stringify(imgList));
9459
+ // 判断抖音是否需要用code覆盖商品编码
9460
+ var needSetOuterId = !(newList[numIndex].outerId || newList[numIndex].outerId !== newList[numIndex].outerSkuId);
9457
9461
  if (type === 4) {
9458
9462
  newList[numIndex].itemId = enableItemId;
9459
9463
  newList[numIndex].supplierName = enableSupplierName;
@@ -9464,7 +9468,7 @@ var GoodItem = function GoodItem(props) {
9464
9468
  if (outerSkuId) newList[numIndex].outerSkuId = outerSkuId;
9465
9469
  if (skuId) newList[numIndex].skuId = skuId;
9466
9470
  }
9467
- if (type === 1 && code) {
9471
+ if (type === 1 && code && needSetOuterId) {
9468
9472
  newList[numIndex].outerId = code;
9469
9473
  }
9470
9474
  //替换成sku的图片
@@ -9665,7 +9669,7 @@ var GoodItem = function GoodItem(props) {
9665
9669
  src: img.picUrl || defaultImg,
9666
9670
  className: "img",
9667
9671
  alt: ""
9668
- })), type !== 4 && changeSku ? /*#__PURE__*/React.createElement(Button, {
9672
+ })), !disabled && type !== 4 && changeSku ? /*#__PURE__*/React.createElement(Button, {
9669
9673
  style: {
9670
9674
  marginTop: '4px'
9671
9675
  },
@@ -9689,7 +9693,7 @@ var GoodItem = function GoodItem(props) {
9689
9693
  disabled: item.disabled || disabled,
9690
9694
  onChange: handleChangeValue(item.key, index)
9691
9695
  }));
9692
- }), !hasPic && type !== 4 && changeSku ? /*#__PURE__*/React.createElement(Button, {
9696
+ }), !disabled && !hasPic && type !== 4 && changeSku ? /*#__PURE__*/React.createElement(Button, {
9693
9697
  style: {
9694
9698
  marginTop: '4px'
9695
9699
  },
package/dist/index.js CHANGED
@@ -9094,6 +9094,8 @@ var Goods = function Goods(props) {
9094
9094
  outerSkuId = _ref3.outerSkuId;
9095
9095
  if (numIndex < 0) return;
9096
9096
  var newList = JSON.parse(JSON.stringify(imgList));
9097
+ // 判断抖音是否需要用code覆盖商品编码
9098
+ var needSetOuterId = !(newList[numIndex].outerId || newList[numIndex].outerId !== newList[numIndex].outerSkuId);
9097
9099
  if (type === 4) {
9098
9100
  newList[numIndex].itemId = enableItemId;
9099
9101
  newList[numIndex].supplierName = enableSupplierName;
@@ -9103,7 +9105,7 @@ var Goods = function Goods(props) {
9103
9105
  if (type === 1 && outerSkuId) {
9104
9106
  newList[numIndex].outerId = outerSkuId;
9105
9107
  }
9106
- if (type === 1 && code) {
9108
+ if (type === 1 && code && needSetOuterId) {
9107
9109
  newList[numIndex].outerId = code;
9108
9110
  }
9109
9111
  //替换成sku的图片
@@ -9315,7 +9317,7 @@ var Goods = function Goods(props) {
9315
9317
  disabled: disabled,
9316
9318
  value: img.supplierName,
9317
9319
  onChange: handleChangeValue('supplierName', index)
9318
- })) : null, type !== 4 && changeSku ? /*#__PURE__*/React__default['default'].createElement(antd.Button, {
9320
+ })) : null, !disabled && type !== 4 && changeSku ? /*#__PURE__*/React__default['default'].createElement(antd.Button, {
9319
9321
  style: {
9320
9322
  marginTop: '4px'
9321
9323
  },
@@ -9466,6 +9468,8 @@ var GoodItem = function GoodItem(props) {
9466
9468
  skuId = _ref3.skuId;
9467
9469
  if (numIndex < 0) return;
9468
9470
  var newList = JSON.parse(JSON.stringify(imgList));
9471
+ // 判断抖音是否需要用code覆盖商品编码
9472
+ var needSetOuterId = !(newList[numIndex].outerId || newList[numIndex].outerId !== newList[numIndex].outerSkuId);
9469
9473
  if (type === 4) {
9470
9474
  newList[numIndex].itemId = enableItemId;
9471
9475
  newList[numIndex].supplierName = enableSupplierName;
@@ -9476,7 +9480,7 @@ var GoodItem = function GoodItem(props) {
9476
9480
  if (outerSkuId) newList[numIndex].outerSkuId = outerSkuId;
9477
9481
  if (skuId) newList[numIndex].skuId = skuId;
9478
9482
  }
9479
- if (type === 1 && code) {
9483
+ if (type === 1 && code && needSetOuterId) {
9480
9484
  newList[numIndex].outerId = code;
9481
9485
  }
9482
9486
  //替换成sku的图片
@@ -9677,7 +9681,7 @@ var GoodItem = function GoodItem(props) {
9677
9681
  src: img.picUrl || defaultImg,
9678
9682
  className: "img",
9679
9683
  alt: ""
9680
- })), type !== 4 && changeSku ? /*#__PURE__*/React__default['default'].createElement(antd.Button, {
9684
+ })), !disabled && type !== 4 && changeSku ? /*#__PURE__*/React__default['default'].createElement(antd.Button, {
9681
9685
  style: {
9682
9686
  marginTop: '4px'
9683
9687
  },
@@ -9701,7 +9705,7 @@ var GoodItem = function GoodItem(props) {
9701
9705
  disabled: item.disabled || disabled,
9702
9706
  onChange: handleChangeValue(item.key, index)
9703
9707
  }));
9704
- }), !hasPic && type !== 4 && changeSku ? /*#__PURE__*/React__default['default'].createElement(antd.Button, {
9708
+ }), !disabled && !hasPic && type !== 4 && changeSku ? /*#__PURE__*/React__default['default'].createElement(antd.Button, {
9705
9709
  style: {
9706
9710
  marginTop: '4px'
9707
9711
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "1.8.0-beta.3",
3
+ "version": "1.8.0-beta.5",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "",
6
6
  "license": "ISC",
@@ -65,5 +65,5 @@
65
65
  "publishConfig": {
66
66
  "access": "public"
67
67
  },
68
- "gitHead": "9b8a08d2903221ffe9aacb2c18953dc165e30851"
68
+ "gitHead": "5c56eac97a0751ea896a86f3f095b60f8403f078"
69
69
  }