ls-pro-common 3.0.17 → 3.0.18

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.
@@ -23,6 +23,7 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
23
23
  //@ts-ignore
24
24
  var _useContext = useContext(ProFormContext),
25
25
  formRef = _useContext.formRef;
26
+ // const inputRef=useRef<any>();
26
27
  var tableRef = useRef();
27
28
  var selectRowRef = useRef([]);
28
29
  var _useState = useState(false),
@@ -79,6 +80,7 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
79
80
  arrowPointAtCenter = _prop$arrowPointAtCen === void 0 ? true : _prop$arrowPointAtCen,
80
81
  rowKey = prop.rowKey,
81
82
  rest = _objectWithoutProperties(prop, _excluded);
83
+ var tableKey = (tableConfig === null || tableConfig === void 0 ? void 0 : tableConfig.rowKey) || 'id';
82
84
  //显示输入框绑定的name,如果不设置textName,设置为$name__text
83
85
  var textNameProp = useMemo(function () {
84
86
  return textName || name + '__text';
@@ -139,6 +141,7 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
139
141
  if (afterLoad) {
140
142
  afterLoad(rows);
141
143
  }
144
+ //todo 加载数据时自动勾选
142
145
  return _context.abrupt("return", {
143
146
  data: rows,
144
147
  total: Number(result.total || 0),
@@ -174,14 +177,16 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
174
177
  if (txt) {
175
178
  setText(txt);
176
179
  } else if (val) {
180
+ var _formRef$current4, _formRef$current4$set;
177
181
  setText(val);
182
+ formRef === null || formRef === void 0 ? void 0 : (_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 ? void 0 : (_formRef$current4$set = _formRef$current4.setFieldsValue) === null || _formRef$current4$set === void 0 ? void 0 : _formRef$current4$set.call(_formRef$current4, _defineProperty({}, textNameProp, val));
178
183
  }
179
184
  }, 0);
180
185
  }, [rowKey]);
181
186
  // 处理返回数据
182
187
  var handleValue = function handleValue(row) {
183
- var _formRef$current4, _formRef$current4$get;
184
- var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 ? void 0 : (_formRef$current4$get = _formRef$current4.getFieldsValue) === null || _formRef$current4$get === void 0 ? void 0 : _formRef$current4$get.call(_formRef$current4)) || {};
188
+ var _formRef$current5, _formRef$current5$get;
189
+ var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 ? void 0 : (_formRef$current5$get = _formRef$current5.getFieldsValue) === null || _formRef$current5$get === void 0 ? void 0 : _formRef$current5$get.call(_formRef$current5)) || {};
185
190
  if (rowKey) {
186
191
  formValue = formValue[rowKey] || {};
187
192
  }
@@ -221,11 +226,11 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
221
226
  setText(txt);
222
227
  setVisible(false);
223
228
  if (rowKey) {
224
- var _formRef$current5, _formRef$current5$set;
225
- formRef === null || formRef === void 0 ? void 0 : (_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 ? void 0 : (_formRef$current5$set = _formRef$current5.setFieldsValue) === null || _formRef$current5$set === void 0 ? void 0 : _formRef$current5$set.call(_formRef$current5, _defineProperty({}, rowKey, formValue));
226
- } else {
227
229
  var _formRef$current6, _formRef$current6$set;
228
- formRef === null || formRef === void 0 ? void 0 : (_formRef$current6 = formRef.current) === null || _formRef$current6 === void 0 ? void 0 : (_formRef$current6$set = _formRef$current6.setFieldsValue) === null || _formRef$current6$set === void 0 ? void 0 : _formRef$current6$set.call(_formRef$current6, _objectSpread({}, formValue));
230
+ formRef === null || formRef === void 0 ? void 0 : (_formRef$current6 = formRef.current) === null || _formRef$current6 === void 0 ? void 0 : (_formRef$current6$set = _formRef$current6.setFieldsValue) === null || _formRef$current6$set === void 0 ? void 0 : _formRef$current6$set.call(_formRef$current6, _defineProperty({}, rowKey, formValue));
231
+ } else {
232
+ var _formRef$current7, _formRef$current7$set;
233
+ formRef === null || formRef === void 0 ? void 0 : (_formRef$current7 = formRef.current) === null || _formRef$current7 === void 0 ? void 0 : (_formRef$current7$set = _formRef$current7.setFieldsValue) === null || _formRef$current7$set === void 0 ? void 0 : _formRef$current7$set.call(_formRef$current7, _objectSpread({}, formValue));
229
234
  }
230
235
  onSelectChange === null || onSelectChange === void 0 ? void 0 : onSelectChange(row, formRef);
231
236
  };
@@ -256,8 +261,8 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
256
261
  };
257
262
  //直接输入不回车,value 和 text 为同一个值
258
263
  var onInput = function onInput(e) {
259
- var _formRef$current7, _formRef$current7$get;
260
- var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current7 = formRef.current) === null || _formRef$current7 === void 0 ? void 0 : (_formRef$current7$get = _formRef$current7.getFieldsValue) === null || _formRef$current7$get === void 0 ? void 0 : _formRef$current7$get.call(_formRef$current7)) || {};
264
+ var _formRef$current8, _formRef$current8$get;
265
+ var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current8 = formRef.current) === null || _formRef$current8 === void 0 ? void 0 : (_formRef$current8$get = _formRef$current8.getFieldsValue) === null || _formRef$current8$get === void 0 ? void 0 : _formRef$current8$get.call(_formRef$current8)) || {};
261
266
  if (rowKey) {
262
267
  formValue = formValue[rowKey] || {};
263
268
  }
@@ -266,30 +271,30 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
266
271
  formValue[textNameProp] = val;
267
272
  setText(val);
268
273
  if (rowKey) {
269
- var _formRef$current8, _formRef$current8$set;
270
- formRef === null || formRef === void 0 ? void 0 : (_formRef$current8 = formRef.current) === null || _formRef$current8 === void 0 ? void 0 : (_formRef$current8$set = _formRef$current8.setFieldsValue) === null || _formRef$current8$set === void 0 ? void 0 : _formRef$current8$set.call(_formRef$current8, _defineProperty({}, rowKey, formValue));
271
- } else {
272
274
  var _formRef$current9, _formRef$current9$set;
273
- formRef === null || formRef === void 0 ? void 0 : (_formRef$current9 = formRef.current) === null || _formRef$current9 === void 0 ? void 0 : (_formRef$current9$set = _formRef$current9.setFieldsValue) === null || _formRef$current9$set === void 0 ? void 0 : _formRef$current9$set.call(_formRef$current9, _objectSpread({}, formValue));
275
+ formRef === null || formRef === void 0 ? void 0 : (_formRef$current9 = formRef.current) === null || _formRef$current9 === void 0 ? void 0 : (_formRef$current9$set = _formRef$current9.setFieldsValue) === null || _formRef$current9$set === void 0 ? void 0 : _formRef$current9$set.call(_formRef$current9, _defineProperty({}, rowKey, formValue));
276
+ } else {
277
+ var _formRef$current10, _formRef$current10$se;
278
+ formRef === null || formRef === void 0 ? void 0 : (_formRef$current10 = formRef.current) === null || _formRef$current10 === void 0 ? void 0 : (_formRef$current10$se = _formRef$current10.setFieldsValue) === null || _formRef$current10$se === void 0 ? void 0 : _formRef$current10$se.call(_formRef$current10, _objectSpread({}, formValue));
274
279
  }
275
280
  };
276
281
  // 当表单重置或点clear时,处理值
277
282
  var clearValue = function clearValue(e) {
278
283
  if (!e.target.value) {
279
- var _formRef$current10, _formRef$current10$ge;
284
+ var _formRef$current11, _formRef$current11$ge;
280
285
  setText('');
281
- var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current10 = formRef.current) === null || _formRef$current10 === void 0 ? void 0 : (_formRef$current10$ge = _formRef$current10.getFieldsValue) === null || _formRef$current10$ge === void 0 ? void 0 : _formRef$current10$ge.call(_formRef$current10)) || {};
286
+ var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current11 = formRef.current) === null || _formRef$current11 === void 0 ? void 0 : (_formRef$current11$ge = _formRef$current11.getFieldsValue) === null || _formRef$current11$ge === void 0 ? void 0 : _formRef$current11$ge.call(_formRef$current11)) || {};
282
287
  if (rowKey) {
283
288
  formValue = formValue[rowKey] || {};
284
289
  }
285
290
  formValue[name] = '';
286
291
  formValue[textNameProp] = '';
287
292
  if (rowKey) {
288
- var _formRef$current11, _formRef$current11$se;
289
- formRef === null || formRef === void 0 ? void 0 : (_formRef$current11 = formRef.current) === null || _formRef$current11 === void 0 ? void 0 : (_formRef$current11$se = _formRef$current11.setFieldsValue) === null || _formRef$current11$se === void 0 ? void 0 : _formRef$current11$se.call(_formRef$current11, _defineProperty({}, rowKey, formValue));
290
- } else {
291
293
  var _formRef$current12, _formRef$current12$se;
292
- formRef === null || formRef === void 0 ? void 0 : (_formRef$current12 = formRef.current) === null || _formRef$current12 === void 0 ? void 0 : (_formRef$current12$se = _formRef$current12.setFieldsValue) === null || _formRef$current12$se === void 0 ? void 0 : _formRef$current12$se.call(_formRef$current12, _objectSpread({}, formValue));
294
+ formRef === null || formRef === void 0 ? void 0 : (_formRef$current12 = formRef.current) === null || _formRef$current12 === void 0 ? void 0 : (_formRef$current12$se = _formRef$current12.setFieldsValue) === null || _formRef$current12$se === void 0 ? void 0 : _formRef$current12$se.call(_formRef$current12, _defineProperty({}, rowKey, formValue));
295
+ } else {
296
+ var _formRef$current13, _formRef$current13$se;
297
+ formRef === null || formRef === void 0 ? void 0 : (_formRef$current13 = formRef.current) === null || _formRef$current13 === void 0 ? void 0 : (_formRef$current13$se = _formRef$current13.setFieldsValue) === null || _formRef$current13$se === void 0 ? void 0 : _formRef$current13$se.call(_formRef$current13, _objectSpread({}, formValue));
293
298
  }
294
299
  }
295
300
  };
@@ -304,6 +309,14 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
304
309
  if (!multiple) {
305
310
  tableOptions.headerTitle = "双击选中当前行数据";
306
311
  }
312
+ var rowSelection = tableConfig === null || tableConfig === void 0 ? void 0 : tableConfig.rowSelection;
313
+ rowSelection = rowSelection == undefined || multiple ? {
314
+ type: 'checkbox',
315
+ onChange: function onChange(keys, rows) {
316
+ // console.log(keys, rows, tableRef?.current?.getDatasource());
317
+ selectRowRef.current = rows;
318
+ }
319
+ } : false;
307
320
  var tableDom = /*#__PURE__*/React.createElement(ProTable, _extends({
308
321
  className: "ls-input-table",
309
322
  columns: columns,
@@ -323,12 +336,7 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
323
336
  btnInline: true
324
337
  },
325
338
  height: 'full',
326
- rowSelection: {
327
- type: multiple ? 'checkbox' : 'radio',
328
- onChange: function onChange(keys, rows) {
329
- selectRowRef.current = rows;
330
- }
331
- },
339
+ rowSelection: rowSelection,
332
340
  onRow: function onRow(record) {
333
341
  return {
334
342
  onDoubleClick: function onDoubleClick() {
@@ -31,6 +31,7 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
31
31
  //@ts-ignore
32
32
  var _useContext = (0, _react.useContext)(_lsProForm.ProFormContext),
33
33
  formRef = _useContext.formRef;
34
+ // const inputRef=useRef<any>();
34
35
  var tableRef = (0, _react.useRef)();
35
36
  var selectRowRef = (0, _react.useRef)([]);
36
37
  var _useState = (0, _react.useState)(false),
@@ -87,6 +88,7 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
87
88
  arrowPointAtCenter = _prop$arrowPointAtCen === void 0 ? true : _prop$arrowPointAtCen,
88
89
  rowKey = prop.rowKey,
89
90
  rest = (0, _objectWithoutProperties2.default)(prop, _excluded);
91
+ var tableKey = (tableConfig === null || tableConfig === void 0 ? void 0 : tableConfig.rowKey) || 'id';
90
92
  //显示输入框绑定的name,如果不设置textName,设置为$name__text
91
93
  var textNameProp = (0, _react.useMemo)(function () {
92
94
  return textName || name + '__text';
@@ -147,6 +149,7 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
147
149
  if (afterLoad) {
148
150
  afterLoad(rows);
149
151
  }
152
+ //todo 加载数据时自动勾选
150
153
  return _context.abrupt("return", {
151
154
  data: rows,
152
155
  total: Number(result.total || 0),
@@ -182,14 +185,16 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
182
185
  if (txt) {
183
186
  setText(txt);
184
187
  } else if (val) {
188
+ var _formRef$current4, _formRef$current4$set;
185
189
  setText(val);
190
+ formRef === null || formRef === void 0 ? void 0 : (_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 ? void 0 : (_formRef$current4$set = _formRef$current4.setFieldsValue) === null || _formRef$current4$set === void 0 ? void 0 : _formRef$current4$set.call(_formRef$current4, (0, _defineProperty2.default)({}, textNameProp, val));
186
191
  }
187
192
  }, 0);
188
193
  }, [rowKey]);
189
194
  // 处理返回数据
190
195
  var handleValue = function handleValue(row) {
191
- var _formRef$current4, _formRef$current4$get;
192
- var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 ? void 0 : (_formRef$current4$get = _formRef$current4.getFieldsValue) === null || _formRef$current4$get === void 0 ? void 0 : _formRef$current4$get.call(_formRef$current4)) || {};
196
+ var _formRef$current5, _formRef$current5$get;
197
+ var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 ? void 0 : (_formRef$current5$get = _formRef$current5.getFieldsValue) === null || _formRef$current5$get === void 0 ? void 0 : _formRef$current5$get.call(_formRef$current5)) || {};
193
198
  if (rowKey) {
194
199
  formValue = formValue[rowKey] || {};
195
200
  }
@@ -229,11 +234,11 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
229
234
  setText(txt);
230
235
  setVisible(false);
231
236
  if (rowKey) {
232
- var _formRef$current5, _formRef$current5$set;
233
- formRef === null || formRef === void 0 ? void 0 : (_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 ? void 0 : (_formRef$current5$set = _formRef$current5.setFieldsValue) === null || _formRef$current5$set === void 0 ? void 0 : _formRef$current5$set.call(_formRef$current5, (0, _defineProperty2.default)({}, rowKey, formValue));
234
- } else {
235
237
  var _formRef$current6, _formRef$current6$set;
236
- formRef === null || formRef === void 0 ? void 0 : (_formRef$current6 = formRef.current) === null || _formRef$current6 === void 0 ? void 0 : (_formRef$current6$set = _formRef$current6.setFieldsValue) === null || _formRef$current6$set === void 0 ? void 0 : _formRef$current6$set.call(_formRef$current6, (0, _objectSpread2.default)({}, formValue));
238
+ formRef === null || formRef === void 0 ? void 0 : (_formRef$current6 = formRef.current) === null || _formRef$current6 === void 0 ? void 0 : (_formRef$current6$set = _formRef$current6.setFieldsValue) === null || _formRef$current6$set === void 0 ? void 0 : _formRef$current6$set.call(_formRef$current6, (0, _defineProperty2.default)({}, rowKey, formValue));
239
+ } else {
240
+ var _formRef$current7, _formRef$current7$set;
241
+ formRef === null || formRef === void 0 ? void 0 : (_formRef$current7 = formRef.current) === null || _formRef$current7 === void 0 ? void 0 : (_formRef$current7$set = _formRef$current7.setFieldsValue) === null || _formRef$current7$set === void 0 ? void 0 : _formRef$current7$set.call(_formRef$current7, (0, _objectSpread2.default)({}, formValue));
237
242
  }
238
243
  onSelectChange === null || onSelectChange === void 0 ? void 0 : onSelectChange(row, formRef);
239
244
  };
@@ -264,8 +269,8 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
264
269
  };
265
270
  //直接输入不回车,value 和 text 为同一个值
266
271
  var onInput = function onInput(e) {
267
- var _formRef$current7, _formRef$current7$get;
268
- var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current7 = formRef.current) === null || _formRef$current7 === void 0 ? void 0 : (_formRef$current7$get = _formRef$current7.getFieldsValue) === null || _formRef$current7$get === void 0 ? void 0 : _formRef$current7$get.call(_formRef$current7)) || {};
272
+ var _formRef$current8, _formRef$current8$get;
273
+ var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current8 = formRef.current) === null || _formRef$current8 === void 0 ? void 0 : (_formRef$current8$get = _formRef$current8.getFieldsValue) === null || _formRef$current8$get === void 0 ? void 0 : _formRef$current8$get.call(_formRef$current8)) || {};
269
274
  if (rowKey) {
270
275
  formValue = formValue[rowKey] || {};
271
276
  }
@@ -274,30 +279,30 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
274
279
  formValue[textNameProp] = val;
275
280
  setText(val);
276
281
  if (rowKey) {
277
- var _formRef$current8, _formRef$current8$set;
278
- formRef === null || formRef === void 0 ? void 0 : (_formRef$current8 = formRef.current) === null || _formRef$current8 === void 0 ? void 0 : (_formRef$current8$set = _formRef$current8.setFieldsValue) === null || _formRef$current8$set === void 0 ? void 0 : _formRef$current8$set.call(_formRef$current8, (0, _defineProperty2.default)({}, rowKey, formValue));
279
- } else {
280
282
  var _formRef$current9, _formRef$current9$set;
281
- formRef === null || formRef === void 0 ? void 0 : (_formRef$current9 = formRef.current) === null || _formRef$current9 === void 0 ? void 0 : (_formRef$current9$set = _formRef$current9.setFieldsValue) === null || _formRef$current9$set === void 0 ? void 0 : _formRef$current9$set.call(_formRef$current9, (0, _objectSpread2.default)({}, formValue));
283
+ formRef === null || formRef === void 0 ? void 0 : (_formRef$current9 = formRef.current) === null || _formRef$current9 === void 0 ? void 0 : (_formRef$current9$set = _formRef$current9.setFieldsValue) === null || _formRef$current9$set === void 0 ? void 0 : _formRef$current9$set.call(_formRef$current9, (0, _defineProperty2.default)({}, rowKey, formValue));
284
+ } else {
285
+ var _formRef$current10, _formRef$current10$se;
286
+ formRef === null || formRef === void 0 ? void 0 : (_formRef$current10 = formRef.current) === null || _formRef$current10 === void 0 ? void 0 : (_formRef$current10$se = _formRef$current10.setFieldsValue) === null || _formRef$current10$se === void 0 ? void 0 : _formRef$current10$se.call(_formRef$current10, (0, _objectSpread2.default)({}, formValue));
282
287
  }
283
288
  };
284
289
  // 当表单重置或点clear时,处理值
285
290
  var clearValue = function clearValue(e) {
286
291
  if (!e.target.value) {
287
- var _formRef$current10, _formRef$current10$ge;
292
+ var _formRef$current11, _formRef$current11$ge;
288
293
  setText('');
289
- var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current10 = formRef.current) === null || _formRef$current10 === void 0 ? void 0 : (_formRef$current10$ge = _formRef$current10.getFieldsValue) === null || _formRef$current10$ge === void 0 ? void 0 : _formRef$current10$ge.call(_formRef$current10)) || {};
294
+ var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current11 = formRef.current) === null || _formRef$current11 === void 0 ? void 0 : (_formRef$current11$ge = _formRef$current11.getFieldsValue) === null || _formRef$current11$ge === void 0 ? void 0 : _formRef$current11$ge.call(_formRef$current11)) || {};
290
295
  if (rowKey) {
291
296
  formValue = formValue[rowKey] || {};
292
297
  }
293
298
  formValue[name] = '';
294
299
  formValue[textNameProp] = '';
295
300
  if (rowKey) {
296
- var _formRef$current11, _formRef$current11$se;
297
- formRef === null || formRef === void 0 ? void 0 : (_formRef$current11 = formRef.current) === null || _formRef$current11 === void 0 ? void 0 : (_formRef$current11$se = _formRef$current11.setFieldsValue) === null || _formRef$current11$se === void 0 ? void 0 : _formRef$current11$se.call(_formRef$current11, (0, _defineProperty2.default)({}, rowKey, formValue));
298
- } else {
299
301
  var _formRef$current12, _formRef$current12$se;
300
- formRef === null || formRef === void 0 ? void 0 : (_formRef$current12 = formRef.current) === null || _formRef$current12 === void 0 ? void 0 : (_formRef$current12$se = _formRef$current12.setFieldsValue) === null || _formRef$current12$se === void 0 ? void 0 : _formRef$current12$se.call(_formRef$current12, (0, _objectSpread2.default)({}, formValue));
302
+ formRef === null || formRef === void 0 ? void 0 : (_formRef$current12 = formRef.current) === null || _formRef$current12 === void 0 ? void 0 : (_formRef$current12$se = _formRef$current12.setFieldsValue) === null || _formRef$current12$se === void 0 ? void 0 : _formRef$current12$se.call(_formRef$current12, (0, _defineProperty2.default)({}, rowKey, formValue));
303
+ } else {
304
+ var _formRef$current13, _formRef$current13$se;
305
+ formRef === null || formRef === void 0 ? void 0 : (_formRef$current13 = formRef.current) === null || _formRef$current13 === void 0 ? void 0 : (_formRef$current13$se = _formRef$current13.setFieldsValue) === null || _formRef$current13$se === void 0 ? void 0 : _formRef$current13$se.call(_formRef$current13, (0, _objectSpread2.default)({}, formValue));
301
306
  }
302
307
  }
303
308
  };
@@ -312,6 +317,14 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
312
317
  if (!multiple) {
313
318
  tableOptions.headerTitle = "双击选中当前行数据";
314
319
  }
320
+ var rowSelection = tableConfig === null || tableConfig === void 0 ? void 0 : tableConfig.rowSelection;
321
+ rowSelection = rowSelection == undefined || multiple ? {
322
+ type: 'checkbox',
323
+ onChange: function onChange(keys, rows) {
324
+ // console.log(keys, rows, tableRef?.current?.getDatasource());
325
+ selectRowRef.current = rows;
326
+ }
327
+ } : false;
315
328
  var tableDom = /*#__PURE__*/_react.default.createElement(_lsProTable.default, (0, _extends2.default)({
316
329
  className: "ls-input-table",
317
330
  columns: columns,
@@ -331,12 +344,7 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
331
344
  btnInline: true
332
345
  },
333
346
  height: 'full',
334
- rowSelection: {
335
- type: multiple ? 'checkbox' : 'radio',
336
- onChange: function onChange(keys, rows) {
337
- selectRowRef.current = rows;
338
- }
339
- },
347
+ rowSelection: rowSelection,
340
348
  onRow: function onRow(record) {
341
349
  return {
342
350
  onDoubleClick: function onDoubleClick() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ls-pro-common",
3
- "version": "3.0.17",
3
+ "version": "3.0.18",
4
4
  "description": "ls-pro-common",
5
5
  "license": "MIT",
6
6
  "sideEffects": [
@@ -21,7 +21,7 @@
21
21
  ],
22
22
  "dependencies": {
23
23
  "@ant-design/icons": "^4.3.0",
24
- "ls-pro-table": "^3.0.10",
24
+ "ls-pro-table": "^3.0.11",
25
25
  "ls-pro-form": "^3.0.6",
26
26
  "ls-pro-descriptions": "^3.0.1",
27
27
  "ls-pro-card": "^3.0.3",