@kmkf-fe-packages/basic-components 0.7.15-alpha.70 → 0.7.15-alpha.71

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
@@ -10165,30 +10165,34 @@ var BsGoods = function BsGoods(props) {
10165
10165
  var valueRef = useRef(null);
10166
10166
  useEffect(function () {
10167
10167
  valueRef.current = value;
10168
- pubsub.subscribe('type', function (type, val) {
10168
+ pubsub.subscribe('type', function (type, data) {
10169
+ console.log(type, data);
10169
10170
  if (disabled) return;
10170
10171
  withInfo.current = {
10171
10172
  type: type,
10172
- val: val
10173
+ val: data.val
10173
10174
  };
10174
- setTableSelect(['2', '4'].includes(val));
10175
- if (['1', '3'].includes(val)) {
10176
- pubsub.publish('selectList', {
10177
- list: cloneDeep((value === null || value === void 0 ? void 0 : value.bsGoods) || [])
10175
+ setTableSelect(['2', '4'].includes(data.val));
10176
+ if (['1', '3'].includes(data.val)) {
10177
+ var _valueRef$current;
10178
+ pubsub.publish('selectListReturn', {
10179
+ list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current = valueRef.current) === null || _valueRef$current === void 0 ? void 0 : _valueRef$current.bsGoods) || []),
10180
+ newValue: data === null || data === void 0 ? void 0 : data.newValue
10178
10181
  });
10179
10182
  }
10180
10183
  });
10181
10184
  //补发
10182
- pubsub.subscribe('reissueType', function (type, val) {
10185
+ pubsub.subscribe('reissueType', function (type, data) {
10183
10186
  if (disabled) return;
10184
10187
  withInfo.current = {
10185
10188
  type: type,
10186
- val: val
10189
+ val: data.val
10187
10190
  };
10188
- setTableSelect(['2', '4'].includes(val));
10189
- if (['1', '3'].includes(val)) {
10190
- pubsub.publish('reissueSelectList', {
10191
- list: cloneDeep((value === null || value === void 0 ? void 0 : value.bsGoods) || [])
10191
+ setTableSelect(['2', '4'].includes(data.val));
10192
+ if (['1', '3'].includes(data.val)) {
10193
+ var _valueRef$current2;
10194
+ pubsub.publish('reissueSelectListReturn', {
10195
+ list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.bsGoods) || [])
10192
10196
  });
10193
10197
  }
10194
10198
  });
@@ -10298,7 +10302,7 @@ var BsExchange = function BsExchange(props) {
10298
10302
  useEffect(function () {
10299
10303
  pubsub.subscribe('selectList', function (_, data) {
10300
10304
  if (disabled) return;
10301
- // console.log('selectList', valueRef.current, data);
10305
+ console.log('selectList', valueRef.current, data);
10302
10306
  if (valueRef.current) {
10303
10307
  var newDataList = cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
10304
10308
  onChange(_objectSpread2(_objectSpread2({}, valueRef.current), {}, {
@@ -10307,6 +10311,15 @@ var BsExchange = function BsExchange(props) {
10307
10311
  }
10308
10312
  });
10309
10313
  }, []);
10314
+ useEffect(function () {
10315
+ pubsub.subscribe('selectListReturn', function (_, data) {
10316
+ if (disabled) return;
10317
+ var newDataList = cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
10318
+ onChange(_objectSpread2(_objectSpread2({}, data.newValue), {}, {
10319
+ bsExchangeReturnGoods: getListHandle(newDataList, valueRef.current)
10320
+ }));
10321
+ });
10322
+ }, []);
10310
10323
  var getListHandle = function getListHandle(list, val) {
10311
10324
  var _val$bsExchangeType, _val$bsExchangeType2;
10312
10325
  //如果是原单换
@@ -10364,8 +10377,13 @@ var BsExchange = function BsExchange(props) {
10364
10377
  // if (['1', '3'].includes(val[0])) {
10365
10378
  // newValue.bsExchangeReturnGoods = getListHandle(bsGoods, newValue);
10366
10379
  // }
10367
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10368
- pubsub.publish('type', val[0]);
10380
+ if (['2', '4'].includes(val[0])) {
10381
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10382
+ }
10383
+ pubsub.publish('type', {
10384
+ val: val[0],
10385
+ newValue: newValue
10386
+ });
10369
10387
  };
10370
10388
  var changeHandle = function changeHandle(val, key) {
10371
10389
  var newValue = _objectSpread2({}, value);
@@ -10510,6 +10528,19 @@ var BsReissue = function BsReissue(props) {
10510
10528
  }
10511
10529
  });
10512
10530
  }, []);
10531
+ useEffect(function () {
10532
+ pubsub.subscribe('reissueSelectListReturn', function (_, data) {
10533
+ if (disabled) return;
10534
+ var newValue = _objectSpread2({}, data.newValue);
10535
+ newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
10536
+ item.money = 0;
10537
+ item.share = 0;
10538
+ item.canUpdateNumber = true;
10539
+ return item;
10540
+ });
10541
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10542
+ });
10543
+ }, []);
10513
10544
  useEffect(function () {
10514
10545
  valueRef.current = value;
10515
10546
  pubsub.subscribeOnce('reissueDeleteGood', function (_, data) {
@@ -10546,19 +10577,16 @@ var BsReissue = function BsReissue(props) {
10546
10577
  });
10547
10578
  }
10548
10579
  newValue[key] = val;
10549
- // if (key === 'bsReissueType') {
10550
- // newValue.bsReissueGoods = [];
10551
- // if (['1', '3'].includes(val[0])) {
10552
- // newValue.bsReissueGoods = (bsGoods || []).map((item: any) => {
10553
- // item.money = 0;
10554
- // item.share = 0;
10555
- // item.canUpdateNumber = false;
10556
- // return item;
10557
- // });
10558
- // }
10559
- // }
10560
- onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2({}, newValue));
10561
- pubsub.publish('reissueType', val[0]);
10580
+ if (key === 'bsReissueType') {
10581
+ newValue.bsReissueGoods = [];
10582
+ }
10583
+ if (['2', '4'].includes(val[0])) {
10584
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10585
+ }
10586
+ pubsub.publish('reissueType', {
10587
+ val: val[0],
10588
+ newValue: newValue
10589
+ });
10562
10590
  };
10563
10591
  //显示选择商品按钮 原单换不显示选择商品
10564
10592
  var showChangeBtn = useMemo(function () {
package/dist/index.js CHANGED
@@ -10176,30 +10176,34 @@ var BsGoods = function BsGoods(props) {
10176
10176
  var valueRef = React.useRef(null);
10177
10177
  React.useEffect(function () {
10178
10178
  valueRef.current = value;
10179
- pubsub__default['default'].subscribe('type', function (type, val) {
10179
+ pubsub__default['default'].subscribe('type', function (type, data) {
10180
+ console.log(type, data);
10180
10181
  if (disabled) return;
10181
10182
  withInfo.current = {
10182
10183
  type: type,
10183
- val: val
10184
+ val: data.val
10184
10185
  };
10185
- setTableSelect(['2', '4'].includes(val));
10186
- if (['1', '3'].includes(val)) {
10187
- pubsub__default['default'].publish('selectList', {
10188
- list: lodash.cloneDeep((value === null || value === void 0 ? void 0 : value.bsGoods) || [])
10186
+ setTableSelect(['2', '4'].includes(data.val));
10187
+ if (['1', '3'].includes(data.val)) {
10188
+ var _valueRef$current;
10189
+ pubsub__default['default'].publish('selectListReturn', {
10190
+ list: lodash.cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current = valueRef.current) === null || _valueRef$current === void 0 ? void 0 : _valueRef$current.bsGoods) || []),
10191
+ newValue: data === null || data === void 0 ? void 0 : data.newValue
10189
10192
  });
10190
10193
  }
10191
10194
  });
10192
10195
  //补发
10193
- pubsub__default['default'].subscribe('reissueType', function (type, val) {
10196
+ pubsub__default['default'].subscribe('reissueType', function (type, data) {
10194
10197
  if (disabled) return;
10195
10198
  withInfo.current = {
10196
10199
  type: type,
10197
- val: val
10200
+ val: data.val
10198
10201
  };
10199
- setTableSelect(['2', '4'].includes(val));
10200
- if (['1', '3'].includes(val)) {
10201
- pubsub__default['default'].publish('reissueSelectList', {
10202
- list: lodash.cloneDeep((value === null || value === void 0 ? void 0 : value.bsGoods) || [])
10202
+ setTableSelect(['2', '4'].includes(data.val));
10203
+ if (['1', '3'].includes(data.val)) {
10204
+ var _valueRef$current2;
10205
+ pubsub__default['default'].publish('reissueSelectListReturn', {
10206
+ list: lodash.cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.bsGoods) || [])
10203
10207
  });
10204
10208
  }
10205
10209
  });
@@ -10309,7 +10313,7 @@ var BsExchange = function BsExchange(props) {
10309
10313
  React.useEffect(function () {
10310
10314
  pubsub__default['default'].subscribe('selectList', function (_, data) {
10311
10315
  if (disabled) return;
10312
- // console.log('selectList', valueRef.current, data);
10316
+ console.log('selectList', valueRef.current, data);
10313
10317
  if (valueRef.current) {
10314
10318
  var newDataList = lodash.cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
10315
10319
  onChange(_objectSpread2(_objectSpread2({}, valueRef.current), {}, {
@@ -10318,6 +10322,15 @@ var BsExchange = function BsExchange(props) {
10318
10322
  }
10319
10323
  });
10320
10324
  }, []);
10325
+ React.useEffect(function () {
10326
+ pubsub__default['default'].subscribe('selectListReturn', function (_, data) {
10327
+ if (disabled) return;
10328
+ var newDataList = lodash.cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
10329
+ onChange(_objectSpread2(_objectSpread2({}, data.newValue), {}, {
10330
+ bsExchangeReturnGoods: getListHandle(newDataList, valueRef.current)
10331
+ }));
10332
+ });
10333
+ }, []);
10321
10334
  var getListHandle = function getListHandle(list, val) {
10322
10335
  var _val$bsExchangeType, _val$bsExchangeType2;
10323
10336
  //如果是原单换
@@ -10375,8 +10388,13 @@ var BsExchange = function BsExchange(props) {
10375
10388
  // if (['1', '3'].includes(val[0])) {
10376
10389
  // newValue.bsExchangeReturnGoods = getListHandle(bsGoods, newValue);
10377
10390
  // }
10378
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10379
- pubsub__default['default'].publish('type', val[0]);
10391
+ if (['2', '4'].includes(val[0])) {
10392
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10393
+ }
10394
+ pubsub__default['default'].publish('type', {
10395
+ val: val[0],
10396
+ newValue: newValue
10397
+ });
10380
10398
  };
10381
10399
  var changeHandle = function changeHandle(val, key) {
10382
10400
  var newValue = _objectSpread2({}, value);
@@ -10521,6 +10539,19 @@ var BsReissue = function BsReissue(props) {
10521
10539
  }
10522
10540
  });
10523
10541
  }, []);
10542
+ React.useEffect(function () {
10543
+ pubsub__default['default'].subscribe('reissueSelectListReturn', function (_, data) {
10544
+ if (disabled) return;
10545
+ var newValue = _objectSpread2({}, data.newValue);
10546
+ newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
10547
+ item.money = 0;
10548
+ item.share = 0;
10549
+ item.canUpdateNumber = true;
10550
+ return item;
10551
+ });
10552
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10553
+ });
10554
+ }, []);
10524
10555
  React.useEffect(function () {
10525
10556
  valueRef.current = value;
10526
10557
  pubsub__default['default'].subscribeOnce('reissueDeleteGood', function (_, data) {
@@ -10557,19 +10588,16 @@ var BsReissue = function BsReissue(props) {
10557
10588
  });
10558
10589
  }
10559
10590
  newValue[key] = val;
10560
- // if (key === 'bsReissueType') {
10561
- // newValue.bsReissueGoods = [];
10562
- // if (['1', '3'].includes(val[0])) {
10563
- // newValue.bsReissueGoods = (bsGoods || []).map((item: any) => {
10564
- // item.money = 0;
10565
- // item.share = 0;
10566
- // item.canUpdateNumber = false;
10567
- // return item;
10568
- // });
10569
- // }
10570
- // }
10571
- onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2({}, newValue));
10572
- pubsub__default['default'].publish('reissueType', val[0]);
10591
+ if (key === 'bsReissueType') {
10592
+ newValue.bsReissueGoods = [];
10593
+ }
10594
+ if (['2', '4'].includes(val[0])) {
10595
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10596
+ }
10597
+ pubsub__default['default'].publish('reissueType', {
10598
+ val: val[0],
10599
+ newValue: newValue
10600
+ });
10573
10601
  };
10574
10602
  //显示选择商品按钮 原单换不显示选择商品
10575
10603
  var showChangeBtn = React.useMemo(function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "0.7.15-alpha.70",
3
+ "version": "0.7.15-alpha.71",
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.70",
23
+ "@kmkf-fe-packages/kmkf-utils": "^0.7.15-alpha.71",
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": "acde6f0a59a6e1516cea8fc29870bbc58d74d0a7"
61
+ "gitHead": "ab3d66cffd03fd0bfe02dfc8bf60212faca21fd5"
62
62
  }