linkmore-design 1.1.28 → 1.1.30
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/Form/FormItem/index.d.ts +1 -0
- package/dist/LmEditTable/DndContainer.d.ts +6 -3
- package/dist/LmEditTable/EditTable.d.ts +16 -5
- package/dist/LmEditTable/components/DraggableContainer.d.ts +10 -0
- package/dist/LmEditTable/components/QuickOpetate.d.ts +12 -0
- package/dist/LmEditTable/components/bottomOpetateComponent.d.ts +13 -0
- package/dist/LmEditTable/components/customRenderEmpty.d.ts +2 -0
- package/dist/LmEditTable/components/index.d.ts +17 -0
- package/dist/LmEditTable/hooks/useForkRef.d.ts +2 -0
- package/dist/LmEditTable/rowSort/DndContainerRow.d.ts +10 -0
- package/dist/LmEditTable/sortableItem.d.ts +3 -2
- package/dist/LmEditTable/util.d.ts +10 -0
- package/dist/LmEditTable/virtual/VirtualRow.d.ts +7 -0
- package/dist/LmEditTable/virtual/VirtualRow2.d.ts +7 -0
- package/dist/LmEditTable/virtual/VirtualTable.d.ts +3 -0
- package/dist/LmEditTable/virtual/VirtualWrapper.d.ts +3 -0
- package/dist/LmEditTable/virtual/context.d.ts +13 -0
- package/dist/LmEditTable/virtual/index.d.ts +4 -0
- package/dist/LmTable/common/index.d.ts +10 -0
- package/dist/LmTable/components/CalcExpression.d.ts +9 -0
- package/dist/LmTable/components/Container/Container.d.ts +20 -0
- package/dist/LmTable/components/Container/index.d.ts +2 -0
- package/dist/LmTable/components/DndContainer.d.ts +37 -5
- package/dist/LmTable/components/HeaderCol.d.ts +1 -0
- package/dist/LmTable/components/Item/Item.d.ts +37 -0
- package/dist/LmTable/components/Item/components/Action/Action.d.ts +10 -0
- package/dist/LmTable/components/Item/components/Action/index.d.ts +2 -0
- package/dist/LmTable/components/Item/components/Handle/index.d.ts +4 -0
- package/dist/LmTable/components/Item/components/Remove/index.d.ts +2 -0
- package/dist/LmTable/components/Item/components/index.d.ts +3 -0
- package/dist/LmTable/components/Item/index.d.ts +2 -0
- package/dist/LmTable/components/{sortableBoxCol.d.ts → SortableBox.d.ts} +0 -0
- package/dist/LmTable/demos/{excelGroup.d.ts → draggable.d.ts} +0 -0
- package/dist/LmTable/demos/resize.d.ts +2 -0
- package/dist/LmTable/expression.d.ts +2 -1
- package/dist/LmTable/hooks/useDndItems.d.ts +13 -0
- package/dist/LmTable/hooks/useGroupDataSource.d.ts +1 -2
- package/dist/LmTable/hooks/useResizeObserver.d.ts +13 -0
- package/dist/LmTable/multipleContainersKeyboardCoordinates.d.ts +3 -0
- package/dist/LmTable/testDemos/group.d.ts +2 -0
- package/dist/LmTable/util.d.ts +1 -1
- package/dist/LmTable/virTual/VirtualRow.d.ts +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.umd.css +367 -0
- package/dist/index.umd.js +4362 -52840
- package/dist/index.umd.min.css +1 -1
- package/dist/index.umd.min.js +23 -47
- package/dist/variables.css +129 -6
- package/es/CardTable/style/index.css +3 -2
- package/es/CardTable/style/variables.css +3 -2
- package/es/CustomTableOption/columnsSort.js +41 -19
- package/es/CustomTableOption/filterSort.js +14 -6
- package/es/CustomTableOption/style/index.css +3 -0
- package/es/CustomTableOption/style/variables.css +3 -0
- package/es/Dropdown/style/index.css +1 -1
- package/es/Dropdown/style/variables.css +1 -1
- package/es/Empty/index.js +0 -1
- package/es/Form/FormItem/index.d.ts +1 -0
- package/es/Form/FormItem/index.js +31 -17
- package/es/Form/style/index.css +4 -0
- package/es/Form/style/variables.css +4 -0
- package/es/InputNumber/index.js +7 -9
- package/es/LmEditTable/DndContainer.d.ts +6 -3
- package/es/LmEditTable/DndContainer.js +70 -10
- package/es/LmEditTable/DragHandle.js +1 -1
- package/es/LmEditTable/EditTable.d.ts +16 -5
- package/es/LmEditTable/EditTable.js +855 -436
- package/es/LmEditTable/components/DraggableContainer.d.ts +10 -0
- package/es/LmEditTable/components/DraggableContainer.js +39 -0
- package/es/LmEditTable/components/QuickOpetate.d.ts +12 -0
- package/es/LmEditTable/components/QuickOpetate.js +82 -0
- package/es/LmEditTable/components/bottomOpetateComponent.d.ts +13 -0
- package/es/LmEditTable/components/bottomOpetateComponent.js +23 -0
- package/es/LmEditTable/components/customRenderEmpty.d.ts +2 -0
- package/es/LmEditTable/components/customRenderEmpty.js +20 -0
- package/es/LmEditTable/components/index.d.ts +17 -0
- package/es/LmEditTable/components/index.js +8 -0
- package/es/LmEditTable/hooks/useForkRef.d.ts +2 -0
- package/es/LmEditTable/hooks/useForkRef.js +22 -0
- package/es/LmEditTable/rowSort/DndContainerRow.d.ts +10 -0
- package/es/LmEditTable/rowSort/DndContainerRow.js +83 -0
- package/es/LmEditTable/sortableItem.d.ts +3 -2
- package/es/LmEditTable/sortableItem.js +16 -4
- package/es/LmEditTable/sortableItemCol.js +40 -10
- package/es/LmEditTable/style/index.css +105 -1
- package/es/LmEditTable/style/variables.css +105 -1
- package/es/LmEditTable/util.d.ts +10 -0
- package/es/LmEditTable/util.js +162 -9
- package/es/LmEditTable/virtual/VirtualRow.d.ts +7 -0
- package/es/LmEditTable/virtual/VirtualRow.js +148 -0
- package/es/LmEditTable/virtual/VirtualRow2.d.ts +7 -0
- package/es/LmEditTable/virtual/VirtualRow2.js +62 -0
- package/es/LmEditTable/virtual/VirtualTable.d.ts +3 -0
- package/es/LmEditTable/virtual/VirtualTable.js +64 -0
- package/es/LmEditTable/virtual/VirtualWrapper.d.ts +3 -0
- package/es/LmEditTable/virtual/VirtualWrapper.js +60 -0
- package/es/LmEditTable/virtual/context.d.ts +13 -0
- package/es/LmEditTable/virtual/context.js +66 -0
- package/es/LmEditTable/virtual/index.d.ts +4 -0
- package/es/LmEditTable/virtual/index.js +4 -0
- package/es/LmTable/Table.js +269 -163
- package/es/LmTable/common/index.d.ts +10 -0
- package/es/LmTable/common/index.js +38 -0
- package/es/LmTable/components/CalcExpression.d.ts +9 -0
- package/es/LmTable/components/CalcExpression.js +150 -0
- package/es/LmTable/components/Container/Container.css +94 -0
- package/es/LmTable/components/Container/Container.d.ts +20 -0
- package/es/LmTable/components/Container/Container.js +52 -0
- package/es/LmTable/components/Container/index.d.ts +2 -0
- package/es/LmTable/components/Container/index.js +1 -0
- package/es/LmTable/components/DndContainer.d.ts +37 -5
- package/es/LmTable/components/DndContainer.js +704 -24
- package/es/LmTable/components/HeaderCol.js +61 -0
- package/es/LmTable/components/Item/Item.css +113 -0
- package/es/LmTable/components/Item/Item.d.ts +37 -0
- package/es/LmTable/components/Item/Item.js +88 -0
- package/es/LmTable/components/Item/components/Action/Action.css +41 -0
- package/es/LmTable/components/Item/components/Action/Action.d.ts +10 -0
- package/es/LmTable/components/Item/components/Action/Action.js +35 -0
- package/es/LmTable/components/Item/components/Action/index.d.ts +2 -0
- package/es/LmTable/components/Item/components/Action/index.js +1 -0
- package/es/LmTable/components/Item/components/Handle/index.d.ts +4 -0
- package/es/LmTable/components/Item/components/Handle/index.js +15 -0
- package/es/LmTable/components/Item/components/Remove/index.d.ts +2 -0
- package/es/LmTable/components/Item/components/Remove/index.js +16 -0
- package/es/LmTable/components/Item/components/index.d.ts +3 -0
- package/es/LmTable/components/Item/components/index.js +3 -0
- package/es/LmTable/components/Item/index.d.ts +2 -0
- package/es/LmTable/components/Item/index.js +2 -0
- package/es/LmTable/components/{sortableBoxCol.js → SortableBox.js} +0 -0
- package/es/LmTable/expression.d.ts +2 -1
- package/es/LmTable/expression.js +92 -16
- package/es/LmTable/hooks/useDndItems.d.ts +13 -0
- package/es/LmTable/hooks/useDndItems.js +234 -0
- package/es/LmTable/hooks/useGroupDataSource.js +2 -24
- package/es/LmTable/hooks/useResizeObserver.d.ts +13 -0
- package/es/LmTable/hooks/useResizeObserver.js +49 -0
- package/es/LmTable/multipleContainersKeyboardCoordinates.d.ts +3 -0
- package/es/LmTable/multipleContainersKeyboardCoordinates.js +117 -0
- package/es/LmTable/style/index.css +13 -2
- package/es/LmTable/style/variables.css +13 -2
- package/es/LmTable/testDemos/group.js +131 -0
- package/es/LmTable/util.js +22 -2
- package/es/LmTable/virTual/VirtualRow.d.ts +1 -1
- package/es/LmTable/virTual/VirtualRow.js +82 -48
- package/es/LmTable/virTual/VirtualTable.js +43 -11
- package/es/LmTable/virTual/context.js +14 -2
- package/es/LmUpload/fns/index.js +1 -1
- package/es/Modal/index.js +10 -3
- package/es/Radio/index.js +9 -1
- package/es/Switch/index.js +7 -2
- package/es/hooks/useEvent/index.js +1 -1
- package/es/index.d.ts +1 -2
- package/es/locale-provider/index.js +1 -1
- package/es/styles/variables.css +129 -6
- package/lib/CardTable/style/index.css +3 -2
- package/lib/CardTable/style/variables.css +3 -2
- package/lib/CustomTableOption/columnsSort.js +48 -23
- package/lib/CustomTableOption/filterSort.js +19 -10
- package/lib/CustomTableOption/style/index.css +3 -0
- package/lib/CustomTableOption/style/variables.css +3 -0
- package/lib/Dropdown/style/index.css +1 -1
- package/lib/Dropdown/style/variables.css +1 -1
- package/lib/Empty/index.js +0 -1
- package/lib/Form/FormItem/index.d.ts +1 -0
- package/lib/Form/FormItem/index.js +32 -17
- package/lib/Form/style/index.css +4 -0
- package/lib/Form/style/variables.css +4 -0
- package/lib/InputNumber/index.js +9 -9
- package/lib/LmEditTable/DndContainer.d.ts +6 -3
- package/lib/LmEditTable/DndContainer.js +74 -9
- package/lib/LmEditTable/DragHandle.js +1 -1
- package/lib/LmEditTable/EditTable.d.ts +16 -5
- package/lib/LmEditTable/EditTable.js +853 -433
- package/lib/LmEditTable/components/DraggableContainer.d.ts +10 -0
- package/lib/LmEditTable/components/DraggableContainer.js +52 -0
- package/lib/LmEditTable/components/QuickOpetate.d.ts +12 -0
- package/lib/LmEditTable/components/QuickOpetate.js +96 -0
- package/lib/LmEditTable/components/bottomOpetateComponent.d.ts +13 -0
- package/lib/LmEditTable/components/bottomOpetateComponent.js +34 -0
- package/lib/LmEditTable/components/customRenderEmpty.d.ts +2 -0
- package/lib/LmEditTable/components/customRenderEmpty.js +32 -0
- package/lib/LmEditTable/components/index.d.ts +17 -0
- package/lib/LmEditTable/components/index.js +45 -0
- package/lib/LmEditTable/hooks/useForkRef.d.ts +2 -0
- package/lib/LmEditTable/hooks/useForkRef.js +29 -0
- package/lib/LmEditTable/rowSort/DndContainerRow.d.ts +10 -0
- package/lib/LmEditTable/rowSort/DndContainerRow.js +100 -0
- package/lib/LmEditTable/sortableItem.d.ts +3 -2
- package/lib/LmEditTable/sortableItem.js +19 -5
- package/lib/LmEditTable/sortableItemCol.js +37 -8
- package/lib/LmEditTable/style/index.css +105 -1
- package/lib/LmEditTable/style/variables.css +105 -1
- package/lib/LmEditTable/util.d.ts +10 -0
- package/lib/LmEditTable/util.js +171 -8
- package/lib/LmEditTable/virtual/VirtualRow.d.ts +7 -0
- package/lib/LmEditTable/virtual/VirtualRow.js +164 -0
- package/lib/LmEditTable/virtual/VirtualRow2.d.ts +7 -0
- package/lib/LmEditTable/virtual/VirtualRow2.js +78 -0
- package/lib/LmEditTable/virtual/VirtualTable.d.ts +3 -0
- package/lib/LmEditTable/virtual/VirtualTable.js +81 -0
- package/lib/LmEditTable/virtual/VirtualWrapper.d.ts +3 -0
- package/lib/LmEditTable/virtual/VirtualWrapper.js +73 -0
- package/lib/LmEditTable/virtual/context.d.ts +13 -0
- package/lib/LmEditTable/virtual/context.js +76 -0
- package/lib/LmEditTable/virtual/index.d.ts +4 -0
- package/lib/LmEditTable/virtual/index.js +31 -0
- package/lib/LmTable/Table.js +269 -163
- package/lib/LmTable/common/index.d.ts +10 -0
- package/lib/LmTable/common/index.js +48 -0
- package/lib/LmTable/components/CalcExpression.d.ts +9 -0
- package/lib/LmTable/components/CalcExpression.js +166 -0
- package/lib/LmTable/components/Container/Container.css +94 -0
- package/lib/LmTable/components/Container/Container.d.ts +20 -0
- package/lib/LmTable/components/Container/Container.js +66 -0
- package/lib/LmTable/components/Container/index.d.ts +2 -0
- package/lib/LmTable/components/Container/index.js +13 -0
- package/lib/LmTable/components/DndContainer.d.ts +37 -5
- package/lib/LmTable/components/DndContainer.js +714 -26
- package/lib/LmTable/components/HeaderCol.js +61 -0
- package/lib/LmTable/components/Item/Item.css +113 -0
- package/lib/LmTable/components/Item/Item.d.ts +37 -0
- package/lib/LmTable/components/Item/Item.js +104 -0
- package/lib/LmTable/components/Item/components/Action/Action.css +41 -0
- package/lib/LmTable/components/Item/components/Action/Action.d.ts +10 -0
- package/lib/LmTable/components/Item/components/Action/Action.js +50 -0
- package/lib/LmTable/components/Item/components/Action/index.d.ts +2 -0
- package/lib/LmTable/components/Item/components/Action/index.js +13 -0
- package/lib/LmTable/components/Item/components/Handle/index.d.ts +4 -0
- package/lib/LmTable/components/Item/components/Handle/index.js +27 -0
- package/lib/LmTable/components/Item/components/Remove/index.d.ts +2 -0
- package/lib/LmTable/components/Item/components/Remove/index.js +27 -0
- package/lib/LmTable/components/Item/components/index.d.ts +3 -0
- package/lib/LmTable/components/Item/components/index.js +31 -0
- package/lib/LmTable/components/Item/index.d.ts +2 -0
- package/lib/LmTable/components/Item/index.js +33 -0
- package/lib/LmTable/components/{sortableBoxCol.js → SortableBox.js} +0 -0
- package/lib/LmTable/expression.d.ts +2 -1
- package/lib/LmTable/expression.js +96 -17
- package/lib/LmTable/hooks/useDndItems.d.ts +13 -0
- package/lib/LmTable/hooks/useDndItems.js +247 -0
- package/lib/LmTable/hooks/useGroupDataSource.js +2 -24
- package/lib/LmTable/hooks/useResizeObserver.d.ts +13 -0
- package/lib/LmTable/hooks/useResizeObserver.js +61 -0
- package/lib/LmTable/multipleContainersKeyboardCoordinates.d.ts +3 -0
- package/lib/LmTable/multipleContainersKeyboardCoordinates.js +126 -0
- package/lib/LmTable/style/index.css +13 -2
- package/lib/LmTable/style/variables.css +13 -2
- package/lib/LmTable/testDemos/group.js +131 -0
- package/lib/LmTable/util.js +22 -2
- package/lib/LmTable/virTual/VirtualRow.d.ts +1 -1
- package/lib/LmTable/virTual/VirtualRow.js +81 -48
- package/lib/LmTable/virTual/VirtualTable.js +43 -10
- package/lib/LmTable/virTual/context.js +14 -2
- package/lib/LmUpload/fns/index.js +1 -1
- package/lib/Modal/index.js +10 -3
- package/lib/Radio/index.js +9 -1
- package/lib/Switch/index.js +9 -2
- package/lib/hooks/useEvent/index.js +1 -1
- package/lib/index.d.ts +1 -2
- package/lib/locale-provider/index.js +1 -1
- package/lib/styles/variables.css +129 -6
- package/package.json +3 -5
- package/dist/LmTable/components/sortableItemCol.d.ts +0 -1
- package/es/LmTable/components/sortableItemCol.js +0 -56
- package/lib/LmTable/components/sortableItemCol.js +0 -56
|
@@ -47,43 +47,47 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
47
47
|
}
|
|
48
48
|
return t;
|
|
49
49
|
};
|
|
50
|
-
/* eslint-disable no-unused-vars */
|
|
51
50
|
|
|
52
|
-
|
|
53
|
-
import { PlusCircleOutlined } from '@ant-design/icons';
|
|
54
51
|
import moment from 'moment';
|
|
55
52
|
import { arrayMove } from '@dnd-kit/sortable';
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
53
|
+
import { Checkbox, IconFont, Input, InputNumber, Radio, Select, Table, Switch, DatePicker, Form } from 'linkmore-design';
|
|
54
|
+
import { isFunction, omit, isEqual, pick, isBoolean, isObject, debounce } from 'lodash';
|
|
58
55
|
import React, { forwardRef, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState, memo, useCallback } from 'react';
|
|
59
56
|
import { useControllableValue } from 'ahooks';
|
|
60
57
|
import { produce } from 'immer';
|
|
61
58
|
import DndContainer from './DndContainer';
|
|
62
|
-
import SortableBox from './sortableBox';
|
|
63
59
|
import SortableBoxCol from './sortableBoxCol';
|
|
64
60
|
import SortableItem from './sortableItem';
|
|
65
61
|
import ColSortableItem from './sortableItemCol';
|
|
66
62
|
import DragHandle from './DragHandle';
|
|
67
63
|
import UploadOss from '../UploadOss';
|
|
68
|
-
import { isObjEmpty, deepDataSourcePreKeys, isExpandRow, checkRowKeyByDataSource } from './util';
|
|
69
|
-
import
|
|
64
|
+
import { isObjEmpty, deepDataSourcePreKeys, isExpandRow, checkRowKeyByDataSource, checkMemoShouldUploadSpecialFun, checkExpandIconColumnIndex, checkDataSourceIsEmpty, checkTableRowIsDisable } from './util';
|
|
65
|
+
import { DraggableContainer, BottomOpetateComponent, QuickOpetate, CustomizeRenderEmpty } from './components';
|
|
66
|
+
import cls from 'classnames';
|
|
67
|
+
import ConfigProvider from '../ConfigProvider';
|
|
68
|
+
import { VirtualTable, VirtualWrapper, VirtualRow } from './virtual';
|
|
70
69
|
var UploadBtn = UploadOss.UploadBtn;
|
|
71
70
|
var EditableContext = /*#__PURE__*/React.createContext(null); // 表格行
|
|
72
71
|
|
|
73
72
|
var EditableRow = function EditableRow(_a) {
|
|
74
73
|
var index = _a.index,
|
|
75
|
-
|
|
74
|
+
virtual = _a.virtual,
|
|
75
|
+
props = __rest(_a, ["index", "virtual"]);
|
|
76
76
|
|
|
77
77
|
var _Form$useForm = Form.useForm(),
|
|
78
78
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
79
79
|
form = _Form$useForm2[0];
|
|
80
80
|
|
|
81
|
+
var dataKey = props.dataKey,
|
|
82
|
+
pushAllForm = props.pushAllForm;
|
|
83
|
+
pushAllForm === null || pushAllForm === void 0 ? void 0 : pushAllForm(form, dataKey, index);
|
|
81
84
|
return /*#__PURE__*/React.createElement(Form, {
|
|
82
85
|
form: form,
|
|
86
|
+
disabled: props.disabled || false,
|
|
83
87
|
component: false
|
|
84
88
|
}, /*#__PURE__*/React.createElement(EditableContext.Provider, {
|
|
85
89
|
value: form
|
|
86
|
-
}, /*#__PURE__*/React.createElement("tr", Object.assign({}, props))));
|
|
90
|
+
}, virtual ? /*#__PURE__*/React.createElement(VirtualRow, Object.assign({}, props)) : /*#__PURE__*/React.createElement("tr", Object.assign({}, props))));
|
|
87
91
|
};
|
|
88
92
|
|
|
89
93
|
var EditableSortRow = function EditableSortRow(_a) {
|
|
@@ -94,8 +98,12 @@ var EditableSortRow = function EditableSortRow(_a) {
|
|
|
94
98
|
_Form$useForm4 = _slicedToArray(_Form$useForm3, 1),
|
|
95
99
|
form = _Form$useForm4[0];
|
|
96
100
|
|
|
101
|
+
var dataKey = props.dataKey,
|
|
102
|
+
pushAllForm = props.pushAllForm;
|
|
103
|
+
pushAllForm === null || pushAllForm === void 0 ? void 0 : pushAllForm(form, dataKey, index);
|
|
97
104
|
return /*#__PURE__*/React.createElement(Form, {
|
|
98
105
|
form: form,
|
|
106
|
+
disabled: props.disabled || false,
|
|
99
107
|
component: false
|
|
100
108
|
}, /*#__PURE__*/React.createElement(EditableContext.Provider, {
|
|
101
109
|
value: form
|
|
@@ -226,88 +234,7 @@ var InputRange = function InputRange(_a) {
|
|
|
226
234
|
return handleInput(e, 'next');
|
|
227
235
|
}
|
|
228
236
|
}, editEnum))));
|
|
229
|
-
};
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
var Opetate = function Opetate(_ref) {
|
|
233
|
-
var record = _ref.record,
|
|
234
|
-
rowKey = _ref.rowKey,
|
|
235
|
-
handleAdd = _ref.handleAdd,
|
|
236
|
-
handleDelete = _ref.handleDelete,
|
|
237
|
-
_ref$options = _ref.options,
|
|
238
|
-
options = _ref$options === void 0 ? ['add', 'delete'] : _ref$options,
|
|
239
|
-
getLength = _ref.getLength,
|
|
240
|
-
quickOpetateClearAll = _ref.quickOpetateClearAll;
|
|
241
|
-
|
|
242
|
-
var appendChildren = function appendChildren() {
|
|
243
|
-
handleAdd === null || handleAdd === void 0 ? void 0 : handleAdd(record, true);
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
var appendAdd = function appendAdd() {
|
|
247
|
-
handleAdd === null || handleAdd === void 0 ? void 0 : handleAdd(record);
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
251
|
-
style: {
|
|
252
|
-
display: 'flex',
|
|
253
|
-
alignItems: 'center',
|
|
254
|
-
justifyContent: 'flex-start',
|
|
255
|
-
marginLeft: '-4px'
|
|
256
|
-
}
|
|
257
|
-
}, options.includes('delete') && /*#__PURE__*/React.createElement(Button, {
|
|
258
|
-
type: "link",
|
|
259
|
-
size: "small",
|
|
260
|
-
disabled: !quickOpetateClearAll && getLength < 2,
|
|
261
|
-
icon: /*#__PURE__*/React.createElement(IconFont, {
|
|
262
|
-
type: "lmweb-minus-circle",
|
|
263
|
-
style: {
|
|
264
|
-
fontSize: 16
|
|
265
|
-
}
|
|
266
|
-
}),
|
|
267
|
-
onClick: function onClick() {
|
|
268
|
-
return handleDelete(record[rowKey]);
|
|
269
|
-
}
|
|
270
|
-
}), (options === null || options === void 0 ? void 0 : options.includes('add')) && (options === null || options === void 0 ? void 0 : options.includes('addInChildren')) ? /*#__PURE__*/React.createElement(Popover, {
|
|
271
|
-
placement: "bottom",
|
|
272
|
-
overlayClassName: 'lm_table_append_add_popover',
|
|
273
|
-
open: open,
|
|
274
|
-
title: null,
|
|
275
|
-
content: /*#__PURE__*/React.createElement("ul", null, /*#__PURE__*/React.createElement("li", {
|
|
276
|
-
onClick: appendAdd
|
|
277
|
-
}, "\u6DFB\u52A0\u5E73\u7EA7"), /*#__PURE__*/React.createElement("li", {
|
|
278
|
-
onClick: appendChildren
|
|
279
|
-
}, "\u6DFB\u52A0\u5B50\u7EA7")),
|
|
280
|
-
trigger: "hover"
|
|
281
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
282
|
-
type: "link",
|
|
283
|
-
size: "small",
|
|
284
|
-
icon: /*#__PURE__*/React.createElement(IconFont, {
|
|
285
|
-
type: "lmweb-plus-circle-fill",
|
|
286
|
-
style: {
|
|
287
|
-
fontSize: 16
|
|
288
|
-
}
|
|
289
|
-
})
|
|
290
|
-
})) : (options === null || options === void 0 ? void 0 : options.includes('add')) || (options === null || options === void 0 ? void 0 : options.includes('addInChildren')) ? /*#__PURE__*/React.createElement(Button, {
|
|
291
|
-
type: "link",
|
|
292
|
-
size: "small",
|
|
293
|
-
icon: /*#__PURE__*/React.createElement(IconFont, {
|
|
294
|
-
type: "lmweb-plus-circle-fill",
|
|
295
|
-
style: {
|
|
296
|
-
fontSize: 16
|
|
297
|
-
}
|
|
298
|
-
}),
|
|
299
|
-
onClick: function onClick() {
|
|
300
|
-
return handleAdd(record, (options === null || options === void 0 ? void 0 : options.includes('addInChildren')) ? true : false);
|
|
301
|
-
}
|
|
302
|
-
}) : null);
|
|
303
|
-
}; // const isValidValue = (verifyValue) => {
|
|
304
|
-
// const toStringValue = JSON.stringify(verifyValue);
|
|
305
|
-
// if (verifyValue === undefined || verifyValue === null || verifyValue === '' || toStringValue === '[]' || toStringValue === '{}') {
|
|
306
|
-
// return false;
|
|
307
|
-
// }
|
|
308
|
-
// return true;
|
|
309
|
-
// }
|
|
310
|
-
|
|
237
|
+
};
|
|
311
238
|
/*
|
|
312
239
|
表格单元格
|
|
313
240
|
editEnum: 下拉框时的数据数组(非数组时是配置设置)
|
|
@@ -337,9 +264,8 @@ var EditableCell = function EditableCell(props) {
|
|
|
337
264
|
handleDelete = props.handleDelete,
|
|
338
265
|
handleCopy = props.handleCopy,
|
|
339
266
|
itemProps = props.itemProps,
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
restProps = __rest(props, ["record", "rowKey", "isEdit", "col", "rowIndex", "colIndex", "handleTableRowDelete", "handleTableRowAdd", "quickOpetateClearAll", "getLength", "isHoverEdit", "editEnum", "valueType", "children", "handleSave", "handleAdd", "handleDelete", "handleCopy", "itemProps", "setValid", "reWriteOriginSource"]);
|
|
267
|
+
initialiZindex = props.initialiZindex,
|
|
268
|
+
restProps = __rest(props, ["record", "rowKey", "isEdit", "col", "rowIndex", "colIndex", "handleTableRowDelete", "handleTableRowAdd", "quickOpetateClearAll", "getLength", "isHoverEdit", "editEnum", "valueType", "children", "handleSave", "handleAdd", "handleDelete", "handleCopy", "itemProps", "initialiZindex"]);
|
|
343
269
|
/** 去除移入移出功能,保留最纯粹的功能,优化性能 */
|
|
344
270
|
|
|
345
271
|
|
|
@@ -359,6 +285,12 @@ var EditableCell = function EditableCell(props) {
|
|
|
359
285
|
|
|
360
286
|
var inputRef = useRef(null);
|
|
361
287
|
var form = useContext(EditableContext);
|
|
288
|
+
|
|
289
|
+
var _useState5 = useState(false),
|
|
290
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
291
|
+
hoverStatus = _useState6[0],
|
|
292
|
+
setHoverStatus = _useState6[1];
|
|
293
|
+
|
|
362
294
|
useEffect(function () {
|
|
363
295
|
var _a;
|
|
364
296
|
|
|
@@ -369,13 +301,7 @@ var EditableCell = function EditableCell(props) {
|
|
|
369
301
|
|
|
370
302
|
var toggleEdit = function toggleEdit() {
|
|
371
303
|
setEditing(!editing); // form.setFieldsValue({ [dataIndex]: record[dataIndex] });
|
|
372
|
-
}; //
|
|
373
|
-
// const focusCapturedRef = useRef(false);
|
|
374
|
-
// const curValue = useMemo(() => {
|
|
375
|
-
// return record?.dataIndex
|
|
376
|
-
// }, [record])
|
|
377
|
-
// const curValueIsValid = isValidValue(curValue);
|
|
378
|
-
// 校验保存
|
|
304
|
+
}; // 校验保存
|
|
379
305
|
|
|
380
306
|
|
|
381
307
|
var save = function save(row) {
|
|
@@ -427,13 +353,7 @@ var EditableCell = function EditableCell(props) {
|
|
|
427
353
|
case 13:
|
|
428
354
|
if (col === null || col === void 0 ? void 0 : col.hoverEdit) {
|
|
429
355
|
toggleEdit();
|
|
430
|
-
}
|
|
431
|
-
// setValid((old) => {
|
|
432
|
-
// const obj = { ...old }
|
|
433
|
-
// delete obj[record[rowKey]]
|
|
434
|
-
// return obj
|
|
435
|
-
// })
|
|
436
|
-
|
|
356
|
+
}
|
|
437
357
|
|
|
438
358
|
_context.next = 18;
|
|
439
359
|
break;
|
|
@@ -458,15 +378,14 @@ var EditableCell = function EditableCell(props) {
|
|
|
458
378
|
/** 快捷刷子,把当前的所有列的值,刷成当前的选中的列 */
|
|
459
379
|
|
|
460
380
|
|
|
461
|
-
var copyKey = function copyKey(e) {
|
|
381
|
+
var copyKey = function copyKey(e, type) {
|
|
462
382
|
e === null || e === void 0 ? void 0 : e.stopPropagation();
|
|
463
383
|
var dataIndex = col.dataIndex;
|
|
464
|
-
handleCopy === null || handleCopy === void 0 ? void 0 : handleCopy(dataIndex, record[dataIndex]);
|
|
384
|
+
handleCopy === null || handleCopy === void 0 ? void 0 : handleCopy(dataIndex, record[dataIndex], type, props.rowIndex);
|
|
465
385
|
};
|
|
466
386
|
|
|
467
387
|
var Control = function Control(con) {
|
|
468
|
-
var _a;
|
|
469
|
-
|
|
388
|
+
var _a;
|
|
470
389
|
|
|
471
390
|
var resultComponentProps = isFunction(componentProps) ? componentProps === null || componentProps === void 0 ? void 0 : componentProps(record, col) : componentProps;
|
|
472
391
|
|
|
@@ -476,7 +395,7 @@ var EditableCell = function EditableCell(props) {
|
|
|
476
395
|
});
|
|
477
396
|
}
|
|
478
397
|
|
|
479
|
-
var clearAttrComponentProps = omit(resultComponentProps, ['optionOnly', 'isOnlyValue']);
|
|
398
|
+
var clearAttrComponentProps = omit(resultComponentProps, ['optionOnly', 'isOnlyValue', 'quickcopy']);
|
|
480
399
|
|
|
481
400
|
switch (con) {
|
|
482
401
|
case 'input':
|
|
@@ -497,19 +416,12 @@ var EditableCell = function EditableCell(props) {
|
|
|
497
416
|
noStyle: true
|
|
498
417
|
}, /*#__PURE__*/React.cloneElement(resultComponentProps.addonAfter, {
|
|
499
418
|
onChange: handleFormItemChange
|
|
500
|
-
})) : null,
|
|
501
|
-
suffix: resultComponentProps.quickcopy ? /*#__PURE__*/React.createElement("span", {
|
|
502
|
-
className: 'lm_table_quickcopy'
|
|
503
|
-
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
504
|
-
onClick: copyKey,
|
|
505
|
-
type: 'lmweb-icon_m_brush'
|
|
506
419
|
})) : null
|
|
507
420
|
}));
|
|
508
421
|
|
|
509
422
|
case 'inputRange':
|
|
510
423
|
return /*#__PURE__*/React.createElement(InputRange, Object.assign({
|
|
511
|
-
onChange: handleFormItemChange
|
|
512
|
-
ref: inputRef
|
|
424
|
+
onChange: handleFormItemChange
|
|
513
425
|
}, resultComponentProps, {
|
|
514
426
|
record: record,
|
|
515
427
|
rowIndex: rowIndex,
|
|
@@ -573,8 +485,7 @@ var EditableCell = function EditableCell(props) {
|
|
|
573
485
|
|
|
574
486
|
case 'radio':
|
|
575
487
|
return /*#__PURE__*/React.createElement(Radio, Object.assign({
|
|
576
|
-
onChange: handleFormItemChange
|
|
577
|
-
ref: inputRef
|
|
488
|
+
onChange: handleFormItemChange
|
|
578
489
|
}, clearAttrComponentProps));
|
|
579
490
|
|
|
580
491
|
case 'radioGroup':
|
|
@@ -585,7 +496,7 @@ var EditableCell = function EditableCell(props) {
|
|
|
585
496
|
|
|
586
497
|
case 'switch':
|
|
587
498
|
return /*#__PURE__*/React.createElement(Switch, Object.assign({
|
|
588
|
-
size:
|
|
499
|
+
size: "small"
|
|
589
500
|
}, clearAttrComponentProps, {
|
|
590
501
|
onChange: handleFormItemChange
|
|
591
502
|
}));
|
|
@@ -599,10 +510,9 @@ var EditableCell = function EditableCell(props) {
|
|
|
599
510
|
|
|
600
511
|
case 'operate':
|
|
601
512
|
case 'lm_edit_opetate':
|
|
602
|
-
return /*#__PURE__*/React.createElement(
|
|
513
|
+
return /*#__PURE__*/React.createElement(QuickOpetate, Object.assign({
|
|
603
514
|
record: record,
|
|
604
515
|
rowKey: rowKey,
|
|
605
|
-
ref: inputRef,
|
|
606
516
|
handleAdd: handleTableRowAdd,
|
|
607
517
|
handleDelete: handleTableRowDelete,
|
|
608
518
|
getLength: getLength,
|
|
@@ -616,7 +526,7 @@ var EditableCell = function EditableCell(props) {
|
|
|
616
526
|
var fromData = form.getFieldsValue();
|
|
617
527
|
return render === null || render === void 0 ? void 0 : render(Object.assign(Object.assign({}, !isObjEmpty(fromData) ? Object.assign(Object.assign({}, record), _defineProperty({}, dataIndex, fromData[dataIndex])) : record), {
|
|
618
528
|
onChange: save
|
|
619
|
-
}));
|
|
529
|
+
}), rowIndex);
|
|
620
530
|
}
|
|
621
531
|
|
|
622
532
|
default:
|
|
@@ -648,25 +558,56 @@ var EditableCell = function EditableCell(props) {
|
|
|
648
558
|
onClick: toggleEdit
|
|
649
559
|
}, childNode);
|
|
650
560
|
} else if (isEdit && editable) {
|
|
651
|
-
childNode =
|
|
561
|
+
childNode = isExpandRow(childNode) ? /*#__PURE__*/React.createElement("div", {
|
|
562
|
+
style: {
|
|
563
|
+
display: 'flex',
|
|
564
|
+
flexDirection: 'row',
|
|
565
|
+
flexWrap: 'nowrap'
|
|
566
|
+
}
|
|
567
|
+
}, isExpandRow(childNode) && childNode[0], /*#__PURE__*/React.createElement(Form.Item, Object.assign({
|
|
652
568
|
errorPlacement: "right",
|
|
653
569
|
valuePropName: editable === 'switch' ? 'checked' : 'value',
|
|
654
570
|
style: {
|
|
655
571
|
margin: 0
|
|
656
|
-
}
|
|
572
|
+
},
|
|
573
|
+
noStyle: formProps ? false : true
|
|
574
|
+
}, formProps, {
|
|
575
|
+
name: dataIndex
|
|
576
|
+
}), Control(editable))) : /*#__PURE__*/React.createElement(Form.Item, Object.assign({
|
|
577
|
+
errorPlacement: "right",
|
|
578
|
+
valuePropName: editable === 'switch' ? 'checked' : 'value',
|
|
579
|
+
style: {
|
|
580
|
+
margin: 0
|
|
581
|
+
},
|
|
582
|
+
noStyle: formProps ? false : true
|
|
657
583
|
}, formProps, {
|
|
658
584
|
name: dataIndex
|
|
659
|
-
}), Control(editable))
|
|
585
|
+
}), Control(editable));
|
|
660
586
|
|
|
661
587
|
if (editable === 'input' && ((resultComponentProps === null || resultComponentProps === void 0 ? void 0 : resultComponentProps.addonBefore) || (resultComponentProps === null || resultComponentProps === void 0 ? void 0 : resultComponentProps.addonAfter))) {
|
|
662
|
-
childNode =
|
|
588
|
+
childNode = isExpandRow(childNode) ? /*#__PURE__*/React.createElement("div", {
|
|
589
|
+
style: {
|
|
590
|
+
display: 'flex',
|
|
591
|
+
flexDirection: 'row',
|
|
592
|
+
flexWrap: 'nowrap'
|
|
593
|
+
}
|
|
594
|
+
}, isExpandRow(childNode) && childNode[0], /*#__PURE__*/React.createElement(Form.Item, Object.assign({
|
|
595
|
+
errorPlacement: "right",
|
|
596
|
+
style: {
|
|
597
|
+
margin: 0
|
|
598
|
+
}
|
|
599
|
+
}, formProps, {
|
|
600
|
+
noStyle: formProps ? false : true,
|
|
601
|
+
name: [dataIndex, 'value']
|
|
602
|
+
}), Control(editable))) : /*#__PURE__*/React.createElement(Form.Item, Object.assign({
|
|
663
603
|
errorPlacement: "right",
|
|
664
604
|
style: {
|
|
665
605
|
margin: 0
|
|
666
606
|
}
|
|
667
607
|
}, formProps, {
|
|
608
|
+
noStyle: formProps ? false : true,
|
|
668
609
|
name: [dataIndex, 'value']
|
|
669
|
-
}), Control(editable))
|
|
610
|
+
}), Control(editable));
|
|
670
611
|
}
|
|
671
612
|
} else if (!isEdit && (componentProps === null || componentProps === void 0 ? void 0 : componentProps.options)) {
|
|
672
613
|
return ((_b = (_a = componentProps === null || componentProps === void 0 ? void 0 : componentProps.options) === null || _a === void 0 ? void 0 : _a.find(function (item) {
|
|
@@ -675,31 +616,71 @@ var EditableCell = function EditableCell(props) {
|
|
|
675
616
|
}
|
|
676
617
|
|
|
677
618
|
return childNode;
|
|
678
|
-
}, [col, isEdit, editing, getLength]); //
|
|
679
|
-
// 出现死循环找我
|
|
619
|
+
}, [col, isEdit, editing, getLength, record]); // 出现死循环找我
|
|
680
620
|
|
|
681
621
|
useEffect(function () {
|
|
682
622
|
var editable = col.editable,
|
|
683
623
|
dataIndex = col.dataIndex;
|
|
684
624
|
|
|
685
625
|
if (isEdit && editable) {
|
|
686
|
-
form.setFieldsValue(_defineProperty({}, dataIndex, editable === 'date' ? moment(record[dataIndex]) : record[dataIndex]));
|
|
687
|
-
}
|
|
688
|
-
// (isEdit && editable && record[dataIndex]) ||
|
|
689
|
-
// (isHoverEdit && editable && record[dataIndex])
|
|
690
|
-
// ) {
|
|
691
|
-
// form.setFieldsValue({
|
|
692
|
-
// [dataIndex]: editable === 'date' ? moment(record[dataIndex]) : record[dataIndex],
|
|
693
|
-
// })
|
|
694
|
-
// }
|
|
695
|
-
|
|
626
|
+
form.setFieldsValue(_defineProperty({}, dataIndex, editable === 'date' && record[dataIndex] ? moment(record[dataIndex]) : record[dataIndex]));
|
|
627
|
+
}
|
|
696
628
|
}, [record]);
|
|
629
|
+
|
|
630
|
+
var handleTdHover = function handleTdHover() {
|
|
631
|
+
setHoverStatus(true);
|
|
632
|
+
};
|
|
633
|
+
|
|
634
|
+
var handleTdMouseOut = function handleTdMouseOut() {
|
|
635
|
+
setHoverStatus(false);
|
|
636
|
+
};
|
|
637
|
+
|
|
697
638
|
return /*#__PURE__*/React.createElement("td", Object.assign({}, omit(clearProps, ['dataIndex']), {
|
|
698
639
|
className: cls(clearProps === null || clearProps === void 0 ? void 0 : clearProps.className, 'lm_custom_cell_td'),
|
|
640
|
+
onMouseEnter: componentProps.quickcopy ? handleTdHover : undefined,
|
|
641
|
+
onMouseLeave: componentProps.quickcopy ? handleTdMouseOut : undefined,
|
|
642
|
+
style: (col === null || col === void 0 ? void 0 : col.fixed) ? {
|
|
643
|
+
zIndex: (initialiZindex || 0) - (Number(col === null || col === void 0 ? void 0 : col.order) || 0)
|
|
644
|
+
} : Object.assign({}, clearProps === null || clearProps === void 0 ? void 0 : clearProps.style),
|
|
699
645
|
key: "r".concat(rowIndex, "_c").concat(colIndex)
|
|
700
|
-
}),
|
|
646
|
+
}), hoverStatus && props.rowIndex > 0 && /*#__PURE__*/React.createElement("span", {
|
|
647
|
+
className: 'quick_copy_warp quick_copy_up',
|
|
648
|
+
onClick: function onClick(e) {
|
|
649
|
+
return copyKey(e, 'up');
|
|
650
|
+
}
|
|
651
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
652
|
+
type: 'lmweb-icon_up'
|
|
653
|
+
})), getMemoChildNode, hoverStatus && props.rowIndex < props.getLength - 1 && /*#__PURE__*/React.createElement("span", {
|
|
654
|
+
className: 'quick_copy_warp quick_copy_down',
|
|
655
|
+
onClick: function onClick(e) {
|
|
656
|
+
return copyKey(e, 'down');
|
|
657
|
+
}
|
|
658
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
659
|
+
type: 'lmweb-icon_down'
|
|
660
|
+
})));
|
|
701
661
|
};
|
|
662
|
+
/** true 不刷新, false 刷新 */
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
var MemoEditableCell = /*#__PURE__*/memo(EditableCell, function (prev, next) {
|
|
666
|
+
var pickProps = ['record', 'colIndex'];
|
|
667
|
+
var p = pick(prev, pickProps);
|
|
668
|
+
var n = pick(next, pickProps);
|
|
669
|
+
|
|
670
|
+
if (next === null || next === void 0 ? void 0 : next.shouldUpdate) {
|
|
671
|
+
return false;
|
|
672
|
+
} // console.log(!checkMemoShouldUploadSpecialFun(prev, next), isEqual(p, n), '22', prev.record, next.record)
|
|
673
|
+
// console.log('333', checkMemoShouldUploadSpecialFun(prev, next), isEqual(p, n))
|
|
702
674
|
|
|
675
|
+
/** TODO: 在record中带有children,子列表数据修改之后,会导致父级的record对比不一样 */
|
|
676
|
+
|
|
677
|
+
|
|
678
|
+
if (!checkMemoShouldUploadSpecialFun(prev, next)) {
|
|
679
|
+
return false;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
return isEqual(p, n);
|
|
683
|
+
});
|
|
703
684
|
var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
704
685
|
var _a, _b;
|
|
705
686
|
|
|
@@ -719,16 +700,26 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
719
700
|
_props$quickOpetateCl = props.quickOpetateClearAll,
|
|
720
701
|
quickOpetateClearAll = _props$quickOpetateCl === void 0 ? true : _props$quickOpetateCl,
|
|
721
702
|
rowSelection = props.rowSelection,
|
|
703
|
+
rowDisabled = props.rowDisabled,
|
|
704
|
+
virtual = props.virtual,
|
|
722
705
|
sortOpen = props.sortOpen,
|
|
706
|
+
disabled = props.disabled,
|
|
723
707
|
colSortOpen = props.colSortOpen,
|
|
708
|
+
_props$indexCol = props.indexCol,
|
|
709
|
+
indexCol = _props$indexCol === void 0 ? false : _props$indexCol,
|
|
724
710
|
filterChange = props.filterChange,
|
|
725
711
|
_props$size = props.size,
|
|
726
712
|
size = _props$size === void 0 ? 'small' : _props$size,
|
|
727
713
|
recordCreatorProps = props.recordCreatorProps,
|
|
728
714
|
_props$shouldUpdate = props.shouldUpdate,
|
|
729
715
|
shouldUpdate = _props$shouldUpdate === void 0 ? false : _props$shouldUpdate,
|
|
730
|
-
|
|
731
|
-
|
|
716
|
+
_props$loading = props.loading,
|
|
717
|
+
loading = _props$loading === void 0 ? false : _props$loading,
|
|
718
|
+
_props$autoSizer = props.autoSizer,
|
|
719
|
+
autoSizer = _props$autoSizer === void 0 ? false : _props$autoSizer,
|
|
720
|
+
_props$initialiZindex = props.initialiZindex,
|
|
721
|
+
initialiZindex = _props$initialiZindex === void 0 ? 100 : _props$initialiZindex,
|
|
722
|
+
resetProps = __rest(props, ["value", "columns", "isEdit", "isAdd", "onChange", "rowKey", "rowHoverEdit", "isUseForm", "isHoverEdit", "useQuickOpetate", "quickOpetateClearAll", "rowSelection", "rowDisabled", "virtual", "sortOpen", "disabled", "colSortOpen", "indexCol", "filterChange", "size", "recordCreatorProps", "shouldUpdate", "loading", "autoSizer", "initialiZindex"]);
|
|
732
723
|
|
|
733
724
|
var _useControllableValue = useControllableValue({
|
|
734
725
|
value: checkRowKeyByDataSource(props.value, _rowKey),
|
|
@@ -736,14 +727,7 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
736
727
|
}),
|
|
737
728
|
_useControllableValue2 = _slicedToArray(_useControllableValue, 2),
|
|
738
729
|
dataSource = _useControllableValue2[0],
|
|
739
|
-
setDataSource = _useControllableValue2[1];
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
var _useState5 = useState({}),
|
|
743
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
744
|
-
_valid = _useState6[0],
|
|
745
|
-
setValid = _useState6[1]; // const [localRowSelectList, setLocalRowSelectList] = useState([])
|
|
746
|
-
|
|
730
|
+
setDataSource = _useControllableValue2[1];
|
|
747
731
|
|
|
748
732
|
var transformRowSelect = function transformRowSelect(selectedRowKeys, selectedRows, info) {
|
|
749
733
|
var _a;
|
|
@@ -761,42 +745,44 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
761
745
|
localRowSelectList = _useControllableValue4[0],
|
|
762
746
|
setLocalRowSelectList = _useControllableValue4[1];
|
|
763
747
|
|
|
764
|
-
var
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
773
|
-
expandedRowKeys = _useState10[0],
|
|
774
|
-
setExpandedRowKeys = _useState10[1];
|
|
775
|
-
|
|
776
|
-
var dataSourceRef = useRef([]);
|
|
777
|
-
var sortDataSorceRef = useRef([]);
|
|
778
|
-
var deepDataSourceRef = useRef([]);
|
|
748
|
+
var _useControllableValue5 = useControllableValue({
|
|
749
|
+
value: {
|
|
750
|
+
disabledRows: (rowDisabled === null || rowDisabled === void 0 ? void 0 : rowDisabled.disabledRows) || []
|
|
751
|
+
}
|
|
752
|
+
}),
|
|
753
|
+
_useControllableValue6 = _slicedToArray(_useControllableValue5, 1),
|
|
754
|
+
localDisabledRows = _useControllableValue6[0];
|
|
755
|
+
/** TODO: 当前展开的列 */
|
|
779
756
|
|
|
780
|
-
var onSortEnd = function onSortEnd(active, over) {
|
|
781
|
-
var cloneArr = _toConsumableArray(dataSourceRef.current);
|
|
782
757
|
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
758
|
+
var _useState7 = useState([]),
|
|
759
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
760
|
+
expandedRowKeys = _useState8[0],
|
|
761
|
+
setExpandedRowKeys = _useState8[1];
|
|
762
|
+
|
|
763
|
+
var dataSourceRef = useRef(dataSource);
|
|
764
|
+
var deepDataSourceRef = useRef(deepDataSourcePreKeys(dataSource, _rowKey));
|
|
765
|
+
dataSourceRef.current = dataSource;
|
|
766
|
+
deepDataSourceRef.current = deepDataSourcePreKeys(dataSource, _rowKey);
|
|
767
|
+
var disabledDataSourceRowKeys = useRef(checkTableRowIsDisable(deepDataSourceRef.current, localDisabledRows.disabledRows, _rowKey));
|
|
768
|
+
disabledDataSourceRowKeys.current = checkTableRowIsDisable(deepDataSourceRef.current, localDisabledRows.disabledRows, _rowKey);
|
|
769
|
+
var tableWarpRef = useRef(null);
|
|
770
|
+
var autoSizerRef = useRef(null);
|
|
771
|
+
var allFormListRef = useRef({});
|
|
772
|
+
var scrollToIndexRef = useRef(null);
|
|
773
|
+
|
|
774
|
+
var _Form$useForm5 = Form.useForm(),
|
|
775
|
+
_Form$useForm6 = _slicedToArray(_Form$useForm5, 1),
|
|
776
|
+
checkForm = _Form$useForm6[0];
|
|
791
777
|
|
|
792
778
|
var onColSortEnd = function onColSortEnd(active, over) {
|
|
793
779
|
var _a;
|
|
794
780
|
|
|
795
781
|
var oldIndex = columns.findIndex(function (item) {
|
|
796
|
-
return item
|
|
782
|
+
return item.dataIndex === active;
|
|
797
783
|
});
|
|
798
784
|
var newIndex = columns.findIndex(function (item) {
|
|
799
|
-
return item
|
|
785
|
+
return item.dataIndex === over;
|
|
800
786
|
});
|
|
801
787
|
filterChange === null || filterChange === void 0 ? void 0 : filterChange((_a = arrayMove(columns, oldIndex, newIndex)) === null || _a === void 0 ? void 0 : _a.map(function (item, index) {
|
|
802
788
|
return Object.assign(Object.assign({}, item), {
|
|
@@ -809,146 +795,39 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
809
795
|
var handleDelete = function handleDelete(key) {
|
|
810
796
|
var nValue = dataSource.filter(function (item) {
|
|
811
797
|
return item[_rowKey] !== key;
|
|
812
|
-
});
|
|
813
|
-
|
|
798
|
+
});
|
|
814
799
|
setDataSource(nValue);
|
|
815
800
|
};
|
|
816
|
-
/**
|
|
801
|
+
/** 点击底部添加按钮添加 */
|
|
817
802
|
|
|
818
803
|
|
|
819
|
-
var handleAdd = function
|
|
804
|
+
var handleAdd = debounce(function (row) {
|
|
820
805
|
var _a;
|
|
821
806
|
|
|
822
807
|
var addDataInfo = isFunction(recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.initData) ? (_a = recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.initData) === null || _a === void 0 ? void 0 : _a.call(recordCreatorProps) : recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.initData;
|
|
823
808
|
var res = produce(dataSourceRef.current, function (draft) {
|
|
824
809
|
draft.push(Object.assign(_defineProperty({}, _rowKey, "".concat(Date.now())), addDataInfo || {}));
|
|
825
810
|
});
|
|
826
|
-
setDataSource(res); // onChange?.(res)
|
|
827
|
-
};
|
|
828
|
-
|
|
829
|
-
useEffect(function () {
|
|
830
|
-
var _a;
|
|
831
|
-
|
|
832
|
-
dataSourceRef.current = dataSource;
|
|
833
|
-
deepDataSourceRef.current = deepDataSourcePreKeys(dataSource, _rowKey);
|
|
834
|
-
|
|
835
|
-
if (sortOpen) {
|
|
836
|
-
var dataSourceKeys = dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
|
|
837
|
-
return item[_rowKey];
|
|
838
|
-
}).join(',');
|
|
839
|
-
var setCallBackFalgKeys = ((_a = sortDataSorceRef.current) === null || _a === void 0 ? void 0 : _a.map(function (item) {
|
|
840
|
-
return item[_rowKey];
|
|
841
|
-
}).join(',')) || '';
|
|
842
|
-
|
|
843
|
-
if (dataSourceKeys !== setCallBackFalgKeys) {
|
|
844
|
-
setCallBackFalg(dataSource);
|
|
845
|
-
sortDataSorceRef.current = dataSource;
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
}, [dataSource]); // /** 本地缓存一个选择数据 */
|
|
849
|
-
// useEffect(() => {
|
|
850
|
-
// if (rowSelection) {
|
|
851
|
-
// const { selectedRowKeys } = rowSelection
|
|
852
|
-
// if (selectedRowKeys) {
|
|
853
|
-
// setLocalRowSelectList(localRowSelectList || [])
|
|
854
|
-
// }
|
|
855
|
-
// }
|
|
856
|
-
// }, [rowSelection])
|
|
857
|
-
// const editTableRowChange = (selectRows) => {
|
|
858
|
-
// setLocalRowSelectList(selectRows);
|
|
859
|
-
// // (rowSelection?.onChange as any)?.(selectRows)
|
|
860
|
-
// }
|
|
861
|
-
|
|
862
|
-
var handleSave = function handleSave(row, options) {
|
|
863
|
-
var _a, _b;
|
|
864
|
-
|
|
865
|
-
var preKeys = (_b = (_a = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : deepDataSourceRef.current) === null || _a === void 0 ? void 0 : _a[row[_rowKey]]) === null || _b === void 0 ? void 0 : _b.preKeys;
|
|
866
|
-
var res = produce(dataSourceRef.current, function (draft) {
|
|
867
|
-
if (options === null || options === void 0 ? void 0 : options.only) {
|
|
868
|
-
var _ref2 = options === null || options === void 0 ? void 0 : options.only,
|
|
869
|
-
key = _ref2.key,
|
|
870
|
-
value = _ref2.value;
|
|
871
|
-
|
|
872
|
-
if ((preKeys === null || preKeys === void 0 ? void 0 : preKeys.length) > 1) {
|
|
873
|
-
var deeps = function deeps(children) {
|
|
874
|
-
children === null || children === void 0 ? void 0 : children.forEach(function (item) {
|
|
875
|
-
var _a;
|
|
876
|
-
|
|
877
|
-
if (preKeys.includes(item[_rowKey])) {
|
|
878
|
-
if (item[_rowKey] === row[_rowKey]) {
|
|
879
|
-
children === null || children === void 0 ? void 0 : children.forEach(function (c) {
|
|
880
|
-
c[key] = value;
|
|
881
|
-
});
|
|
882
|
-
(_a = Object.keys(item)) === null || _a === void 0 ? void 0 : _a.forEach(function (v) {
|
|
883
|
-
item[v] = row[v] || item[v];
|
|
884
|
-
});
|
|
885
|
-
} else if (item.children) {
|
|
886
|
-
deeps(item.children);
|
|
887
|
-
}
|
|
888
|
-
}
|
|
889
|
-
});
|
|
890
|
-
};
|
|
891
|
-
|
|
892
|
-
deeps(draft);
|
|
893
|
-
} else {
|
|
894
|
-
draft === null || draft === void 0 ? void 0 : draft.forEach(function (item, index) {
|
|
895
|
-
if (row[_rowKey] === item[_rowKey]) {
|
|
896
|
-
draft[index] = row;
|
|
897
|
-
} else {
|
|
898
|
-
draft[index][key] = value;
|
|
899
|
-
}
|
|
900
|
-
});
|
|
901
|
-
}
|
|
902
|
-
} else {
|
|
903
|
-
if ((preKeys === null || preKeys === void 0 ? void 0 : preKeys.length) > 1) {
|
|
904
|
-
var _deeps = function _deeps(children) {
|
|
905
|
-
children === null || children === void 0 ? void 0 : children.forEach(function (item) {
|
|
906
|
-
var _a;
|
|
907
|
-
|
|
908
|
-
if (preKeys.includes(item[_rowKey])) {
|
|
909
|
-
if (item[_rowKey] === row[_rowKey]) {
|
|
910
|
-
(_a = Object.keys(row)) === null || _a === void 0 ? void 0 : _a.forEach(function (v) {
|
|
911
|
-
item[v] = row[v] || item[v];
|
|
912
|
-
});
|
|
913
|
-
} else if (item.children) {
|
|
914
|
-
_deeps(item.children);
|
|
915
|
-
}
|
|
916
|
-
}
|
|
917
|
-
});
|
|
918
|
-
};
|
|
919
|
-
|
|
920
|
-
_deeps(draft);
|
|
921
|
-
} else {
|
|
922
|
-
var index = draft.findIndex(function (item) {
|
|
923
|
-
return row[_rowKey] === item[_rowKey];
|
|
924
|
-
});
|
|
925
|
-
|
|
926
|
-
if (index !== -1) {
|
|
927
|
-
draft[index] = row;
|
|
928
|
-
}
|
|
929
|
-
}
|
|
930
|
-
}
|
|
931
|
-
});
|
|
932
811
|
setDataSource(res);
|
|
933
|
-
};
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
});
|
|
945
|
-
}; // @ts-ignore
|
|
812
|
+
}, 40); // const reWriteOriginSource = (rowKey: string, rowValue, dataIndex: number, nextValue) => {
|
|
813
|
+
// setDataSource((prevDataSource) => {
|
|
814
|
+
// return prevDataSource?.map((item) => {
|
|
815
|
+
// if (get(item, rowKey) === rowValue) {
|
|
816
|
+
// set(item, dataIndex, nextValue)
|
|
817
|
+
// }
|
|
818
|
+
// return item
|
|
819
|
+
// })
|
|
820
|
+
// })
|
|
821
|
+
// }
|
|
822
|
+
// @ts-ignore
|
|
946
823
|
|
|
824
|
+
/** 删除当前行 */
|
|
947
825
|
|
|
948
|
-
var handleTableRowDelete = function
|
|
826
|
+
var handleTableRowDelete = debounce(function (key) {
|
|
949
827
|
var _a, _b, _c;
|
|
950
828
|
|
|
951
|
-
var
|
|
829
|
+
var rkey = isObject(key) ? key[_rowKey] : key;
|
|
830
|
+
var preKeys = (_b = (_a = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : deepDataSourceRef.current) === null || _a === void 0 ? void 0 : _a[rkey]) === null || _b === void 0 ? void 0 : _b.preKeys;
|
|
952
831
|
|
|
953
832
|
if (preKeys.length > 1) {
|
|
954
833
|
/** 说明删除的是children中的数据 */
|
|
@@ -969,7 +848,7 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
969
848
|
return newData;
|
|
970
849
|
};
|
|
971
850
|
|
|
972
|
-
var res = filter(
|
|
851
|
+
var res = filter(dataSourceRef.current, key);
|
|
973
852
|
setDataSource(res);
|
|
974
853
|
} else {
|
|
975
854
|
if (((_c = dataSourceRef.current) === null || _c === void 0 ? void 0 : _c.length) === 1 && !quickOpetateClearAll) {
|
|
@@ -988,34 +867,76 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
988
867
|
|
|
989
868
|
setDataSource(_res);
|
|
990
869
|
}
|
|
991
|
-
};
|
|
992
|
-
/** 快捷添加 */
|
|
993
870
|
|
|
871
|
+
return null;
|
|
872
|
+
}, 40);
|
|
873
|
+
/** 替换当前行 */
|
|
874
|
+
|
|
875
|
+
var handleTableRowReplace = debounce(function (record, defaultRecord) {
|
|
876
|
+
var _a, _b;
|
|
877
|
+
|
|
878
|
+
var rkey = isObject(record) ? record[_rowKey] : record;
|
|
879
|
+
var preKeys = (_b = (_a = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : deepDataSourceRef.current) === null || _a === void 0 ? void 0 : _a[rkey]) === null || _b === void 0 ? void 0 : _b.preKeys; // const res = cloneDeep(dataSourceRef.current)
|
|
880
|
+
|
|
881
|
+
var deep = function deep(children) {
|
|
882
|
+
return children.map(function (item) {
|
|
883
|
+
if (item[_rowKey] === rkey) {
|
|
884
|
+
return defaultRecord;
|
|
885
|
+
} else if (preKeys.includes(item[_rowKey]) && item.children) {
|
|
886
|
+
var child = deep(item.children);
|
|
887
|
+
return Object.assign(Object.assign({}, item), {
|
|
888
|
+
children: child
|
|
889
|
+
});
|
|
890
|
+
} else {
|
|
891
|
+
return item;
|
|
892
|
+
}
|
|
893
|
+
});
|
|
894
|
+
};
|
|
895
|
+
|
|
896
|
+
var res = deep(dataSourceRef.current);
|
|
897
|
+
setDataSource(res);
|
|
898
|
+
}, 20);
|
|
899
|
+
/** 快捷添加 */
|
|
994
900
|
|
|
995
|
-
var handleTableRowAdd = function
|
|
901
|
+
var handleTableRowAdd = debounce(function (record, isAppendInChindren, defaultRecord) {
|
|
996
902
|
var _a, _b;
|
|
997
903
|
|
|
998
|
-
var
|
|
904
|
+
var rkey = isObject(record) ? record[_rowKey] : record;
|
|
905
|
+
var preKeys = (_b = (_a = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : deepDataSourceRef.current) === null || _a === void 0 ? void 0 : _a[rkey]) === null || _b === void 0 ? void 0 : _b.preKeys;
|
|
999
906
|
var res = produce(dataSourceRef.current, function (draft) {
|
|
1000
|
-
var _a, _b, _c, _d;
|
|
907
|
+
var _a, _b, _c, _d, _e;
|
|
1001
908
|
|
|
1002
|
-
if (preKeys.length > 1) {
|
|
909
|
+
if ((preKeys === null || preKeys === void 0 ? void 0 : preKeys.length) > 1) {
|
|
1003
910
|
var deeps = function deeps(children) {
|
|
1004
911
|
children === null || children === void 0 ? void 0 : children.forEach(function (item, index) {
|
|
1005
|
-
var _a;
|
|
912
|
+
var _a, _b;
|
|
1006
913
|
|
|
1007
914
|
if (preKeys === null || preKeys === void 0 ? void 0 : preKeys.includes(item[_rowKey])) {
|
|
1008
|
-
if (item[_rowKey] ===
|
|
915
|
+
if (item[_rowKey] === rkey) {
|
|
1009
916
|
if (isAppendInChindren) {
|
|
1010
917
|
if (item === null || item === void 0 ? void 0 : item.children) {
|
|
1011
|
-
|
|
918
|
+
if (Array.isArray(defaultRecord)) {
|
|
919
|
+
var _a2;
|
|
920
|
+
|
|
921
|
+
(_a = item === null || item === void 0 ? void 0 : item.children) === null || _a === void 0 ? void 0 : (_a2 = _a).push.apply(_a2, _toConsumableArray(defaultRecord));
|
|
922
|
+
} else {
|
|
923
|
+
(_b = item === null || item === void 0 ? void 0 : item.children) === null || _b === void 0 ? void 0 : _b.push(defaultRecord || _defineProperty({}, _rowKey, "".concat(Date.now())));
|
|
924
|
+
}
|
|
1012
925
|
} else {
|
|
1013
|
-
|
|
926
|
+
if (Array.isArray(defaultRecord)) {
|
|
927
|
+
item.children = _toConsumableArray(defaultRecord);
|
|
928
|
+
} else {
|
|
929
|
+
item.children = [defaultRecord || _defineProperty({}, _rowKey, "".concat(Date.now()))];
|
|
930
|
+
}
|
|
1014
931
|
}
|
|
1015
932
|
|
|
1016
933
|
!expandedRowKeys.includes(item[_rowKey]) && setExpandedRowKeys([].concat(_toConsumableArray(expandedRowKeys), [item[_rowKey]]));
|
|
1017
934
|
} else {
|
|
1018
|
-
|
|
935
|
+
if (Array.isArray(defaultRecord)) {
|
|
936
|
+
children.splice.apply(children, [index + 1, 0].concat(_toConsumableArray(defaultRecord)));
|
|
937
|
+
} else {
|
|
938
|
+
children.splice(index + 1, 0, defaultRecord || _defineProperty({}, _rowKey, "".concat(Date.now())));
|
|
939
|
+
}
|
|
1019
940
|
}
|
|
1020
941
|
} else if (item.children) {
|
|
1021
942
|
deeps(item.children);
|
|
@@ -1027,31 +948,123 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
1027
948
|
deeps(draft);
|
|
1028
949
|
} else {
|
|
1029
950
|
var index = draft.findIndex(function (item) {
|
|
1030
|
-
return
|
|
951
|
+
return rkey === item[_rowKey];
|
|
1031
952
|
});
|
|
1032
953
|
|
|
1033
954
|
if (index !== -1) {
|
|
1034
955
|
if (isAppendInChindren) {
|
|
1035
956
|
if ((_a = draft[index].children) === null || _a === void 0 ? void 0 : _a.length) {
|
|
1036
|
-
|
|
957
|
+
if (Array.isArray(defaultRecord)) {
|
|
958
|
+
var _b2;
|
|
959
|
+
|
|
960
|
+
(_b = draft[index].children) === null || _b === void 0 ? void 0 : (_b2 = _b).push.apply(_b2, _toConsumableArray(defaultRecord));
|
|
961
|
+
} else {
|
|
962
|
+
(_c = draft[index].children) === null || _c === void 0 ? void 0 : _c.push(defaultRecord || _defineProperty({}, _rowKey, "".concat(Date.now())));
|
|
963
|
+
}
|
|
1037
964
|
} else {
|
|
1038
|
-
draft[index].children = [_defineProperty({}, _rowKey, "".concat(Date.now()))];
|
|
965
|
+
draft[index].children = Array.isArray(defaultRecord) ? _toConsumableArray(defaultRecord) : [defaultRecord || _defineProperty({}, _rowKey, "".concat(Date.now()))];
|
|
1039
966
|
}
|
|
1040
967
|
|
|
1041
|
-
!expandedRowKeys.includes((
|
|
968
|
+
!expandedRowKeys.includes((_d = draft[index]) === null || _d === void 0 ? void 0 : _d[_rowKey]) && setExpandedRowKeys([].concat(_toConsumableArray(expandedRowKeys), [(_e = draft[index]) === null || _e === void 0 ? void 0 : _e[_rowKey]]));
|
|
1042
969
|
} else {
|
|
1043
|
-
|
|
970
|
+
if (Array.isArray(defaultRecord)) {
|
|
971
|
+
draft.splice.apply(draft, [index + 1, 0].concat(_toConsumableArray(defaultRecord)));
|
|
972
|
+
} else {
|
|
973
|
+
draft.splice(index + 1, 0, defaultRecord || _defineProperty({}, _rowKey, "".concat(Date.now())));
|
|
974
|
+
}
|
|
1044
975
|
}
|
|
1045
976
|
}
|
|
1046
977
|
}
|
|
1047
978
|
});
|
|
1048
979
|
setDataSource(res);
|
|
980
|
+
}, 50);
|
|
981
|
+
|
|
982
|
+
var handleSave = function handleSave(row, options) {
|
|
983
|
+
var _a, _b;
|
|
984
|
+
|
|
985
|
+
var preKeys = (_b = (_a = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : deepDataSourceRef.current) === null || _a === void 0 ? void 0 : _a[row[_rowKey]]) === null || _b === void 0 ? void 0 : _b.preKeys;
|
|
986
|
+
|
|
987
|
+
if (options === null || options === void 0 ? void 0 : options.only) {
|
|
988
|
+
var res = produce(dataSourceRef.current, function (draft) {
|
|
989
|
+
if (options === null || options === void 0 ? void 0 : options.only) {
|
|
990
|
+
var _ref7 = options === null || options === void 0 ? void 0 : options.only,
|
|
991
|
+
key = _ref7.key,
|
|
992
|
+
value = _ref7.value;
|
|
993
|
+
|
|
994
|
+
if ((preKeys === null || preKeys === void 0 ? void 0 : preKeys.length) > 1) {
|
|
995
|
+
var deeps = function deeps(children) {
|
|
996
|
+
children === null || children === void 0 ? void 0 : children.forEach(function (item) {
|
|
997
|
+
var _a;
|
|
998
|
+
|
|
999
|
+
if (preKeys.includes(item[_rowKey])) {
|
|
1000
|
+
if (item[_rowKey] === row[_rowKey]) {
|
|
1001
|
+
children === null || children === void 0 ? void 0 : children.forEach(function (c) {
|
|
1002
|
+
c[key] = value;
|
|
1003
|
+
});
|
|
1004
|
+
(_a = Object.keys(item)) === null || _a === void 0 ? void 0 : _a.forEach(function (v) {
|
|
1005
|
+
item[v] = row[v] || item[v];
|
|
1006
|
+
});
|
|
1007
|
+
} else if (item.children) {
|
|
1008
|
+
deeps(item.children);
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
});
|
|
1012
|
+
};
|
|
1013
|
+
|
|
1014
|
+
deeps(draft);
|
|
1015
|
+
} else {
|
|
1016
|
+
draft === null || draft === void 0 ? void 0 : draft.forEach(function (item, index) {
|
|
1017
|
+
if (row[_rowKey] === item[_rowKey]) {
|
|
1018
|
+
draft[index] = row;
|
|
1019
|
+
} else {
|
|
1020
|
+
draft[index][key] = value;
|
|
1021
|
+
}
|
|
1022
|
+
});
|
|
1023
|
+
}
|
|
1024
|
+
} else {
|
|
1025
|
+
if ((preKeys === null || preKeys === void 0 ? void 0 : preKeys.length) > 1) {
|
|
1026
|
+
var _deeps = function _deeps(children) {
|
|
1027
|
+
children === null || children === void 0 ? void 0 : children.forEach(function (item) {
|
|
1028
|
+
var _a;
|
|
1029
|
+
|
|
1030
|
+
if (preKeys.includes(item[_rowKey])) {
|
|
1031
|
+
if (item[_rowKey] === row[_rowKey]) {
|
|
1032
|
+
(_a = Object.keys(row)) === null || _a === void 0 ? void 0 : _a.forEach(function (v) {
|
|
1033
|
+
item[v] = row[v] || item[v];
|
|
1034
|
+
});
|
|
1035
|
+
} else if (item.children) {
|
|
1036
|
+
_deeps(item.children);
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
});
|
|
1040
|
+
};
|
|
1041
|
+
|
|
1042
|
+
_deeps(draft);
|
|
1043
|
+
} else {
|
|
1044
|
+
var index = draft.findIndex(function (item) {
|
|
1045
|
+
return row[_rowKey] === item[_rowKey];
|
|
1046
|
+
});
|
|
1047
|
+
|
|
1048
|
+
if (index !== -1) {
|
|
1049
|
+
draft[index] = row;
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
});
|
|
1054
|
+
setDataSource(res);
|
|
1055
|
+
} else {
|
|
1056
|
+
handleTableRowReplace(row[_rowKey], row);
|
|
1057
|
+
}
|
|
1049
1058
|
};
|
|
1059
|
+
/** 快捷刷子功能 */
|
|
1060
|
+
|
|
1050
1061
|
|
|
1051
|
-
var handleCopy = function handleCopy(key, value) {
|
|
1062
|
+
var handleCopy = function handleCopy(key, value, type, rowIndex) {
|
|
1052
1063
|
var res = produce(dataSourceRef.current, function (draft) {
|
|
1053
|
-
draft === null || draft === void 0 ? void 0 : draft.forEach(function (item) {
|
|
1054
|
-
|
|
1064
|
+
draft === null || draft === void 0 ? void 0 : draft.forEach(function (item, index) {
|
|
1065
|
+
if (type === 'up' && index < rowIndex || type === 'down' && index > rowIndex) {
|
|
1066
|
+
item[key] = value;
|
|
1067
|
+
}
|
|
1055
1068
|
});
|
|
1056
1069
|
});
|
|
1057
1070
|
setDataSource(res);
|
|
@@ -1060,17 +1073,16 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
1060
1073
|
|
|
1061
1074
|
|
|
1062
1075
|
var hasDisableOptions = useMemo(function () {
|
|
1063
|
-
// const hasOnlyOptionsDatas = columns.filter(item => item?.['componentProps']?.optionOnly)
|
|
1064
1076
|
var hasOnlyOptionsDatas = columns.filter(function (item) {
|
|
1065
1077
|
var _a;
|
|
1066
1078
|
|
|
1067
1079
|
var resultComponentProps = isFunction(item === null || item === void 0 ? void 0 : item.componentProps) ? (_a = item === null || item === void 0 ? void 0 : item.componentProps) === null || _a === void 0 ? void 0 : _a.call(item, {}, item) : item === null || item === void 0 ? void 0 : item.componentProps;
|
|
1068
1080
|
return resultComponentProps === null || resultComponentProps === void 0 ? void 0 : resultComponentProps.optionOnly;
|
|
1069
|
-
});
|
|
1081
|
+
}); // const hasOnlyOptionsDatas = columns.filter((item) => item?.componentProps?.optionOnly)
|
|
1070
1082
|
|
|
1071
1083
|
if (hasOnlyOptionsDatas.length) {
|
|
1072
1084
|
return hasOnlyOptionsDatas === null || hasOnlyOptionsDatas === void 0 ? void 0 : hasOnlyOptionsDatas.map(function (item) {
|
|
1073
|
-
return item
|
|
1085
|
+
return item.dataIndex;
|
|
1074
1086
|
});
|
|
1075
1087
|
}
|
|
1076
1088
|
|
|
@@ -1082,12 +1094,11 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
1082
1094
|
var newColumns = columns === null || columns === void 0 ? void 0 : columns.map(function (item) {
|
|
1083
1095
|
var _a;
|
|
1084
1096
|
|
|
1085
|
-
var resultComponentProps = isFunction(item.componentProps) ? (_a = item
|
|
1086
|
-
|
|
1087
|
-
var _ref5 = resultComponentProps || {},
|
|
1088
|
-
optionOnly = _ref5.optionOnly,
|
|
1089
|
-
options = _ref5.options; // const { optionOnly, options } = item['componentProps'] || {}
|
|
1097
|
+
var resultComponentProps = isFunction(item.componentProps) ? (_a = item.componentProps) === null || _a === void 0 ? void 0 : _a.call(item, {}, item) : item.componentProps;
|
|
1090
1098
|
|
|
1099
|
+
var _ref8 = resultComponentProps || {},
|
|
1100
|
+
optionOnly = _ref8.optionOnly,
|
|
1101
|
+
options = _ref8.options;
|
|
1091
1102
|
|
|
1092
1103
|
if (optionOnly && options) {
|
|
1093
1104
|
var dataIndex = item.dataIndex;
|
|
@@ -1107,7 +1118,7 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
1107
1118
|
}
|
|
1108
1119
|
|
|
1109
1120
|
return Object.assign(Object.assign({}, item), {
|
|
1110
|
-
componentProps: Object.assign(Object.assign({}, item
|
|
1121
|
+
componentProps: Object.assign(Object.assign({}, item.componentProps), {
|
|
1111
1122
|
options: newOptions
|
|
1112
1123
|
})
|
|
1113
1124
|
});
|
|
@@ -1126,16 +1137,49 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
1126
1137
|
var rColumns = hasDisableOptions ? DisableOptions : columns;
|
|
1127
1138
|
var localColumns = [sortOpen ? {
|
|
1128
1139
|
title: '排序',
|
|
1129
|
-
dataIndex: '
|
|
1140
|
+
dataIndex: '_sort',
|
|
1130
1141
|
width: 48,
|
|
1131
1142
|
maxWidth: 48,
|
|
1132
1143
|
className: 'drag-visible',
|
|
1144
|
+
fixed: 'left',
|
|
1145
|
+
order: -2,
|
|
1133
1146
|
render: function render(_, record) {
|
|
1134
1147
|
return /*#__PURE__*/React.createElement(DragHandle, {
|
|
1135
|
-
id: record[_rowKey] || record.id
|
|
1148
|
+
id: (record === null || record === void 0 ? void 0 : record[_rowKey]) || (record === null || record === void 0 ? void 0 : record.id)
|
|
1136
1149
|
});
|
|
1137
1150
|
}
|
|
1138
|
-
} : null
|
|
1151
|
+
} : null, indexCol ? isBoolean(indexCol) ? {
|
|
1152
|
+
title: '',
|
|
1153
|
+
dataIndex: '_index',
|
|
1154
|
+
width: 48,
|
|
1155
|
+
maxWidth: 48,
|
|
1156
|
+
ellipsis: true,
|
|
1157
|
+
fixed: 'left',
|
|
1158
|
+
order: -1,
|
|
1159
|
+
render: function render(_, record, index) {
|
|
1160
|
+
var _a, _b, _c;
|
|
1161
|
+
|
|
1162
|
+
return ((_c = (_b = (_a = deepDataSourceRef.current) === null || _a === void 0 ? void 0 : _a[record[_rowKey]]) === null || _b === void 0 ? void 0 : _b['_deepIds']) === null || _c === void 0 ? void 0 : _c.join('-')) || "".concat(index + 1);
|
|
1163
|
+
}
|
|
1164
|
+
} : Object.assign(Object.assign({
|
|
1165
|
+
title: '',
|
|
1166
|
+
dataIndex: '_index',
|
|
1167
|
+
width: 48,
|
|
1168
|
+
ellipsis: true,
|
|
1169
|
+
maxWidth: 48,
|
|
1170
|
+
order: -1,
|
|
1171
|
+
fixed: 'left'
|
|
1172
|
+
}, indexCol || {}), {
|
|
1173
|
+
render: function render(_, record, index) {
|
|
1174
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1175
|
+
|
|
1176
|
+
if (isFunction(indexCol === null || indexCol === void 0 ? void 0 : indexCol.render)) {
|
|
1177
|
+
return (_a = indexCol === null || indexCol === void 0 ? void 0 : indexCol.render) === null || _a === void 0 ? void 0 : _a.call(indexCol, record, (_c = (_b = deepDataSourceRef.current) === null || _b === void 0 ? void 0 : _b[record[_rowKey]]) === null || _c === void 0 ? void 0 : _c['_deepIds']);
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
return ((_f = (_e = (_d = deepDataSourceRef.current) === null || _d === void 0 ? void 0 : _d[record[_rowKey]]) === null || _e === void 0 ? void 0 : _e['_deepIds']) === null || _f === void 0 ? void 0 : _f.join('-')) || "".concat(index + 1);
|
|
1181
|
+
}
|
|
1182
|
+
}) : null].concat(_toConsumableArray(rColumns), [useQuickOpetate ? {
|
|
1139
1183
|
title: '操作',
|
|
1140
1184
|
dataIndex: 'lm_edit_opetate',
|
|
1141
1185
|
width: 68,
|
|
@@ -1146,11 +1190,11 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
1146
1190
|
options: Array.isArray(useQuickOpetate) ? useQuickOpetate : ['add', 'delete']
|
|
1147
1191
|
}
|
|
1148
1192
|
} : null]).filter(function (item) {
|
|
1149
|
-
return item && item.show !== false;
|
|
1193
|
+
return item && (item === null || item === void 0 ? void 0 : item.show) !== false;
|
|
1150
1194
|
});
|
|
1151
|
-
localColumns = localColumns.map(function (item, index) {
|
|
1195
|
+
localColumns = localColumns === null || localColumns === void 0 ? void 0 : localColumns.map(function (item, index) {
|
|
1152
1196
|
return Object.assign(Object.assign({}, item), {
|
|
1153
|
-
order: [null, undefined].includes(item
|
|
1197
|
+
order: [null, undefined].includes(item.order) ? index : item.order
|
|
1154
1198
|
});
|
|
1155
1199
|
}).sort(function (a, b) {
|
|
1156
1200
|
return a.order - b.order;
|
|
@@ -1159,7 +1203,7 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
1159
1203
|
var mainColumns = [];
|
|
1160
1204
|
var rightColumns = [];
|
|
1161
1205
|
localColumns === null || localColumns === void 0 ? void 0 : localColumns.forEach(function (item) {
|
|
1162
|
-
if ((item === null || item === void 0 ? void 0 : item.fixed) === 'left') {
|
|
1206
|
+
if ((item === null || item === void 0 ? void 0 : item.fixed) === 'left' || (item === null || item === void 0 ? void 0 : item.fixed) === true) {
|
|
1163
1207
|
leftColumns.push(item);
|
|
1164
1208
|
} else if ((item === null || item === void 0 ? void 0 : item.fixed) === 'right') {
|
|
1165
1209
|
rightColumns.push(item);
|
|
@@ -1173,29 +1217,22 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
1173
1217
|
var mapColumns = function mapColumns(col, index) {
|
|
1174
1218
|
var _a, _b;
|
|
1175
1219
|
|
|
1176
|
-
if (!col.editable && !((_a = col.children) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
shouldCellUpdate: function shouldCellUpdate(record, prevRecord) {
|
|
1182
|
-
var _a;
|
|
1183
|
-
|
|
1184
|
-
var dataIndex = col.dataIndex,
|
|
1185
|
-
editable = col.editable,
|
|
1186
|
-
relevanceCols = col.relevanceCols,
|
|
1187
|
-
componentProps = col.componentProps;
|
|
1220
|
+
if (!col.editable && !((_a = col.children) === null || _a === void 0 ? void 0 : _a.length) && (col === null || col === void 0 ? void 0 : col.dataIndex) === '_sort') {
|
|
1221
|
+
var fn = col === null || col === void 0 ? void 0 : col.render;
|
|
1222
|
+
return Object.assign(Object.assign({}, col), {
|
|
1223
|
+
render: function render(text, record, i) {
|
|
1224
|
+
var _a;
|
|
1188
1225
|
|
|
1189
|
-
|
|
1190
|
-
return true;
|
|
1226
|
+
return fn === null || fn === void 0 ? void 0 : fn((_a = dataSource[i]) === null || _a === void 0 ? void 0 : _a[col.dataIndex], dataSource[i], i);
|
|
1191
1227
|
}
|
|
1228
|
+
});
|
|
1229
|
+
}
|
|
1192
1230
|
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1231
|
+
if (isEdit && (col === null || col === void 0 ? void 0 : col.render) && (col === null || col === void 0 ? void 0 : col.editable) === 'render') {
|
|
1232
|
+
delete col.render;
|
|
1233
|
+
}
|
|
1196
1234
|
|
|
1197
|
-
|
|
1198
|
-
},
|
|
1235
|
+
var newCol = Object.assign({
|
|
1199
1236
|
onCell: function onCell(record, rowIndex) {
|
|
1200
1237
|
return {
|
|
1201
1238
|
getLength: dataSource.length,
|
|
@@ -1204,13 +1241,14 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
1204
1241
|
col: col,
|
|
1205
1242
|
rowIndex: rowIndex,
|
|
1206
1243
|
colIndex: index,
|
|
1244
|
+
initialiZindex: initialiZindex,
|
|
1207
1245
|
quickOpetateClearAll: quickOpetateClearAll,
|
|
1208
1246
|
handleTableRowDelete: handleTableRowDelete,
|
|
1209
1247
|
handleTableRowAdd: handleTableRowAdd,
|
|
1210
1248
|
editable: col.editable,
|
|
1211
1249
|
dataIndex: col.dataIndex,
|
|
1212
1250
|
itemProps: col.itemProps,
|
|
1213
|
-
|
|
1251
|
+
shouldUpdate: shouldUpdate,
|
|
1214
1252
|
isEdit: isEdit,
|
|
1215
1253
|
isHoverEdit: isHoverEdit,
|
|
1216
1254
|
handleAdd: handleAdd,
|
|
@@ -1218,11 +1256,10 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
1218
1256
|
handleCopy: handleCopy,
|
|
1219
1257
|
editEnum: typeof col.editEnum === 'function' ? col.editEnum(record) : col.editEnum,
|
|
1220
1258
|
valueType: typeof col.valueType === 'function' ? col.valueType(record) : col.valueType,
|
|
1221
|
-
handleSave: handleSave
|
|
1222
|
-
reWriteOriginSource: reWriteOriginSource
|
|
1259
|
+
handleSave: handleSave
|
|
1223
1260
|
};
|
|
1224
1261
|
}
|
|
1225
|
-
});
|
|
1262
|
+
}, col);
|
|
1226
1263
|
|
|
1227
1264
|
if (col === null || col === void 0 ? void 0 : col.children) {
|
|
1228
1265
|
newCol.children = (_b = col.children) === null || _b === void 0 ? void 0 : _b.map(mapColumns);
|
|
@@ -1231,24 +1268,24 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
1231
1268
|
return newCol;
|
|
1232
1269
|
};
|
|
1233
1270
|
|
|
1234
|
-
var res = localColumns.map(function (col, index) {
|
|
1271
|
+
var res = localColumns === null || localColumns === void 0 ? void 0 : localColumns.map(function (col, index) {
|
|
1235
1272
|
return mapColumns(col, index);
|
|
1236
1273
|
});
|
|
1237
1274
|
return res;
|
|
1238
|
-
}, [columns, isAdd, sortOpen, useQuickOpetate,
|
|
1239
|
-
var DraggableContainer = useCallback(function (_a) {
|
|
1240
|
-
var _b;
|
|
1275
|
+
}, [columns, isAdd, sortOpen, useQuickOpetate, dataSource, _toConsumableArray(memoOptions)]);
|
|
1241
1276
|
|
|
1242
|
-
|
|
1277
|
+
var onSortEnd = function onSortEnd(active, over) {
|
|
1278
|
+
var cloneArr = _toConsumableArray(dataSourceRef.current);
|
|
1279
|
+
|
|
1280
|
+
var oldIndex = cloneArr.findIndex(function (v) {
|
|
1281
|
+
return v[_rowKey] === active;
|
|
1282
|
+
});
|
|
1283
|
+
var newIndex = cloneArr.findIndex(function (v) {
|
|
1284
|
+
return v[_rowKey] === over;
|
|
1285
|
+
});
|
|
1286
|
+
setDataSource(arrayMove(cloneArr, oldIndex, newIndex));
|
|
1287
|
+
};
|
|
1243
1288
|
|
|
1244
|
-
return /*#__PURE__*/React.createElement(DndContainer, {
|
|
1245
|
-
move: onSortEnd
|
|
1246
|
-
}, /*#__PURE__*/React.createElement(SortableBox, {
|
|
1247
|
-
items: (_b = dataSourceRef.current) === null || _b === void 0 ? void 0 : _b.map(function (item) {
|
|
1248
|
-
return item[_rowKey];
|
|
1249
|
-
})
|
|
1250
|
-
}, /*#__PURE__*/React.createElement("tbody", Object.assign({}, props))));
|
|
1251
|
-
}, [sortEditTable]);
|
|
1252
1289
|
var colDraggableContainer = useCallback(function (_a) {
|
|
1253
1290
|
var _b;
|
|
1254
1291
|
|
|
@@ -1266,40 +1303,18 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
1266
1303
|
}, child);
|
|
1267
1304
|
}));
|
|
1268
1305
|
}, [columns]);
|
|
1269
|
-
var config = useMemo(function () {
|
|
1270
|
-
var component = {
|
|
1271
|
-
body: Object.assign({
|
|
1272
|
-
row: sortOpen ? EditableSortRow : EditableRow,
|
|
1273
|
-
cell: EditableCell
|
|
1274
|
-
}, sortOpen ? {
|
|
1275
|
-
wrapper: DraggableContainer
|
|
1276
|
-
} : {})
|
|
1277
|
-
};
|
|
1278
|
-
|
|
1279
|
-
if (colSortOpen) {
|
|
1280
|
-
component['header'] = {
|
|
1281
|
-
row: colDraggableContainer
|
|
1282
|
-
};
|
|
1283
|
-
}
|
|
1284
|
-
|
|
1285
|
-
return Object.assign({
|
|
1286
|
-
pagination: false,
|
|
1287
|
-
tableLayout: 'fixed',
|
|
1288
|
-
scroll: {
|
|
1289
|
-
x: '100%'
|
|
1290
|
-
},
|
|
1291
|
-
rowKey: function rowKey(record) {
|
|
1292
|
-
return record[_rowKey] || record.index || Math.random();
|
|
1293
|
-
},
|
|
1294
|
-
components: component
|
|
1295
|
-
}, resetProps);
|
|
1296
|
-
}, [resultColumns, dataSource, sortOpen, colSortOpen, size]);
|
|
1297
1306
|
useImperativeHandle(ref, function () {
|
|
1298
1307
|
return {
|
|
1299
1308
|
setRow: handleSave,
|
|
1300
1309
|
getCheckboxRecords: function getCheckboxRecords() {
|
|
1301
1310
|
return localRowSelectList.selectedRows;
|
|
1302
1311
|
},
|
|
1312
|
+
deleteRowData: function deleteRowData(data) {
|
|
1313
|
+
return handleTableRowDelete(data);
|
|
1314
|
+
},
|
|
1315
|
+
addRowData: function addRowData(data, defaultValue, addInChild) {
|
|
1316
|
+
return addInChild === 'replace' ? handleTableRowReplace(data, defaultValue) : handleTableRowAdd(data, addInChild, defaultValue);
|
|
1317
|
+
},
|
|
1303
1318
|
clearSelect: function clearSelect() {
|
|
1304
1319
|
setLocalRowSelectList({
|
|
1305
1320
|
selectedRows: []
|
|
@@ -1310,8 +1325,257 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
1310
1325
|
selectedRows: value
|
|
1311
1326
|
});
|
|
1312
1327
|
},
|
|
1313
|
-
|
|
1314
|
-
return
|
|
1328
|
+
columns: columns.map(function (item) {
|
|
1329
|
+
return omit(item, ['render', 'sorter', 'onFilter', 'filters', 'componentProps', 'formProps', 'editable']);
|
|
1330
|
+
}),
|
|
1331
|
+
// verify: async () => {
|
|
1332
|
+
// let allRule = {}
|
|
1333
|
+
// let time
|
|
1334
|
+
// let fullNum = 0
|
|
1335
|
+
// columns.forEach((col: any) => {
|
|
1336
|
+
// if (col?.formProps?.rules) {
|
|
1337
|
+
// allRule[col.dataIndex] = col?.formProps?.rules || []
|
|
1338
|
+
// }
|
|
1339
|
+
// })
|
|
1340
|
+
// const validator = new AsyncValidator(allRule);
|
|
1341
|
+
// let flag = true
|
|
1342
|
+
// let messageIndex = null
|
|
1343
|
+
// let errorRowKey = null
|
|
1344
|
+
// let errorInfo = null
|
|
1345
|
+
// const deepValidator = async (data, index) => {
|
|
1346
|
+
// for (let i = 0; i < data.length; i++) {
|
|
1347
|
+
// if (flag) {
|
|
1348
|
+
// try {
|
|
1349
|
+
// await validator.validate(data[i], (errors, fields) => {
|
|
1350
|
+
// if (errors) {
|
|
1351
|
+
// errorInfo = { errors, fields, value: data[i] };
|
|
1352
|
+
// flag = false
|
|
1353
|
+
// messageIndex = index === null ? i : index
|
|
1354
|
+
// errorRowKey = data?.[i]?.[rowKey]
|
|
1355
|
+
// } else if (data[i].children) {
|
|
1356
|
+
// deepValidator(data[i].children, i)
|
|
1357
|
+
// }
|
|
1358
|
+
// })
|
|
1359
|
+
// } catch (error) {
|
|
1360
|
+
// break;
|
|
1361
|
+
// }
|
|
1362
|
+
// }
|
|
1363
|
+
// }
|
|
1364
|
+
// }
|
|
1365
|
+
// await deepValidator(dataSource, null)
|
|
1366
|
+
// console.log(flag, 'fff')
|
|
1367
|
+
// if (flag) {
|
|
1368
|
+
// return Promise.resolve(dataSource)
|
|
1369
|
+
// } else {
|
|
1370
|
+
// setTimeout(() => {
|
|
1371
|
+
// if (messageIndex !== null) {
|
|
1372
|
+
// scrollToIndexRef.current?.(messageIndex, { align: 'center' })
|
|
1373
|
+
// time = setInterval(async () => {
|
|
1374
|
+
// fullNum++
|
|
1375
|
+
// if (fullNum > 5) {
|
|
1376
|
+
// clearInterval(time)
|
|
1377
|
+
// } else {
|
|
1378
|
+
// const form = (Object.values(allFormListRef.current || []).find((item: any) => item.key === errorRowKey) as any)?.form
|
|
1379
|
+
// if (form) {
|
|
1380
|
+
// try {
|
|
1381
|
+
// await form.validateFields()
|
|
1382
|
+
// console.log('验证成功')
|
|
1383
|
+
// } catch (error) {
|
|
1384
|
+
// console.log('验证失败', error)
|
|
1385
|
+
// return error
|
|
1386
|
+
// } finally {
|
|
1387
|
+
// clearInterval(time)
|
|
1388
|
+
// }
|
|
1389
|
+
// }
|
|
1390
|
+
// }
|
|
1391
|
+
// }, 500)
|
|
1392
|
+
// }
|
|
1393
|
+
// }, 100)
|
|
1394
|
+
// return Promise.reject(errorInfo)
|
|
1395
|
+
// }
|
|
1396
|
+
// },
|
|
1397
|
+
verify: function verify() {
|
|
1398
|
+
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
1399
|
+
var time, fullNum, flag, messageIndex, errorRowKey, errorInfo, deepValidator;
|
|
1400
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
1401
|
+
while (1) {
|
|
1402
|
+
switch (_context4.prev = _context4.next) {
|
|
1403
|
+
case 0:
|
|
1404
|
+
if (!virtual) {
|
|
1405
|
+
_context4.next = 17;
|
|
1406
|
+
break;
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
fullNum = 0;
|
|
1410
|
+
flag = true;
|
|
1411
|
+
messageIndex = null;
|
|
1412
|
+
errorRowKey = null;
|
|
1413
|
+
errorInfo = null;
|
|
1414
|
+
|
|
1415
|
+
deepValidator = function deepValidator(data, index) {
|
|
1416
|
+
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
1417
|
+
var _c, i;
|
|
1418
|
+
|
|
1419
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1420
|
+
while (1) {
|
|
1421
|
+
switch (_context2.prev = _context2.next) {
|
|
1422
|
+
case 0:
|
|
1423
|
+
i = 0;
|
|
1424
|
+
|
|
1425
|
+
case 1:
|
|
1426
|
+
if (!(i < data.length)) {
|
|
1427
|
+
_context2.next = 23;
|
|
1428
|
+
break;
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1431
|
+
if (!flag) {
|
|
1432
|
+
_context2.next = 20;
|
|
1433
|
+
break;
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
_context2.prev = 3;
|
|
1437
|
+
checkForm.resetFields();
|
|
1438
|
+
checkForm.setFieldsValue(data[i]);
|
|
1439
|
+
_context2.next = 8;
|
|
1440
|
+
return checkForm.validateFields();
|
|
1441
|
+
|
|
1442
|
+
case 8:
|
|
1443
|
+
if (!data[i].children) {
|
|
1444
|
+
_context2.next = 11;
|
|
1445
|
+
break;
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
_context2.next = 11;
|
|
1449
|
+
return deepValidator(data[i].children, i);
|
|
1450
|
+
|
|
1451
|
+
case 11:
|
|
1452
|
+
_context2.next = 20;
|
|
1453
|
+
break;
|
|
1454
|
+
|
|
1455
|
+
case 13:
|
|
1456
|
+
_context2.prev = 13;
|
|
1457
|
+
_context2.t0 = _context2["catch"](3);
|
|
1458
|
+
errorInfo = {
|
|
1459
|
+
error: _context2.t0,
|
|
1460
|
+
value: data[i]
|
|
1461
|
+
};
|
|
1462
|
+
flag = false;
|
|
1463
|
+
messageIndex = index === null ? i : index;
|
|
1464
|
+
errorRowKey = (_c = data === null || data === void 0 ? void 0 : data[i]) === null || _c === void 0 ? void 0 : _c[_rowKey];
|
|
1465
|
+
return _context2.abrupt("break", 23);
|
|
1466
|
+
|
|
1467
|
+
case 20:
|
|
1468
|
+
i++;
|
|
1469
|
+
_context2.next = 1;
|
|
1470
|
+
break;
|
|
1471
|
+
|
|
1472
|
+
case 23:
|
|
1473
|
+
case "end":
|
|
1474
|
+
return _context2.stop();
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
}, _callee2, null, [[3, 13]]);
|
|
1478
|
+
}));
|
|
1479
|
+
};
|
|
1480
|
+
|
|
1481
|
+
_context4.next = 9;
|
|
1482
|
+
return deepValidator(dataSource, null);
|
|
1483
|
+
|
|
1484
|
+
case 9:
|
|
1485
|
+
if (!flag) {
|
|
1486
|
+
_context4.next = 13;
|
|
1487
|
+
break;
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
return _context4.abrupt("return", Promise.resolve(dataSource));
|
|
1491
|
+
|
|
1492
|
+
case 13:
|
|
1493
|
+
setTimeout(function () {
|
|
1494
|
+
var _a;
|
|
1495
|
+
|
|
1496
|
+
if (messageIndex !== null) {
|
|
1497
|
+
(_a = scrollToIndexRef.current) === null || _a === void 0 ? void 0 : _a.call(scrollToIndexRef, messageIndex, {
|
|
1498
|
+
align: 'center'
|
|
1499
|
+
});
|
|
1500
|
+
time = setInterval(function () {
|
|
1501
|
+
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
1502
|
+
var _b, form;
|
|
1503
|
+
|
|
1504
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
1505
|
+
while (1) {
|
|
1506
|
+
switch (_context3.prev = _context3.next) {
|
|
1507
|
+
case 0:
|
|
1508
|
+
fullNum++;
|
|
1509
|
+
|
|
1510
|
+
if (!(fullNum > 5)) {
|
|
1511
|
+
_context3.next = 5;
|
|
1512
|
+
break;
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
clearInterval(time);
|
|
1516
|
+
_context3.next = 20;
|
|
1517
|
+
break;
|
|
1518
|
+
|
|
1519
|
+
case 5:
|
|
1520
|
+
form = (_b = Object.values(allFormListRef.current || []).find(function (item) {
|
|
1521
|
+
return item.key === errorRowKey;
|
|
1522
|
+
})) === null || _b === void 0 ? void 0 : _b.form;
|
|
1523
|
+
|
|
1524
|
+
if (!form) {
|
|
1525
|
+
_context3.next = 20;
|
|
1526
|
+
break;
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
_context3.prev = 7;
|
|
1530
|
+
_context3.next = 10;
|
|
1531
|
+
return form.validateFields();
|
|
1532
|
+
|
|
1533
|
+
case 10:
|
|
1534
|
+
console.log('验证成功');
|
|
1535
|
+
_context3.next = 17;
|
|
1536
|
+
break;
|
|
1537
|
+
|
|
1538
|
+
case 13:
|
|
1539
|
+
_context3.prev = 13;
|
|
1540
|
+
_context3.t0 = _context3["catch"](7);
|
|
1541
|
+
console.log('验证失败', _context3.t0);
|
|
1542
|
+
return _context3.abrupt("return", _context3.t0);
|
|
1543
|
+
|
|
1544
|
+
case 17:
|
|
1545
|
+
_context3.prev = 17;
|
|
1546
|
+
clearInterval(time);
|
|
1547
|
+
return _context3.finish(17);
|
|
1548
|
+
|
|
1549
|
+
case 20:
|
|
1550
|
+
case "end":
|
|
1551
|
+
return _context3.stop();
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
}, _callee3, null, [[7, 13, 17, 20]]);
|
|
1555
|
+
}));
|
|
1556
|
+
}, 300);
|
|
1557
|
+
}
|
|
1558
|
+
}, 100);
|
|
1559
|
+
return _context4.abrupt("return", Promise.reject(errorInfo));
|
|
1560
|
+
|
|
1561
|
+
case 15:
|
|
1562
|
+
_context4.next = 18;
|
|
1563
|
+
break;
|
|
1564
|
+
|
|
1565
|
+
case 17:
|
|
1566
|
+
return _context4.abrupt("return", Promise.all(Object.values(allFormListRef.current || []).map(function (item) {
|
|
1567
|
+
var _a;
|
|
1568
|
+
|
|
1569
|
+
return (_a = item === null || item === void 0 ? void 0 : item.form) === null || _a === void 0 ? void 0 : _a.validateFields();
|
|
1570
|
+
})));
|
|
1571
|
+
|
|
1572
|
+
case 18:
|
|
1573
|
+
case "end":
|
|
1574
|
+
return _context4.stop();
|
|
1575
|
+
}
|
|
1576
|
+
}
|
|
1577
|
+
}, _callee4);
|
|
1578
|
+
}));
|
|
1315
1579
|
}
|
|
1316
1580
|
};
|
|
1317
1581
|
});
|
|
@@ -1319,22 +1583,157 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
1319
1583
|
return isEdit && isAdd || isHoverEdit && isAdd;
|
|
1320
1584
|
}, [isEdit, isAdd, isHoverEdit]);
|
|
1321
1585
|
|
|
1586
|
+
var pushAllForm = function pushAllForm(form, key, index) {
|
|
1587
|
+
allFormListRef.current[key] = {
|
|
1588
|
+
form: form,
|
|
1589
|
+
key: key,
|
|
1590
|
+
index: index
|
|
1591
|
+
};
|
|
1592
|
+
};
|
|
1593
|
+
|
|
1594
|
+
var config = useRef(Object.assign({
|
|
1595
|
+
pagination: false,
|
|
1596
|
+
tableLayout: 'fixed',
|
|
1597
|
+
scroll: {
|
|
1598
|
+
x: '100%'
|
|
1599
|
+
},
|
|
1600
|
+
rowKey: function rowKey(record) {
|
|
1601
|
+
return record[_rowKey] || record.index || Math.random();
|
|
1602
|
+
},
|
|
1603
|
+
components: {
|
|
1604
|
+
table: virtual ? function (props) {
|
|
1605
|
+
return /*#__PURE__*/React.createElement(VirtualTable, Object.assign({}, props, {
|
|
1606
|
+
fn: scrollToIndexRef
|
|
1607
|
+
}));
|
|
1608
|
+
} : null,
|
|
1609
|
+
body: Object.assign({
|
|
1610
|
+
row: function row(rowProps) {
|
|
1611
|
+
return sortOpen ? EditableSortRow(Object.assign(Object.assign({}, rowProps), {
|
|
1612
|
+
virtual: virtual
|
|
1613
|
+
})) : EditableRow(Object.assign(Object.assign({}, rowProps), {
|
|
1614
|
+
virtual: virtual
|
|
1615
|
+
}));
|
|
1616
|
+
},
|
|
1617
|
+
cell: props.shouldUpdate ? EditableCell : MemoEditableCell
|
|
1618
|
+
}, sortOpen ? {
|
|
1619
|
+
wrapper: function wrapper(wrapperProps) {
|
|
1620
|
+
var _a, _b, _c;
|
|
1621
|
+
|
|
1622
|
+
return DraggableContainer(Object.assign(Object.assign({}, wrapperProps), {
|
|
1623
|
+
virtual: virtual,
|
|
1624
|
+
keys: (_a = dataSourceRef.current) === null || _a === void 0 ? void 0 : _a.map(function (item) {
|
|
1625
|
+
return item[_rowKey];
|
|
1626
|
+
}),
|
|
1627
|
+
options: dataSourceRef.current,
|
|
1628
|
+
rowKey: _rowKey,
|
|
1629
|
+
onSortEnd: onSortEnd,
|
|
1630
|
+
tableWidth: (_c = (_b = tableWarpRef === null || tableWarpRef === void 0 ? void 0 : tableWarpRef.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect()) === null || _c === void 0 ? void 0 : _c.width
|
|
1631
|
+
}));
|
|
1632
|
+
}
|
|
1633
|
+
} : virtual ? {
|
|
1634
|
+
wrapper: VirtualWrapper
|
|
1635
|
+
} : {}),
|
|
1636
|
+
header: {
|
|
1637
|
+
row: colSortOpen ? colDraggableContainer : null
|
|
1638
|
+
}
|
|
1639
|
+
},
|
|
1640
|
+
onRow: function onRow(record, index) {
|
|
1641
|
+
var _a;
|
|
1642
|
+
|
|
1643
|
+
return {
|
|
1644
|
+
disabled: disabled || !!((_a = disabledDataSourceRowKeys.current) === null || _a === void 0 ? void 0 : _a.includes(record[_rowKey])),
|
|
1645
|
+
dataKey: record[_rowKey],
|
|
1646
|
+
index: index,
|
|
1647
|
+
pushAllForm: pushAllForm
|
|
1648
|
+
};
|
|
1649
|
+
}
|
|
1650
|
+
}, resetProps));
|
|
1651
|
+
useEffect(function () {
|
|
1652
|
+
var _a;
|
|
1653
|
+
|
|
1654
|
+
if (autoSizer) {
|
|
1655
|
+
var tableClient = (_a = tableWarpRef === null || tableWarpRef === void 0 ? void 0 : tableWarpRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
1656
|
+
var height = (tableClient === null || tableClient === void 0 ? void 0 : tableClient.height) || '100%';
|
|
1657
|
+
var TailorHeight = size === 'middle' ? 48 : 40;
|
|
1658
|
+
|
|
1659
|
+
if (isAdd) {
|
|
1660
|
+
TailorHeight += 48;
|
|
1661
|
+
}
|
|
1662
|
+
|
|
1663
|
+
if (props.summary) {
|
|
1664
|
+
TailorHeight += 48;
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
if (props.pagination) {
|
|
1668
|
+
TailorHeight += 48;
|
|
1669
|
+
}
|
|
1670
|
+
|
|
1671
|
+
autoSizerRef.current = {
|
|
1672
|
+
width: tableClient === null || tableClient === void 0 ? void 0 : tableClient.width,
|
|
1673
|
+
height: typeof height === 'string' ? "calc(".concat(height, " - ").concat(TailorHeight, "px)") : height - TailorHeight
|
|
1674
|
+
};
|
|
1675
|
+
}
|
|
1676
|
+
}, []);
|
|
1677
|
+
var checkFormItem = useMemo(function () {
|
|
1678
|
+
var arr = [];
|
|
1679
|
+
columns.forEach(function (item) {
|
|
1680
|
+
var _a;
|
|
1681
|
+
|
|
1682
|
+
if (item.children) {
|
|
1683
|
+
(_a = item.children) === null || _a === void 0 ? void 0 : _a.forEach(function (c) {
|
|
1684
|
+
arr.push( /*#__PURE__*/React.createElement(Form.Item, Object.assign({
|
|
1685
|
+
noStyle: true,
|
|
1686
|
+
key: c.dataIndex,
|
|
1687
|
+
name: c.dataIndex
|
|
1688
|
+
}, (c === null || c === void 0 ? void 0 : c['formProps']) || {}), c.dataIndex || 'text'));
|
|
1689
|
+
});
|
|
1690
|
+
} else {
|
|
1691
|
+
arr.push( /*#__PURE__*/React.createElement(Form.Item, Object.assign({
|
|
1692
|
+
noStyle: true,
|
|
1693
|
+
key: item.dataIndex,
|
|
1694
|
+
name: item.dataIndex
|
|
1695
|
+
}, (item === null || item === void 0 ? void 0 : item['formProps']) || {}), item.dataIndex || 'text'));
|
|
1696
|
+
}
|
|
1697
|
+
});
|
|
1698
|
+
return arr;
|
|
1699
|
+
}, [columns]);
|
|
1700
|
+
|
|
1322
1701
|
if (colSortOpen) {
|
|
1323
1702
|
return /*#__PURE__*/React.createElement("div", {
|
|
1324
|
-
className: "lm_editTable_warpper"
|
|
1703
|
+
className: "lm_editTable_warpper",
|
|
1704
|
+
ref: tableWarpRef
|
|
1705
|
+
}, /*#__PURE__*/React.createElement(ConfigProvider, {
|
|
1706
|
+
renderEmpty: loading ? function () {
|
|
1707
|
+
return null;
|
|
1708
|
+
} : CustomizeRenderEmpty
|
|
1325
1709
|
}, /*#__PURE__*/React.createElement(DndContainer, {
|
|
1710
|
+
rowKey: _rowKey,
|
|
1711
|
+
options: resultColumns,
|
|
1326
1712
|
move: onColSortEnd
|
|
1327
1713
|
}, /*#__PURE__*/React.createElement(SortableBoxCol, {
|
|
1328
1714
|
items: columns.reduce(function (acc, item) {
|
|
1329
1715
|
return [].concat(_toConsumableArray(acc), [item.dataIndex]);
|
|
1330
1716
|
}, [])
|
|
1331
|
-
}, /*#__PURE__*/React.createElement(Table, Object.assign({}, config, {
|
|
1717
|
+
}, /*#__PURE__*/React.createElement(Table, Object.assign({}, checkDataSourceIsEmpty(config.current, dataSourceRef.current, autoSizerRef.current), {
|
|
1718
|
+
loading: loading,
|
|
1332
1719
|
size: size || 'small',
|
|
1333
1720
|
columns: resultColumns,
|
|
1334
1721
|
rowClassName: "editable-row",
|
|
1335
1722
|
bordered: true,
|
|
1336
1723
|
pagination: false,
|
|
1337
|
-
|
|
1724
|
+
expandable: Object.assign({
|
|
1725
|
+
expandedRowKeys: expandedRowKeys,
|
|
1726
|
+
fixed: true,
|
|
1727
|
+
indentSize: 0,
|
|
1728
|
+
expandIconColumnIndex: checkExpandIconColumnIndex({
|
|
1729
|
+
rowSelection: rowSelection,
|
|
1730
|
+
sortOpen: sortOpen,
|
|
1731
|
+
indexCol: indexCol
|
|
1732
|
+
}) || 0,
|
|
1733
|
+
onExpandedRowsChange: function onExpandedRowsChange(expandedRows) {
|
|
1734
|
+
return setExpandedRowKeys(expandedRows);
|
|
1735
|
+
}
|
|
1736
|
+
}, resetProps === null || resetProps === void 0 ? void 0 : resetProps.expandable),
|
|
1338
1737
|
rowSelection: !rowSelection ? undefined : Object.assign(Object.assign({
|
|
1339
1738
|
fixed: true,
|
|
1340
1739
|
type: 'checkbox',
|
|
@@ -1344,40 +1743,57 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
1344
1743
|
return isObject(v) ? v[_rowKey] : v;
|
|
1345
1744
|
}),
|
|
1346
1745
|
onChange: function onChange(selectedRowKeys, selectedRows, info) {
|
|
1347
|
-
// editTableRowChange(selectedRowKeys, selectedRows, info)
|
|
1348
1746
|
setLocalRowSelectList(selectedRowKeys, selectedRows, info);
|
|
1349
1747
|
}
|
|
1350
1748
|
}),
|
|
1351
1749
|
dataSource: dataSource
|
|
1352
|
-
})))),
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1750
|
+
}))))), /*#__PURE__*/React.createElement(BottomOpetateComponent, {
|
|
1751
|
+
disabled: disabled,
|
|
1752
|
+
isShowAddAction: isShowAddAction,
|
|
1753
|
+
recordCreatorProps: recordCreatorProps,
|
|
1754
|
+
handleAdd: handleAdd
|
|
1755
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
1356
1756
|
style: {
|
|
1357
|
-
|
|
1757
|
+
display: 'none'
|
|
1358
1758
|
}
|
|
1359
|
-
}, /*#__PURE__*/React.createElement(
|
|
1360
|
-
|
|
1361
|
-
|
|
1759
|
+
}, /*#__PURE__*/React.createElement(Form, {
|
|
1760
|
+
form: checkForm,
|
|
1761
|
+
component: false
|
|
1762
|
+
}, checkFormItem)));
|
|
1362
1763
|
} // @ts-ignore
|
|
1363
1764
|
|
|
1364
1765
|
|
|
1365
1766
|
return /*#__PURE__*/React.createElement("div", {
|
|
1366
|
-
className:
|
|
1367
|
-
|
|
1767
|
+
className: cls('lm_editTable_warpper', autoSizer && 'lm_editable_autosize'),
|
|
1768
|
+
ref: tableWarpRef
|
|
1769
|
+
}, /*#__PURE__*/React.createElement(ConfigProvider, {
|
|
1770
|
+
renderEmpty: loading ? function () {
|
|
1771
|
+
return null;
|
|
1772
|
+
} : CustomizeRenderEmpty
|
|
1773
|
+
}, /*#__PURE__*/React.createElement(Table, Object.assign({}, checkDataSourceIsEmpty(config.current, dataSourceRef.current, autoSizerRef.current), {
|
|
1368
1774
|
size: size || 'small',
|
|
1369
1775
|
columns: resultColumns,
|
|
1370
1776
|
rowClassName: "editable-row",
|
|
1371
1777
|
bordered: true,
|
|
1778
|
+
loading: loading,
|
|
1779
|
+
style: autoSizer ? {
|
|
1780
|
+
height: isAdd ? "calc(100% - ".concat(48, "px)") : '100%'
|
|
1781
|
+
} : undefined,
|
|
1372
1782
|
pagination: false,
|
|
1373
1783
|
// components={tableComponents}
|
|
1374
|
-
expandable: (
|
|
1784
|
+
expandable: Object.assign({
|
|
1375
1785
|
expandedRowKeys: expandedRowKeys,
|
|
1376
1786
|
fixed: true,
|
|
1787
|
+
indentSize: 0,
|
|
1788
|
+
expandIconColumnIndex: checkExpandIconColumnIndex({
|
|
1789
|
+
rowSelection: rowSelection,
|
|
1790
|
+
sortOpen: sortOpen,
|
|
1791
|
+
indexCol: indexCol
|
|
1792
|
+
}) || 0,
|
|
1377
1793
|
onExpandedRowsChange: function onExpandedRowsChange(expandedRows) {
|
|
1378
1794
|
return setExpandedRowKeys(expandedRows);
|
|
1379
1795
|
}
|
|
1380
|
-
},
|
|
1796
|
+
}, resetProps === null || resetProps === void 0 ? void 0 : resetProps.expandable),
|
|
1381
1797
|
rowSelection: !rowSelection ? undefined : Object.assign(Object.assign({
|
|
1382
1798
|
fixed: true,
|
|
1383
1799
|
type: 'checkbox',
|
|
@@ -1391,15 +1807,18 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
1391
1807
|
}
|
|
1392
1808
|
}),
|
|
1393
1809
|
dataSource: dataSource
|
|
1394
|
-
})),
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
}
|
|
1810
|
+
}))), /*#__PURE__*/React.createElement(BottomOpetateComponent, {
|
|
1811
|
+
disabled: disabled,
|
|
1812
|
+
isShowAddAction: isShowAddAction,
|
|
1813
|
+
recordCreatorProps: recordCreatorProps,
|
|
1814
|
+
handleAdd: handleAdd
|
|
1815
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
1816
|
+
style: {
|
|
1817
|
+
display: 'none'
|
|
1818
|
+
}
|
|
1819
|
+
}, /*#__PURE__*/React.createElement(Form, {
|
|
1820
|
+
form: checkForm,
|
|
1821
|
+
component: false
|
|
1822
|
+
}, checkFormItem)));
|
|
1404
1823
|
});
|
|
1405
1824
|
export default /*#__PURE__*/memo(EditTable);
|