@kmkf-fe-packages/basic-components 1.22.1-beta.10 → 1.22.1-beta.12

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
@@ -10963,6 +10963,11 @@ var jstGoods = function jstGoods(props) {
10963
10963
  onChange === null || onChange === void 0 ? void 0 : onChange(typeInitValueMap[type]);
10964
10964
  }
10965
10965
  }, [value, type]);
10966
+ useEffect(function () {
10967
+ if (changeIndex > (value === null || value === void 0 ? void 0 : value.length) - 1) {
10968
+ setChangeIndex(0);
10969
+ }
10970
+ }, value);
10966
10971
  var content = function content(item, index) {
10967
10972
  return /*#__PURE__*/React.createElement("div", {
10968
10973
  style: {
@@ -10973,7 +10978,7 @@ var jstGoods = function jstGoods(props) {
10973
10978
  style: {
10974
10979
  textAlign: 'center'
10975
10980
  }
10976
- }, "\u5305\u88F9".concat(index + 1, "\u5546\u54C1\u4FE1\u606F")), ((item === null || item === void 0 ? void 0 : item.items) || []).map(function (t, index) {
10981
+ }, "\u5305\u88F9".concat(index + 1, "\u5546\u54C1\u4FE1\u606F"), item.sid && /*#__PURE__*/React.createElement("span", null, "(\u7CFB\u7EDF\u5355\u53F7:", item.sid, ")")), ((item === null || item === void 0 ? void 0 : item.items) || []).map(function (t, index) {
10977
10982
  return /*#__PURE__*/React.createElement("div", {
10978
10983
  key: index
10979
10984
  }, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Image, {
@@ -13272,13 +13277,39 @@ var GoodItem$1 = function GoodItem(props) {
13272
13277
  title: "\u5546\u54C1\u6570\u91CF",
13273
13278
  align: 'center',
13274
13279
  ellipsis: true,
13275
- width: 100
13280
+ width: 100,
13281
+ render: function render(val, record, index) {
13282
+ return record.canEdit && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
13283
+ style: {
13284
+ width: 70
13285
+ },
13286
+ value: val,
13287
+ min: 1,
13288
+ precision: 0,
13289
+ onChange: function onChange(num) {
13290
+ return updateHandle(num, index, 'goodsNumber');
13291
+ }
13292
+ }) : /*#__PURE__*/React.createElement("span", null, val);
13293
+ }
13276
13294
  }, {
13277
13295
  dataIndex: 'goodsPrice',
13278
13296
  title: "\u5546\u54C1\u5355\u4EF7",
13279
13297
  align: 'center',
13280
13298
  ellipsis: true,
13281
- width: 120
13299
+ width: 120,
13300
+ render: function render(val, record, index) {
13301
+ return record.canEdit && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
13302
+ style: {
13303
+ width: 70
13304
+ },
13305
+ value: val,
13306
+ min: 0,
13307
+ precision: 2,
13308
+ onChange: function onChange(num) {
13309
+ return updateHandle(num, index, 'goodsPrice');
13310
+ }
13311
+ }) : /*#__PURE__*/React.createElement("span", null, val);
13312
+ }
13282
13313
  }, {
13283
13314
  dataIndex: 'shopPrice',
13284
13315
  title: "\u5546\u54C1\u7F51\u5E97\u552E\u4EF7",
@@ -13302,7 +13333,20 @@ var GoodItem$1 = function GoodItem(props) {
13302
13333
  title: "\u5B9E\u4ED8\u91D1\u989D",
13303
13334
  align: 'center',
13304
13335
  ellipsis: true,
13305
- width: 120
13336
+ width: 120,
13337
+ render: function render(val, record, index) {
13338
+ return record.canEdit && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
13339
+ style: {
13340
+ width: 70
13341
+ },
13342
+ value: val,
13343
+ min: 0,
13344
+ precision: 2,
13345
+ onChange: function onChange(num) {
13346
+ return updateHandle(num, index, 'payment');
13347
+ }
13348
+ }) : /*#__PURE__*/React.createElement("span", null, val);
13349
+ }
13306
13350
  }, {
13307
13351
  dataIndex: 'tcSku',
13308
13352
  title: "\u5957\u9910SKU",
@@ -13605,6 +13649,7 @@ var GoodItem$1 = function GoodItem(props) {
13605
13649
  }].concat(_toConsumableArray(columns));
13606
13650
  }, []);
13607
13651
  var onSubmit = function onSubmit(list) {
13652
+ console.log('🚀 ~ onSubmit ~ list:', list);
13608
13653
  var newList = [];
13609
13654
  if (['WDT_REISSUE_GOODS', 'WDT_GOODS', 'WDT_EXCHANGE_GOODS'].includes(type)) {
13610
13655
  newList = list.map(function (item) {
@@ -13649,6 +13694,7 @@ var GoodItem$1 = function GoodItem(props) {
13649
13694
  isGift: '',
13650
13695
  uuid: uuid(),
13651
13696
  canDelete: true,
13697
+ canEdit: true,
13652
13698
  goodsNumber: 1,
13653
13699
  canUpdateNumber: canUpdateNumber
13654
13700
  });
package/dist/index.js CHANGED
@@ -10975,6 +10975,11 @@ var jstGoods = function jstGoods(props) {
10975
10975
  onChange === null || onChange === void 0 ? void 0 : onChange(typeInitValueMap[type]);
10976
10976
  }
10977
10977
  }, [value, type]);
10978
+ React.useEffect(function () {
10979
+ if (changeIndex > (value === null || value === void 0 ? void 0 : value.length) - 1) {
10980
+ setChangeIndex(0);
10981
+ }
10982
+ }, value);
10978
10983
  var content = function content(item, index) {
10979
10984
  return /*#__PURE__*/React__default['default'].createElement("div", {
10980
10985
  style: {
@@ -10985,7 +10990,7 @@ var jstGoods = function jstGoods(props) {
10985
10990
  style: {
10986
10991
  textAlign: 'center'
10987
10992
  }
10988
- }, "\u5305\u88F9".concat(index + 1, "\u5546\u54C1\u4FE1\u606F")), ((item === null || item === void 0 ? void 0 : item.items) || []).map(function (t, index) {
10993
+ }, "\u5305\u88F9".concat(index + 1, "\u5546\u54C1\u4FE1\u606F"), item.sid && /*#__PURE__*/React__default['default'].createElement("span", null, "(\u7CFB\u7EDF\u5355\u53F7:", item.sid, ")")), ((item === null || item === void 0 ? void 0 : item.items) || []).map(function (t, index) {
10989
10994
  return /*#__PURE__*/React__default['default'].createElement("div", {
10990
10995
  key: index
10991
10996
  }, /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Image, {
@@ -13284,13 +13289,39 @@ var GoodItem$1 = function GoodItem(props) {
13284
13289
  title: "\u5546\u54C1\u6570\u91CF",
13285
13290
  align: 'center',
13286
13291
  ellipsis: true,
13287
- width: 100
13292
+ width: 100,
13293
+ render: function render(val, record, index) {
13294
+ return record.canEdit && !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
13295
+ style: {
13296
+ width: 70
13297
+ },
13298
+ value: val,
13299
+ min: 1,
13300
+ precision: 0,
13301
+ onChange: function onChange(num) {
13302
+ return updateHandle(num, index, 'goodsNumber');
13303
+ }
13304
+ }) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
13305
+ }
13288
13306
  }, {
13289
13307
  dataIndex: 'goodsPrice',
13290
13308
  title: "\u5546\u54C1\u5355\u4EF7",
13291
13309
  align: 'center',
13292
13310
  ellipsis: true,
13293
- width: 120
13311
+ width: 120,
13312
+ render: function render(val, record, index) {
13313
+ return record.canEdit && !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
13314
+ style: {
13315
+ width: 70
13316
+ },
13317
+ value: val,
13318
+ min: 0,
13319
+ precision: 2,
13320
+ onChange: function onChange(num) {
13321
+ return updateHandle(num, index, 'goodsPrice');
13322
+ }
13323
+ }) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
13324
+ }
13294
13325
  }, {
13295
13326
  dataIndex: 'shopPrice',
13296
13327
  title: "\u5546\u54C1\u7F51\u5E97\u552E\u4EF7",
@@ -13314,7 +13345,20 @@ var GoodItem$1 = function GoodItem(props) {
13314
13345
  title: "\u5B9E\u4ED8\u91D1\u989D",
13315
13346
  align: 'center',
13316
13347
  ellipsis: true,
13317
- width: 120
13348
+ width: 120,
13349
+ render: function render(val, record, index) {
13350
+ return record.canEdit && !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
13351
+ style: {
13352
+ width: 70
13353
+ },
13354
+ value: val,
13355
+ min: 0,
13356
+ precision: 2,
13357
+ onChange: function onChange(num) {
13358
+ return updateHandle(num, index, 'payment');
13359
+ }
13360
+ }) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
13361
+ }
13318
13362
  }, {
13319
13363
  dataIndex: 'tcSku',
13320
13364
  title: "\u5957\u9910SKU",
@@ -13617,6 +13661,7 @@ var GoodItem$1 = function GoodItem(props) {
13617
13661
  }].concat(_toConsumableArray(columns));
13618
13662
  }, []);
13619
13663
  var onSubmit = function onSubmit(list) {
13664
+ console.log('🚀 ~ onSubmit ~ list:', list);
13620
13665
  var newList = [];
13621
13666
  if (['WDT_REISSUE_GOODS', 'WDT_GOODS', 'WDT_EXCHANGE_GOODS'].includes(type)) {
13622
13667
  newList = list.map(function (item) {
@@ -13661,6 +13706,7 @@ var GoodItem$1 = function GoodItem(props) {
13661
13706
  isGift: '',
13662
13707
  uuid: kmkfUtils.uuid(),
13663
13708
  canDelete: true,
13709
+ canEdit: true,
13664
13710
  goodsNumber: 1,
13665
13711
  canUpdateNumber: canUpdateNumber
13666
13712
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "1.22.1-beta.10",
3
+ "version": "1.22.1-beta.12",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "",
6
6
  "license": "ISC",
@@ -20,7 +20,7 @@
20
20
  "watch": "nodemon --ignore dist/ --ignore node_modules/ --watch src/ -C -e ts,tsx,less --debug -x 'yarn async'"
21
21
  },
22
22
  "dependencies": {
23
- "@kmkf-fe-packages/kmkf-utils": "1.22.1-beta.10",
23
+ "@kmkf-fe-packages/kmkf-utils": "1.22.1-beta.12",
24
24
  "ahooks": "^3.7.4",
25
25
  "bignumber.js": "^9.1.2",
26
26
  "kmkf-monitor": "^0.8.9",
@@ -65,5 +65,5 @@
65
65
  "publishConfig": {
66
66
  "access": "public"
67
67
  },
68
- "gitHead": "143523e8020568c583dfb07a1044dc12ade967ee"
68
+ "gitHead": "43e0e8a2ead29fdebc77c8d879bb2f2092b01dbe"
69
69
  }