@kmkf-fe-packages/basic-components 0.7.15-alpha.77 → 0.7.15-alpha.79

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
@@ -9795,7 +9795,7 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9795
9795
  case 5:
9796
9796
  res = _context.sent;
9797
9797
  products = res.data.products;
9798
- newProducts = products.map(function (item, index) {
9798
+ newProducts = (products || []).map(function (item, index) {
9799
9799
  return _objectSpread2(_objectSpread2({}, item), {}, {
9800
9800
  index: index + 1
9801
9801
  });
@@ -9907,7 +9907,7 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9907
9907
  dataSource: goodList,
9908
9908
  scroll: {
9909
9909
  x: true,
9910
- y: 300
9910
+ y: 250
9911
9911
  },
9912
9912
  pagination: {
9913
9913
  size: 'small',
@@ -9994,6 +9994,7 @@ var GoodItem = function GoodItem(props) {
9994
9994
  label: '否',
9995
9995
  value: '否'
9996
9996
  }],
9997
+ disabled: disabled,
9997
9998
  value: val,
9998
9999
  onChange: function onChange(val) {
9999
10000
  return updateHandle(val, index, 'mark');
@@ -10044,6 +10045,9 @@ var GoodItem = function GoodItem(props) {
10044
10045
  width: 100,
10045
10046
  render: function render(val, record, index) {
10046
10047
  return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
10048
+ style: {
10049
+ width: 70
10050
+ },
10047
10051
  value: val,
10048
10052
  min: 0,
10049
10053
  precision: 0,
@@ -10191,32 +10195,36 @@ var BsGoods = function BsGoods(props) {
10191
10195
  useEffect(function () {
10192
10196
  pubsub.subscribe('type', function (type, data) {
10193
10197
  if (disabled) return;
10198
+ console.log(type, data);
10194
10199
  withInfo.current = {
10195
10200
  type: type,
10196
- val: data.val
10201
+ val: data.val,
10202
+ goodValue: data.goodValue
10197
10203
  };
10198
10204
  setTableSelect(['2', '4'].includes(data.val));
10199
10205
  if (['1', '3'].includes(data.val)) {
10200
10206
  var _valueRef$current;
10201
10207
  pubsub.publish('selectListReturn', {
10202
10208
  list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current = valueRef.current) === null || _valueRef$current === void 0 ? void 0 : _valueRef$current.bsGoods) || []),
10203
- newValue: data === null || data === void 0 ? void 0 : data.newValue
10209
+ goodValue: data === null || data === void 0 ? void 0 : data.goodValue
10204
10210
  });
10205
10211
  }
10206
10212
  });
10207
10213
  //补发
10208
10214
  pubsub.subscribe('reissueType', function (type, data) {
10209
10215
  if (disabled) return;
10216
+ console.log(type, data);
10210
10217
  withInfo.current = {
10211
10218
  type: type,
10212
- val: data.val
10219
+ val: data.val,
10220
+ goodValue: data.goodValue
10213
10221
  };
10214
10222
  setTableSelect(['2', '4'].includes(data.val));
10215
10223
  if (['1', '3'].includes(data.val)) {
10216
10224
  var _valueRef$current2;
10217
10225
  pubsub.publish('reissueSelectListReturn', {
10218
10226
  list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.bsGoods) || []),
10219
- newValue: data === null || data === void 0 ? void 0 : data.newValue
10227
+ goodValue: data === null || data === void 0 ? void 0 : data.goodValue
10220
10228
  });
10221
10229
  }
10222
10230
  });
@@ -10226,13 +10234,14 @@ var BsGoods = function BsGoods(props) {
10226
10234
  if (disabled) return;
10227
10235
  var newList = cloneDeep(list);
10228
10236
  var type = ((_withInfo$current = withInfo.current) === null || _withInfo$current === void 0 ? void 0 : _withInfo$current.type) === 'reissueType' ? 'reissueSelectList' : 'selectList';
10229
- console.log('onSelect', type, withInfo.current);
10237
+ console.log('onSelect', type, withInfo.current, newList);
10230
10238
  pubsub.publish(type, {
10231
10239
  type: (_withInfo$current2 = withInfo.current) === null || _withInfo$current2 === void 0 ? void 0 : _withInfo$current2.val,
10232
10240
  list: newList.map(function (item) {
10233
10241
  item.canDelete = true;
10234
10242
  return item;
10235
- })
10243
+ }),
10244
+ goodValue: withInfo.current.goodValue
10236
10245
  });
10237
10246
  };
10238
10247
  var _onDelete = function onDelete(item) {
@@ -10302,21 +10311,19 @@ var BsExchange = function BsExchange(props) {
10302
10311
  pubsub.subscribe('selectList', function (_, data) {
10303
10312
  console.log('selectList', data, valueRef.current);
10304
10313
  if (disabled) return;
10305
- if (valueRef.current) {
10306
- var newDataList = cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
10307
- onChange(_objectSpread2(_objectSpread2({}, valueRef.current), {}, {
10308
- bsExchangeReturnGoods: getListHandle(newDataList, valueRef.current)
10309
- }));
10310
- }
10314
+ var newDataList = cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
10315
+ onChange(_objectSpread2(_objectSpread2({}, data.goodValue), {}, {
10316
+ bsExchangeReturnGoods: getListHandle(newDataList, valueRef.current)
10317
+ }));
10311
10318
  });
10312
10319
  }, []);
10313
10320
  useEffect(function () {
10314
10321
  pubsub.subscribe('selectListReturn', function (_, data) {
10315
10322
  console.log('selectListReturn', data);
10316
10323
  if (disabled) return;
10317
- var newValue = _objectSpread2({}, data.newValue);
10324
+ var newValue = _objectSpread2({}, data.goodValue);
10318
10325
  var newDataList = cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
10319
- onChange(_objectSpread2(_objectSpread2({}, data.newValue), {}, {
10326
+ onChange(_objectSpread2(_objectSpread2({}, newValue), {}, {
10320
10327
  bsExchangeReturnGoods: getListHandle(newDataList, newValue)
10321
10328
  }));
10322
10329
  });
@@ -10380,7 +10387,7 @@ var BsExchange = function BsExchange(props) {
10380
10387
  }
10381
10388
  pubsub.publish('type', {
10382
10389
  val: val[0],
10383
- newValue: newValue
10390
+ goodValue: newValue
10384
10391
  });
10385
10392
  };
10386
10393
  var changeHandle = function changeHandle(val, key) {
@@ -10388,6 +10395,7 @@ var BsExchange = function BsExchange(props) {
10388
10395
  if (key === 'bsExchangeGiftGoods') {
10389
10396
  val = cloneDeep(val).map(function (t) {
10390
10397
  t.money = 0;
10398
+ t.share = 0;
10391
10399
  return t;
10392
10400
  });
10393
10401
  }
@@ -10504,25 +10512,23 @@ var BsReissue = function BsReissue(props) {
10504
10512
  var valueRef = useRef({});
10505
10513
  useEffect(function () {
10506
10514
  pubsub.subscribe('reissueSelectList', function (_, data) {
10507
- console.log('reissueSelectList', valueRef.current);
10515
+ console.log('reissueSelectList', data);
10508
10516
  if (disabled) return;
10509
- if (valueRef.current) {
10510
- var newValue = _objectSpread2({}, valueRef.current);
10511
- newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
10512
- item.money = 0;
10513
- item.share = 0;
10514
- item.canUpdateNumber = true;
10515
- return item;
10516
- });
10517
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10518
- }
10517
+ var newValue = _objectSpread2({}, data.goodValue);
10518
+ newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
10519
+ item.money = 0;
10520
+ item.share = 0;
10521
+ item.canUpdateNumber = true;
10522
+ return item;
10523
+ });
10524
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10519
10525
  });
10520
10526
  }, []);
10521
10527
  useEffect(function () {
10522
10528
  pubsub.subscribe('reissueSelectListReturn', function (_, data) {
10523
10529
  console.log('reissueSelectListReturn', data);
10524
10530
  if (disabled) return;
10525
- var newValue = _objectSpread2({}, data.newValue);
10531
+ var newValue = _objectSpread2({}, data.goodValue);
10526
10532
  newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
10527
10533
  item.money = 0;
10528
10534
  item.share = 0;
@@ -10551,10 +10557,11 @@ var BsReissue = function BsReissue(props) {
10551
10557
  newValue.bsReissueGoods = [];
10552
10558
  if (['2', '4'].includes(val[0])) {
10553
10559
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10560
+ valueRef.current = newValue;
10554
10561
  }
10555
10562
  pubsub.publish('reissueType', {
10556
10563
  val: val[0],
10557
- newValue: newValue
10564
+ goodValue: newValue
10558
10565
  });
10559
10566
  };
10560
10567
  var changeGoodHandle = function changeGoodHandle(val) {
package/dist/index.js CHANGED
@@ -9806,7 +9806,7 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9806
9806
  case 5:
9807
9807
  res = _context.sent;
9808
9808
  products = res.data.products;
9809
- newProducts = products.map(function (item, index) {
9809
+ newProducts = (products || []).map(function (item, index) {
9810
9810
  return _objectSpread2(_objectSpread2({}, item), {}, {
9811
9811
  index: index + 1
9812
9812
  });
@@ -9918,7 +9918,7 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9918
9918
  dataSource: goodList,
9919
9919
  scroll: {
9920
9920
  x: true,
9921
- y: 300
9921
+ y: 250
9922
9922
  },
9923
9923
  pagination: {
9924
9924
  size: 'small',
@@ -10005,6 +10005,7 @@ var GoodItem = function GoodItem(props) {
10005
10005
  label: '否',
10006
10006
  value: '否'
10007
10007
  }],
10008
+ disabled: disabled,
10008
10009
  value: val,
10009
10010
  onChange: function onChange(val) {
10010
10011
  return updateHandle(val, index, 'mark');
@@ -10055,6 +10056,9 @@ var GoodItem = function GoodItem(props) {
10055
10056
  width: 100,
10056
10057
  render: function render(val, record, index) {
10057
10058
  return record.canUpdateNumber && !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
10059
+ style: {
10060
+ width: 70
10061
+ },
10058
10062
  value: val,
10059
10063
  min: 0,
10060
10064
  precision: 0,
@@ -10202,32 +10206,36 @@ var BsGoods = function BsGoods(props) {
10202
10206
  React.useEffect(function () {
10203
10207
  pubsub__default['default'].subscribe('type', function (type, data) {
10204
10208
  if (disabled) return;
10209
+ console.log(type, data);
10205
10210
  withInfo.current = {
10206
10211
  type: type,
10207
- val: data.val
10212
+ val: data.val,
10213
+ goodValue: data.goodValue
10208
10214
  };
10209
10215
  setTableSelect(['2', '4'].includes(data.val));
10210
10216
  if (['1', '3'].includes(data.val)) {
10211
10217
  var _valueRef$current;
10212
10218
  pubsub__default['default'].publish('selectListReturn', {
10213
10219
  list: lodash.cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current = valueRef.current) === null || _valueRef$current === void 0 ? void 0 : _valueRef$current.bsGoods) || []),
10214
- newValue: data === null || data === void 0 ? void 0 : data.newValue
10220
+ goodValue: data === null || data === void 0 ? void 0 : data.goodValue
10215
10221
  });
10216
10222
  }
10217
10223
  });
10218
10224
  //补发
10219
10225
  pubsub__default['default'].subscribe('reissueType', function (type, data) {
10220
10226
  if (disabled) return;
10227
+ console.log(type, data);
10221
10228
  withInfo.current = {
10222
10229
  type: type,
10223
- val: data.val
10230
+ val: data.val,
10231
+ goodValue: data.goodValue
10224
10232
  };
10225
10233
  setTableSelect(['2', '4'].includes(data.val));
10226
10234
  if (['1', '3'].includes(data.val)) {
10227
10235
  var _valueRef$current2;
10228
10236
  pubsub__default['default'].publish('reissueSelectListReturn', {
10229
10237
  list: lodash.cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.bsGoods) || []),
10230
- newValue: data === null || data === void 0 ? void 0 : data.newValue
10238
+ goodValue: data === null || data === void 0 ? void 0 : data.goodValue
10231
10239
  });
10232
10240
  }
10233
10241
  });
@@ -10237,13 +10245,14 @@ var BsGoods = function BsGoods(props) {
10237
10245
  if (disabled) return;
10238
10246
  var newList = lodash.cloneDeep(list);
10239
10247
  var type = ((_withInfo$current = withInfo.current) === null || _withInfo$current === void 0 ? void 0 : _withInfo$current.type) === 'reissueType' ? 'reissueSelectList' : 'selectList';
10240
- console.log('onSelect', type, withInfo.current);
10248
+ console.log('onSelect', type, withInfo.current, newList);
10241
10249
  pubsub__default['default'].publish(type, {
10242
10250
  type: (_withInfo$current2 = withInfo.current) === null || _withInfo$current2 === void 0 ? void 0 : _withInfo$current2.val,
10243
10251
  list: newList.map(function (item) {
10244
10252
  item.canDelete = true;
10245
10253
  return item;
10246
- })
10254
+ }),
10255
+ goodValue: withInfo.current.goodValue
10247
10256
  });
10248
10257
  };
10249
10258
  var _onDelete = function onDelete(item) {
@@ -10313,21 +10322,19 @@ var BsExchange = function BsExchange(props) {
10313
10322
  pubsub__default['default'].subscribe('selectList', function (_, data) {
10314
10323
  console.log('selectList', data, valueRef.current);
10315
10324
  if (disabled) return;
10316
- if (valueRef.current) {
10317
- var newDataList = lodash.cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
10318
- onChange(_objectSpread2(_objectSpread2({}, valueRef.current), {}, {
10319
- bsExchangeReturnGoods: getListHandle(newDataList, valueRef.current)
10320
- }));
10321
- }
10325
+ var newDataList = lodash.cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
10326
+ onChange(_objectSpread2(_objectSpread2({}, data.goodValue), {}, {
10327
+ bsExchangeReturnGoods: getListHandle(newDataList, valueRef.current)
10328
+ }));
10322
10329
  });
10323
10330
  }, []);
10324
10331
  React.useEffect(function () {
10325
10332
  pubsub__default['default'].subscribe('selectListReturn', function (_, data) {
10326
10333
  console.log('selectListReturn', data);
10327
10334
  if (disabled) return;
10328
- var newValue = _objectSpread2({}, data.newValue);
10335
+ var newValue = _objectSpread2({}, data.goodValue);
10329
10336
  var newDataList = lodash.cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
10330
- onChange(_objectSpread2(_objectSpread2({}, data.newValue), {}, {
10337
+ onChange(_objectSpread2(_objectSpread2({}, newValue), {}, {
10331
10338
  bsExchangeReturnGoods: getListHandle(newDataList, newValue)
10332
10339
  }));
10333
10340
  });
@@ -10391,7 +10398,7 @@ var BsExchange = function BsExchange(props) {
10391
10398
  }
10392
10399
  pubsub__default['default'].publish('type', {
10393
10400
  val: val[0],
10394
- newValue: newValue
10401
+ goodValue: newValue
10395
10402
  });
10396
10403
  };
10397
10404
  var changeHandle = function changeHandle(val, key) {
@@ -10399,6 +10406,7 @@ var BsExchange = function BsExchange(props) {
10399
10406
  if (key === 'bsExchangeGiftGoods') {
10400
10407
  val = lodash.cloneDeep(val).map(function (t) {
10401
10408
  t.money = 0;
10409
+ t.share = 0;
10402
10410
  return t;
10403
10411
  });
10404
10412
  }
@@ -10515,25 +10523,23 @@ var BsReissue = function BsReissue(props) {
10515
10523
  var valueRef = React.useRef({});
10516
10524
  React.useEffect(function () {
10517
10525
  pubsub__default['default'].subscribe('reissueSelectList', function (_, data) {
10518
- console.log('reissueSelectList', valueRef.current);
10526
+ console.log('reissueSelectList', data);
10519
10527
  if (disabled) return;
10520
- if (valueRef.current) {
10521
- var newValue = _objectSpread2({}, valueRef.current);
10522
- newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
10523
- item.money = 0;
10524
- item.share = 0;
10525
- item.canUpdateNumber = true;
10526
- return item;
10527
- });
10528
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10529
- }
10528
+ var newValue = _objectSpread2({}, data.goodValue);
10529
+ newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
10530
+ item.money = 0;
10531
+ item.share = 0;
10532
+ item.canUpdateNumber = true;
10533
+ return item;
10534
+ });
10535
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10530
10536
  });
10531
10537
  }, []);
10532
10538
  React.useEffect(function () {
10533
10539
  pubsub__default['default'].subscribe('reissueSelectListReturn', function (_, data) {
10534
10540
  console.log('reissueSelectListReturn', data);
10535
10541
  if (disabled) return;
10536
- var newValue = _objectSpread2({}, data.newValue);
10542
+ var newValue = _objectSpread2({}, data.goodValue);
10537
10543
  newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
10538
10544
  item.money = 0;
10539
10545
  item.share = 0;
@@ -10562,10 +10568,11 @@ var BsReissue = function BsReissue(props) {
10562
10568
  newValue.bsReissueGoods = [];
10563
10569
  if (['2', '4'].includes(val[0])) {
10564
10570
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10571
+ valueRef.current = newValue;
10565
10572
  }
10566
10573
  pubsub__default['default'].publish('reissueType', {
10567
10574
  val: val[0],
10568
- newValue: newValue
10575
+ goodValue: newValue
10569
10576
  });
10570
10577
  };
10571
10578
  var changeGoodHandle = function changeGoodHandle(val) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "0.7.15-alpha.77",
3
+ "version": "0.7.15-alpha.79",
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": "^0.7.15-alpha.77",
23
+ "@kmkf-fe-packages/kmkf-utils": "^0.7.15-alpha.78",
24
24
  "lodash": "^4.17.21",
25
25
  "pubsub-js": "^1.9.4",
26
26
  "umi-request": "^1.4.0"
@@ -58,5 +58,5 @@
58
58
  "publishConfig": {
59
59
  "access": "public"
60
60
  },
61
- "gitHead": "0e83bab9b7b18f2a73aa3803a05fa6ef4c15b570"
61
+ "gitHead": "2b7ebb2978054a6c571ea3e389cdc1f089442a77"
62
62
  }