ztxkui 4.2.23-345-beta → 4.2.23-346-beta

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.
@@ -41,10 +41,14 @@ var InputModal = function (_a) {
41
41
  setModalValue(props.value);
42
42
  }
43
43
  };
44
+ var close = function () {
45
+ setVisible(false);
46
+ isDoubleClick.current = false;
47
+ };
44
48
  var handleSure = function () {
45
49
  onChange && onChange(modalValue);
46
50
  onBlur && onBlur(modalValue);
47
- setVisible(false);
51
+ close();
48
52
  };
49
53
  var handleClear = function () {
50
54
  setModalValue('');
@@ -56,7 +60,7 @@ var InputModal = function (_a) {
56
60
  };
57
61
  return (React.createElement(React.Fragment, null,
58
62
  React.createElement(Input, __assign({}, props, { onBlur: handleBlur, onDoubleClick: handleDoubleClick, onChange: function (e) { return onChange && onChange(e.target.value); } })),
59
- React.createElement(Modal, { title: isModalDisabled ? '内容' : '请输入内容', visible: visible, loading: false, destroyOnClose: true, onCancel: function () { return setVisible(false); }, footer: isModalDisabled ? undefined : (React.createElement(React.Fragment, null,
63
+ React.createElement(Modal, { title: isModalDisabled ? '内容' : '请输入内容', visible: visible, loading: false, destroyOnClose: true, onCancel: close, footer: isModalDisabled ? undefined : (React.createElement(React.Fragment, null,
60
64
  React.createElement(Button, { onClick: handleClear }, "\u6E05\u7A7A\u5185\u5BB9"),
61
65
  React.createElement(Button, { type: "primary", onClick: handleSure }, "\u786E\u8BA4"))) },
62
66
  React.createElement(Input.TextArea, { value: modalValue, readOnly: isModalDisabled, autoFocus: true, autoSize: { minRows: 10, maxRows: 50 }, onChange: function (e) { return setModalValue(e.target.value); } }))));
@@ -449,20 +449,7 @@ function getNewColumns(basicConfig, editableConfig, dynamicConfig, otherConfig)
449
449
  _newColumns.push(_column);
450
450
  }
451
451
  // 添加render字段
452
- if (!_column.render) {
453
- _column.render = function (text, record, index) {
454
- var value = text;
455
- if (text == null || text === '')
456
- return '— —';
457
- else if (_column.dateFormat)
458
- return dayjs(text).format(_column.dateFormat);
459
- if (_column.precision)
460
- value = exactRound(text, _column.precision);
461
- if (_column.thousand)
462
- value = toThousand(value);
463
- return value;
464
- };
465
- }
452
+ appendRender(_column);
466
453
  // 添加表头提示信息
467
454
  if (_column.headTooltip) {
468
455
  _column.title = (React.createElement(TableHeadTooltip, { headTooltip: _column.headTooltip }, _column.title));
@@ -596,6 +583,32 @@ function getNewColumns(basicConfig, editableConfig, dynamicConfig, otherConfig)
596
583
  _newColumns: _newColumns,
597
584
  _dynamicColumns: _dynamicColumns,
598
585
  };
586
+ function appendRender(_column) {
587
+ if (!_column.render) {
588
+ if (_column.children) {
589
+ _column.children.forEach(function (item) {
590
+ appendRender(item);
591
+ });
592
+ }
593
+ else {
594
+ _column.render = returnRender(_column);
595
+ }
596
+ }
597
+ function returnRender(_column) {
598
+ return function (text, record, index) {
599
+ var value = text;
600
+ if (text == null || text === '')
601
+ return '— —';
602
+ else if (_column.dateFormat)
603
+ return dayjs(text).format(_column.dateFormat);
604
+ if (_column.precision)
605
+ value = exactRound(text, _column.precision);
606
+ if (_column.thousand)
607
+ value = toThousand(value);
608
+ return value;
609
+ };
610
+ }
611
+ }
599
612
  }
600
613
  function useColumns(props) {
601
614
  var columns = props.columns, hiddenColumnDynamicIcon = props.hiddenColumnDynamicIcon, showColumnDynamic = props.showColumnDynamic, showColumnDynamicKey = props.showColumnDynamicKey, onAddAndDelHandle = props.onAddAndDelHandle, hideAddIcon = props.hideAddIcon, showDelAllBtn = props.showDelAllBtn, delAllChange = props.delAllChange, addIconText = props.addIconText, hideDelIcon = props.hideDelIcon, delIconText = props.delIconText, showDynamicHandle = props.showDynamicHandle, onEditableSave = props.onEditableSave, configInfo = props.configInfo, copyByKey = props.copyByKey, onTableChange = props.onTableChange, currentPage = props.currentPage, currentDataSource = props.currentDataSource, preDataSource = props.preDataSource, rowKey = props.rowKey, dataSourceRef = props.dataSourceRef, expandableChildrenColumnName = props.expandableChildrenColumnName, customSortHandle = props.customSortHandle, customOrder = props.customOrder, setCustomOrder = props.setCustomOrder, isSort = props.isSort, onFillDownChangeRef = props.onFillDownChangeRef, isHasFilterRef = props.isHasFilterRef, filterSearchValuesRef = props.filterSearchValuesRef, diffData = props.diffData;
@@ -96,11 +96,11 @@ var TableEnhanceCell = function (_a) {
96
96
  var getRealyIndex = useCallback(function () {
97
97
  var newRecords = dataSource ? dataSource() : [];
98
98
  var rowKeyIndex = newRecords.findIndex(function (newRecord) {
99
- if (typeof rowKey === 'string') {
100
- return (newRecord === null || newRecord === void 0 ? void 0 : newRecord[rowKey]) === (record === null || record === void 0 ? void 0 : record[rowKey]);
99
+ if (typeof rowKey === 'function') {
100
+ return rowKey(newRecord) === rowKey(record);
101
101
  }
102
102
  else {
103
- return rowKey(newRecord) === rowKey(record);
103
+ return (newRecord === null || newRecord === void 0 ? void 0 : newRecord[rowKey]) === (record === null || record === void 0 ? void 0 : record[rowKey]);
104
104
  }
105
105
  });
106
106
  if (rowKeyIndex !== -1 && isHasFilterRef.current) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkui",
3
- "version": "4.2.23-345-beta",
3
+ "version": "4.2.23-346-beta",
4
4
  "private": false,
5
5
  "description": "React components library",
6
6
  "author": "zt-front-end",