linkmore-design 1.1.13-alpha.1 → 1.1.13-alpha.12
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/CHANGELOG.md +118 -0
- package/dist/Button/demos/ghost.d.ts +2 -0
- package/dist/ConfigProvider/context.d.ts +1 -0
- package/dist/Descriptions/Cell.d.ts +1 -0
- package/dist/Descriptions/Item.d.ts +1 -0
- package/dist/Descriptions/index.d.ts +1 -1
- package/dist/Form/FormWrapper.d.ts +3 -0
- package/dist/Form/WrapperItem.d.ts +4 -0
- package/dist/Form/demos/disabled.d.ts +2 -0
- package/dist/Form/demos/responsive.d.ts +0 -1
- package/dist/Form/index.d.ts +2 -0
- package/dist/Form/interface.d.ts +12 -0
- package/dist/IconFont/demos/ConfigProvider.d.ts +2 -0
- package/dist/IconFont/index.d.ts +1 -2
- package/dist/LmDrag/LmDrag.d.ts +4 -0
- package/dist/LmDrag/components/DndContainer.d.ts +3 -0
- package/dist/LmDrag/components/sortableBox.d.ts +5 -0
- package/dist/LmDrag/components/sortableItem.d.ts +7 -0
- package/dist/LmDrag/demos/basic.d.ts +2 -0
- package/dist/LmDrag/index.d.ts +10 -0
- package/dist/LmDrag/style/index.d.ts +1 -0
- package/dist/LmDrag/style/variables.d.ts +1 -0
- package/dist/LmDrag/wrapper/Root.d.ts +3 -0
- package/dist/LmEditTable/EditTable.d.ts +16 -3
- package/dist/LmEditTable/components/DraggableContainer.d.ts +4 -1
- package/dist/LmEditTable/components/QuickOpetate.d.ts +12 -0
- package/dist/LmEditTable/components/bottomOpetateComponent.d.ts +13 -0
- package/dist/LmEditTable/components/index.d.ts +7 -2
- package/dist/LmEditTable/hooks/useForkRef.d.ts +2 -0
- package/dist/LmEditTable/rowSort/DndContainerRow.d.ts +10 -0
- package/dist/LmEditTable/util.d.ts +5 -0
- package/dist/LmEditTable/virtual/VirtualRow.d.ts +1 -0
- package/dist/LmFilter/LmFilter.d.ts +2 -6
- package/dist/LmTable/demos/summuy.d.ts +2 -0
- package/dist/LmTable/expression.d.ts +1 -0
- package/dist/LmTable/hooks/useGroupDataSource.d.ts +7 -0
- package/dist/LmUpload/UploadList/ItemPictureCard.d.ts +2 -1
- package/dist/LmUpload/fns/index.d.ts +1 -0
- package/dist/QuickMenu/demos/useInDraw.d.ts +2 -0
- package/dist/QuickMenu/index.d.ts +3 -1
- package/dist/Select/index.d.ts +3 -0
- package/dist/TreeSelect/demos/treedata.d.ts +3 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.umd.js +2811 -1527
- package/dist/index.umd.min.js +17 -17
- package/dist/variables.css +270 -120
- package/es/Button/index.js +4 -3
- package/es/Button/style/index.css +28 -25
- package/es/Button/style/variables.css +28 -25
- package/es/Cascader/index.js +31 -3
- package/es/Cascader/style/index.css +1 -0
- package/es/Cascader/style/variables.css +1 -0
- package/es/ConfigProvider/context.d.ts +1 -0
- package/es/ConfigProvider/index.js +5 -3
- package/es/Descriptions/Cell.d.ts +1 -0
- package/es/Descriptions/Cell.js +5 -2
- package/es/Descriptions/Item.d.ts +1 -0
- package/es/Descriptions/Row.js +6 -1
- package/es/Descriptions/index.d.ts +1 -1
- package/es/Descriptions/index.js +3 -3
- package/es/Descriptions/style/index.css +3 -0
- package/es/Descriptions/style/variables.css +3 -0
- package/es/Form/Form.js +13 -4
- package/es/Form/FormItem/ItemHolder.js +1 -10
- package/es/Form/FormWrapper.d.ts +3 -0
- package/es/Form/FormWrapper.js +22 -0
- package/es/Form/WrapperItem.d.ts +4 -0
- package/es/Form/WrapperItem.js +217 -0
- package/es/Form/container.js +1 -13
- package/es/Form/images/icon_collapse.svg +1 -0
- package/es/Form/index.d.ts +2 -0
- package/es/Form/index.js +2 -0
- package/es/Form/interface.d.ts +12 -0
- package/es/Form/style/index.css +34 -41
- package/es/Form/style/variables.css +34 -41
- package/es/IconFont/index.d.ts +1 -2
- package/es/IconFont/index.js +18 -4
- package/es/ImageViewer/components/Operate.js +4 -7
- package/es/Input/index.js +47 -10
- package/es/InputNumber/index.js +23 -11
- package/es/InputNumber/style/index.css +7 -0
- package/es/InputNumber/style/variables.css +7 -0
- package/es/LmDrag/LmDrag.d.ts +4 -0
- package/es/LmDrag/LmDrag.js +30 -0
- package/es/LmDrag/components/DndContainer.d.ts +3 -0
- package/es/LmDrag/components/DndContainer.js +121 -0
- package/es/LmDrag/components/sortableBox.d.ts +5 -0
- package/es/LmDrag/components/sortableBox.js +23 -0
- package/es/LmDrag/components/sortableItem.d.ts +7 -0
- package/es/LmDrag/components/sortableItem.js +41 -0
- package/es/LmDrag/index.d.ts +10 -0
- package/es/LmDrag/index.js +3 -0
- package/es/LmDrag/style/index.css +0 -0
- package/es/LmDrag/style/index.d.ts +1 -0
- package/es/LmDrag/style/index.js +1 -0
- package/es/LmDrag/style/variables.css +0 -0
- package/es/LmDrag/style/variables.d.ts +1 -0
- package/es/LmDrag/style/variables.js +1 -0
- package/es/LmDrag/wrapper/Root.d.ts +3 -0
- package/es/LmDrag/wrapper/Root.js +12 -0
- package/es/LmEditTable/DragHandle.js +1 -1
- package/es/LmEditTable/EditTable.d.ts +16 -3
- package/es/LmEditTable/EditTable.js +295 -240
- package/es/LmEditTable/components/DraggableContainer.d.ts +4 -1
- package/es/LmEditTable/components/DraggableContainer.js +10 -3
- 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/index.d.ts +7 -2
- package/es/LmEditTable/components/index.js +3 -1
- 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 +81 -0
- package/es/LmEditTable/sortableItem.js +1 -0
- package/es/LmEditTable/sortableItemCol.js +40 -10
- package/es/LmEditTable/style/index.css +27 -0
- package/es/LmEditTable/style/variables.css +27 -0
- package/es/LmEditTable/util.d.ts +5 -0
- package/es/LmEditTable/util.js +51 -12
- package/es/LmEditTable/virtual/VirtualRow.d.ts +1 -0
- package/es/LmEditTable/virtual/VirtualRow.js +5 -3
- package/es/LmEditTable/virtual/VirtualRowBack.js +12 -14
- package/es/LmFilter/LmFilter.js +6 -6
- package/es/LmFilter/components/CheckboxFilter.js +9 -4
- package/es/LmFilter/components/DropdownFIlter.js +186 -111
- package/es/LmFilter/components/SelectFilter.js +4 -3
- package/es/LmFilter/filterFns/index.js +5 -7
- package/es/LmFilter/index.js +0 -3
- package/es/LmFilter/style/index.css +82 -54
- package/es/LmFilter/style/variables.css +82 -54
- package/es/LmFilter/utils.js +6 -6
- package/es/LmSelect/style/index.css +1 -0
- package/es/LmSelect/style/variables.css +1 -0
- package/es/LmTable/Table.js +24 -15
- package/es/LmTable/expression.d.ts +1 -0
- package/es/LmTable/expression.js +31 -0
- package/es/LmTable/hooks/useGroupDataSource.js +50 -0
- package/es/LmTable/style/index.css +39 -0
- package/es/LmTable/style/variables.css +39 -0
- package/es/LmTable/virTual/VirtualRow.js +12 -14
- package/es/LmUpload/LmUpload.js +6 -3
- package/es/LmUpload/UploadList/ItemPicture.js +2 -1
- package/es/LmUpload/UploadList/ItemPictureCard.d.ts +2 -1
- package/es/LmUpload/UploadList/ItemPictureCard.js +15 -5
- package/es/LmUpload/UploadList/ItemText.js +7 -2
- package/es/LmUpload/UploadList/index.js +53 -2
- package/es/LmUpload/body/UploadCore.js +4 -1
- package/es/LmUpload/fns/index.d.ts +1 -0
- package/es/LmUpload/fns/index.js +27 -6
- package/es/LmUpload/style/index.css +17 -0
- package/es/LmUpload/style/variables.css +17 -0
- package/es/QuickMenu/index.d.ts +3 -1
- package/es/QuickMenu/index.js +22 -19
- package/es/Select/index.d.ts +3 -0
- package/es/Select/index.js +44 -7
- package/es/Select/style/index.css +28 -0
- package/es/Select/style/variables.css +28 -0
- package/es/TreeSelect/index.js +17 -2
- package/es/TreeSelect/style/index.css +3 -0
- package/es/TreeSelect/style/variables.css +3 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +2 -1
- package/es/styles/variables.css +270 -120
- package/lib/Button/index.js +4 -3
- package/lib/Button/style/index.css +28 -25
- package/lib/Button/style/variables.css +28 -25
- package/lib/Cascader/index.js +35 -3
- package/lib/Cascader/style/index.css +1 -0
- package/lib/Cascader/style/variables.css +1 -0
- package/lib/ConfigProvider/context.d.ts +1 -0
- package/lib/ConfigProvider/index.js +5 -3
- package/lib/Descriptions/Cell.d.ts +1 -0
- package/lib/Descriptions/Cell.js +5 -2
- package/lib/Descriptions/Item.d.ts +1 -0
- package/lib/Descriptions/Row.js +6 -1
- package/lib/Descriptions/index.d.ts +1 -1
- package/lib/Descriptions/index.js +3 -3
- package/lib/Descriptions/style/index.css +3 -0
- package/lib/Descriptions/style/variables.css +3 -0
- package/lib/Form/Form.js +13 -4
- package/lib/Form/FormItem/ItemHolder.js +1 -10
- package/lib/Form/FormWrapper.d.ts +3 -0
- package/lib/Form/FormWrapper.js +34 -0
- package/lib/Form/WrapperItem.d.ts +4 -0
- package/lib/Form/WrapperItem.js +235 -0
- package/lib/Form/container.js +1 -13
- package/lib/Form/images/icon_collapse.svg +1 -0
- package/lib/Form/index.d.ts +2 -0
- package/lib/Form/index.js +3 -0
- package/lib/Form/interface.d.ts +12 -0
- package/lib/Form/style/index.css +34 -41
- package/lib/Form/style/variables.css +34 -41
- package/lib/IconFont/index.d.ts +1 -2
- package/lib/IconFont/index.js +25 -4
- package/lib/ImageViewer/components/Operate.js +4 -8
- package/lib/Input/index.js +52 -10
- package/lib/InputNumber/index.js +29 -11
- package/lib/InputNumber/style/index.css +7 -0
- package/lib/InputNumber/style/variables.css +7 -0
- package/lib/LmDrag/LmDrag.d.ts +4 -0
- package/lib/LmDrag/LmDrag.js +44 -0
- package/lib/LmDrag/components/DndContainer.d.ts +3 -0
- package/lib/LmDrag/components/DndContainer.js +138 -0
- package/lib/LmDrag/components/sortableBox.d.ts +5 -0
- package/lib/LmDrag/components/sortableBox.js +37 -0
- package/lib/LmDrag/components/sortableItem.d.ts +7 -0
- package/lib/LmDrag/components/sortableItem.js +54 -0
- package/lib/LmDrag/index.d.ts +10 -0
- package/lib/LmDrag/index.js +19 -0
- package/lib/LmDrag/style/index.css +0 -0
- package/lib/LmDrag/style/index.d.ts +1 -0
- package/lib/LmDrag/style/index.js +3 -0
- package/lib/LmDrag/style/variables.css +0 -0
- package/lib/LmDrag/style/variables.d.ts +1 -0
- package/lib/LmDrag/style/variables.js +3 -0
- package/lib/LmDrag/wrapper/Root.d.ts +3 -0
- package/lib/LmDrag/wrapper/Root.js +26 -0
- package/lib/LmEditTable/DragHandle.js +1 -1
- package/lib/LmEditTable/EditTable.d.ts +16 -3
- package/lib/LmEditTable/EditTable.js +290 -235
- package/lib/LmEditTable/components/DraggableContainer.d.ts +4 -1
- package/lib/LmEditTable/components/DraggableContainer.js +12 -5
- 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/index.d.ts +7 -2
- package/lib/LmEditTable/components/index.js +16 -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 +99 -0
- package/lib/LmEditTable/sortableItem.js +1 -0
- package/lib/LmEditTable/sortableItemCol.js +37 -8
- package/lib/LmEditTable/style/index.css +27 -0
- package/lib/LmEditTable/style/variables.css +27 -0
- package/lib/LmEditTable/util.d.ts +5 -0
- package/lib/LmEditTable/util.js +52 -11
- package/lib/LmEditTable/virtual/VirtualRow.d.ts +1 -0
- package/lib/LmEditTable/virtual/VirtualRow.js +8 -3
- package/lib/LmEditTable/virtual/VirtualRowBack.js +12 -14
- package/lib/LmFilter/LmFilter.js +6 -6
- package/lib/LmFilter/components/CheckboxFilter.js +9 -4
- package/lib/LmFilter/components/DropdownFIlter.js +186 -111
- package/lib/LmFilter/components/SelectFilter.js +4 -3
- package/lib/LmFilter/filterFns/index.js +5 -7
- package/lib/LmFilter/index.js +0 -3
- package/lib/LmFilter/style/index.css +82 -54
- package/lib/LmFilter/style/variables.css +82 -54
- package/lib/LmFilter/utils.js +6 -6
- package/lib/LmSelect/style/index.css +1 -0
- package/lib/LmSelect/style/variables.css +1 -0
- package/lib/LmTable/Table.js +24 -15
- package/lib/LmTable/expression.d.ts +1 -0
- package/lib/LmTable/expression.js +41 -0
- package/lib/LmTable/hooks/useGroupDataSource.js +50 -0
- package/lib/LmTable/style/index.css +39 -0
- package/lib/LmTable/style/variables.css +39 -0
- package/lib/LmTable/virTual/VirtualRow.js +12 -14
- package/lib/LmUpload/LmUpload.js +9 -3
- package/lib/LmUpload/UploadList/ItemPicture.js +2 -1
- package/lib/LmUpload/UploadList/ItemPictureCard.d.ts +2 -1
- package/lib/LmUpload/UploadList/ItemPictureCard.js +15 -5
- package/lib/LmUpload/UploadList/ItemText.js +7 -2
- package/lib/LmUpload/UploadList/index.js +54 -2
- package/lib/LmUpload/body/UploadCore.js +5 -1
- package/lib/LmUpload/fns/index.d.ts +1 -0
- package/lib/LmUpload/fns/index.js +27 -6
- package/lib/LmUpload/style/index.css +17 -0
- package/lib/LmUpload/style/variables.css +17 -0
- package/lib/QuickMenu/index.d.ts +3 -1
- package/lib/QuickMenu/index.js +21 -18
- package/lib/Select/index.d.ts +3 -0
- package/lib/Select/index.js +47 -7
- package/lib/Select/style/index.css +28 -0
- package/lib/Select/style/variables.css +28 -0
- package/lib/TreeSelect/index.js +21 -2
- package/lib/TreeSelect/style/index.css +3 -0
- package/lib/TreeSelect/style/variables.css +3 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +15 -1
- package/lib/styles/variables.css +270 -120
- package/package.json +5 -1
|
@@ -17,8 +17,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
17
17
|
|
|
18
18
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
19
19
|
|
|
20
|
-
var _icons = require("@ant-design/icons");
|
|
21
|
-
|
|
22
20
|
var _moment = _interopRequireDefault(require("moment"));
|
|
23
21
|
|
|
24
22
|
var _sortable = require("@dnd-kit/sortable");
|
|
@@ -97,8 +95,6 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
97
95
|
}
|
|
98
96
|
return t;
|
|
99
97
|
};
|
|
100
|
-
/* eslint-disable no-unused-vars */
|
|
101
|
-
|
|
102
98
|
|
|
103
99
|
var UploadBtn = _UploadOss.default.UploadBtn;
|
|
104
100
|
|
|
@@ -132,6 +128,7 @@ var EditableSortRow = function EditableSortRow(_a) {
|
|
|
132
128
|
|
|
133
129
|
return /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Form, {
|
|
134
130
|
form: form,
|
|
131
|
+
disabled: props.disabled || false,
|
|
135
132
|
component: false
|
|
136
133
|
}, /*#__PURE__*/_react.default.createElement(EditableContext.Provider, {
|
|
137
134
|
value: form
|
|
@@ -262,80 +259,6 @@ var InputRange = function InputRange(_a) {
|
|
|
262
259
|
return handleInput(e, 'next');
|
|
263
260
|
}
|
|
264
261
|
}, editEnum))));
|
|
265
|
-
}; // 操作列
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
var Opetate = function Opetate(_ref) {
|
|
269
|
-
var record = _ref.record,
|
|
270
|
-
rowKey = _ref.rowKey,
|
|
271
|
-
handleAdd = _ref.handleAdd,
|
|
272
|
-
handleDelete = _ref.handleDelete,
|
|
273
|
-
_ref$options = _ref.options,
|
|
274
|
-
options = _ref$options === void 0 ? ['add', 'delete'] : _ref$options,
|
|
275
|
-
getLength = _ref.getLength,
|
|
276
|
-
quickOpetateClearAll = _ref.quickOpetateClearAll;
|
|
277
|
-
|
|
278
|
-
var appendChildren = function appendChildren() {
|
|
279
|
-
handleAdd === null || handleAdd === void 0 ? void 0 : handleAdd(record, true);
|
|
280
|
-
};
|
|
281
|
-
|
|
282
|
-
var appendAdd = function appendAdd() {
|
|
283
|
-
handleAdd === null || handleAdd === void 0 ? void 0 : handleAdd(record);
|
|
284
|
-
};
|
|
285
|
-
|
|
286
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
287
|
-
style: {
|
|
288
|
-
display: 'flex',
|
|
289
|
-
alignItems: 'center',
|
|
290
|
-
justifyContent: 'flex-start',
|
|
291
|
-
marginLeft: '-4px'
|
|
292
|
-
}
|
|
293
|
-
}, options.includes('delete') && /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Button, {
|
|
294
|
-
type: "link",
|
|
295
|
-
size: "small",
|
|
296
|
-
disabled: !quickOpetateClearAll && getLength < 2,
|
|
297
|
-
icon: /*#__PURE__*/_react.default.createElement(_linkmoreDesign.IconFont, {
|
|
298
|
-
type: "lmweb-minus-circle",
|
|
299
|
-
style: {
|
|
300
|
-
fontSize: 16
|
|
301
|
-
}
|
|
302
|
-
}),
|
|
303
|
-
onClick: function onClick() {
|
|
304
|
-
return handleDelete(record[rowKey]);
|
|
305
|
-
}
|
|
306
|
-
}), (options === null || options === void 0 ? void 0 : options.includes('add')) && (options === null || options === void 0 ? void 0 : options.includes('addInChildren')) ? /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Popover, {
|
|
307
|
-
placement: "bottom",
|
|
308
|
-
overlayClassName: "lm_table_append_add_popover",
|
|
309
|
-
open: open,
|
|
310
|
-
title: null,
|
|
311
|
-
content: /*#__PURE__*/_react.default.createElement("ul", null, /*#__PURE__*/_react.default.createElement("li", {
|
|
312
|
-
onClick: appendAdd
|
|
313
|
-
}, "\u6DFB\u52A0\u5E73\u7EA7"), /*#__PURE__*/_react.default.createElement("li", {
|
|
314
|
-
onClick: appendChildren
|
|
315
|
-
}, "\u6DFB\u52A0\u5B50\u7EA7")),
|
|
316
|
-
trigger: "hover"
|
|
317
|
-
}, /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Button, {
|
|
318
|
-
type: "link",
|
|
319
|
-
size: "small",
|
|
320
|
-
icon: /*#__PURE__*/_react.default.createElement(_linkmoreDesign.IconFont, {
|
|
321
|
-
type: "lmweb-plus-circle-fill",
|
|
322
|
-
style: {
|
|
323
|
-
fontSize: 16
|
|
324
|
-
}
|
|
325
|
-
})
|
|
326
|
-
})) : /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Button, {
|
|
327
|
-
type: "link",
|
|
328
|
-
size: "small",
|
|
329
|
-
icon: /*#__PURE__*/_react.default.createElement(_linkmoreDesign.IconFont, {
|
|
330
|
-
type: "lmweb-plus-circle-fill",
|
|
331
|
-
style: {
|
|
332
|
-
fontSize: 16
|
|
333
|
-
}
|
|
334
|
-
}),
|
|
335
|
-
onClick: function onClick() {
|
|
336
|
-
return handleAdd(record, (options === null || options === void 0 ? void 0 : options.includes('addInChildren')) ? true : false);
|
|
337
|
-
}
|
|
338
|
-
}));
|
|
339
262
|
};
|
|
340
263
|
/*
|
|
341
264
|
表格单元格
|
|
@@ -366,9 +289,7 @@ var EditableCell = function EditableCell(props) {
|
|
|
366
289
|
handleDelete = props.handleDelete,
|
|
367
290
|
handleCopy = props.handleCopy,
|
|
368
291
|
itemProps = props.itemProps,
|
|
369
|
-
|
|
370
|
-
reWriteOriginSource = props.reWriteOriginSource,
|
|
371
|
-
restProps = __rest(props, ["record", "rowKey", "isEdit", "col", "rowIndex", "colIndex", "handleTableRowDelete", "handleTableRowAdd", "quickOpetateClearAll", "getLength", "isHoverEdit", "editEnum", "valueType", "children", "handleSave", "handleAdd", "handleDelete", "handleCopy", "itemProps", "setValid", "reWriteOriginSource"]);
|
|
292
|
+
restProps = __rest(props, ["record", "rowKey", "isEdit", "col", "rowIndex", "colIndex", "handleTableRowDelete", "handleTableRowAdd", "quickOpetateClearAll", "getLength", "isHoverEdit", "editEnum", "valueType", "children", "handleSave", "handleAdd", "handleDelete", "handleCopy", "itemProps"]);
|
|
372
293
|
/** 去除移入移出功能,保留最纯粹的功能,优化性能 */
|
|
373
294
|
|
|
374
295
|
|
|
@@ -456,13 +377,7 @@ var EditableCell = function EditableCell(props) {
|
|
|
456
377
|
case 13:
|
|
457
378
|
if (col === null || col === void 0 ? void 0 : col.hoverEdit) {
|
|
458
379
|
toggleEdit();
|
|
459
|
-
}
|
|
460
|
-
// setValid((old) => {
|
|
461
|
-
// const obj = { ...old }
|
|
462
|
-
// delete obj[record[rowKey]]
|
|
463
|
-
// return obj
|
|
464
|
-
// })
|
|
465
|
-
|
|
380
|
+
}
|
|
466
381
|
|
|
467
382
|
_context.next = 18;
|
|
468
383
|
break;
|
|
@@ -494,7 +409,16 @@ var EditableCell = function EditableCell(props) {
|
|
|
494
409
|
};
|
|
495
410
|
|
|
496
411
|
var Control = function Control(con) {
|
|
412
|
+
var _a;
|
|
413
|
+
|
|
497
414
|
var resultComponentProps = (0, _lodash.isFunction)(componentProps) ? componentProps === null || componentProps === void 0 ? void 0 : componentProps(record, col) : componentProps;
|
|
415
|
+
|
|
416
|
+
if ((0, _lodash.isFunction)(componentProps) && ((_a = col === null || col === void 0 ? void 0 : col.newOptions) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
417
|
+
resultComponentProps = Object.assign(Object.assign({}, resultComponentProps), {
|
|
418
|
+
options: col === null || col === void 0 ? void 0 : col.newOptions
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
|
|
498
422
|
var clearAttrComponentProps = (0, _lodash.omit)(resultComponentProps, ['optionOnly', 'isOnlyValue', 'quickcopy']);
|
|
499
423
|
|
|
500
424
|
switch (con) {
|
|
@@ -521,8 +445,7 @@ var EditableCell = function EditableCell(props) {
|
|
|
521
445
|
|
|
522
446
|
case 'inputRange':
|
|
523
447
|
return /*#__PURE__*/_react.default.createElement(InputRange, Object.assign({
|
|
524
|
-
onChange: handleFormItemChange
|
|
525
|
-
ref: inputRef
|
|
448
|
+
onChange: handleFormItemChange
|
|
526
449
|
}, resultComponentProps, {
|
|
527
450
|
record: record,
|
|
528
451
|
rowIndex: rowIndex,
|
|
@@ -612,10 +535,9 @@ var EditableCell = function EditableCell(props) {
|
|
|
612
535
|
|
|
613
536
|
case 'operate':
|
|
614
537
|
case 'lm_edit_opetate':
|
|
615
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
538
|
+
return /*#__PURE__*/_react.default.createElement(_components.QuickOpetate, Object.assign({
|
|
616
539
|
record: record,
|
|
617
540
|
rowKey: rowKey,
|
|
618
|
-
ref: inputRef,
|
|
619
541
|
handleAdd: handleTableRowAdd,
|
|
620
542
|
handleDelete: handleTableRowDelete,
|
|
621
543
|
getLength: getLength,
|
|
@@ -624,11 +546,12 @@ var EditableCell = function EditableCell(props) {
|
|
|
624
546
|
|
|
625
547
|
case 'render':
|
|
626
548
|
{
|
|
627
|
-
var
|
|
549
|
+
var _resultComponentProps = resultComponentProps,
|
|
550
|
+
render = _resultComponentProps.render;
|
|
628
551
|
var fromData = form.getFieldsValue();
|
|
629
552
|
return render === null || render === void 0 ? void 0 : render(Object.assign(Object.assign({}, !(0, _util.isObjEmpty)(fromData) ? Object.assign(Object.assign({}, record), (0, _defineProperty2.default)({}, dataIndex, fromData[dataIndex])) : record), {
|
|
630
553
|
onChange: save
|
|
631
|
-
}));
|
|
554
|
+
}), rowIndex);
|
|
632
555
|
}
|
|
633
556
|
|
|
634
557
|
default:
|
|
@@ -665,7 +588,8 @@ var EditableCell = function EditableCell(props) {
|
|
|
665
588
|
valuePropName: editable === 'switch' ? 'checked' : 'value',
|
|
666
589
|
style: {
|
|
667
590
|
margin: 0
|
|
668
|
-
}
|
|
591
|
+
},
|
|
592
|
+
noStyle: formProps ? false : true
|
|
669
593
|
}, formProps, {
|
|
670
594
|
name: dataIndex
|
|
671
595
|
}), Control(editable)));
|
|
@@ -677,6 +601,7 @@ var EditableCell = function EditableCell(props) {
|
|
|
677
601
|
margin: 0
|
|
678
602
|
}
|
|
679
603
|
}, formProps, {
|
|
604
|
+
noStyle: formProps ? false : true,
|
|
680
605
|
name: [dataIndex, 'value']
|
|
681
606
|
}), Control(editable)));
|
|
682
607
|
}
|
|
@@ -687,14 +612,14 @@ var EditableCell = function EditableCell(props) {
|
|
|
687
612
|
}
|
|
688
613
|
|
|
689
614
|
return childNode;
|
|
690
|
-
}, [col, isEdit, editing, getLength]); // 出现死循环找我
|
|
615
|
+
}, [col, isEdit, editing, getLength, record]); // 出现死循环找我
|
|
691
616
|
|
|
692
617
|
(0, _react.useEffect)(function () {
|
|
693
618
|
var editable = col.editable,
|
|
694
619
|
dataIndex = col.dataIndex;
|
|
695
620
|
|
|
696
621
|
if (isEdit && editable) {
|
|
697
|
-
form.setFieldsValue((0, _defineProperty2.default)({}, dataIndex, editable === 'date' ? (0, _moment.default)(record[dataIndex]) : record[dataIndex]));
|
|
622
|
+
form.setFieldsValue((0, _defineProperty2.default)({}, dataIndex, editable === 'date' && record[dataIndex] ? (0, _moment.default)(record[dataIndex]) : record[dataIndex]));
|
|
698
623
|
}
|
|
699
624
|
}, [record]);
|
|
700
625
|
|
|
@@ -733,10 +658,16 @@ var EditableCell = function EditableCell(props) {
|
|
|
733
658
|
var MemoEditableCell = /*#__PURE__*/(0, _react.memo)(EditableCell, function (prev, next) {
|
|
734
659
|
var pickProps = ['record', 'colIndex'];
|
|
735
660
|
var p = (0, _lodash.pick)(prev, pickProps);
|
|
736
|
-
var n = (0, _lodash.pick)(next, pickProps);
|
|
661
|
+
var n = (0, _lodash.pick)(next, pickProps);
|
|
662
|
+
|
|
663
|
+
if (next === null || next === void 0 ? void 0 : next.shouldUpdate) {
|
|
664
|
+
return false;
|
|
665
|
+
} // console.log(!checkMemoShouldUploadSpecialFun(prev, next), isEqual(p, n), '22', prev.record, next.record)
|
|
666
|
+
// console.log('333', checkMemoShouldUploadSpecialFun(prev, next), isEqual(p, n))
|
|
737
667
|
|
|
738
668
|
/** TODO: 在record中带有children,子列表数据修改之后,会导致父级的record对比不一样 */
|
|
739
669
|
|
|
670
|
+
|
|
740
671
|
if (!(0, _util.checkMemoShouldUploadSpecialFun)(prev, next)) {
|
|
741
672
|
return false;
|
|
742
673
|
}
|
|
@@ -744,6 +675,8 @@ var MemoEditableCell = /*#__PURE__*/(0, _react.memo)(EditableCell, function (pre
|
|
|
744
675
|
return (0, _lodash.isEqual)(p, n);
|
|
745
676
|
});
|
|
746
677
|
var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
678
|
+
var _a, _b;
|
|
679
|
+
|
|
747
680
|
var defaultData = props.value,
|
|
748
681
|
columns = props.columns,
|
|
749
682
|
isEdit = props.isEdit,
|
|
@@ -762,16 +695,19 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
762
695
|
rowSelection = props.rowSelection,
|
|
763
696
|
virtual = props.virtual,
|
|
764
697
|
sortOpen = props.sortOpen,
|
|
698
|
+
disabled = props.disabled,
|
|
765
699
|
colSortOpen = props.colSortOpen,
|
|
700
|
+
_props$indexCol = props.indexCol,
|
|
701
|
+
indexCol = _props$indexCol === void 0 ? false : _props$indexCol,
|
|
766
702
|
filterChange = props.filterChange,
|
|
767
703
|
_props$size = props.size,
|
|
768
704
|
size = _props$size === void 0 ? 'small' : _props$size,
|
|
769
705
|
recordCreatorProps = props.recordCreatorProps,
|
|
770
706
|
_props$shouldUpdate = props.shouldUpdate,
|
|
771
707
|
shouldUpdate = _props$shouldUpdate === void 0 ? false : _props$shouldUpdate,
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
708
|
+
_props$loading = props.loading,
|
|
709
|
+
loading = _props$loading === void 0 ? false : _props$loading,
|
|
710
|
+
resetProps = __rest(props, ["value", "columns", "isEdit", "isAdd", "onChange", "rowKey", "rowHoverEdit", "isUseForm", "isHoverEdit", "useQuickOpetate", "quickOpetateClearAll", "rowSelection", "virtual", "sortOpen", "disabled", "colSortOpen", "indexCol", "filterChange", "size", "recordCreatorProps", "shouldUpdate", "loading"]);
|
|
775
711
|
|
|
776
712
|
var _useControllableValue = (0, _ahooks.useControllableValue)({
|
|
777
713
|
value: (0, _util.checkRowKeyByDataSource)(props.value, _rowKey),
|
|
@@ -779,30 +715,36 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
779
715
|
}),
|
|
780
716
|
_useControllableValue2 = (0, _slicedToArray2.default)(_useControllableValue, 2),
|
|
781
717
|
dataSource = _useControllableValue2[0],
|
|
782
|
-
setDataSource = _useControllableValue2[1];
|
|
718
|
+
setDataSource = _useControllableValue2[1];
|
|
783
719
|
|
|
720
|
+
var transformRowSelect = function transformRowSelect(selectedRowKeys, selectedRows, info) {
|
|
721
|
+
var _a;
|
|
784
722
|
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
_valid = _useState8[0],
|
|
788
|
-
setValid = _useState8[1];
|
|
723
|
+
return (_a = rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.onChange) === null || _a === void 0 ? void 0 : _a.call(rowSelection, selectedRowKeys, selectedRows, info);
|
|
724
|
+
};
|
|
789
725
|
|
|
790
|
-
var
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
726
|
+
var _useControllableValue3 = (0, _ahooks.useControllableValue)({
|
|
727
|
+
value: {
|
|
728
|
+
selectedRows: (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRows) || (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || []
|
|
729
|
+
},
|
|
730
|
+
onChange: (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.onChange) ? transformRowSelect : undefined
|
|
731
|
+
}),
|
|
732
|
+
_useControllableValue4 = (0, _slicedToArray2.default)(_useControllableValue3, 2),
|
|
733
|
+
localRowSelectList = _useControllableValue4[0],
|
|
734
|
+
setLocalRowSelectList = _useControllableValue4[1];
|
|
735
|
+
/** TODO: 当前展开的列 */
|
|
795
736
|
|
|
796
737
|
|
|
797
|
-
var
|
|
798
|
-
|
|
799
|
-
expandedRowKeys =
|
|
800
|
-
setExpandedRowKeys =
|
|
738
|
+
var _useState7 = (0, _react.useState)([]),
|
|
739
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
740
|
+
expandedRowKeys = _useState8[0],
|
|
741
|
+
setExpandedRowKeys = _useState8[1];
|
|
801
742
|
|
|
802
743
|
var dataSourceRef = (0, _react.useRef)(dataSource);
|
|
803
744
|
var deepDataSourceRef = (0, _react.useRef)((0, _util.deepDataSourcePreKeys)(dataSource, _rowKey));
|
|
804
745
|
dataSourceRef.current = dataSource;
|
|
805
746
|
deepDataSourceRef.current = (0, _util.deepDataSourcePreKeys)(dataSource, _rowKey);
|
|
747
|
+
var tableWarpRef = (0, _react.useRef)(null);
|
|
806
748
|
|
|
807
749
|
var onColSortEnd = function onColSortEnd(active, over) {
|
|
808
750
|
var _a;
|
|
@@ -824,41 +766,21 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
824
766
|
var handleDelete = function handleDelete(key) {
|
|
825
767
|
var nValue = dataSource.filter(function (item) {
|
|
826
768
|
return item[_rowKey] !== key;
|
|
827
|
-
});
|
|
828
|
-
|
|
769
|
+
});
|
|
829
770
|
setDataSource(nValue);
|
|
830
771
|
};
|
|
831
|
-
/**
|
|
772
|
+
/** 点击底部添加按钮添加 */
|
|
832
773
|
|
|
833
774
|
|
|
834
|
-
var handleAdd = function
|
|
775
|
+
var handleAdd = (0, _lodash.debounce)(function (row) {
|
|
835
776
|
var _a;
|
|
836
777
|
|
|
837
778
|
var addDataInfo = (0, _lodash.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;
|
|
838
779
|
var res = (0, _immer.produce)(dataSourceRef.current, function (draft) {
|
|
839
780
|
draft.push(Object.assign((0, _defineProperty2.default)({}, _rowKey, "".concat(Date.now())), addDataInfo || {}));
|
|
840
781
|
});
|
|
841
|
-
setDataSource(res);
|
|
842
|
-
};
|
|
843
|
-
/** 本地缓存一个选择数据 */
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
(0, _react.useEffect)(function () {
|
|
847
|
-
if (rowSelection) {
|
|
848
|
-
var selectedRowKeys = rowSelection.selectedRowKeys;
|
|
849
|
-
|
|
850
|
-
if (selectedRowKeys) {
|
|
851
|
-
setLocalRowSelectList(localRowSelectList || []);
|
|
852
|
-
}
|
|
853
|
-
}
|
|
854
|
-
}, [rowSelection]);
|
|
855
|
-
|
|
856
|
-
var editTableRowChange = function editTableRowChange(selectRows) {
|
|
857
|
-
var _a;
|
|
858
|
-
|
|
859
|
-
setLocalRowSelectList(selectRows);
|
|
860
|
-
(_a = rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.onChange) === null || _a === void 0 ? void 0 : _a.call(rowSelection, selectRows);
|
|
861
|
-
};
|
|
782
|
+
setDataSource(res);
|
|
783
|
+
}, 40);
|
|
862
784
|
|
|
863
785
|
var handleSave = function handleSave(row, options) {
|
|
864
786
|
var _a, _b;
|
|
@@ -866,9 +788,9 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
866
788
|
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;
|
|
867
789
|
var res = (0, _immer.produce)(dataSourceRef.current, function (draft) {
|
|
868
790
|
if (options === null || options === void 0 ? void 0 : options.only) {
|
|
869
|
-
var
|
|
870
|
-
key =
|
|
871
|
-
value =
|
|
791
|
+
var _ref = options === null || options === void 0 ? void 0 : options.only,
|
|
792
|
+
key = _ref.key,
|
|
793
|
+
value = _ref.value;
|
|
872
794
|
|
|
873
795
|
if ((preKeys === null || preKeys === void 0 ? void 0 : preKeys.length) > 1) {
|
|
874
796
|
var deeps = function deeps(children) {
|
|
@@ -931,25 +853,26 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
931
853
|
}
|
|
932
854
|
});
|
|
933
855
|
setDataSource(res);
|
|
934
|
-
};
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
var handleTableRowDelete = function
|
|
856
|
+
}; // const reWriteOriginSource = (rowKey: string, rowValue, dataIndex: number, nextValue) => {
|
|
857
|
+
// setDataSource((prevDataSource) => {
|
|
858
|
+
// return prevDataSource?.map((item) => {
|
|
859
|
+
// if (get(item, rowKey) === rowValue) {
|
|
860
|
+
// set(item, dataIndex, nextValue)
|
|
861
|
+
// }
|
|
862
|
+
// return item
|
|
863
|
+
// })
|
|
864
|
+
// })
|
|
865
|
+
// }
|
|
866
|
+
// @ts-ignore
|
|
867
|
+
|
|
868
|
+
/** 删除当前行 */
|
|
869
|
+
|
|
870
|
+
|
|
871
|
+
var handleTableRowDelete = (0, _lodash.debounce)(function (key) {
|
|
950
872
|
var _a, _b, _c;
|
|
951
873
|
|
|
952
|
-
var
|
|
874
|
+
var rkey = (0, _lodash.isObject)(key) ? key[_rowKey] : key;
|
|
875
|
+
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;
|
|
953
876
|
|
|
954
877
|
if (preKeys.length > 1) {
|
|
955
878
|
/** 说明删除的是children中的数据 */
|
|
@@ -970,7 +893,7 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
970
893
|
return newData;
|
|
971
894
|
};
|
|
972
895
|
|
|
973
|
-
var res = filter(
|
|
896
|
+
var res = filter(dataSourceRef.current, key);
|
|
974
897
|
setDataSource(res);
|
|
975
898
|
} else {
|
|
976
899
|
if (((_c = dataSourceRef.current) === null || _c === void 0 ? void 0 : _c.length) === 1 && !quickOpetateClearAll) {
|
|
@@ -989,34 +912,76 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
989
912
|
|
|
990
913
|
setDataSource(_res);
|
|
991
914
|
}
|
|
992
|
-
};
|
|
993
|
-
/** 快捷添加 */
|
|
994
915
|
|
|
916
|
+
return null;
|
|
917
|
+
}, 40);
|
|
918
|
+
/** 替换当前行 */
|
|
995
919
|
|
|
996
|
-
var
|
|
920
|
+
var handleTableRowReplace = (0, _lodash.debounce)(function (record, defaultRecord) {
|
|
997
921
|
var _a, _b;
|
|
998
922
|
|
|
999
|
-
var
|
|
923
|
+
var rkey = (0, _lodash.isObject)(record) ? record[_rowKey] : record;
|
|
924
|
+
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)
|
|
925
|
+
|
|
926
|
+
var deep = function deep(children) {
|
|
927
|
+
return children.map(function (item) {
|
|
928
|
+
if (item[_rowKey] === rkey) {
|
|
929
|
+
return defaultRecord;
|
|
930
|
+
} else if (preKeys.includes(item[_rowKey]) && item.children) {
|
|
931
|
+
var child = deep(item.children);
|
|
932
|
+
return Object.assign(Object.assign({}, item), {
|
|
933
|
+
children: child
|
|
934
|
+
});
|
|
935
|
+
} else {
|
|
936
|
+
return item;
|
|
937
|
+
}
|
|
938
|
+
});
|
|
939
|
+
};
|
|
940
|
+
|
|
941
|
+
var res = deep(dataSourceRef.current);
|
|
942
|
+
setDataSource(res);
|
|
943
|
+
}, 40);
|
|
944
|
+
/** 快捷添加 */
|
|
945
|
+
|
|
946
|
+
var handleTableRowAdd = (0, _lodash.debounce)(function (record, isAppendInChindren, defaultRecord) {
|
|
947
|
+
var _a, _b;
|
|
948
|
+
|
|
949
|
+
var rkey = (0, _lodash.isObject)(record) ? record[_rowKey] : record;
|
|
950
|
+
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;
|
|
1000
951
|
var res = (0, _immer.produce)(dataSourceRef.current, function (draft) {
|
|
1001
|
-
var _a, _b, _c, _d;
|
|
952
|
+
var _a, _b, _c, _d, _e;
|
|
1002
953
|
|
|
1003
|
-
if (preKeys.length > 1) {
|
|
954
|
+
if ((preKeys === null || preKeys === void 0 ? void 0 : preKeys.length) > 1) {
|
|
1004
955
|
var deeps = function deeps(children) {
|
|
1005
956
|
children === null || children === void 0 ? void 0 : children.forEach(function (item, index) {
|
|
1006
|
-
var _a;
|
|
957
|
+
var _a, _b;
|
|
1007
958
|
|
|
1008
959
|
if (preKeys === null || preKeys === void 0 ? void 0 : preKeys.includes(item[_rowKey])) {
|
|
1009
|
-
if (item[_rowKey] ===
|
|
960
|
+
if (item[_rowKey] === rkey) {
|
|
1010
961
|
if (isAppendInChindren) {
|
|
1011
962
|
if (item === null || item === void 0 ? void 0 : item.children) {
|
|
1012
|
-
|
|
963
|
+
if (Array.isArray(defaultRecord)) {
|
|
964
|
+
var _a2;
|
|
965
|
+
|
|
966
|
+
(_a = item === null || item === void 0 ? void 0 : item.children) === null || _a === void 0 ? void 0 : (_a2 = _a).push.apply(_a2, (0, _toConsumableArray2.default)(defaultRecord));
|
|
967
|
+
} else {
|
|
968
|
+
(_b = item === null || item === void 0 ? void 0 : item.children) === null || _b === void 0 ? void 0 : _b.push(defaultRecord || (0, _defineProperty2.default)({}, _rowKey, "".concat(Date.now())));
|
|
969
|
+
}
|
|
1013
970
|
} else {
|
|
1014
|
-
|
|
971
|
+
if (Array.isArray(defaultRecord)) {
|
|
972
|
+
item.children = (0, _toConsumableArray2.default)(defaultRecord);
|
|
973
|
+
} else {
|
|
974
|
+
item.children = [defaultRecord || (0, _defineProperty2.default)({}, _rowKey, "".concat(Date.now()))];
|
|
975
|
+
}
|
|
1015
976
|
}
|
|
1016
977
|
|
|
1017
978
|
!expandedRowKeys.includes(item[_rowKey]) && setExpandedRowKeys([].concat((0, _toConsumableArray2.default)(expandedRowKeys), [item[_rowKey]]));
|
|
1018
979
|
} else {
|
|
1019
|
-
|
|
980
|
+
if (Array.isArray(defaultRecord)) {
|
|
981
|
+
children.splice.apply(children, [index + 1, 0].concat((0, _toConsumableArray2.default)(defaultRecord)));
|
|
982
|
+
} else {
|
|
983
|
+
children.splice(index + 1, 0, defaultRecord || (0, _defineProperty2.default)({}, _rowKey, "".concat(Date.now())));
|
|
984
|
+
}
|
|
1020
985
|
}
|
|
1021
986
|
} else if (item.children) {
|
|
1022
987
|
deeps(item.children);
|
|
@@ -1028,26 +993,37 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1028
993
|
deeps(draft);
|
|
1029
994
|
} else {
|
|
1030
995
|
var index = draft.findIndex(function (item) {
|
|
1031
|
-
return
|
|
996
|
+
return rkey === item[_rowKey];
|
|
1032
997
|
});
|
|
1033
998
|
|
|
1034
999
|
if (index !== -1) {
|
|
1035
1000
|
if (isAppendInChindren) {
|
|
1036
1001
|
if ((_a = draft[index].children) === null || _a === void 0 ? void 0 : _a.length) {
|
|
1037
|
-
|
|
1002
|
+
if (Array.isArray(defaultRecord)) {
|
|
1003
|
+
var _b2;
|
|
1004
|
+
|
|
1005
|
+
(_b = draft[index].children) === null || _b === void 0 ? void 0 : (_b2 = _b).push.apply(_b2, (0, _toConsumableArray2.default)(defaultRecord));
|
|
1006
|
+
} else {
|
|
1007
|
+
(_c = draft[index].children) === null || _c === void 0 ? void 0 : _c.push(defaultRecord || (0, _defineProperty2.default)({}, _rowKey, "".concat(Date.now())));
|
|
1008
|
+
}
|
|
1038
1009
|
} else {
|
|
1039
|
-
draft[index].children = [(0, _defineProperty2.default)({}, _rowKey, "".concat(Date.now()))];
|
|
1010
|
+
draft[index].children = Array.isArray(defaultRecord) ? (0, _toConsumableArray2.default)(defaultRecord) : [defaultRecord || (0, _defineProperty2.default)({}, _rowKey, "".concat(Date.now()))];
|
|
1040
1011
|
}
|
|
1041
1012
|
|
|
1042
|
-
!expandedRowKeys.includes((
|
|
1013
|
+
!expandedRowKeys.includes((_d = draft[index]) === null || _d === void 0 ? void 0 : _d[_rowKey]) && setExpandedRowKeys([].concat((0, _toConsumableArray2.default)(expandedRowKeys), [(_e = draft[index]) === null || _e === void 0 ? void 0 : _e[_rowKey]]));
|
|
1043
1014
|
} else {
|
|
1044
|
-
|
|
1015
|
+
if (Array.isArray(defaultRecord)) {
|
|
1016
|
+
draft.splice.apply(draft, [index + 1, 0].concat((0, _toConsumableArray2.default)(defaultRecord)));
|
|
1017
|
+
} else {
|
|
1018
|
+
draft.splice(index + 1, 0, defaultRecord || (0, _defineProperty2.default)({}, _rowKey, "".concat(Date.now())));
|
|
1019
|
+
}
|
|
1045
1020
|
}
|
|
1046
1021
|
}
|
|
1047
1022
|
}
|
|
1048
1023
|
});
|
|
1049
1024
|
setDataSource(res);
|
|
1050
|
-
};
|
|
1025
|
+
}, 50);
|
|
1026
|
+
/** 快捷刷子功能 */
|
|
1051
1027
|
|
|
1052
1028
|
var handleCopy = function handleCopy(key, value, type, rowIndex) {
|
|
1053
1029
|
var res = (0, _immer.produce)(dataSourceRef.current, function (draft) {
|
|
@@ -1066,8 +1042,9 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1066
1042
|
var hasOnlyOptionsDatas = columns.filter(function (item) {
|
|
1067
1043
|
var _a;
|
|
1068
1044
|
|
|
1069
|
-
|
|
1070
|
-
|
|
1045
|
+
var resultComponentProps = (0, _lodash.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;
|
|
1046
|
+
return resultComponentProps === null || resultComponentProps === void 0 ? void 0 : resultComponentProps.optionOnly;
|
|
1047
|
+
}); // const hasOnlyOptionsDatas = columns.filter((item) => item?.componentProps?.optionOnly)
|
|
1071
1048
|
|
|
1072
1049
|
if (hasOnlyOptionsDatas.length) {
|
|
1073
1050
|
return hasOnlyOptionsDatas === null || hasOnlyOptionsDatas === void 0 ? void 0 : hasOnlyOptionsDatas.map(function (item) {
|
|
@@ -1081,9 +1058,13 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1081
1058
|
|
|
1082
1059
|
var DisableOptions = (0, _react.useMemo)(function () {
|
|
1083
1060
|
var newColumns = columns === null || columns === void 0 ? void 0 : columns.map(function (item) {
|
|
1084
|
-
var
|
|
1085
|
-
|
|
1086
|
-
|
|
1061
|
+
var _a;
|
|
1062
|
+
|
|
1063
|
+
var resultComponentProps = (0, _lodash.isFunction)(item.componentProps) ? (_a = item.componentProps) === null || _a === void 0 ? void 0 : _a.call(item, {}, item) : item.componentProps;
|
|
1064
|
+
|
|
1065
|
+
var _ref8 = resultComponentProps || {},
|
|
1066
|
+
optionOnly = _ref8.optionOnly,
|
|
1067
|
+
options = _ref8.options;
|
|
1087
1068
|
|
|
1088
1069
|
if (optionOnly && options) {
|
|
1089
1070
|
var dataIndex = item.dataIndex;
|
|
@@ -1095,6 +1076,13 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1095
1076
|
disabled: !!dataIndexData.includes(o === null || o === void 0 ? void 0 : o.value)
|
|
1096
1077
|
});
|
|
1097
1078
|
});
|
|
1079
|
+
|
|
1080
|
+
if ((0, _lodash.isFunction)(item.componentProps)) {
|
|
1081
|
+
return Object.assign(Object.assign({}, item), {
|
|
1082
|
+
newOptions: newOptions
|
|
1083
|
+
});
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1098
1086
|
return Object.assign(Object.assign({}, item), {
|
|
1099
1087
|
componentProps: Object.assign(Object.assign({}, item.componentProps), {
|
|
1100
1088
|
options: newOptions
|
|
@@ -1115,17 +1103,47 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1115
1103
|
var rColumns = hasDisableOptions ? DisableOptions : columns;
|
|
1116
1104
|
var localColumns = [sortOpen ? {
|
|
1117
1105
|
title: '排序',
|
|
1118
|
-
dataIndex: '
|
|
1106
|
+
dataIndex: '_sort',
|
|
1119
1107
|
width: 48,
|
|
1120
1108
|
maxWidth: 48,
|
|
1121
1109
|
className: 'drag-visible',
|
|
1122
1110
|
fixed: 'left',
|
|
1123
1111
|
render: function render(_, record) {
|
|
1124
1112
|
return /*#__PURE__*/_react.default.createElement(_DragHandle.default, {
|
|
1125
|
-
id: record[_rowKey] || record.id
|
|
1113
|
+
id: (record === null || record === void 0 ? void 0 : record[_rowKey]) || (record === null || record === void 0 ? void 0 : record.id)
|
|
1126
1114
|
});
|
|
1127
1115
|
}
|
|
1128
|
-
} : null
|
|
1116
|
+
} : null, indexCol ? (0, _lodash.isBoolean)(indexCol) ? {
|
|
1117
|
+
title: '',
|
|
1118
|
+
dataIndex: '_index',
|
|
1119
|
+
width: 48,
|
|
1120
|
+
maxWidth: 48,
|
|
1121
|
+
ellipsis: true,
|
|
1122
|
+
fixed: 'left',
|
|
1123
|
+
render: function render(_, record, index) {
|
|
1124
|
+
var _a, _b, _c;
|
|
1125
|
+
|
|
1126
|
+
console.log(deepDataSourceRef.current, '--deepDataSourceRef.current', _rowKey);
|
|
1127
|
+
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);
|
|
1128
|
+
}
|
|
1129
|
+
} : Object.assign(Object.assign({
|
|
1130
|
+
title: '',
|
|
1131
|
+
dataIndex: '_index',
|
|
1132
|
+
width: 48,
|
|
1133
|
+
ellipsis: true,
|
|
1134
|
+
maxWidth: 48,
|
|
1135
|
+
fixed: 'left'
|
|
1136
|
+
}, indexCol || {}), {
|
|
1137
|
+
render: function render(_, record, index) {
|
|
1138
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1139
|
+
|
|
1140
|
+
if ((0, _lodash.isFunction)(indexCol === null || indexCol === void 0 ? void 0 : indexCol.render)) {
|
|
1141
|
+
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']);
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
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);
|
|
1145
|
+
}
|
|
1146
|
+
}) : null].concat((0, _toConsumableArray2.default)(rColumns), [useQuickOpetate ? {
|
|
1129
1147
|
title: '操作',
|
|
1130
1148
|
dataIndex: 'lm_edit_opetate',
|
|
1131
1149
|
width: 68,
|
|
@@ -1136,9 +1154,9 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1136
1154
|
options: Array.isArray(useQuickOpetate) ? useQuickOpetate : ['add', 'delete']
|
|
1137
1155
|
}
|
|
1138
1156
|
} : null]).filter(function (item) {
|
|
1139
|
-
return item;
|
|
1157
|
+
return item && (item === null || item === void 0 ? void 0 : item.show) !== false;
|
|
1140
1158
|
});
|
|
1141
|
-
localColumns = localColumns.map(function (item, index) {
|
|
1159
|
+
localColumns = localColumns === null || localColumns === void 0 ? void 0 : localColumns.map(function (item, index) {
|
|
1142
1160
|
return Object.assign(Object.assign({}, item), {
|
|
1143
1161
|
order: [null, undefined].includes(item.order) ? index : item.order
|
|
1144
1162
|
});
|
|
@@ -1163,8 +1181,19 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1163
1181
|
var mapColumns = function mapColumns(col, index) {
|
|
1164
1182
|
var _a, _b;
|
|
1165
1183
|
|
|
1166
|
-
if (!col.editable && !((_a = col.children) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
1167
|
-
|
|
1184
|
+
if (!col.editable && !((_a = col.children) === null || _a === void 0 ? void 0 : _a.length) && (col === null || col === void 0 ? void 0 : col.dataIndex) === '_sort') {
|
|
1185
|
+
var fn = col === null || col === void 0 ? void 0 : col.render;
|
|
1186
|
+
return Object.assign(Object.assign({}, col), {
|
|
1187
|
+
render: function render(text, record, i) {
|
|
1188
|
+
var _a;
|
|
1189
|
+
|
|
1190
|
+
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
|
+
}
|
|
1192
|
+
});
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
if (isEdit && (col === null || col === void 0 ? void 0 : col.render) && (col === null || col === void 0 ? void 0 : col.editable) === 'render') {
|
|
1196
|
+
delete col.render;
|
|
1168
1197
|
}
|
|
1169
1198
|
|
|
1170
1199
|
var newCol = Object.assign(Object.assign({}, col), {
|
|
@@ -1182,7 +1211,7 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1182
1211
|
editable: col.editable,
|
|
1183
1212
|
dataIndex: col.dataIndex,
|
|
1184
1213
|
itemProps: col.itemProps,
|
|
1185
|
-
|
|
1214
|
+
shouldUpdate: shouldUpdate,
|
|
1186
1215
|
isEdit: isEdit,
|
|
1187
1216
|
isHoverEdit: isHoverEdit,
|
|
1188
1217
|
handleAdd: handleAdd,
|
|
@@ -1190,8 +1219,7 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1190
1219
|
handleCopy: handleCopy,
|
|
1191
1220
|
editEnum: typeof col.editEnum === 'function' ? col.editEnum(record) : col.editEnum,
|
|
1192
1221
|
valueType: typeof col.valueType === 'function' ? col.valueType(record) : col.valueType,
|
|
1193
|
-
handleSave: handleSave
|
|
1194
|
-
reWriteOriginSource: reWriteOriginSource
|
|
1222
|
+
handleSave: handleSave
|
|
1195
1223
|
};
|
|
1196
1224
|
}
|
|
1197
1225
|
});
|
|
@@ -1203,7 +1231,7 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1203
1231
|
return newCol;
|
|
1204
1232
|
};
|
|
1205
1233
|
|
|
1206
|
-
var res = localColumns.map(function (col, index) {
|
|
1234
|
+
var res = localColumns === null || localColumns === void 0 ? void 0 : localColumns.map(function (col, index) {
|
|
1207
1235
|
return mapColumns(col, index);
|
|
1208
1236
|
});
|
|
1209
1237
|
return res;
|
|
@@ -1240,8 +1268,24 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1240
1268
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
1241
1269
|
return {
|
|
1242
1270
|
setRow: handleSave,
|
|
1243
|
-
|
|
1244
|
-
return
|
|
1271
|
+
getCheckboxRecords: function getCheckboxRecords() {
|
|
1272
|
+
return localRowSelectList.selectedRows;
|
|
1273
|
+
},
|
|
1274
|
+
deleteRowData: function deleteRowData(data) {
|
|
1275
|
+
return handleTableRowDelete(data);
|
|
1276
|
+
},
|
|
1277
|
+
addRowData: function addRowData(data, defaultValue, addInChild) {
|
|
1278
|
+
return addInChild === 'replace' ? handleTableRowReplace(data, defaultValue) : handleTableRowAdd(data, addInChild, defaultValue);
|
|
1279
|
+
},
|
|
1280
|
+
clearSelect: function clearSelect() {
|
|
1281
|
+
setLocalRowSelectList({
|
|
1282
|
+
selectedRows: []
|
|
1283
|
+
});
|
|
1284
|
+
},
|
|
1285
|
+
customSetCheckboxRecords: function customSetCheckboxRecords(value) {
|
|
1286
|
+
setLocalRowSelectList({
|
|
1287
|
+
selectedRows: value
|
|
1288
|
+
});
|
|
1245
1289
|
}
|
|
1246
1290
|
};
|
|
1247
1291
|
});
|
|
@@ -1270,14 +1314,17 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1270
1314
|
cell: MemoEditableCell
|
|
1271
1315
|
}, sortOpen ? {
|
|
1272
1316
|
wrapper: function wrapper(wrapperProps) {
|
|
1273
|
-
var _a;
|
|
1317
|
+
var _a, _b, _c;
|
|
1274
1318
|
|
|
1275
1319
|
return (0, _components.DraggableContainer)(Object.assign(Object.assign({}, wrapperProps), {
|
|
1276
1320
|
virtual: virtual,
|
|
1277
1321
|
keys: (_a = dataSourceRef.current) === null || _a === void 0 ? void 0 : _a.map(function (item) {
|
|
1278
1322
|
return item[_rowKey];
|
|
1279
1323
|
}),
|
|
1280
|
-
|
|
1324
|
+
options: dataSourceRef.current,
|
|
1325
|
+
rowKey: _rowKey,
|
|
1326
|
+
onSortEnd: onSortEnd,
|
|
1327
|
+
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
|
|
1281
1328
|
}));
|
|
1282
1329
|
}
|
|
1283
1330
|
} : virtual ? {
|
|
@@ -1286,12 +1333,18 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1286
1333
|
header: {
|
|
1287
1334
|
row: colSortOpen ? colDraggableContainer : null
|
|
1288
1335
|
}
|
|
1336
|
+
},
|
|
1337
|
+
onRow: function onRow(record, index) {
|
|
1338
|
+
return {
|
|
1339
|
+
disabled: disabled
|
|
1340
|
+
};
|
|
1289
1341
|
}
|
|
1290
1342
|
}, resetProps));
|
|
1291
1343
|
|
|
1292
1344
|
if (colSortOpen) {
|
|
1293
1345
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
1294
|
-
className: "lm_editTable_warpper"
|
|
1346
|
+
className: "lm_editTable_warpper",
|
|
1347
|
+
ref: tableWarpRef
|
|
1295
1348
|
}, /*#__PURE__*/_react.default.createElement(_DndContainer.default, {
|
|
1296
1349
|
move: onColSortEnd
|
|
1297
1350
|
}, /*#__PURE__*/_react.default.createElement(_sortableBoxCol.default, {
|
|
@@ -1299,75 +1352,77 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1299
1352
|
return [].concat((0, _toConsumableArray2.default)(acc), [item.dataIndex]);
|
|
1300
1353
|
}, [])
|
|
1301
1354
|
}, /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Table, Object.assign({}, config.current, {
|
|
1355
|
+
loading: loading,
|
|
1302
1356
|
size: size || 'small',
|
|
1303
1357
|
columns: resultColumns,
|
|
1304
1358
|
rowClassName: "editable-row",
|
|
1305
1359
|
bordered: true,
|
|
1306
1360
|
pagination: false,
|
|
1307
|
-
|
|
1308
|
-
rowSelection: !rowSelection ? undefined : {
|
|
1361
|
+
rowSelection: !rowSelection ? undefined : Object.assign(Object.assign({
|
|
1309
1362
|
fixed: true,
|
|
1310
1363
|
type: 'checkbox',
|
|
1311
|
-
columnWidth: 36
|
|
1312
|
-
|
|
1313
|
-
|
|
1364
|
+
columnWidth: 36
|
|
1365
|
+
}, rowSelection), {
|
|
1366
|
+
selectedRowKeys: (_a = localRowSelectList === null || localRowSelectList === void 0 ? void 0 : localRowSelectList.selectedRows) === null || _a === void 0 ? void 0 : _a.map(function (v) {
|
|
1367
|
+
return (0, _lodash.isObject)(v) ? v[_rowKey] : v;
|
|
1314
1368
|
}),
|
|
1315
|
-
onChange: function onChange(selectedRowKeys, selectedRows) {
|
|
1316
|
-
|
|
1369
|
+
onChange: function onChange(selectedRowKeys, selectedRows, info) {
|
|
1370
|
+
setLocalRowSelectList(selectedRowKeys, selectedRows, info);
|
|
1317
1371
|
}
|
|
1318
|
-
},
|
|
1372
|
+
}),
|
|
1319
1373
|
dataSource: dataSource
|
|
1320
|
-
})))),
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
}
|
|
1327
|
-
}, /*#__PURE__*/_react.default.createElement(_icons.PlusCircleOutlined, {
|
|
1328
|
-
className: "lmweb-plus"
|
|
1329
|
-
}), "\u65B0\u589E"));
|
|
1374
|
+
})))), /*#__PURE__*/_react.default.createElement(_components.BottomOpetateComponent, {
|
|
1375
|
+
disabled: disabled,
|
|
1376
|
+
isShowAddAction: isShowAddAction,
|
|
1377
|
+
recordCreatorProps: recordCreatorProps,
|
|
1378
|
+
handleAdd: handleAdd
|
|
1379
|
+
}));
|
|
1330
1380
|
} // @ts-ignore
|
|
1331
1381
|
|
|
1332
1382
|
|
|
1333
1383
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
1334
|
-
className: "lm_editTable_warpper"
|
|
1384
|
+
className: "lm_editTable_warpper",
|
|
1385
|
+
ref: tableWarpRef
|
|
1335
1386
|
}, /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Table, Object.assign({}, config.current, {
|
|
1336
1387
|
size: size || 'small',
|
|
1337
1388
|
columns: resultColumns,
|
|
1338
1389
|
rowClassName: "editable-row",
|
|
1339
1390
|
bordered: true,
|
|
1391
|
+
loading: loading,
|
|
1340
1392
|
pagination: false,
|
|
1341
1393
|
// components={tableComponents}
|
|
1342
1394
|
expandable: (resetProps === null || resetProps === void 0 ? void 0 : resetProps.expandable) || {
|
|
1343
1395
|
expandedRowKeys: expandedRowKeys,
|
|
1344
1396
|
fixed: true,
|
|
1397
|
+
// indentSize: 0,
|
|
1398
|
+
expandIconColumnIndex: (0, _util.checkExpandIconColumnIndex)({
|
|
1399
|
+
rowSelection: rowSelection,
|
|
1400
|
+
sortOpen: sortOpen,
|
|
1401
|
+
indexCol: indexCol
|
|
1402
|
+
}) || 0,
|
|
1345
1403
|
onExpandedRowsChange: function onExpandedRowsChange(expandedRows) {
|
|
1346
1404
|
return setExpandedRowKeys(expandedRows);
|
|
1347
1405
|
}
|
|
1348
1406
|
},
|
|
1349
|
-
rowSelection: !rowSelection ? undefined : {
|
|
1407
|
+
rowSelection: !rowSelection ? undefined : Object.assign(Object.assign({
|
|
1350
1408
|
fixed: true,
|
|
1351
1409
|
type: 'checkbox',
|
|
1352
|
-
columnWidth: 36
|
|
1353
|
-
|
|
1354
|
-
|
|
1410
|
+
columnWidth: 36
|
|
1411
|
+
}, rowSelection), {
|
|
1412
|
+
selectedRowKeys: (_b = localRowSelectList === null || localRowSelectList === void 0 ? void 0 : localRowSelectList.selectedRows) === null || _b === void 0 ? void 0 : _b.map(function (v) {
|
|
1413
|
+
return (0, _lodash.isObject)(v) ? v[_rowKey] : v;
|
|
1355
1414
|
}),
|
|
1356
|
-
onChange: function onChange(selectedRowKeys, selectedRows) {
|
|
1357
|
-
|
|
1415
|
+
onChange: function onChange(selectedRowKeys, selectedRows, info) {
|
|
1416
|
+
setLocalRowSelectList(selectedRowKeys, selectedRows, info);
|
|
1358
1417
|
}
|
|
1359
|
-
},
|
|
1418
|
+
}),
|
|
1360
1419
|
dataSource: dataSource
|
|
1361
|
-
})),
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
}, (recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.style) || {})
|
|
1368
|
-
}, /*#__PURE__*/_react.default.createElement(_linkmoreDesign.IconFont, {
|
|
1369
|
-
type: "lmweb-plus"
|
|
1370
|
-
}), (recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.creatorButtonText) || '新增'));
|
|
1420
|
+
})), /*#__PURE__*/_react.default.createElement(_components.BottomOpetateComponent, {
|
|
1421
|
+
disabled: disabled,
|
|
1422
|
+
isShowAddAction: isShowAddAction,
|
|
1423
|
+
recordCreatorProps: recordCreatorProps,
|
|
1424
|
+
handleAdd: handleAdd
|
|
1425
|
+
}));
|
|
1371
1426
|
});
|
|
1372
1427
|
|
|
1373
1428
|
var _default = /*#__PURE__*/(0, _react.memo)(EditTable);
|