@kmkf-fe-packages/basic-components 0.7.15-alpha.60 → 0.7.15-alpha.61

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
@@ -9337,6 +9337,13 @@ var LogisticsTrajectory = function LogisticsTrajectory(props) {
9337
9337
  trajectoryCode = value.trajectoryCode,
9338
9338
  trajectoryPhone = value.trajectoryPhone;
9339
9339
  var newCompany = company ? company : trajectoryCompany;
9340
+ //不展示拦截状态不请求
9341
+ if (!(showField && showField.includes('snapshot'))) {
9342
+ return;
9343
+ }
9344
+ if (disabled) {
9345
+ return;
9346
+ }
9340
9347
  if (newCompany === 'SF' && !(newCompany && trajectoryCode && trajectoryPhone)) {
9341
9348
  return;
9342
9349
  } else if (!(newCompany && trajectoryCode)) {
@@ -9930,6 +9937,8 @@ var GoodItem = function GoodItem(props) {
9930
9937
  showChangeBtn = _props$showChangeBtn === void 0 ? true : _props$showChangeBtn,
9931
9938
  _props$tableSelect = props.tableSelect,
9932
9939
  tableSelect = _props$tableSelect === void 0 ? false : _props$tableSelect,
9940
+ _props$selectType = props.selectType,
9941
+ selectType = _props$selectType === void 0 ? '' : _props$selectType,
9933
9942
  _props$otherOperation = props.otherOperations,
9934
9943
  otherOperations = _props$otherOperation === void 0 ? null : _props$otherOperation,
9935
9944
  _props$canUpdateNumbe = props.canUpdateNumber,
@@ -9950,10 +9959,8 @@ var GoodItem = function GoodItem(props) {
9950
9959
  selectedRowKeys = _useState2[0],
9951
9960
  setSelectedRowKeys = _useState2[1];
9952
9961
  useEffect(function () {
9953
- if (!tableSelect) {
9954
- setSelectedRowKeys([]);
9955
- }
9956
- }, [tableSelect]);
9962
+ setSelectedRowKeys([]);
9963
+ }, [tableSelect, selectType]);
9957
9964
  var updateHandle = function updateHandle(val, index, type) {
9958
9965
  if (value === null || value === void 0 ? void 0 : value.length) {
9959
9966
  value[index][type] = val;
@@ -10137,6 +10144,7 @@ var GoodItem = function GoodItem(props) {
10137
10144
  };
10138
10145
 
10139
10146
  var BsGoods = function BsGoods(props) {
10147
+ var _withInfo$current3, _withInfo$current4;
10140
10148
  var value = props.value,
10141
10149
  disabled = props.disabled,
10142
10150
  onChange = props.onChange;
@@ -10145,33 +10153,30 @@ var BsGoods = function BsGoods(props) {
10145
10153
  tableSelect = _useState2[0],
10146
10154
  setTableSelect = _useState2[1];
10147
10155
  // const [withInfo, setWithInfo] = useState({ type: '', val: '' });
10148
- var _useState3 = useState(''),
10149
- _useState4 = _slicedToArray(_useState3, 2),
10150
- withType = _useState4[0],
10151
- setWithType = _useState4[1];
10152
- var _useState5 = useState(''),
10153
- _useState6 = _slicedToArray(_useState5, 2),
10154
- withValue = _useState6[0],
10155
- setWithValue = _useState6[1];
10156
+ // const [withType, setWithType] = useState('');
10157
+ // const [withValue, setWithValue] = useState('');
10158
+ var withInfo = useRef(null);
10156
10159
  useEffect(function () {
10157
10160
  pubsub.subscribe('type', function (type, val) {
10158
10161
  if (disabled) return;
10159
10162
  console.log('type', type, val);
10160
- // setWithInfo({ type, val });
10161
- setWithType(type);
10162
- setWithValue(val);
10163
+ withInfo.current = {
10164
+ type: type,
10165
+ val: val
10166
+ };
10163
10167
  setTableSelect(['2', '4'].includes(val));
10164
10168
  });
10165
10169
  //补发
10166
10170
  pubsub.subscribe('reissueType', function (type, val) {
10167
10171
  if (disabled) return;
10168
10172
  console.log('reissueType', type, val);
10169
- // setWithInfo({ type, val });
10170
- setWithType(type);
10171
- setWithValue(val);
10173
+ withInfo.current = {
10174
+ type: type,
10175
+ val: val
10176
+ };
10172
10177
  setTableSelect(['2', '4'].includes(val));
10173
10178
  });
10174
- }, [disabled, withType, withValue, setWithType, setWithValue, setTableSelect]);
10179
+ }, [disabled]);
10175
10180
  useEffect(function () {
10176
10181
  if (!disabled) {
10177
10182
  pubsub.publish('goodList', {
@@ -10179,13 +10184,13 @@ var BsGoods = function BsGoods(props) {
10179
10184
  });
10180
10185
  }
10181
10186
  }, [value, disabled]);
10182
- var onSelect = function onSelect(list) {
10187
+ var _onSelect = function onSelect(list) {
10188
+ var _withInfo$current, _withInfo$current2;
10183
10189
  if (disabled) return;
10184
10190
  var newList = cloneDeep(list);
10185
- var type = withType === 'reissueType' ? 'reissueSelectList' : 'selectList';
10186
- console.log(withType, withValue, type);
10191
+ var type = ((_withInfo$current = withInfo.current) === null || _withInfo$current === void 0 ? void 0 : _withInfo$current.type) === 'reissueType' ? 'reissueSelectList' : 'selectList';
10187
10192
  pubsub.publish(type, {
10188
- type: withValue,
10193
+ type: (_withInfo$current2 = withInfo.current) === null || _withInfo$current2 === void 0 ? void 0 : _withInfo$current2.val,
10189
10194
  list: newList.map(function (item) {
10190
10195
  item.canDelete = true;
10191
10196
  return item;
@@ -10208,8 +10213,11 @@ var BsGoods = function BsGoods(props) {
10208
10213
  disabled: disabled,
10209
10214
  value: value === null || value === void 0 ? void 0 : value.bsGoods,
10210
10215
  shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
10211
- tableSelect: tableSelect,
10212
- onSelect: onSelect,
10216
+ tableSelect: ['2', '4'].includes(withInfo === null || withInfo === void 0 ? void 0 : (_withInfo$current3 = withInfo.current) === null || _withInfo$current3 === void 0 ? void 0 : _withInfo$current3.val),
10217
+ selectType: withInfo === null || withInfo === void 0 ? void 0 : (_withInfo$current4 = withInfo.current) === null || _withInfo$current4 === void 0 ? void 0 : _withInfo$current4.type,
10218
+ onSelect: function onSelect(list) {
10219
+ return _onSelect(list);
10220
+ },
10213
10221
  onDelete: function onDelete(item) {
10214
10222
  return _onDelete(item);
10215
10223
  },
package/dist/index.js CHANGED
@@ -9348,6 +9348,13 @@ var LogisticsTrajectory = function LogisticsTrajectory(props) {
9348
9348
  trajectoryCode = value.trajectoryCode,
9349
9349
  trajectoryPhone = value.trajectoryPhone;
9350
9350
  var newCompany = company ? company : trajectoryCompany;
9351
+ //不展示拦截状态不请求
9352
+ if (!(showField && showField.includes('snapshot'))) {
9353
+ return;
9354
+ }
9355
+ if (disabled) {
9356
+ return;
9357
+ }
9351
9358
  if (newCompany === 'SF' && !(newCompany && trajectoryCode && trajectoryPhone)) {
9352
9359
  return;
9353
9360
  } else if (!(newCompany && trajectoryCode)) {
@@ -9941,6 +9948,8 @@ var GoodItem = function GoodItem(props) {
9941
9948
  showChangeBtn = _props$showChangeBtn === void 0 ? true : _props$showChangeBtn,
9942
9949
  _props$tableSelect = props.tableSelect,
9943
9950
  tableSelect = _props$tableSelect === void 0 ? false : _props$tableSelect,
9951
+ _props$selectType = props.selectType,
9952
+ selectType = _props$selectType === void 0 ? '' : _props$selectType,
9944
9953
  _props$otherOperation = props.otherOperations,
9945
9954
  otherOperations = _props$otherOperation === void 0 ? null : _props$otherOperation,
9946
9955
  _props$canUpdateNumbe = props.canUpdateNumber,
@@ -9961,10 +9970,8 @@ var GoodItem = function GoodItem(props) {
9961
9970
  selectedRowKeys = _useState2[0],
9962
9971
  setSelectedRowKeys = _useState2[1];
9963
9972
  React.useEffect(function () {
9964
- if (!tableSelect) {
9965
- setSelectedRowKeys([]);
9966
- }
9967
- }, [tableSelect]);
9973
+ setSelectedRowKeys([]);
9974
+ }, [tableSelect, selectType]);
9968
9975
  var updateHandle = function updateHandle(val, index, type) {
9969
9976
  if (value === null || value === void 0 ? void 0 : value.length) {
9970
9977
  value[index][type] = val;
@@ -10148,6 +10155,7 @@ var GoodItem = function GoodItem(props) {
10148
10155
  };
10149
10156
 
10150
10157
  var BsGoods = function BsGoods(props) {
10158
+ var _withInfo$current3, _withInfo$current4;
10151
10159
  var value = props.value,
10152
10160
  disabled = props.disabled,
10153
10161
  onChange = props.onChange;
@@ -10156,33 +10164,30 @@ var BsGoods = function BsGoods(props) {
10156
10164
  tableSelect = _useState2[0],
10157
10165
  setTableSelect = _useState2[1];
10158
10166
  // const [withInfo, setWithInfo] = useState({ type: '', val: '' });
10159
- var _useState3 = React.useState(''),
10160
- _useState4 = _slicedToArray(_useState3, 2),
10161
- withType = _useState4[0],
10162
- setWithType = _useState4[1];
10163
- var _useState5 = React.useState(''),
10164
- _useState6 = _slicedToArray(_useState5, 2),
10165
- withValue = _useState6[0],
10166
- setWithValue = _useState6[1];
10167
+ // const [withType, setWithType] = useState('');
10168
+ // const [withValue, setWithValue] = useState('');
10169
+ var withInfo = React.useRef(null);
10167
10170
  React.useEffect(function () {
10168
10171
  pubsub__default['default'].subscribe('type', function (type, val) {
10169
10172
  if (disabled) return;
10170
10173
  console.log('type', type, val);
10171
- // setWithInfo({ type, val });
10172
- setWithType(type);
10173
- setWithValue(val);
10174
+ withInfo.current = {
10175
+ type: type,
10176
+ val: val
10177
+ };
10174
10178
  setTableSelect(['2', '4'].includes(val));
10175
10179
  });
10176
10180
  //补发
10177
10181
  pubsub__default['default'].subscribe('reissueType', function (type, val) {
10178
10182
  if (disabled) return;
10179
10183
  console.log('reissueType', type, val);
10180
- // setWithInfo({ type, val });
10181
- setWithType(type);
10182
- setWithValue(val);
10184
+ withInfo.current = {
10185
+ type: type,
10186
+ val: val
10187
+ };
10183
10188
  setTableSelect(['2', '4'].includes(val));
10184
10189
  });
10185
- }, [disabled, withType, withValue, setWithType, setWithValue, setTableSelect]);
10190
+ }, [disabled]);
10186
10191
  React.useEffect(function () {
10187
10192
  if (!disabled) {
10188
10193
  pubsub__default['default'].publish('goodList', {
@@ -10190,13 +10195,13 @@ var BsGoods = function BsGoods(props) {
10190
10195
  });
10191
10196
  }
10192
10197
  }, [value, disabled]);
10193
- var onSelect = function onSelect(list) {
10198
+ var _onSelect = function onSelect(list) {
10199
+ var _withInfo$current, _withInfo$current2;
10194
10200
  if (disabled) return;
10195
10201
  var newList = lodash.cloneDeep(list);
10196
- var type = withType === 'reissueType' ? 'reissueSelectList' : 'selectList';
10197
- console.log(withType, withValue, type);
10202
+ var type = ((_withInfo$current = withInfo.current) === null || _withInfo$current === void 0 ? void 0 : _withInfo$current.type) === 'reissueType' ? 'reissueSelectList' : 'selectList';
10198
10203
  pubsub__default['default'].publish(type, {
10199
- type: withValue,
10204
+ type: (_withInfo$current2 = withInfo.current) === null || _withInfo$current2 === void 0 ? void 0 : _withInfo$current2.val,
10200
10205
  list: newList.map(function (item) {
10201
10206
  item.canDelete = true;
10202
10207
  return item;
@@ -10219,8 +10224,11 @@ var BsGoods = function BsGoods(props) {
10219
10224
  disabled: disabled,
10220
10225
  value: value === null || value === void 0 ? void 0 : value.bsGoods,
10221
10226
  shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
10222
- tableSelect: tableSelect,
10223
- onSelect: onSelect,
10227
+ tableSelect: ['2', '4'].includes(withInfo === null || withInfo === void 0 ? void 0 : (_withInfo$current3 = withInfo.current) === null || _withInfo$current3 === void 0 ? void 0 : _withInfo$current3.val),
10228
+ selectType: withInfo === null || withInfo === void 0 ? void 0 : (_withInfo$current4 = withInfo.current) === null || _withInfo$current4 === void 0 ? void 0 : _withInfo$current4.type,
10229
+ onSelect: function onSelect(list) {
10230
+ return _onSelect(list);
10231
+ },
10224
10232
  onDelete: function onDelete(item) {
10225
10233
  return _onDelete(item);
10226
10234
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "0.7.15-alpha.60",
3
+ "version": "0.7.15-alpha.61",
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.59",
23
+ "@kmkf-fe-packages/kmkf-utils": "^0.7.15-alpha.61",
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": "251c86791a81cf4bbf3d475341d482286e6179ae"
61
+ "gitHead": "fdc6c2f7bfdd28d6800c7186adc3866a612cc6f6"
62
62
  }