wt-enjoy-link-antd-repack 4.1.45 → 4.1.46

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.
@@ -20,7 +20,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
20
20
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
21
21
  import { MinusOutlined } from '@ant-design/icons';
22
22
  import { Button, Card } from 'antd';
23
- import { concat, differenceBy, isEmpty, keys, pullAllBy } from 'lodash';
23
+ import { concat, differenceBy, findIndex, isEmpty, keys, pullAllBy } from 'lodash';
24
24
  import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useState } from 'react';
25
25
  import { BiuCue, BiuField, BiuResizeTable } from "../..";
26
26
  import { DATE_FORMTYPE } from "../../../constant";
@@ -196,7 +196,7 @@ export var EditTable = /*#__PURE__*/React.memo( /*#__PURE__*/forwardRef(function
196
196
  dataIndex: key,
197
197
  fixed: fixed,
198
198
  ellipsis: true,
199
- render: function render(text, record, rowIndex) {
199
+ render: function render(text, record) {
200
200
  var newValue = text;
201
201
  if (DATE_FORMTYPE.includes(restCol.formItemType)) {
202
202
  newValue = formatMoment(newValue);
@@ -212,8 +212,9 @@ export var EditTable = /*#__PURE__*/React.memo( /*#__PURE__*/forwardRef(function
212
212
  if (onChangeData) {
213
213
  ops.onChangeData = function (e, data) {
214
214
  setList(function (currentList) {
215
+ var idx = findIndex(currentList, ['key', record.key]);
215
216
  if (onChangeData) {
216
- currentList.splice(rowIndex, 1, _objectSpread(_objectSpread({}, currentList[rowIndex]), onChangeData(data, currentList[rowIndex])));
217
+ currentList.splice(idx, 1, _objectSpread(_objectSpread({}, currentList[idx]), onChangeData(data, currentList[idx])));
217
218
  }
218
219
  return currentList;
219
220
  });
@@ -223,9 +224,10 @@ export var EditTable = /*#__PURE__*/React.memo( /*#__PURE__*/forwardRef(function
223
224
  var value = formatChangeValue(e, v);
224
225
  setList(function (currentList) {
225
226
  var basicList = _toConsumableArray(currentList);
226
- basicList.splice(rowIndex, 1, _objectSpread(_objectSpread({}, basicList[rowIndex]), {}, _defineProperty({}, key, value)));
227
+ var idx = findIndex(basicList, ['key', record.key]);
228
+ basicList.splice(idx, 1, _objectSpread(_objectSpread({}, basicList[idx]), {}, _defineProperty({}, key, value)));
227
229
  if (onChange) {
228
- basicList.splice(rowIndex, 1, _objectSpread(_objectSpread({}, basicList[rowIndex]), onChange(value, basicList[rowIndex])));
230
+ basicList.splice(idx, 1, _objectSpread(_objectSpread({}, basicList[idx]), onChange(value, basicList[idx])));
229
231
  }
230
232
  return _toConsumableArray(basicList);
231
233
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wt-enjoy-link-antd-repack",
3
- "version": "4.1.45",
3
+ "version": "4.1.46",
4
4
  "description": "万通业务组件",
5
5
  "sideEffects": false,
6
6
  "main": "dist/esm/index.js",