@kmkf-fe-packages/basic-components 0.7.15-alpha.76 → 0.7.15-alpha.78

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: '50%'
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) {
@@ -10504,25 +10511,23 @@ var BsReissue = function BsReissue(props) {
10504
10511
  var valueRef = useRef({});
10505
10512
  useEffect(function () {
10506
10513
  pubsub.subscribe('reissueSelectList', function (_, data) {
10507
- console.log('reissueSelectList', valueRef.current);
10514
+ console.log('reissueSelectList', data);
10508
10515
  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
- }
10516
+ var newValue = _objectSpread2({}, data.goodValue);
10517
+ newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
10518
+ item.money = 0;
10519
+ item.share = 0;
10520
+ item.canUpdateNumber = true;
10521
+ return item;
10522
+ });
10523
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10519
10524
  });
10520
10525
  }, []);
10521
10526
  useEffect(function () {
10522
10527
  pubsub.subscribe('reissueSelectListReturn', function (_, data) {
10523
10528
  console.log('reissueSelectListReturn', data);
10524
10529
  if (disabled) return;
10525
- var newValue = _objectSpread2({}, data.newValue);
10530
+ var newValue = _objectSpread2({}, data.goodValue);
10526
10531
  newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
10527
10532
  item.money = 0;
10528
10533
  item.share = 0;
@@ -10551,10 +10556,11 @@ var BsReissue = function BsReissue(props) {
10551
10556
  newValue.bsReissueGoods = [];
10552
10557
  if (['2', '4'].includes(val[0])) {
10553
10558
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10559
+ valueRef.current = newValue;
10554
10560
  }
10555
10561
  pubsub.publish('reissueType', {
10556
10562
  val: val[0],
10557
- newValue: newValue
10563
+ goodValue: newValue
10558
10564
  });
10559
10565
  };
10560
10566
  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: '50%'
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) {
@@ -10515,25 +10522,23 @@ var BsReissue = function BsReissue(props) {
10515
10522
  var valueRef = React.useRef({});
10516
10523
  React.useEffect(function () {
10517
10524
  pubsub__default['default'].subscribe('reissueSelectList', function (_, data) {
10518
- console.log('reissueSelectList', valueRef.current);
10525
+ console.log('reissueSelectList', data);
10519
10526
  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
- }
10527
+ var newValue = _objectSpread2({}, data.goodValue);
10528
+ newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
10529
+ item.money = 0;
10530
+ item.share = 0;
10531
+ item.canUpdateNumber = true;
10532
+ return item;
10533
+ });
10534
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10530
10535
  });
10531
10536
  }, []);
10532
10537
  React.useEffect(function () {
10533
10538
  pubsub__default['default'].subscribe('reissueSelectListReturn', function (_, data) {
10534
10539
  console.log('reissueSelectListReturn', data);
10535
10540
  if (disabled) return;
10536
- var newValue = _objectSpread2({}, data.newValue);
10541
+ var newValue = _objectSpread2({}, data.goodValue);
10537
10542
  newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
10538
10543
  item.money = 0;
10539
10544
  item.share = 0;
@@ -10562,10 +10567,11 @@ var BsReissue = function BsReissue(props) {
10562
10567
  newValue.bsReissueGoods = [];
10563
10568
  if (['2', '4'].includes(val[0])) {
10564
10569
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10570
+ valueRef.current = newValue;
10565
10571
  }
10566
10572
  pubsub__default['default'].publish('reissueType', {
10567
10573
  val: val[0],
10568
- newValue: newValue
10574
+ goodValue: newValue
10569
10575
  });
10570
10576
  };
10571
10577
  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.76",
3
+ "version": "0.7.15-alpha.78",
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.76",
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": "59a50bea3ca62d5010ccb7a81ae5a95d8d724fcc"
61
+ "gitHead": "6b9df5c3d3f86da3f0dca5564281db9bb9ebda7e"
62
62
  }