linkmore-design 1.1.27 → 1.1.28-alpha.6
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/LmEditTable/DndContainer.d.ts +6 -3
- package/dist/LmEditTable/EditTable.d.ts +15 -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/virTual/VirtualRow.d.ts +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.umd.js +1909 -679
- package/dist/index.umd.min.js +21 -21
- package/dist/variables.css +115 -2
- package/es/CardTable/style/index.css +3 -2
- package/es/CardTable/style/variables.css +3 -2
- package/es/CustomTableOption/columnsSort.js +41 -18
- 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/Form/FormItem/index.js +5 -1
- 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 +15 -5
- package/es/LmEditTable/EditTable.js +696 -361
- 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 +109 -0
- package/es/LmEditTable/style/variables.css +109 -0
- package/es/LmEditTable/util.d.ts +10 -0
- package/es/LmEditTable/util.js +158 -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/LmFilter/baseFilter/index.js +3 -2
- package/es/LmFilter/filterFns/index.js +4 -2
- package/es/LmTable/virTual/VirtualRow.d.ts +1 -1
- package/es/LmTable/virTual/VirtualRow.js +82 -48
- package/es/LmTable/virTual/VirtualTable.js +17 -9
- package/es/LmTable/virTual/context.js +14 -2
- package/es/LmUpload/body/UploadCore.js +1 -1
- package/es/LmUpload/fns/index.js +1 -1
- 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/styles/variables.css +115 -2
- package/lib/CardTable/style/index.css +3 -2
- package/lib/CardTable/style/variables.css +3 -2
- package/lib/CustomTableOption/columnsSort.js +48 -22
- 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/Form/FormItem/index.js +5 -1
- 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 +15 -5
- package/lib/LmEditTable/EditTable.js +694 -358
- 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 +109 -0
- package/lib/LmEditTable/style/variables.css +109 -0
- package/lib/LmEditTable/util.d.ts +10 -0
- package/lib/LmEditTable/util.js +167 -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/LmFilter/baseFilter/index.js +3 -2
- package/lib/LmFilter/filterFns/index.js +4 -2
- package/lib/LmTable/virTual/VirtualRow.d.ts +1 -1
- package/lib/LmTable/virTual/VirtualRow.js +81 -48
- package/lib/LmTable/virTual/VirtualTable.js +16 -8
- package/lib/LmTable/virTual/context.js +14 -2
- package/lib/LmUpload/body/UploadCore.js +1 -1
- package/lib/LmUpload/fns/index.js +1 -1
- 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/styles/variables.css +115 -2
- package/package.json +7 -9
package/dist/index.umd.js
CHANGED
|
@@ -91007,8 +91007,9 @@
|
|
|
91007
91007
|
// 二级过滤 => 基础过滤组件
|
|
91008
91008
|
var LmFilterBase = /*#__PURE__*/React__default['default'].memo(function (_ref) {
|
|
91009
91009
|
var instance = _ref.instance;
|
|
91010
|
-
var dataSource = instance.dataSource
|
|
91011
|
-
|
|
91010
|
+
var dataSource = instance.dataSource,
|
|
91011
|
+
enableSearch = instance.enableSearch;
|
|
91012
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, enableSearch && /*#__PURE__*/React__default['default'].createElement(FuzzySearch, {
|
|
91012
91013
|
instance: instance
|
|
91013
91014
|
}), dataSource.map(function (v, index) {
|
|
91014
91015
|
var isHidden = !v.show && typeof v.show === 'boolean';
|
|
@@ -92881,6 +92882,7 @@
|
|
|
92881
92882
|
|
|
92882
92883
|
if (getIsHas(itemValue) && !!item) {
|
|
92883
92884
|
return [].concat(_toConsumableArray$1(pre), [{
|
|
92885
|
+
relation: obj[cur].mode || 'and',
|
|
92884
92886
|
fieldName: cur,
|
|
92885
92887
|
fieldType: (item === null || item === void 0 ? void 0 : item.valueType) || 'string',
|
|
92886
92888
|
type: item.type,
|
|
@@ -92890,7 +92892,7 @@
|
|
|
92890
92892
|
* and 等同于逻辑关系contains: 选中的值包含所有值
|
|
92891
92893
|
* or 等同于逻辑关系in: 选中的值存在于所有值之中
|
|
92892
92894
|
*/
|
|
92893
|
-
operator:
|
|
92895
|
+
operator: 'in'
|
|
92894
92896
|
}]);
|
|
92895
92897
|
}
|
|
92896
92898
|
|
|
@@ -93056,11 +93058,12 @@
|
|
|
93056
93058
|
if (getIsHas(itemValue) && !!item) {
|
|
93057
93059
|
// eslint-disable-next-line no-param-reassign
|
|
93058
93060
|
pre[cur] = {
|
|
93061
|
+
relation: complexFilter[cur].mode || 'and',
|
|
93059
93062
|
fieldName: cur,
|
|
93060
93063
|
fieldType: (item === null || item === void 0 ? void 0 : item.valueType) || 'string',
|
|
93061
93064
|
type: item.type,
|
|
93062
93065
|
value: Array.isArray(itemValue) ? itemValue : [itemValue],
|
|
93063
|
-
operator:
|
|
93066
|
+
operator: 'in'
|
|
93064
93067
|
};
|
|
93065
93068
|
}
|
|
93066
93069
|
|
|
@@ -181820,7 +181823,7 @@
|
|
|
181820
181823
|
|
|
181821
181824
|
var filesLoopCheck = React.useCallback(function (files) {
|
|
181822
181825
|
return Promise.all(files.map(fileCheckAsync));
|
|
181823
|
-
}, []);
|
|
181826
|
+
}, [fileCheckAsync]);
|
|
181824
181827
|
/*
|
|
181825
181828
|
* 上传前: 先校验 => 全部校验通过后开始上传
|
|
181826
181829
|
* 事件执行顺序:
|
|
@@ -182040,7 +182043,7 @@
|
|
|
182040
182043
|
var isUploading = getUploadStatus().uploading;
|
|
182041
182044
|
if (isUploading) return;
|
|
182042
182045
|
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.click();
|
|
182043
|
-
}, [getUploadStatus]); // 上传触发事件
|
|
182046
|
+
}, [disabled, getUploadStatus]); // 上传触发事件
|
|
182044
182047
|
|
|
182045
182048
|
var uploadChange = React.useCallback(function (e) {
|
|
182046
182049
|
var _inputRef$current2;
|
|
@@ -188747,8 +188750,7 @@
|
|
|
188747
188750
|
|
|
188748
188751
|
var _excluded$1j = ["children", "className", "disabled", "size"];
|
|
188749
188752
|
var prefixCls$3 = 'lm_input-number';
|
|
188750
|
-
|
|
188751
|
-
var LMInputNumber = function LMInputNumber(props) {
|
|
188753
|
+
var LMInputNumber = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
188752
188754
|
var children = props.children,
|
|
188753
188755
|
className = props.className,
|
|
188754
188756
|
customDisabled = props.disabled,
|
|
@@ -188762,24 +188764,24 @@
|
|
|
188762
188764
|
var size = React__default['default'].useContext(SizeContext$1);
|
|
188763
188765
|
var mergeSize = customizeSize || size;
|
|
188764
188766
|
return /*#__PURE__*/React__default['default'].createElement(InputNumber$1, _objectSpread(_objectSpread({
|
|
188767
|
+
ref: ref,
|
|
188765
188768
|
className: classnames(className, prefixCls$3),
|
|
188766
188769
|
placeholder: "\u8BF7\u8F93\u5165"
|
|
188767
188770
|
}, rest), {}, {
|
|
188768
188771
|
size: mergeSize,
|
|
188769
188772
|
disabled: mergedDisabled
|
|
188770
188773
|
}));
|
|
188771
|
-
};
|
|
188772
|
-
|
|
188774
|
+
});
|
|
188773
188775
|
var CInputNumber = LMInputNumber;
|
|
188774
|
-
|
|
188775
|
-
CInputNumber.Price = function (props) {
|
|
188776
|
+
CInputNumber.Price = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
188776
188777
|
return /*#__PURE__*/React__default['default'].createElement(InputNumber$1, _objectSpread({
|
|
188777
188778
|
prefix: "\uFFE5",
|
|
188779
|
+
ref: ref,
|
|
188778
188780
|
formatter: function formatter(value) {
|
|
188779
188781
|
return "".concat(value).replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
188780
188782
|
}
|
|
188781
188783
|
}, props));
|
|
188782
|
-
};
|
|
188784
|
+
});
|
|
188783
188785
|
|
|
188784
188786
|
var getRenderPropValue = function getRenderPropValue(propValue) {
|
|
188785
188787
|
if (!propValue) {
|
|
@@ -233639,6 +233641,14 @@
|
|
|
233639
233641
|
return restrictToBoundingRect(transform, draggingNodeRect, containerNodeRect);
|
|
233640
233642
|
};
|
|
233641
233643
|
|
|
233644
|
+
const restrictToVerticalAxis = ({
|
|
233645
|
+
transform
|
|
233646
|
+
}) => {
|
|
233647
|
+
return { ...transform,
|
|
233648
|
+
x: 0
|
|
233649
|
+
};
|
|
233650
|
+
};
|
|
233651
|
+
|
|
233642
233652
|
var DndContainer = function DndContainer(_ref) {
|
|
233643
233653
|
var children = _ref.children,
|
|
233644
233654
|
move = _ref.move;
|
|
@@ -285835,13 +285845,20 @@
|
|
|
285835
285845
|
rowHeight: 0,
|
|
285836
285846
|
columnsLen: 0,
|
|
285837
285847
|
// 总行数
|
|
285838
|
-
totalLen: 0
|
|
285848
|
+
totalLen: 0,
|
|
285849
|
+
// 分割后的列数组
|
|
285850
|
+
sliceColumns: {
|
|
285851
|
+
leftColumns: [],
|
|
285852
|
+
centerColumns: [],
|
|
285853
|
+
rightColumns: []
|
|
285854
|
+
}
|
|
285839
285855
|
};
|
|
285840
285856
|
|
|
285841
285857
|
var reducer$4 = function reducer(state, action) {
|
|
285842
285858
|
var totalLen = action.totalLen,
|
|
285843
285859
|
columnsLen = action.columnsLen,
|
|
285844
|
-
rowHeight = action.rowHeight
|
|
285860
|
+
rowHeight = action.rowHeight,
|
|
285861
|
+
sliceColumns = action.sliceColumns;
|
|
285845
285862
|
|
|
285846
285863
|
switch (action.type) {
|
|
285847
285864
|
// 数据数量
|
|
@@ -285862,6 +285879,11 @@
|
|
|
285862
285879
|
rowHeight: rowHeight
|
|
285863
285880
|
});
|
|
285864
285881
|
|
|
285882
|
+
case 'changeSliceColumns':
|
|
285883
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
285884
|
+
sliceColumns: sliceColumns
|
|
285885
|
+
});
|
|
285886
|
+
|
|
285865
285887
|
default:
|
|
285866
285888
|
throw new Error();
|
|
285867
285889
|
}
|
|
@@ -285872,14 +285894,14 @@
|
|
|
285872
285894
|
};
|
|
285873
285895
|
|
|
285874
285896
|
var VirtualTable = /*#__PURE__*/React__default['default'].memo(function (tableProps) {
|
|
285875
|
-
var _bodyRef$current,
|
|
285897
|
+
var _bodyRef$current, _tableProps$children$3, _tableProps$children$4, _bodyRef$current2;
|
|
285876
285898
|
|
|
285877
285899
|
var bodyRef = React.useRef(null);
|
|
285878
285900
|
|
|
285879
285901
|
var _useRealive = useRealive(),
|
|
285880
285902
|
_useRealive2 = _slicedToArray$1(_useRealive, 2),
|
|
285881
285903
|
state = _useRealive2[0],
|
|
285882
|
-
dispatch = _useRealive2[1]; // { totalSize, virtualItems }
|
|
285904
|
+
dispatch = _useRealive2[1]; // 行虚拟化 { totalSize, virtualItems }
|
|
285883
285905
|
|
|
285884
285906
|
|
|
285885
285907
|
var rowVirtual = useVirtual({
|
|
@@ -285892,18 +285914,26 @@
|
|
|
285892
285914
|
return state.rowHeight;
|
|
285893
285915
|
}, [state.rowHeight]),
|
|
285894
285916
|
overscan: 5
|
|
285895
|
-
});
|
|
285917
|
+
}); // 列动态宽度
|
|
285918
|
+
|
|
285919
|
+
var columnEstimateSize = React.useCallback(function (i) {
|
|
285920
|
+
var _tableProps$children$, _tableProps$children$2;
|
|
285921
|
+
|
|
285922
|
+
var colWidths = tableProps === null || tableProps === void 0 ? void 0 : (_tableProps$children$ = tableProps.children[0]) === null || _tableProps$children$ === void 0 ? void 0 : (_tableProps$children$2 = _tableProps$children$.props) === null || _tableProps$children$2 === void 0 ? void 0 : _tableProps$children$2.colWidths;
|
|
285923
|
+
var leftColumnsLen = state.sliceColumns.leftColumns.length;
|
|
285924
|
+
var centerColumnsLen = state.sliceColumns.centerColumns.length; // 获取非固定列
|
|
285925
|
+
|
|
285926
|
+
var virList = colWidths.slice(leftColumnsLen, leftColumnsLen + centerColumnsLen);
|
|
285927
|
+
return virList[i] || 0;
|
|
285928
|
+
}, [(_tableProps$children$3 = tableProps.children[0]) === null || _tableProps$children$3 === void 0 ? void 0 : (_tableProps$children$4 = _tableProps$children$3.props) === null || _tableProps$children$4 === void 0 ? void 0 : _tableProps$children$4.colWidths, state.sliceColumns.leftColumns.length, state.sliceColumns.centerColumns.length]); // 列虚拟化
|
|
285929
|
+
|
|
285896
285930
|
var columnVirtual = useVirtual({
|
|
285897
285931
|
horizontal: true,
|
|
285898
285932
|
size: state.columnsLen,
|
|
285899
285933
|
parentRef: {
|
|
285900
285934
|
current: bodyRef === null || bodyRef === void 0 ? void 0 : (_bodyRef$current2 = bodyRef.current) === null || _bodyRef$current2 === void 0 ? void 0 : _bodyRef$current2.parentNode
|
|
285901
285935
|
},
|
|
285902
|
-
estimateSize:
|
|
285903
|
-
var _tableProps$children$, _tableProps$children$2;
|
|
285904
|
-
|
|
285905
|
-
return tableProps === null || tableProps === void 0 ? void 0 : (_tableProps$children$ = tableProps.children[0]) === null || _tableProps$children$ === void 0 ? void 0 : (_tableProps$children$2 = _tableProps$children$.props) === null || _tableProps$children$2 === void 0 ? void 0 : _tableProps$children$2.colWidths[i];
|
|
285906
|
-
}, [(_tableProps$children$3 = tableProps.children[0]) === null || _tableProps$children$3 === void 0 ? void 0 : (_tableProps$children$4 = _tableProps$children$3.props) === null || _tableProps$children$4 === void 0 ? void 0 : _tableProps$children$4.colWidths]),
|
|
285936
|
+
estimateSize: columnEstimateSize,
|
|
285907
285937
|
overscan: 5
|
|
285908
285938
|
});
|
|
285909
285939
|
var instance = {
|
|
@@ -285968,33 +285998,63 @@
|
|
|
285968
285998
|
});
|
|
285969
285999
|
|
|
285970
286000
|
var _excluded$28 = ["children"];
|
|
285971
|
-
|
|
286001
|
+
|
|
286002
|
+
var useOptions$2 = function useOptions(_ref) {
|
|
285972
286003
|
var children = _ref.children,
|
|
285973
|
-
|
|
286004
|
+
ref = _ref.ref,
|
|
286005
|
+
trRef = _ref.trRef;
|
|
285974
286006
|
|
|
285975
286007
|
var _useStore = useStore(),
|
|
285976
286008
|
state = _useStore.state,
|
|
285977
286009
|
dispatch = _useStore.dispatch,
|
|
285978
286010
|
instance = _useStore.instance;
|
|
285979
286011
|
|
|
286012
|
+
var virtualItems = instance.columnVirtual.virtualItems;
|
|
285980
286013
|
var rowHeight = state.rowHeight,
|
|
285981
286014
|
totalLen = state.totalLen;
|
|
285982
|
-
var
|
|
285983
|
-
|
|
286015
|
+
var sliceColumns = React.useMemo(function () {
|
|
286016
|
+
return children === null || children === void 0 ? void 0 : children.reduce(function (pre, cur) {
|
|
286017
|
+
var _cur$props, _cur$props2;
|
|
285984
286018
|
|
|
285985
|
-
|
|
285986
|
-
|
|
286019
|
+
if (typeof ((_cur$props = cur.props) === null || _cur$props === void 0 ? void 0 : _cur$props.fixLeft) === 'number') {
|
|
286020
|
+
pre.leftColumns.push(cur);
|
|
286021
|
+
return pre;
|
|
286022
|
+
}
|
|
286023
|
+
|
|
286024
|
+
if (typeof ((_cur$props2 = cur.props) === null || _cur$props2 === void 0 ? void 0 : _cur$props2.fixRight) === 'number') {
|
|
286025
|
+
pre.rightColumns.push(cur);
|
|
286026
|
+
return pre;
|
|
286027
|
+
}
|
|
285987
286028
|
|
|
285988
|
-
|
|
286029
|
+
pre.centerColumns.push(cur);
|
|
286030
|
+
return pre;
|
|
286031
|
+
}, {
|
|
286032
|
+
leftColumns: [],
|
|
286033
|
+
rightColumns: [],
|
|
286034
|
+
centerColumns: []
|
|
286035
|
+
});
|
|
285989
286036
|
}, [children]);
|
|
285990
286037
|
React.useEffect(function () {
|
|
285991
|
-
|
|
286038
|
+
dispatch({
|
|
286039
|
+
type: 'changeSliceColumns',
|
|
286040
|
+
sliceColumns: sliceColumns
|
|
286041
|
+
});
|
|
286042
|
+
}, [sliceColumns]); // 非固定列长度
|
|
286043
|
+
|
|
286044
|
+
var centerColumnsLen = React.useMemo(function () {
|
|
286045
|
+
var _sliceColumns$centerC;
|
|
286046
|
+
|
|
286047
|
+
return (_sliceColumns$centerC = sliceColumns.centerColumns.length) !== null && _sliceColumns$centerC !== void 0 ? _sliceColumns$centerC : 0;
|
|
286048
|
+
}, [sliceColumns]);
|
|
286049
|
+
React.useEffect(function () {
|
|
286050
|
+
if (state.columnsLen !== centerColumnsLen) {
|
|
285992
286051
|
dispatch({
|
|
285993
286052
|
type: 'changeColumnsLen',
|
|
285994
|
-
columnsLen:
|
|
286053
|
+
columnsLen: centerColumnsLen !== null && centerColumnsLen !== void 0 ? centerColumnsLen : 0
|
|
285995
286054
|
});
|
|
285996
286055
|
}
|
|
285997
|
-
}, [
|
|
286056
|
+
}, [centerColumnsLen, dispatch, state.columnsLen]); // 获取行的高度
|
|
286057
|
+
|
|
285998
286058
|
React.useEffect(function () {
|
|
285999
286059
|
var initHeight = function initHeight(tempRef) {
|
|
286000
286060
|
var _tempRef$current;
|
|
@@ -286005,56 +286065,60 @@
|
|
|
286005
286065
|
var tempRowHeight = (_tempRef$current$offs = tempRef === null || tempRef === void 0 ? void 0 : (_tempRef$current2 = tempRef.current) === null || _tempRef$current2 === void 0 ? void 0 : _tempRef$current2.offsetHeight) !== null && _tempRef$current$offs !== void 0 ? _tempRef$current$offs : 0;
|
|
286006
286066
|
dispatch({
|
|
286007
286067
|
type: 'initHeight',
|
|
286008
|
-
rowHeight: tempRowHeight
|
|
286068
|
+
rowHeight: tempRowHeight + 1
|
|
286009
286069
|
});
|
|
286010
286070
|
}
|
|
286011
286071
|
};
|
|
286012
286072
|
|
|
286013
286073
|
initHeight(Object.prototype.hasOwnProperty.call(ref, 'current') ? ref : trRef);
|
|
286014
|
-
}, [trRef, dispatch, rowHeight, totalLen, ref]); //
|
|
286015
|
-
|
|
286016
|
-
var
|
|
286017
|
-
|
|
286018
|
-
|
|
286019
|
-
|
|
286020
|
-
|
|
286021
|
-
|
|
286022
|
-
|
|
286023
|
-
|
|
286024
|
-
|
|
286025
|
-
|
|
286026
|
-
|
|
286027
|
-
|
|
286028
|
-
|
|
286074
|
+
}, [trRef, dispatch, rowHeight, totalLen, ref]); // 横向单元格合并
|
|
286075
|
+
|
|
286076
|
+
var leftColSpan = React.useMemo(function () {
|
|
286077
|
+
var _virtualItems$;
|
|
286078
|
+
|
|
286079
|
+
return (_virtualItems$ = virtualItems[0]) === null || _virtualItems$ === void 0 ? void 0 : _virtualItems$.index;
|
|
286080
|
+
}, [virtualItems]); // 右侧隐藏数量
|
|
286081
|
+
|
|
286082
|
+
var rightColSpan = React.useMemo(function () {
|
|
286083
|
+
return sliceColumns.centerColumns.length - virtualItems.length - leftColSpan || 0;
|
|
286084
|
+
}, [sliceColumns.centerColumns.length, virtualItems.length, leftColSpan]);
|
|
286085
|
+
return _objectSpread(_objectSpread({
|
|
286086
|
+
virtualItems: virtualItems
|
|
286087
|
+
}, sliceColumns), {}, {
|
|
286088
|
+
leftColSpan: leftColSpan,
|
|
286089
|
+
rightColSpan: rightColSpan
|
|
286090
|
+
});
|
|
286091
|
+
};
|
|
286029
286092
|
|
|
286030
|
-
|
|
286031
|
-
|
|
286032
|
-
|
|
286033
|
-
fixedLeft: [],
|
|
286034
|
-
fixedRight: [],
|
|
286035
|
-
columns: []
|
|
286036
|
-
});
|
|
286037
|
-
}, [children]); // 截取非固定列
|
|
286093
|
+
var VirtualRow = /*#__PURE__*/React__default['default'].memo(function (_ref2, ref) {
|
|
286094
|
+
var children = _ref2.children,
|
|
286095
|
+
resetProps = _objectWithoutProperties$1(_ref2, _excluded$28);
|
|
286038
286096
|
|
|
286039
|
-
var
|
|
286040
|
-
var fixedLeft = fixedColumns.fixedLeft,
|
|
286041
|
-
columns = fixedColumns.columns;
|
|
286042
|
-
return virtualItems.slice(fixedLeft.length, fixedLeft.length + columns.length);
|
|
286043
|
-
}, [fixedColumns, virtualItems]); // 横线单元格合并
|
|
286097
|
+
var trRef = React.useRef(null);
|
|
286044
286098
|
|
|
286045
|
-
var
|
|
286046
|
-
|
|
286099
|
+
var _useOptions = useOptions$2({
|
|
286100
|
+
children: children,
|
|
286101
|
+
ref: ref,
|
|
286102
|
+
trRef: trRef
|
|
286103
|
+
}),
|
|
286104
|
+
virtualItems = _useOptions.virtualItems,
|
|
286105
|
+
leftColumns = _useOptions.leftColumns,
|
|
286106
|
+
centerColumns = _useOptions.centerColumns,
|
|
286107
|
+
rightColumns = _useOptions.rightColumns,
|
|
286108
|
+
leftColSpan = _useOptions.leftColSpan,
|
|
286109
|
+
rightColSpan = _useOptions.rightColSpan;
|
|
286047
286110
|
|
|
286048
|
-
var startIndex = (resetVirtualItems === null || resetVirtualItems === void 0 ? void 0 : (_resetVirtualItems$ = resetVirtualItems[0]) === null || _resetVirtualItems$ === void 0 ? void 0 : _resetVirtualItems$.index) || 0;
|
|
286049
|
-
return startIndex ? startIndex - fixedColumns.fixedLeft.length : startIndex;
|
|
286050
|
-
}, [fixedColumns, resetVirtualItems]);
|
|
286051
286111
|
return /*#__PURE__*/React__default['default'].createElement("tr", _objectSpread(_objectSpread({}, resetProps), {}, {
|
|
286052
286112
|
ref: Object.prototype.hasOwnProperty.call(ref, 'current') ? ref : trRef
|
|
286053
|
-
}),
|
|
286054
|
-
|
|
286055
|
-
|
|
286056
|
-
|
|
286057
|
-
|
|
286113
|
+
}), leftColumns, !!leftColSpan && /*#__PURE__*/React__default['default'].createElement("td", {
|
|
286114
|
+
key: "leftColSpan",
|
|
286115
|
+
colSpan: leftColSpan
|
|
286116
|
+
}), virtualItems.map(function (virtualCol) {
|
|
286117
|
+
return centerColumns[virtualCol.index];
|
|
286118
|
+
}), !!rightColSpan && /*#__PURE__*/React__default['default'].createElement("td", {
|
|
286119
|
+
key: "rightColSpan",
|
|
286120
|
+
colSpan: rightColSpan
|
|
286121
|
+
}), rightColumns);
|
|
286058
286122
|
});
|
|
286059
286123
|
|
|
286060
286124
|
// 分组求和计算
|
|
@@ -287665,7 +287729,12 @@
|
|
|
287665
287729
|
|
|
287666
287730
|
return React.useCallback(function () {
|
|
287667
287731
|
var fn = handlerRef.current;
|
|
287668
|
-
|
|
287732
|
+
|
|
287733
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
287734
|
+
args[_key] = arguments[_key];
|
|
287735
|
+
}
|
|
287736
|
+
|
|
287737
|
+
return fn === null || fn === void 0 ? void 0 : fn.apply(void 0, args);
|
|
287669
287738
|
}, []);
|
|
287670
287739
|
}
|
|
287671
287740
|
|
|
@@ -288636,14 +288705,18 @@
|
|
|
288636
288705
|
}));
|
|
288637
288706
|
};
|
|
288638
288707
|
|
|
288639
|
-
var _excluded$2g = ["children"],
|
|
288708
|
+
var _excluded$2g = ["children", "disabled"],
|
|
288640
288709
|
_excluded2$y = ["children", "size", "buttonStyle", "direction", "className"];
|
|
288641
288710
|
|
|
288642
288711
|
var LMRadio = function LMRadio(props) {
|
|
288643
288712
|
var children = props.children,
|
|
288713
|
+
customDisabled = props.disabled,
|
|
288644
288714
|
restProps = _objectWithoutProperties$1(props, _excluded$2g);
|
|
288645
288715
|
|
|
288716
|
+
var disabled = React__default['default'].useContext(DisabledContext$1);
|
|
288717
|
+
var mergedDisabled = customDisabled || disabled;
|
|
288646
288718
|
return /*#__PURE__*/React__default['default'].createElement(Radio$1, _extends$2({
|
|
288719
|
+
disabled: mergedDisabled,
|
|
288647
288720
|
className: "lm-radio"
|
|
288648
288721
|
}, restProps), children);
|
|
288649
288722
|
};
|
|
@@ -293573,17 +293646,21 @@
|
|
|
293573
293646
|
Tabs$3.TabPane = TabPane$3;
|
|
293574
293647
|
Tabs$3.AntdTabs = Tabs$1;
|
|
293575
293648
|
|
|
293576
|
-
var _excluded$2w = ["size", "className"];
|
|
293649
|
+
var _excluded$2w = ["size", "className", "disabled"];
|
|
293577
293650
|
|
|
293578
293651
|
var Switch$2 = function Switch(props) {
|
|
293579
293652
|
var _props$size = props.size,
|
|
293580
293653
|
size = _props$size === void 0 ? 'default' : _props$size,
|
|
293581
293654
|
className = props.className,
|
|
293655
|
+
customDisabled = props.disabled,
|
|
293582
293656
|
restProps = _objectWithoutProperties$1(props, _excluded$2w);
|
|
293583
293657
|
|
|
293658
|
+
var disabled = React__default['default'].useContext(DisabledContext$1);
|
|
293659
|
+
var mergedDisabled = customDisabled || disabled;
|
|
293584
293660
|
var classs = classnames('lm-switch', className, _defineProperty$1({}, "lm-switch-".concat(size), size));
|
|
293585
293661
|
return /*#__PURE__*/React__default['default'].createElement(Switch$1, _objectSpread(_objectSpread({
|
|
293586
|
-
className: classs
|
|
293662
|
+
className: classs,
|
|
293663
|
+
disabled: mergedDisabled
|
|
293587
293664
|
}, restProps), {}, {
|
|
293588
293665
|
size: size
|
|
293589
293666
|
}));
|
|
@@ -293592,10 +293669,17 @@
|
|
|
293592
293669
|
var Search$1 = LmInput.Search;
|
|
293593
293670
|
|
|
293594
293671
|
var SortItem = function SortItem(props) {
|
|
293595
|
-
var
|
|
293672
|
+
var item = props.item,
|
|
293673
|
+
addFiexd = props.addFiexd,
|
|
293674
|
+
toggleShow = props.toggleShow,
|
|
293675
|
+
id = props.id,
|
|
293676
|
+
clearFiexd = props.clearFiexd,
|
|
293677
|
+
_props$disabled = props.disabled,
|
|
293678
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled;
|
|
293596
293679
|
|
|
293597
293680
|
var _useSortable = useSortable({
|
|
293598
|
-
id: "".concat(
|
|
293681
|
+
id: "".concat(id),
|
|
293682
|
+
disabled: disabled
|
|
293599
293683
|
}),
|
|
293600
293684
|
attributes = _useSortable.attributes,
|
|
293601
293685
|
listeners = _useSortable.listeners,
|
|
@@ -293612,31 +293696,40 @@
|
|
|
293612
293696
|
className: "lm_custom_item",
|
|
293613
293697
|
style: style
|
|
293614
293698
|
}, attributes), /*#__PURE__*/React__default['default'].createElement(LMCheckBox, {
|
|
293615
|
-
checked: (
|
|
293699
|
+
checked: (item === null || item === void 0 ? void 0 : item.show) !== false,
|
|
293700
|
+
disabled: item === null || item === void 0 ? void 0 : item.behaviorNoCache,
|
|
293616
293701
|
onChange: function onChange(e) {
|
|
293617
|
-
return
|
|
293702
|
+
return toggleShow(e.target.checked, id);
|
|
293618
293703
|
},
|
|
293619
293704
|
className: "filter_item-content"
|
|
293620
|
-
},
|
|
293705
|
+
}, item === null || item === void 0 ? void 0 : item.title), /*#__PURE__*/React__default['default'].createElement("div", null, (item === null || item === void 0 ? void 0 : item.fixed) && /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
293621
293706
|
type: "lmweb-vertical-align-middl",
|
|
293622
|
-
className:
|
|
293707
|
+
className: classnames('lm_custom_icon', !!(item === null || item === void 0 ? void 0 : item.behaviorNoCache) && 'custom_hiddle'),
|
|
293623
293708
|
onClick: function onClick(e) {
|
|
293624
|
-
|
|
293625
|
-
|
|
293709
|
+
if (!(item === null || item === void 0 ? void 0 : item.behaviorNoCache)) {
|
|
293710
|
+
e.stopPropagation();
|
|
293711
|
+
clearFiexd(id);
|
|
293712
|
+
}
|
|
293626
293713
|
}
|
|
293627
|
-
}), !(
|
|
293714
|
+
}), !(item === null || item === void 0 ? void 0 : item.fixed) && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
293628
293715
|
type: "lmweb-vertical-align-top",
|
|
293629
|
-
className
|
|
293716
|
+
// className="lm_custom_icon hover_show icon_top"
|
|
293717
|
+
className: classnames('lm_custom_icon', !!(item === null || item === void 0 ? void 0 : item.behaviorNoCache) && 'custom_hiddle', 'icon_top'),
|
|
293630
293718
|
onClick: function onClick(e) {
|
|
293631
|
-
|
|
293632
|
-
|
|
293719
|
+
if (!(item === null || item === void 0 ? void 0 : item.behaviorNoCache)) {
|
|
293720
|
+
e.stopPropagation();
|
|
293721
|
+
addFiexd(id, 'left');
|
|
293722
|
+
}
|
|
293633
293723
|
}
|
|
293634
293724
|
}), /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
293635
293725
|
type: "lmweb-vertical-align-botto",
|
|
293636
|
-
className
|
|
293726
|
+
// className="lm_custom_icon hover_show icon_bottom"
|
|
293727
|
+
className: classnames('lm_custom_icon', !!(item === null || item === void 0 ? void 0 : item.behaviorNoCache) && 'custom_hiddle', 'icon_bottom'),
|
|
293637
293728
|
onClick: function onClick(e) {
|
|
293638
|
-
|
|
293639
|
-
|
|
293729
|
+
if (!(item === null || item === void 0 ? void 0 : item.behaviorNoCache)) {
|
|
293730
|
+
e.stopPropagation();
|
|
293731
|
+
addFiexd(id, 'right');
|
|
293732
|
+
}
|
|
293640
293733
|
}
|
|
293641
293734
|
})), /*#__PURE__*/React__default['default'].createElement(HolderOutlined$2, _objectSpread(_objectSpread({}, listeners), {}, {
|
|
293642
293735
|
className: "lm_custom_icon sort_item",
|
|
@@ -293683,7 +293776,7 @@
|
|
|
293683
293776
|
var cloneCol = (_cloneDeep = lodash.cloneDeep(localColumns)) === null || _cloneDeep === void 0 ? void 0 : _cloneDeep.filter(function (item) {
|
|
293684
293777
|
var _item$title;
|
|
293685
293778
|
|
|
293686
|
-
return ((_item$title = item.title) === null || _item$title === void 0 ? void 0 : _item$title.indexOf(searchValue)) > -1;
|
|
293779
|
+
return lodash.isFunction(item.title) ? false : ((_item$title = item.title) === null || _item$title === void 0 ? void 0 : _item$title.indexOf(searchValue)) > -1;
|
|
293687
293780
|
});
|
|
293688
293781
|
cloneCol.forEach(function (item, index) {
|
|
293689
293782
|
if (colStateValue === null || colStateValue === void 0 ? void 0 : colStateValue.hasOwnProperty(item.dataIndex)) {
|
|
@@ -293847,6 +293940,7 @@
|
|
|
293847
293940
|
}
|
|
293848
293941
|
};
|
|
293849
293942
|
});
|
|
293943
|
+
console.log(sortMenu, 'sortMenu');
|
|
293850
293944
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
293851
293945
|
className: "lm_custom_option_columns"
|
|
293852
293946
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -293882,6 +293976,7 @@
|
|
|
293882
293976
|
return /*#__PURE__*/React__default['default'].createElement(SortItem, {
|
|
293883
293977
|
key: item.dataIndex,
|
|
293884
293978
|
item: item,
|
|
293979
|
+
disabled: !!item.behaviorNoCache,
|
|
293885
293980
|
toggleShow: toggleShow,
|
|
293886
293981
|
clearFiexd: clearFiexd,
|
|
293887
293982
|
id: item.dataIndex
|
|
@@ -293902,6 +293997,7 @@
|
|
|
293902
293997
|
key: item.dataIndex,
|
|
293903
293998
|
addFiexd: addFiexd,
|
|
293904
293999
|
toggleShow: toggleShow,
|
|
294000
|
+
disabled: !!item.behaviorNoCache,
|
|
293905
294001
|
item: item,
|
|
293906
294002
|
id: item.dataIndex
|
|
293907
294003
|
});
|
|
@@ -293920,6 +294016,7 @@
|
|
|
293920
294016
|
return /*#__PURE__*/React__default['default'].createElement(SortItem, {
|
|
293921
294017
|
key: item.dataIndex,
|
|
293922
294018
|
toggleShow: toggleShow,
|
|
294019
|
+
disabled: !!item.behaviorNoCache,
|
|
293923
294020
|
clearFiexd: clearFiexd,
|
|
293924
294021
|
item: item,
|
|
293925
294022
|
id: item.dataIndex
|
|
@@ -294147,10 +294244,15 @@
|
|
|
294147
294244
|
var Search$3 = LmInput.Search;
|
|
294148
294245
|
|
|
294149
294246
|
var SortItem$2 = function SortItem(props) {
|
|
294150
|
-
var
|
|
294247
|
+
var id = props.id,
|
|
294248
|
+
item = props.item,
|
|
294249
|
+
toggleShow = props.toggleShow,
|
|
294250
|
+
_props$disabled = props.disabled,
|
|
294251
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled;
|
|
294151
294252
|
|
|
294152
294253
|
var _useSortable = useSortable({
|
|
294153
|
-
id: "".concat(
|
|
294254
|
+
id: "".concat(id),
|
|
294255
|
+
disabled: disabled
|
|
294154
294256
|
}),
|
|
294155
294257
|
attributes = _useSortable.attributes,
|
|
294156
294258
|
listeners = _useSortable.listeners,
|
|
@@ -294167,12 +294269,13 @@
|
|
|
294167
294269
|
className: "lm_custom_item",
|
|
294168
294270
|
style: style
|
|
294169
294271
|
}, attributes), /*#__PURE__*/React__default['default'].createElement(LMCheckBox, {
|
|
294170
|
-
checked: (
|
|
294272
|
+
checked: (item === null || item === void 0 ? void 0 : item.show) !== false,
|
|
294273
|
+
disabled: item === null || item === void 0 ? void 0 : item.behaviorNoCache,
|
|
294171
294274
|
onChange: function onChange(e) {
|
|
294172
|
-
return
|
|
294275
|
+
return toggleShow(e.target.checked, id);
|
|
294173
294276
|
},
|
|
294174
294277
|
className: "filter_item-content"
|
|
294175
|
-
},
|
|
294278
|
+
}, item === null || item === void 0 ? void 0 : item.title), /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(HolderOutlined$2, _objectSpread(_objectSpread({}, listeners), {}, {
|
|
294176
294279
|
className: "lm_custom_icon sort_item"
|
|
294177
294280
|
}))));
|
|
294178
294281
|
};
|
|
@@ -294348,6 +294451,7 @@
|
|
|
294348
294451
|
}, sortMenu === null || sortMenu === void 0 ? void 0 : sortMenu.map(function (item) {
|
|
294349
294452
|
return /*#__PURE__*/React__default['default'].createElement(SortItem$2, {
|
|
294350
294453
|
key: item.field,
|
|
294454
|
+
disabled: !!item.behaviorNoCache,
|
|
294351
294455
|
toggleShow: toggleShow,
|
|
294352
294456
|
item: item,
|
|
294353
294457
|
id: item.field
|
|
@@ -312568,7 +312672,11 @@
|
|
|
312568
312672
|
} else if (isRenderProps && (shouldUpdate || dependencies) && !hasName) {
|
|
312569
312673
|
childNode = children(context);
|
|
312570
312674
|
} else {
|
|
312571
|
-
warning
|
|
312675
|
+
// warning(
|
|
312676
|
+
// !mergedName.length,
|
|
312677
|
+
// 'Form.Item',
|
|
312678
|
+
// '`name` is only used for validate React element. If you are using Form.Item as layout display, please remove `name` instead.',
|
|
312679
|
+
// );
|
|
312572
312680
|
childNode = children;
|
|
312573
312681
|
}
|
|
312574
312682
|
|
|
@@ -312654,16 +312762,59 @@
|
|
|
312654
312762
|
|
|
312655
312763
|
Form$4.Wrapper = Wrapper;
|
|
312656
312764
|
|
|
312657
|
-
var
|
|
312658
|
-
var
|
|
312659
|
-
|
|
312765
|
+
var DragOver = /*#__PURE__*/React__default['default'].memo(function (_ref) {
|
|
312766
|
+
var instance = _ref.instance;
|
|
312767
|
+
var isDragging = instance.isDragging,
|
|
312768
|
+
activeId = instance.activeId,
|
|
312769
|
+
options = instance.options;
|
|
312770
|
+
var item = activeId && options.find(function (v) {
|
|
312771
|
+
return v.dataIndex === activeId;
|
|
312772
|
+
});
|
|
312773
|
+
return /*#__PURE__*/React__default['default'].createElement(DragOverlay, {
|
|
312774
|
+
adjustScale: false
|
|
312775
|
+
}, isDragging ? /*#__PURE__*/React__default['default'].createElement("div", {
|
|
312776
|
+
className: "lm_editable_col_drag"
|
|
312777
|
+
}, item === null || item === void 0 ? void 0 : item.title) : null);
|
|
312778
|
+
}); // 可拖拽容器
|
|
312779
|
+
|
|
312780
|
+
var DndContainer$1 = function DndContainer(_ref2) {
|
|
312781
|
+
var children = _ref2.children,
|
|
312782
|
+
move = _ref2.move,
|
|
312783
|
+
options = _ref2.options,
|
|
312784
|
+
rowKey = _ref2.rowKey;
|
|
312785
|
+
|
|
312786
|
+
var _React$useState = React__default['default'].useState(false),
|
|
312787
|
+
_React$useState2 = _slicedToArray$1(_React$useState, 2),
|
|
312788
|
+
isDragging = _React$useState2[0],
|
|
312789
|
+
setIsDragging = _React$useState2[1]; // 是否拖拽中
|
|
312790
|
+
|
|
312791
|
+
|
|
312792
|
+
var _React$useState3 = React__default['default'].useState(null),
|
|
312793
|
+
_React$useState4 = _slicedToArray$1(_React$useState3, 2),
|
|
312794
|
+
activeId = _React$useState4[0],
|
|
312795
|
+
setActiveId = _React$useState4[1]; // 是否拖拽中
|
|
312796
|
+
|
|
312797
|
+
|
|
312660
312798
|
var sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, {
|
|
312661
312799
|
coordinateGetter: sortableKeyboardCoordinates
|
|
312662
|
-
})); //
|
|
312800
|
+
})); // 开始拖拽
|
|
312801
|
+
|
|
312802
|
+
var handleDragStart = function handleDragStart(_ref3) {
|
|
312803
|
+
var active = _ref3.active;
|
|
312804
|
+
setIsDragging(true);
|
|
312805
|
+
|
|
312806
|
+
if (!active) {
|
|
312807
|
+
return;
|
|
312808
|
+
}
|
|
312809
|
+
|
|
312810
|
+
setActiveId(active.id);
|
|
312811
|
+
}; // 拖拽结束
|
|
312812
|
+
|
|
312663
312813
|
|
|
312664
312814
|
var handleDragEnd = function handleDragEnd(event) {
|
|
312665
312815
|
var active = event.active,
|
|
312666
|
-
over = event.over;
|
|
312816
|
+
over = event.over;
|
|
312817
|
+
setActiveId(null); // 未移入时触发
|
|
312667
312818
|
|
|
312668
312819
|
if (!(over === null || over === void 0 ? void 0 : over.id)) {
|
|
312669
312820
|
return;
|
|
@@ -312675,39 +312826,374 @@
|
|
|
312675
312826
|
}
|
|
312676
312827
|
};
|
|
312677
312828
|
|
|
312829
|
+
var instance = {
|
|
312830
|
+
isDragging: isDragging,
|
|
312831
|
+
activeId: activeId,
|
|
312832
|
+
options: options,
|
|
312833
|
+
rowKey: rowKey,
|
|
312834
|
+
children: children,
|
|
312835
|
+
move: move,
|
|
312836
|
+
items: options === null || options === void 0 ? void 0 : options.map(function (v) {
|
|
312837
|
+
return v[rowKey];
|
|
312838
|
+
})
|
|
312839
|
+
};
|
|
312678
312840
|
return /*#__PURE__*/React__default['default'].createElement(DndContext, {
|
|
312679
312841
|
sensors: sensors,
|
|
312680
312842
|
collisionDetection: closestCenter,
|
|
312843
|
+
onDragStart: handleDragStart,
|
|
312681
312844
|
onDragEnd: handleDragEnd,
|
|
312845
|
+
onDragCancel: function onDragCancel() {
|
|
312846
|
+
return setActiveId(null);
|
|
312847
|
+
},
|
|
312682
312848
|
modifiers: [restrictToParentElement]
|
|
312683
|
-
}, children
|
|
312849
|
+
}, children, /*#__PURE__*/React__default['default'].createElement(DragOver, {
|
|
312850
|
+
instance: instance
|
|
312851
|
+
}));
|
|
312684
312852
|
};
|
|
312685
312853
|
|
|
312854
|
+
var DndContainer$2 = /*#__PURE__*/React.memo(DndContainer$1);
|
|
312855
|
+
|
|
312686
312856
|
var SortableBox$1 = function SortableBox(_ref) {
|
|
312687
312857
|
var items = _ref.items,
|
|
312688
312858
|
children = _ref.children;
|
|
312689
312859
|
return /*#__PURE__*/React__default['default'].createElement(SortableContext$1, {
|
|
312690
312860
|
items: items,
|
|
312691
|
-
strategy:
|
|
312861
|
+
strategy: horizontalListSortingStrategy
|
|
312692
312862
|
}, children);
|
|
312693
312863
|
};
|
|
312694
312864
|
|
|
312695
|
-
var
|
|
312696
|
-
|
|
312697
|
-
|
|
312698
|
-
|
|
312699
|
-
|
|
312700
|
-
|
|
312701
|
-
|
|
312865
|
+
var TableContext$2 = /*#__PURE__*/React.createContext({
|
|
312866
|
+
state: null,
|
|
312867
|
+
dispatch: null,
|
|
312868
|
+
instance: {}
|
|
312869
|
+
});
|
|
312870
|
+
|
|
312871
|
+
var useStore$1 = function useStore() {
|
|
312872
|
+
return React.useContext(TableContext$2);
|
|
312873
|
+
};
|
|
312874
|
+
|
|
312875
|
+
var initialState$3 = {
|
|
312876
|
+
// 行高度
|
|
312877
|
+
rowHeight: 0,
|
|
312878
|
+
columnsLen: 0,
|
|
312879
|
+
// 总行数
|
|
312880
|
+
totalLen: 0,
|
|
312881
|
+
// 分割后的列数组
|
|
312882
|
+
sliceColumns: {
|
|
312883
|
+
leftColumns: [],
|
|
312884
|
+
centerColumns: [],
|
|
312885
|
+
rightColumns: []
|
|
312886
|
+
}
|
|
312887
|
+
};
|
|
312888
|
+
|
|
312889
|
+
var reducer$5 = function reducer(state, action) {
|
|
312890
|
+
var totalLen = action.totalLen,
|
|
312891
|
+
columnsLen = action.columnsLen,
|
|
312892
|
+
rowHeight = action.rowHeight,
|
|
312893
|
+
sliceColumns = action.sliceColumns;
|
|
312894
|
+
|
|
312895
|
+
switch (action.type) {
|
|
312896
|
+
// 数据数量
|
|
312897
|
+
case 'changeTotalLen':
|
|
312898
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
312899
|
+
totalLen: totalLen
|
|
312900
|
+
});
|
|
312901
|
+
// 列数量
|
|
312902
|
+
|
|
312903
|
+
case 'changeColumnsLen':
|
|
312904
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
312905
|
+
columnsLen: columnsLen
|
|
312906
|
+
});
|
|
312907
|
+
// 初始化行高度
|
|
312908
|
+
|
|
312909
|
+
case 'initHeight':
|
|
312910
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
312911
|
+
rowHeight: rowHeight
|
|
312912
|
+
});
|
|
312913
|
+
|
|
312914
|
+
case 'changeSliceColumns':
|
|
312915
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
312916
|
+
sliceColumns: sliceColumns
|
|
312917
|
+
});
|
|
312918
|
+
|
|
312919
|
+
default:
|
|
312920
|
+
throw new Error();
|
|
312921
|
+
}
|
|
312922
|
+
};
|
|
312923
|
+
|
|
312924
|
+
var useRealive$1 = function useRealive() {
|
|
312925
|
+
return React.useReducer(reducer$5, initialState$3);
|
|
312926
|
+
};
|
|
312927
|
+
|
|
312928
|
+
var VirtualTable$1 = /*#__PURE__*/React__default['default'].memo(function (tableProps) {
|
|
312929
|
+
var _bodyRef$current, _tableProps$children$3, _tableProps$children$4, _bodyRef$current2;
|
|
312930
|
+
|
|
312931
|
+
var fn = tableProps.fn;
|
|
312932
|
+
var bodyRef = React.useRef(null);
|
|
312933
|
+
|
|
312934
|
+
var _useRealive = useRealive$1(),
|
|
312935
|
+
_useRealive2 = _slicedToArray$1(_useRealive, 2),
|
|
312936
|
+
state = _useRealive2[0],
|
|
312937
|
+
dispatch = _useRealive2[1]; // 行虚拟化 { totalSize, virtualItems }
|
|
312938
|
+
|
|
312939
|
+
|
|
312940
|
+
var rowVirtual = useVirtual({
|
|
312941
|
+
size: state.totalLen,
|
|
312942
|
+
// 绑定父节点
|
|
312943
|
+
parentRef: {
|
|
312944
|
+
current: bodyRef === null || bodyRef === void 0 ? void 0 : (_bodyRef$current = bodyRef.current) === null || _bodyRef$current === void 0 ? void 0 : _bodyRef$current.parentNode
|
|
312945
|
+
},
|
|
312946
|
+
estimateSize: React__default['default'].useCallback(function () {
|
|
312947
|
+
return state.rowHeight;
|
|
312948
|
+
}, [state.rowHeight]),
|
|
312949
|
+
overscan: 5
|
|
312950
|
+
});
|
|
312951
|
+
fn.current = rowVirtual.scrollToIndex; // 列动态宽度
|
|
312952
|
+
|
|
312953
|
+
var columnEstimateSize = React.useCallback(function (i) {
|
|
312954
|
+
var _tableProps$children$, _tableProps$children$2;
|
|
312955
|
+
|
|
312956
|
+
var colWidths = tableProps === null || tableProps === void 0 ? void 0 : (_tableProps$children$ = tableProps.children[0]) === null || _tableProps$children$ === void 0 ? void 0 : (_tableProps$children$2 = _tableProps$children$.props) === null || _tableProps$children$2 === void 0 ? void 0 : _tableProps$children$2.colWidths;
|
|
312957
|
+
var leftColumnsLen = state.sliceColumns.leftColumns.length;
|
|
312958
|
+
var centerColumnsLen = state.sliceColumns.centerColumns.length; // 获取非固定列
|
|
312959
|
+
|
|
312960
|
+
var virList = colWidths.slice(leftColumnsLen, leftColumnsLen + centerColumnsLen);
|
|
312961
|
+
return virList[i] || 0;
|
|
312962
|
+
}, [(_tableProps$children$3 = tableProps.children[0]) === null || _tableProps$children$3 === void 0 ? void 0 : (_tableProps$children$4 = _tableProps$children$3.props) === null || _tableProps$children$4 === void 0 ? void 0 : _tableProps$children$4.colWidths, state.sliceColumns.leftColumns.length, state.sliceColumns.centerColumns.length]); // 列虚拟化
|
|
312963
|
+
|
|
312964
|
+
var columnVirtual = useVirtual({
|
|
312965
|
+
horizontal: true,
|
|
312966
|
+
size: state.columnsLen,
|
|
312967
|
+
parentRef: {
|
|
312968
|
+
current: bodyRef === null || bodyRef === void 0 ? void 0 : (_bodyRef$current2 = bodyRef.current) === null || _bodyRef$current2 === void 0 ? void 0 : _bodyRef$current2.parentNode
|
|
312969
|
+
},
|
|
312970
|
+
estimateSize: columnEstimateSize,
|
|
312971
|
+
overscan: 5
|
|
312972
|
+
});
|
|
312973
|
+
var instance = {
|
|
312974
|
+
rowVirtual: rowVirtual,
|
|
312975
|
+
columnVirtual: columnVirtual
|
|
312976
|
+
};
|
|
312977
|
+
return /*#__PURE__*/React__default['default'].createElement(TableContext$2.Provider, {
|
|
312978
|
+
value: {
|
|
312979
|
+
state: state,
|
|
312980
|
+
dispatch: dispatch,
|
|
312981
|
+
instance: instance
|
|
312982
|
+
}
|
|
312983
|
+
}, /*#__PURE__*/React__default['default'].createElement("table", _objectSpread({
|
|
312984
|
+
ref: bodyRef
|
|
312985
|
+
}, tableProps)));
|
|
312986
|
+
});
|
|
312987
|
+
|
|
312988
|
+
var _excluded$2P = ["children"];
|
|
312989
|
+
var VirtualWrapper$1 = /*#__PURE__*/React__default['default'].memo(function (wrapperProps) {
|
|
312990
|
+
var _virtualItems$, _virtualItems;
|
|
312991
|
+
|
|
312992
|
+
var children = wrapperProps.children,
|
|
312993
|
+
resetProps = _objectWithoutProperties$1(wrapperProps, _excluded$2P);
|
|
312994
|
+
|
|
312995
|
+
var _useStore = useStore$1(),
|
|
312996
|
+
state = _useStore.state,
|
|
312997
|
+
dispatch = _useStore.dispatch,
|
|
312998
|
+
instance = _useStore.instance;
|
|
312999
|
+
|
|
313000
|
+
var _instance$rowVirtual = instance.rowVirtual,
|
|
313001
|
+
virtualItems = _instance$rowVirtual.virtualItems,
|
|
313002
|
+
totalSize = _instance$rowVirtual.totalSize;
|
|
313003
|
+
var contents = React.useMemo(function () {
|
|
313004
|
+
return children[1];
|
|
313005
|
+
}, [children]);
|
|
313006
|
+
var contentsLen = React.useMemo(function () {
|
|
313007
|
+
var _contents$length;
|
|
313008
|
+
|
|
313009
|
+
return (_contents$length = contents === null || contents === void 0 ? void 0 : contents.length) !== null && _contents$length !== void 0 ? _contents$length : 0;
|
|
313010
|
+
}, [contents]);
|
|
313011
|
+
React.useEffect(function () {
|
|
313012
|
+
if (state.totalLen !== contentsLen) {
|
|
313013
|
+
dispatch({
|
|
313014
|
+
type: 'changeTotalLen',
|
|
313015
|
+
totalLen: contentsLen !== null && contentsLen !== void 0 ? contentsLen : 0
|
|
313016
|
+
});
|
|
313017
|
+
}
|
|
313018
|
+
}, [contentsLen, dispatch, state.totalLen]);
|
|
313019
|
+
var paddingTop = virtualItems.length > 0 ? (virtualItems === null || virtualItems === void 0 ? void 0 : (_virtualItems$ = virtualItems[0]) === null || _virtualItems$ === void 0 ? void 0 : _virtualItems$.start) || 0 : 0;
|
|
313020
|
+
var paddingBottom = virtualItems.length > 0 ? totalSize - ((virtualItems === null || virtualItems === void 0 ? void 0 : (_virtualItems = virtualItems[virtualItems.length - 1]) === null || _virtualItems === void 0 ? void 0 : _virtualItems.end) || 0) : 0;
|
|
313021
|
+
return /*#__PURE__*/React__default['default'].createElement("tbody", _objectSpread({}, resetProps), paddingTop > 0 && /*#__PURE__*/React__default['default'].createElement("tr", null, /*#__PURE__*/React__default['default'].createElement("td", {
|
|
313022
|
+
style: {
|
|
313023
|
+
height: "".concat(paddingTop, "px")
|
|
313024
|
+
}
|
|
313025
|
+
})), children[0], virtualItems.map(function (virtualRow) {
|
|
313026
|
+
return contents[virtualRow.index];
|
|
313027
|
+
}), paddingBottom > 0 && /*#__PURE__*/React__default['default'].createElement("tr", null, /*#__PURE__*/React__default['default'].createElement("td", {
|
|
313028
|
+
style: {
|
|
313029
|
+
height: "".concat(paddingBottom, "px")
|
|
313030
|
+
}
|
|
313031
|
+
})));
|
|
313032
|
+
});
|
|
313033
|
+
|
|
313034
|
+
function setRef(ref, value) {
|
|
313035
|
+
if (typeof ref === 'function') {
|
|
313036
|
+
ref(value);
|
|
313037
|
+
} else if (ref) {
|
|
313038
|
+
ref.current = value;
|
|
313039
|
+
}
|
|
313040
|
+
}
|
|
313041
|
+
|
|
313042
|
+
function useForkRef(refA, refB) {
|
|
313043
|
+
return React.useMemo(function () {
|
|
313044
|
+
if (refA == null && refB == null) {
|
|
313045
|
+
return null;
|
|
313046
|
+
}
|
|
313047
|
+
|
|
313048
|
+
return function (refValue) {
|
|
313049
|
+
setRef(refA, refValue);
|
|
313050
|
+
setRef(refB, refValue);
|
|
313051
|
+
};
|
|
313052
|
+
}, [refA, refB]);
|
|
313053
|
+
}
|
|
313054
|
+
|
|
313055
|
+
var _excluded$2Q = ["children", "pref"];
|
|
313056
|
+
|
|
313057
|
+
var useOptions$3 = function useOptions(_ref) {
|
|
313058
|
+
var _sliceColumns$centerC4;
|
|
313059
|
+
|
|
313060
|
+
var children = _ref.children,
|
|
313061
|
+
ref = _ref.ref,
|
|
313062
|
+
trRef = _ref.trRef;
|
|
313063
|
+
|
|
313064
|
+
var _useStore = useStore$1(),
|
|
313065
|
+
state = _useStore.state,
|
|
313066
|
+
dispatch = _useStore.dispatch,
|
|
313067
|
+
instance = _useStore.instance;
|
|
313068
|
+
|
|
313069
|
+
var virtualItems = instance.columnVirtual.virtualItems;
|
|
313070
|
+
var rowHeight = state.rowHeight,
|
|
313071
|
+
totalLen = state.totalLen;
|
|
313072
|
+
var sliceColumns = React.useMemo(function () {
|
|
313073
|
+
var _children$reduce;
|
|
313074
|
+
|
|
313075
|
+
return children === null || children === void 0 ? void 0 : (_children$reduce = children.reduce) === null || _children$reduce === void 0 ? void 0 : _children$reduce.call(children, function (pre, cur) {
|
|
313076
|
+
var _cur$props, _cur$props2;
|
|
313077
|
+
|
|
313078
|
+
if (typeof ((_cur$props = cur.props) === null || _cur$props === void 0 ? void 0 : _cur$props.fixLeft) === 'number') {
|
|
313079
|
+
pre.leftColumns.push(cur);
|
|
313080
|
+
return pre;
|
|
313081
|
+
}
|
|
313082
|
+
|
|
313083
|
+
if (typeof ((_cur$props2 = cur.props) === null || _cur$props2 === void 0 ? void 0 : _cur$props2.fixRight) === 'number') {
|
|
313084
|
+
pre.rightColumns.push(cur);
|
|
313085
|
+
return pre;
|
|
313086
|
+
}
|
|
313087
|
+
|
|
313088
|
+
pre.centerColumns.push(cur);
|
|
313089
|
+
return pre;
|
|
313090
|
+
}, {
|
|
313091
|
+
leftColumns: [],
|
|
313092
|
+
rightColumns: [],
|
|
313093
|
+
centerColumns: []
|
|
313094
|
+
});
|
|
313095
|
+
}, [children]);
|
|
313096
|
+
React.useEffect(function () {
|
|
313097
|
+
dispatch({
|
|
313098
|
+
type: 'changeSliceColumns',
|
|
313099
|
+
sliceColumns: sliceColumns
|
|
313100
|
+
});
|
|
313101
|
+
}, [sliceColumns]); // 非固定列长度
|
|
313102
|
+
|
|
313103
|
+
var centerColumnsLen = React.useMemo(function () {
|
|
313104
|
+
var _sliceColumns$centerC, _sliceColumns$centerC2;
|
|
313105
|
+
|
|
313106
|
+
return (_sliceColumns$centerC = sliceColumns === null || sliceColumns === void 0 ? void 0 : (_sliceColumns$centerC2 = sliceColumns.centerColumns) === null || _sliceColumns$centerC2 === void 0 ? void 0 : _sliceColumns$centerC2.length) !== null && _sliceColumns$centerC !== void 0 ? _sliceColumns$centerC : 0;
|
|
313107
|
+
}, [sliceColumns]);
|
|
313108
|
+
React.useEffect(function () {
|
|
313109
|
+
if (state.columnsLen !== centerColumnsLen) {
|
|
313110
|
+
dispatch({
|
|
313111
|
+
type: 'changeColumnsLen',
|
|
313112
|
+
columnsLen: centerColumnsLen !== null && centerColumnsLen !== void 0 ? centerColumnsLen : 0
|
|
313113
|
+
});
|
|
313114
|
+
}
|
|
313115
|
+
}, [centerColumnsLen, dispatch, state.columnsLen]); // 获取行的高度
|
|
313116
|
+
|
|
313117
|
+
React.useEffect(function () {
|
|
313118
|
+
var initHeight = function initHeight(tempRef) {
|
|
313119
|
+
var _tempRef$current;
|
|
313120
|
+
|
|
313121
|
+
if ((tempRef === null || tempRef === void 0 ? void 0 : (_tempRef$current = tempRef.current) === null || _tempRef$current === void 0 ? void 0 : _tempRef$current.offsetHeight) && !rowHeight && totalLen) {
|
|
313122
|
+
var _tempRef$current$offs, _tempRef$current2;
|
|
313123
|
+
|
|
313124
|
+
var tempRowHeight = (_tempRef$current$offs = tempRef === null || tempRef === void 0 ? void 0 : (_tempRef$current2 = tempRef.current) === null || _tempRef$current2 === void 0 ? void 0 : _tempRef$current2.offsetHeight) !== null && _tempRef$current$offs !== void 0 ? _tempRef$current$offs : 0;
|
|
313125
|
+
dispatch({
|
|
313126
|
+
type: 'initHeight',
|
|
313127
|
+
rowHeight: tempRowHeight + 1
|
|
313128
|
+
});
|
|
313129
|
+
}
|
|
313130
|
+
};
|
|
313131
|
+
|
|
313132
|
+
initHeight(Object.prototype.hasOwnProperty.call(ref, 'current') ? ref : trRef);
|
|
313133
|
+
}, [trRef, dispatch, rowHeight, totalLen, ref]); // 横向单元格合并
|
|
313134
|
+
|
|
313135
|
+
var leftColSpan = React.useMemo(function () {
|
|
313136
|
+
var _virtualItems$;
|
|
313137
|
+
|
|
313138
|
+
return (_virtualItems$ = virtualItems[0]) === null || _virtualItems$ === void 0 ? void 0 : _virtualItems$.index;
|
|
313139
|
+
}, [virtualItems]); // 右侧隐藏数量
|
|
313140
|
+
|
|
313141
|
+
var rightColSpan = React.useMemo(function () {
|
|
313142
|
+
var _sliceColumns$centerC3;
|
|
313143
|
+
|
|
313144
|
+
return (sliceColumns === null || sliceColumns === void 0 ? void 0 : (_sliceColumns$centerC3 = sliceColumns.centerColumns) === null || _sliceColumns$centerC3 === void 0 ? void 0 : _sliceColumns$centerC3.length) - (virtualItems === null || virtualItems === void 0 ? void 0 : virtualItems.length) - leftColSpan || 0;
|
|
313145
|
+
}, [sliceColumns === null || sliceColumns === void 0 ? void 0 : (_sliceColumns$centerC4 = sliceColumns.centerColumns) === null || _sliceColumns$centerC4 === void 0 ? void 0 : _sliceColumns$centerC4.length, virtualItems.length, leftColSpan]);
|
|
313146
|
+
return _objectSpread(_objectSpread({
|
|
313147
|
+
virtualItems: virtualItems
|
|
313148
|
+
}, sliceColumns), {}, {
|
|
313149
|
+
leftColSpan: leftColSpan,
|
|
313150
|
+
rightColSpan: rightColSpan
|
|
313151
|
+
});
|
|
312702
313152
|
};
|
|
312703
313153
|
|
|
312704
|
-
var
|
|
313154
|
+
var VirtualRow$1 = /*#__PURE__*/React__default['default'].memo(function (_ref2, ref) {
|
|
313155
|
+
var children = _ref2.children,
|
|
313156
|
+
pref = _ref2.pref,
|
|
313157
|
+
resetProps = _objectWithoutProperties$1(_ref2, _excluded$2Q);
|
|
313158
|
+
|
|
313159
|
+
var trRef = React.useRef(null);
|
|
313160
|
+
var clearProps = lodash.omit(resetProps, ['dataKey', 'pushAllForm']);
|
|
313161
|
+
|
|
313162
|
+
var _useOptions = useOptions$3({
|
|
313163
|
+
children: children,
|
|
313164
|
+
ref: ref,
|
|
313165
|
+
trRef: trRef
|
|
313166
|
+
}),
|
|
313167
|
+
virtualItems = _useOptions.virtualItems,
|
|
313168
|
+
leftColumns = _useOptions.leftColumns,
|
|
313169
|
+
centerColumns = _useOptions.centerColumns,
|
|
313170
|
+
rightColumns = _useOptions.rightColumns,
|
|
313171
|
+
leftColSpan = _useOptions.leftColSpan,
|
|
313172
|
+
rightColSpan = _useOptions.rightColSpan;
|
|
313173
|
+
|
|
313174
|
+
return /*#__PURE__*/React__default['default'].createElement("tr", _objectSpread(_objectSpread({}, clearProps), {}, {
|
|
313175
|
+
ref: useForkRef(pref, trRef)
|
|
313176
|
+
}), leftColumns, !!leftColSpan && /*#__PURE__*/React__default['default'].createElement("td", {
|
|
313177
|
+
key: "leftColSpan",
|
|
313178
|
+
colSpan: leftColSpan
|
|
313179
|
+
}), virtualItems.map(function (virtualCol) {
|
|
313180
|
+
return /*#__PURE__*/React__default['default'].cloneElement(centerColumns[virtualCol.index], {
|
|
313181
|
+
ref: virtualCol.measureRef
|
|
313182
|
+
});
|
|
313183
|
+
}), !!rightColSpan && /*#__PURE__*/React__default['default'].createElement("td", {
|
|
313184
|
+
key: "rightColSpan",
|
|
313185
|
+
colSpan: rightColSpan
|
|
313186
|
+
}), rightColumns);
|
|
313187
|
+
});
|
|
313188
|
+
|
|
313189
|
+
var _excluded$2R = ["data-row-key", "children", "className", "virtual"];
|
|
312705
313190
|
|
|
312706
313191
|
var SortableItem$1 = function SortableItem(props) {
|
|
312707
313192
|
var key = props['data-row-key'],
|
|
312708
313193
|
children = props.children,
|
|
312709
313194
|
className = props.className,
|
|
312710
|
-
|
|
313195
|
+
virtual = props.virtual,
|
|
313196
|
+
resetField = _objectWithoutProperties$1(props, _excluded$2R);
|
|
312711
313197
|
|
|
312712
313198
|
var _useSortable = useSortable({
|
|
312713
313199
|
id: key
|
|
@@ -312721,27 +313207,66 @@
|
|
|
312721
313207
|
transform: CSS.Transform.toString(transform),
|
|
312722
313208
|
transition: transition
|
|
312723
313209
|
};
|
|
312724
|
-
|
|
313210
|
+
|
|
313211
|
+
if (!virtual) {
|
|
313212
|
+
return /*#__PURE__*/React__default['default'].createElement("tr", _objectSpread(_objectSpread({}, resetField), {}, {
|
|
313213
|
+
ref: setNodeRef,
|
|
313214
|
+
key: key,
|
|
313215
|
+
style: style
|
|
313216
|
+
}, attributes), children);
|
|
313217
|
+
}
|
|
313218
|
+
|
|
313219
|
+
return /*#__PURE__*/React__default['default'].createElement(VirtualRow$1, _objectSpread(_objectSpread({}, resetField), {}, {
|
|
312725
313220
|
ref: setNodeRef,
|
|
313221
|
+
pref: setNodeRef,
|
|
312726
313222
|
key: key,
|
|
312727
313223
|
style: style
|
|
312728
313224
|
}, attributes), children);
|
|
312729
313225
|
};
|
|
312730
313226
|
|
|
312731
|
-
var
|
|
312732
|
-
var Item$5 = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
312733
|
-
var _children$props;
|
|
313227
|
+
var SortableItem$2 = /*#__PURE__*/React.memo(SortableItem$1);
|
|
312734
313228
|
|
|
313229
|
+
var _excluded$2S = ["children"];
|
|
313230
|
+
// children: React.ReactNode
|
|
313231
|
+
// }
|
|
313232
|
+
// interface ItemInstance {}
|
|
313233
|
+
// @ts-ignore
|
|
313234
|
+
|
|
313235
|
+
var Item$5 = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
312735
313236
|
var children = _ref.children,
|
|
312736
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
313237
|
+
props = _objectWithoutProperties$1(_ref, _excluded$2S);
|
|
313238
|
+
|
|
313239
|
+
// const rProps = omit({ ...props, ...children.props }, [
|
|
313240
|
+
// 'isSticky',
|
|
313241
|
+
// 'colStart',
|
|
313242
|
+
// 'colEnd',
|
|
313243
|
+
// 'prefixCls',
|
|
313244
|
+
// 'fixLeft',
|
|
313245
|
+
// 'fixRight',
|
|
313246
|
+
// 'lastFixLeft',
|
|
313247
|
+
// 'firstFixRight',
|
|
313248
|
+
// 'lastFixRight',
|
|
313249
|
+
// 'firstFixLeft',
|
|
313250
|
+
// 'isSticky',
|
|
313251
|
+
// 'additionalProps',
|
|
313252
|
+
// 'rowType',
|
|
313253
|
+
// ])
|
|
313254
|
+
return (
|
|
313255
|
+
/*#__PURE__*/
|
|
313256
|
+
// <th {...rProps} ref={ref as any} />
|
|
313257
|
+
React__default['default'].createElement("th", _objectSpread(_objectSpread(_objectSpread({}, props), children.props), {}, {
|
|
313258
|
+
ref: ref
|
|
313259
|
+
})) // <th {...props} ref={ref as any}>
|
|
313260
|
+
// {(children as any)?.props?.children || children}
|
|
313261
|
+
// </th>
|
|
312737
313262
|
|
|
312738
|
-
|
|
312739
|
-
ref: ref
|
|
312740
|
-
}), (children === null || children === void 0 ? void 0 : (_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.children) || children);
|
|
313263
|
+
);
|
|
312741
313264
|
});
|
|
312742
|
-
function SortableItem$
|
|
313265
|
+
function SortableItem$3(props) {
|
|
313266
|
+
var id = props.id;
|
|
313267
|
+
|
|
312743
313268
|
var _useSortable = useSortable({
|
|
312744
|
-
id:
|
|
313269
|
+
id: id
|
|
312745
313270
|
}),
|
|
312746
313271
|
attributes = _useSortable.attributes,
|
|
312747
313272
|
listeners = _useSortable.listeners,
|
|
@@ -312751,7 +313276,9 @@
|
|
|
312751
313276
|
|
|
312752
313277
|
var style = {
|
|
312753
313278
|
position: 'relative',
|
|
312754
|
-
transform: CSS.Translate.toString(transform),
|
|
313279
|
+
transform: CSS.Translate.toString(transform ? _objectSpread(_objectSpread({}, transform), {}, {
|
|
313280
|
+
y: 0
|
|
313281
|
+
}) : transform),
|
|
312755
313282
|
transition: transition,
|
|
312756
313283
|
touchAction: 'none',
|
|
312757
313284
|
height: '40px',
|
|
@@ -312781,7 +313308,7 @@
|
|
|
312781
313308
|
touchAction: 'none',
|
|
312782
313309
|
cursor: 'move'
|
|
312783
313310
|
},
|
|
312784
|
-
className:
|
|
313311
|
+
className: "icon_drag".concat(isDragging ? 'bing' : '')
|
|
312785
313312
|
}));
|
|
312786
313313
|
};
|
|
312787
313314
|
|
|
@@ -312793,25 +313320,26 @@
|
|
|
312793
313320
|
function deepDataSourcePreKeys(dataSource, rowKey) {
|
|
312794
313321
|
var deepDataSource = [];
|
|
312795
313322
|
|
|
312796
|
-
var eachChildren = function eachChildren(children, preKeys) {
|
|
312797
|
-
children === null || children === void 0 ? void 0 : children.forEach(function (item) {
|
|
313323
|
+
var eachChildren = function eachChildren(children, preKeys, deepIds) {
|
|
313324
|
+
children === null || children === void 0 ? void 0 : children.forEach(function (item, index) {
|
|
312798
313325
|
deepDataSource.push(_objectSpread(_objectSpread({}, item), {}, {
|
|
312799
|
-
preKeys: [].concat(_toConsumableArray$1(preKeys), [item === null || item === void 0 ? void 0 : item[rowKey]])
|
|
313326
|
+
preKeys: [].concat(_toConsumableArray$1(preKeys), [item === null || item === void 0 ? void 0 : item[rowKey]]),
|
|
313327
|
+
_deepIds: [].concat(_toConsumableArray$1(deepIds), [index + 1])
|
|
312800
313328
|
}));
|
|
312801
313329
|
|
|
312802
313330
|
if (item === null || item === void 0 ? void 0 : item.children) {
|
|
312803
|
-
eachChildren(item === null || item === void 0 ? void 0 : item.children, [].concat(_toConsumableArray$1(preKeys), [item === null || item === void 0 ? void 0 : item[rowKey]])); // deepDataSource.push({ ...item, preKeys: [...preKeys, item[rowKey]] })
|
|
313331
|
+
eachChildren(item === null || item === void 0 ? void 0 : item.children, [].concat(_toConsumableArray$1(preKeys), [item === null || item === void 0 ? void 0 : item[rowKey]]), [].concat(_toConsumableArray$1(deepIds), [index + 1])); // deepDataSource.push({ ...item, preKeys: [...preKeys, item[rowKey]] })
|
|
312804
313332
|
}
|
|
312805
313333
|
});
|
|
312806
313334
|
};
|
|
312807
313335
|
|
|
312808
|
-
eachChildren(dataSource, []);
|
|
313336
|
+
eachChildren(dataSource, [], []);
|
|
312809
313337
|
return lodash.keyBy(deepDataSource, rowKey);
|
|
312810
313338
|
}
|
|
312811
313339
|
function isExpandRow(children) {
|
|
312812
|
-
var _children$, _children$$props, _children$$props$chil, _children$$props$chil2, _children$$props$chil3;
|
|
313340
|
+
var _children$, _children$$props, _children$$props$chil, _children$$props$chil2, _children$$props$chil3, _children$2, _children$2$props, _children$2$props$chi, _children$2$props$chi2, _children$2$props$chi3, _children$2$props$chi4;
|
|
312813
313341
|
|
|
312814
|
-
return ['Collapse row', 'Expand row'].includes(children === null || children === void 0 ? void 0 : (_children$ = children[0]) === null || _children$ === void 0 ? void 0 : (_children$$props = _children$.props) === null || _children$$props === void 0 ? void 0 : (_children$$props$chil = _children$$props.children) === null || _children$$props$chil === void 0 ? void 0 : (_children$$props$chil2 = _children$$props$chil[1]) === null || _children$$props$chil2 === void 0 ? void 0 : (_children$$props$chil3 = _children$$props$chil2.props) === null || _children$$props$chil3 === void 0 ? void 0 : _children$$props$chil3['aria-label']);
|
|
313342
|
+
return ['Collapse row', 'Expand row'].includes(children === null || children === void 0 ? void 0 : (_children$ = children[0]) === null || _children$ === void 0 ? void 0 : (_children$$props = _children$.props) === null || _children$$props === void 0 ? void 0 : (_children$$props$chil = _children$$props.children) === null || _children$$props$chil === void 0 ? void 0 : (_children$$props$chil2 = _children$$props$chil[1]) === null || _children$$props$chil2 === void 0 ? void 0 : (_children$$props$chil3 = _children$$props$chil2.props) === null || _children$$props$chil3 === void 0 ? void 0 : _children$$props$chil3['aria-label']) || (children === null || children === void 0 ? void 0 : (_children$2 = children[0]) === null || _children$2 === void 0 ? void 0 : (_children$2$props = _children$2.props) === null || _children$2$props === void 0 ? void 0 : (_children$2$props$chi = _children$2$props.children) === null || _children$2$props$chi === void 0 ? void 0 : (_children$2$props$chi2 = _children$2$props$chi[1]) === null || _children$2$props$chi2 === void 0 ? void 0 : (_children$2$props$chi3 = _children$2$props$chi2.props) === null || _children$2$props$chi3 === void 0 ? void 0 : (_children$2$props$chi4 = _children$2$props$chi3.className) === null || _children$2$props$chi4 === void 0 ? void 0 : _children$2$props$chi4.indexOf('ant-table-row-expand-icon')) > -1;
|
|
312815
313343
|
}
|
|
312816
313344
|
function checkRowKeyByDataSource(dataSource, rowKey) {
|
|
312817
313345
|
var addRowKey = function addRowKey(children, pkey) {
|
|
@@ -312837,186 +313365,340 @@
|
|
|
312837
313365
|
|
|
312838
313366
|
return _objectSpread(_objectSpread({}, v), {}, _defineProperty$1({}, rowKey, v[rowKey] || "v".concat(idx + 1)));
|
|
312839
313367
|
});
|
|
312840
|
-
return res;
|
|
313368
|
+
return res || [];
|
|
312841
313369
|
}
|
|
313370
|
+
function getExpandStatus(children) {
|
|
313371
|
+
var _children$3, _children$3$props, _children$3$props$chi, _children$3$props$chi2, _children$3$props$chi3;
|
|
312842
313372
|
|
|
312843
|
-
|
|
312844
|
-
|
|
312845
|
-
|
|
312846
|
-
|
|
312847
|
-
_excluded5 = ["onMouseEnter", "onMouseLeave"],
|
|
312848
|
-
_excluded6 = ["value", "columns", "isEdit", "isAdd", "onChange", "rowKey", "rowHoverEdit", "isUseForm", "isHoverEdit", "useQuickOpetate", "quickOpetateClearAll", "rowSelection", "sortOpen", "colSortOpen", "filterChange", "size", "recordCreatorProps", "shouldUpdate"];
|
|
312849
|
-
var UploadBtn$1 = UploadOss.UploadBtn;
|
|
312850
|
-
var EditableContext$1 = /*#__PURE__*/React__default['default'].createContext(null); // 表格行
|
|
313373
|
+
return isExpandRow(children) ? children === null || children === void 0 ? void 0 : (_children$3 = children[0]) === null || _children$3 === void 0 ? void 0 : (_children$3$props = _children$3.props) === null || _children$3$props === void 0 ? void 0 : (_children$3$props$chi = _children$3$props.children) === null || _children$3$props$chi === void 0 ? void 0 : (_children$3$props$chi2 = _children$3$props$chi[1]) === null || _children$3$props$chi2 === void 0 ? void 0 : (_children$3$props$chi3 = _children$3$props$chi2.props) === null || _children$3$props$chi3 === void 0 ? void 0 : _children$3$props$chi3['aria-label'] : '';
|
|
313374
|
+
}
|
|
313375
|
+
function checkMemoShouldUploadSpecialFun(prev, next) {
|
|
313376
|
+
var _prevCol$componentPro, _nextCol$componentPro, _prevCol$componentPro2, _nextCol$componentPro2, _prevCol$componentPro3, _nextCol$componentPro3, _prevCol$componentPro4, _nextCol$componentPro4, _prevCol$componentPro5, _nextCol$componentPro5, _next$className, _prevCol$componentPro6, _nextCol$componentPro6;
|
|
312851
313377
|
|
|
312852
|
-
|
|
312853
|
-
var index = _ref.index,
|
|
312854
|
-
props = _objectWithoutProperties$1(_ref, _excluded$2R);
|
|
313378
|
+
var checkExpandStatus = getExpandStatus(prev.children) === getExpandStatus(next.children);
|
|
312855
313379
|
|
|
312856
|
-
|
|
312857
|
-
|
|
312858
|
-
|
|
313380
|
+
if (!checkExpandStatus) {
|
|
313381
|
+
return false;
|
|
313382
|
+
}
|
|
312859
313383
|
|
|
312860
|
-
|
|
312861
|
-
|
|
312862
|
-
|
|
312863
|
-
}, /*#__PURE__*/React__default['default'].createElement(EditableContext$1.Provider, {
|
|
312864
|
-
value: form
|
|
312865
|
-
}, /*#__PURE__*/React__default['default'].createElement("tr", _objectSpread({}, props))));
|
|
312866
|
-
};
|
|
313384
|
+
var prevCol = prev === null || prev === void 0 ? void 0 : prev.col;
|
|
313385
|
+
var nextCol = next === null || next === void 0 ? void 0 : next.col;
|
|
313386
|
+
/** TODO: 使用了自定义render, 是否要判断rowIndex? 这样排序之后,渲染的性能就会变差 */
|
|
312867
313387
|
|
|
312868
|
-
|
|
312869
|
-
|
|
312870
|
-
|
|
313388
|
+
if (((prevCol === null || prevCol === void 0 ? void 0 : prevCol.render) || (nextCol === null || nextCol === void 0 ? void 0 : nextCol.render)) && !lodash.isEqual(lodash.pick(prev, ['colIndex', 'record', 'children']), lodash.pick(next, ['colIndex', 'record', 'children']))) {
|
|
313389
|
+
return false;
|
|
313390
|
+
}
|
|
312871
313391
|
|
|
312872
|
-
|
|
312873
|
-
|
|
312874
|
-
|
|
313392
|
+
if (!(next === null || next === void 0 ? void 0 : next.quickOpetateClearAll) && ((next === null || next === void 0 ? void 0 : next.getLength) < 2 || (prev === null || prev === void 0 ? void 0 : prev.getLength) === 1) && (next === null || next === void 0 ? void 0 : next.dataIndex) === 'lm_edit_opetate') {
|
|
313393
|
+
return false;
|
|
313394
|
+
}
|
|
312875
313395
|
|
|
312876
|
-
|
|
312877
|
-
|
|
312878
|
-
|
|
312879
|
-
}, /*#__PURE__*/React__default['default'].createElement(EditableContext$1.Provider, {
|
|
312880
|
-
value: form
|
|
312881
|
-
}, /*#__PURE__*/React__default['default'].createElement(SortableItem$1, _objectSpread({}, props))));
|
|
312882
|
-
};
|
|
313396
|
+
if (prev.isEdit !== next.isEdit) {
|
|
313397
|
+
return false;
|
|
313398
|
+
} // console.log(22, prevCol?.editable === 'render', nextCol?.editable === 'render', prevCol?.componentProps, prevCol?.componentProps)
|
|
312883
313399
|
|
|
312884
|
-
var UploadSingle$1 = function UploadSingle(props) {
|
|
312885
|
-
var value = props.value,
|
|
312886
|
-
onChange = props.onChange,
|
|
312887
|
-
editEnum = props.editEnum;
|
|
312888
313400
|
|
|
312889
|
-
|
|
312890
|
-
|
|
312891
|
-
}
|
|
313401
|
+
if (((prevCol === null || prevCol === void 0 ? void 0 : prevCol.editable) === 'render' || (nextCol === null || nextCol === void 0 ? void 0 : nextCol.editable) === 'render') && ((prevCol === null || prevCol === void 0 ? void 0 : (_prevCol$componentPro = prevCol.componentProps) === null || _prevCol$componentPro === void 0 ? void 0 : _prevCol$componentPro.render) || (nextCol === null || nextCol === void 0 ? void 0 : (_nextCol$componentPro = nextCol.componentProps) === null || _nextCol$componentPro === void 0 ? void 0 : _nextCol$componentPro.render)) && (!lodash.isEqual(lodash.omit(prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps, ['render']), lodash.omit(nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps, ['render'])) || !lodash.isEqual(lodash.pick(prev, ['colIndex', 'record', 'rowIndex']), lodash.pick(next, ['colIndex', 'record', 'rowIndex'])))) {
|
|
313402
|
+
return false;
|
|
313403
|
+
}
|
|
312892
313404
|
|
|
312893
|
-
|
|
312894
|
-
|
|
312895
|
-
}
|
|
312896
|
-
type: "lmweb-link",
|
|
312897
|
-
style: {
|
|
312898
|
-
fontSize: 14,
|
|
312899
|
-
color: '#1890ff'
|
|
312900
|
-
}
|
|
312901
|
-
}), /*#__PURE__*/React__default['default'].createElement("a", {
|
|
312902
|
-
href: "".concat(value === null || value === void 0 ? void 0 : value.externalUrl, "/").concat(value === null || value === void 0 ? void 0 : value.filePath).concat(value === null || value === void 0 ? void 0 : value.realFileName),
|
|
312903
|
-
target: "_blank",
|
|
312904
|
-
rel: "noreferrer"
|
|
312905
|
-
}, value === null || value === void 0 ? void 0 : value.fileName), /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
312906
|
-
type: "lmweb-delete",
|
|
312907
|
-
style: {
|
|
312908
|
-
fontSize: 14,
|
|
312909
|
-
color: '#1890ff'
|
|
312910
|
-
},
|
|
312911
|
-
onClick: handleDelete
|
|
312912
|
-
})) : /*#__PURE__*/React__default['default'].createElement(UploadBtn$1, _objectSpread(_objectSpread({}, editEnum), {}, {
|
|
312913
|
-
value: value,
|
|
312914
|
-
onChange: onChange
|
|
312915
|
-
})));
|
|
312916
|
-
};
|
|
313405
|
+
if (((prevCol === null || prevCol === void 0 ? void 0 : prevCol.fixed) || (nextCol === null || nextCol === void 0 ? void 0 : nextCol.fixed)) && !lodash.isEqual(prev === null || prev === void 0 ? void 0 : prev.style, next === null || next === void 0 ? void 0 : next.style)) {
|
|
313406
|
+
return false;
|
|
313407
|
+
}
|
|
312917
313408
|
|
|
312918
|
-
|
|
312919
|
-
|
|
312920
|
-
|
|
312921
|
-
onChange = _ref3.onChange,
|
|
312922
|
-
record = _ref3.record,
|
|
312923
|
-
rowIndex = _ref3.rowIndex,
|
|
312924
|
-
colIndex = _ref3.colIndex,
|
|
312925
|
-
validator = _ref3.validator,
|
|
312926
|
-
editEnum = _objectWithoutProperties$1(_ref3, _excluded3$b);
|
|
313409
|
+
if (((prevCol === null || prevCol === void 0 ? void 0 : (_prevCol$componentPro2 = prevCol.componentProps) === null || _prevCol$componentPro2 === void 0 ? void 0 : _prevCol$componentPro2.optionOnly) || (nextCol === null || nextCol === void 0 ? void 0 : (_nextCol$componentPro2 = nextCol.componentProps) === null || _nextCol$componentPro2 === void 0 ? void 0 : _nextCol$componentPro2.optionOnly)) && !lodash.isEqual(prevCol === null || prevCol === void 0 ? void 0 : (_prevCol$componentPro3 = prevCol.componentProps) === null || _prevCol$componentPro3 === void 0 ? void 0 : _prevCol$componentPro3.options, nextCol === null || nextCol === void 0 ? void 0 : (_nextCol$componentPro3 = nextCol.componentProps) === null || _nextCol$componentPro3 === void 0 ? void 0 : _nextCol$componentPro3.options)) {
|
|
313410
|
+
return false;
|
|
313411
|
+
}
|
|
312927
313412
|
|
|
312928
|
-
|
|
312929
|
-
|
|
313413
|
+
if (((prevCol === null || prevCol === void 0 ? void 0 : (_prevCol$componentPro4 = prevCol.componentProps) === null || _prevCol$componentPro4 === void 0 ? void 0 : _prevCol$componentPro4.options) || (nextCol === null || nextCol === void 0 ? void 0 : (_nextCol$componentPro4 = nextCol.componentProps) === null || _nextCol$componentPro4 === void 0 ? void 0 : _nextCol$componentPro4.options)) && !lodash.isEqual(prevCol === null || prevCol === void 0 ? void 0 : (_prevCol$componentPro5 = prevCol.componentProps) === null || _prevCol$componentPro5 === void 0 ? void 0 : _prevCol$componentPro5.options, nextCol === null || nextCol === void 0 ? void 0 : (_nextCol$componentPro5 = nextCol.componentProps) === null || _nextCol$componentPro5 === void 0 ? void 0 : _nextCol$componentPro5.options)) {
|
|
313414
|
+
return false;
|
|
313415
|
+
}
|
|
312930
313416
|
|
|
312931
|
-
|
|
312932
|
-
|
|
312933
|
-
|
|
312934
|
-
setValue = _useState2[1];
|
|
313417
|
+
if ((lodash.isFunction(prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) || lodash.isFunction(nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps)) && !lodash.isEqual(prevCol.newOptions, nextCol.newOptions) && !lodash.isEqual(prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps, nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps)) {
|
|
313418
|
+
return false;
|
|
313419
|
+
}
|
|
312935
313420
|
|
|
312936
|
-
|
|
312937
|
-
|
|
312938
|
-
|
|
313421
|
+
if (((prevCol === null || prevCol === void 0 ? void 0 : prevCol.order) || (nextCol === null || nextCol === void 0 ? void 0 : nextCol.order)) && !lodash.isEqual(prevCol === null || prevCol === void 0 ? void 0 : prevCol.order, nextCol === null || nextCol === void 0 ? void 0 : nextCol.order)) {
|
|
313422
|
+
// return isEqual(prevCol?.order, nextCol?.fixed)
|
|
313423
|
+
return false;
|
|
313424
|
+
}
|
|
312939
313425
|
|
|
312940
|
-
|
|
312941
|
-
|
|
312942
|
-
}
|
|
313426
|
+
if (next.className.indexOf('drag-visible') > -1) {
|
|
313427
|
+
return lodash.isEqual(prev.style, next.style);
|
|
313428
|
+
}
|
|
312943
313429
|
|
|
312944
|
-
|
|
312945
|
-
|
|
312946
|
-
|
|
312947
|
-
onChange(v);
|
|
312948
|
-
history.current.push(v);
|
|
312949
|
-
};
|
|
313430
|
+
if (((_next$className = next.className) === null || _next$className === void 0 ? void 0 : _next$className.indexOf('ant-table-row-expand-icon-cell')) > -1) {
|
|
313431
|
+
return false;
|
|
313432
|
+
}
|
|
312950
313433
|
|
|
312951
|
-
|
|
312952
|
-
var
|
|
313434
|
+
if (next.className.indexOf('ant-table-selection-column') > -1) {
|
|
313435
|
+
var _prev$children, _prev$children$, _next$children, _next$children$;
|
|
312953
313436
|
|
|
312954
|
-
|
|
312955
|
-
|
|
312956
|
-
|
|
312957
|
-
setValue(['', nValue[1]]);
|
|
312958
|
-
} else if (type === 'next') {
|
|
312959
|
-
setValue([nValue[0], '']);
|
|
312960
|
-
}
|
|
313437
|
+
return lodash.isEqual((_prev$children = prev.children) === null || _prev$children === void 0 ? void 0 : (_prev$children$ = _prev$children[1]) === null || _prev$children$ === void 0 ? void 0 : _prev$children$.props, (_next$children = next.children) === null || _next$children === void 0 ? void 0 : (_next$children$ = _next$children[1]) === null || _next$children$ === void 0 ? void 0 : _next$children$.props);
|
|
313438
|
+
}
|
|
313439
|
+
/** 如果启用了快速复制功能,需要实时判断rowIndex与getLength */
|
|
312961
313440
|
|
|
312962
|
-
|
|
312963
|
-
|
|
313441
|
+
|
|
313442
|
+
if ((prevCol === null || prevCol === void 0 ? void 0 : (_prevCol$componentPro6 = prevCol.componentProps) === null || _prevCol$componentPro6 === void 0 ? void 0 : _prevCol$componentPro6.quickcopy) || (nextCol === null || nextCol === void 0 ? void 0 : (_nextCol$componentPro6 = nextCol.componentProps) === null || _nextCol$componentPro6 === void 0 ? void 0 : _nextCol$componentPro6.quickcopy)) {
|
|
313443
|
+
var pickProps = ['record', 'colIndex', 'rowIndex', 'getLength'];
|
|
313444
|
+
var p = lodash.pick(prev, pickProps);
|
|
313445
|
+
var n = lodash.pick(next, pickProps);
|
|
313446
|
+
return lodash.isEqual(p, n);
|
|
313447
|
+
}
|
|
313448
|
+
|
|
313449
|
+
return true;
|
|
313450
|
+
}
|
|
313451
|
+
function checkExpandIconColumnIndex(_ref) {
|
|
313452
|
+
var rowSelection = _ref.rowSelection,
|
|
313453
|
+
sortOpen = _ref.sortOpen,
|
|
313454
|
+
indexCol = _ref.indexCol;
|
|
313455
|
+
var arr = [rowSelection, sortOpen, indexCol].filter(function (item) {
|
|
313456
|
+
return !!item;
|
|
313457
|
+
});
|
|
313458
|
+
return arr.length;
|
|
313459
|
+
}
|
|
313460
|
+
function checkDataSourceIsEmpty(config, dataSource, scrollInfo) {
|
|
313461
|
+
var resultConfig = _objectSpread({}, config);
|
|
313462
|
+
|
|
313463
|
+
if (scrollInfo) {
|
|
313464
|
+
var _resultConfig$scroll, _resultConfig$scroll2;
|
|
313465
|
+
|
|
313466
|
+
resultConfig = _objectSpread(_objectSpread({}, resultConfig), {}, {
|
|
313467
|
+
scroll: {
|
|
313468
|
+
x: ((_resultConfig$scroll = resultConfig.scroll) === null || _resultConfig$scroll === void 0 ? void 0 : _resultConfig$scroll.x) || '100%',
|
|
313469
|
+
y: scrollInfo.height || ((_resultConfig$scroll2 = resultConfig.scroll) === null || _resultConfig$scroll2 === void 0 ? void 0 : _resultConfig$scroll2.y)
|
|
312964
313470
|
}
|
|
313471
|
+
});
|
|
313472
|
+
}
|
|
312965
313473
|
|
|
312966
|
-
|
|
313474
|
+
if (dataSource.length) {
|
|
313475
|
+
return resultConfig;
|
|
313476
|
+
}
|
|
312967
313477
|
|
|
312968
|
-
|
|
312969
|
-
|
|
312970
|
-
|
|
312971
|
-
|
|
312972
|
-
|
|
313478
|
+
return _objectSpread(_objectSpread({}, resultConfig), {}, {
|
|
313479
|
+
components: _objectSpread(_objectSpread({}, resultConfig.components), {}, {
|
|
313480
|
+
body: {}
|
|
313481
|
+
})
|
|
313482
|
+
});
|
|
313483
|
+
}
|
|
313484
|
+
/** 根据传入的disabedRows, 得出最终需要disabed的rowKeys */
|
|
313485
|
+
|
|
313486
|
+
function checkTableRowIsDisable(deepDataSource, disabledRows, rowKey) {
|
|
313487
|
+
var disabledRkeys = [];
|
|
313488
|
+
|
|
313489
|
+
if (!disabledRows.length) {
|
|
313490
|
+
return disabledRkeys;
|
|
313491
|
+
}
|
|
313492
|
+
|
|
313493
|
+
var disableIds = disabledRows.map(function (item) {
|
|
313494
|
+
return lodash.isObject(item) ? item === null || item === void 0 ? void 0 : item[rowKey] : item;
|
|
313495
|
+
});
|
|
313496
|
+
|
|
313497
|
+
function deep(children, arrs) {
|
|
313498
|
+
children === null || children === void 0 ? void 0 : children.forEach(function (item) {
|
|
313499
|
+
arrs.push(item[rowKey]);
|
|
313500
|
+
|
|
313501
|
+
if (item.children) {
|
|
313502
|
+
deep(item.children, arrs);
|
|
312973
313503
|
}
|
|
312974
|
-
};
|
|
313504
|
+
});
|
|
313505
|
+
}
|
|
312975
313506
|
|
|
312976
|
-
|
|
312977
|
-
|
|
313507
|
+
if (disableIds.length) {
|
|
313508
|
+
disableIds === null || disableIds === void 0 ? void 0 : disableIds.forEach(function (item) {
|
|
313509
|
+
disabledRkeys.push(item);
|
|
313510
|
+
var record = deepDataSource[item];
|
|
312978
313511
|
|
|
312979
|
-
|
|
312980
|
-
|
|
312981
|
-
|
|
312982
|
-
|
|
312983
|
-
}
|
|
312984
|
-
|
|
312985
|
-
|
|
312986
|
-
|
|
312987
|
-
|
|
312988
|
-
|
|
312989
|
-
|
|
312990
|
-
|
|
312991
|
-
|
|
312992
|
-
|
|
312993
|
-
|
|
313512
|
+
if (record === null || record === void 0 ? void 0 : record.children) {
|
|
313513
|
+
deep(record.children, disabledRkeys);
|
|
313514
|
+
}
|
|
313515
|
+
});
|
|
313516
|
+
}
|
|
313517
|
+
|
|
313518
|
+
return disabledRkeys;
|
|
313519
|
+
}
|
|
313520
|
+
|
|
313521
|
+
var DndContainer$3 = function DndContainer(_ref) {
|
|
313522
|
+
var children = _ref.children,
|
|
313523
|
+
options = _ref.options,
|
|
313524
|
+
move = _ref.move,
|
|
313525
|
+
rowKey = _ref.rowKey,
|
|
313526
|
+
items = _ref.items,
|
|
313527
|
+
tableWidth = _ref.tableWidth;
|
|
313528
|
+
|
|
313529
|
+
var _React$useState = React__default['default'].useState(false),
|
|
313530
|
+
_React$useState2 = _slicedToArray$1(_React$useState, 2),
|
|
313531
|
+
isDragging = _React$useState2[0],
|
|
313532
|
+
setIsDragging = _React$useState2[1]; // 是否拖拽中
|
|
313533
|
+
|
|
313534
|
+
|
|
313535
|
+
var _React$useState3 = React__default['default'].useState(null),
|
|
313536
|
+
_React$useState4 = _slicedToArray$1(_React$useState3, 2),
|
|
313537
|
+
activeId = _React$useState4[0],
|
|
313538
|
+
setActiveId = _React$useState4[1]; // 是否拖拽中
|
|
313539
|
+
|
|
313540
|
+
|
|
313541
|
+
var sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, {
|
|
313542
|
+
coordinateGetter: sortableKeyboardCoordinates
|
|
313543
|
+
})); // 开始拖拽
|
|
313544
|
+
|
|
313545
|
+
var handleDragStart = function handleDragStart(_ref2) {
|
|
313546
|
+
var active = _ref2.active;
|
|
313547
|
+
setIsDragging(true);
|
|
313548
|
+
|
|
313549
|
+
if (!active) {
|
|
313550
|
+
return;
|
|
312994
313551
|
}
|
|
312995
|
-
|
|
312996
|
-
|
|
312997
|
-
|
|
312998
|
-
|
|
312999
|
-
|
|
313000
|
-
|
|
313001
|
-
|
|
313002
|
-
|
|
313003
|
-
|
|
313004
|
-
|
|
313005
|
-
|
|
313552
|
+
|
|
313553
|
+
setActiveId(active.id);
|
|
313554
|
+
}; // 拖拽结束
|
|
313555
|
+
|
|
313556
|
+
|
|
313557
|
+
var handleDragEnd = function handleDragEnd(event) {
|
|
313558
|
+
var active = event.active,
|
|
313559
|
+
over = event.over;
|
|
313560
|
+
setActiveId(null); // 未移入时触发
|
|
313561
|
+
|
|
313562
|
+
if (!(over === null || over === void 0 ? void 0 : over.id)) {
|
|
313563
|
+
return;
|
|
313564
|
+
} // 移入时触发更新数据
|
|
313565
|
+
|
|
313566
|
+
|
|
313567
|
+
if (active.id !== over.id) {
|
|
313568
|
+
move(active.id, over.id);
|
|
313006
313569
|
}
|
|
313007
|
-
}
|
|
313008
|
-
|
|
313570
|
+
}; // @ts-ignore
|
|
313571
|
+
return /*#__PURE__*/React__default['default'].createElement(DndContext, {
|
|
313572
|
+
sensors: sensors,
|
|
313573
|
+
onDragStart: handleDragStart,
|
|
313574
|
+
onDragCancel: function onDragCancel() {
|
|
313575
|
+
return setActiveId(null);
|
|
313576
|
+
},
|
|
313577
|
+
collisionDetection: closestCenter,
|
|
313578
|
+
onDragEnd: handleDragEnd,
|
|
313579
|
+
modifiers: [restrictToParentElement, restrictToVerticalAxis]
|
|
313580
|
+
}, children);
|
|
313581
|
+
};
|
|
313582
|
+
|
|
313583
|
+
var DndContainer$4 = /*#__PURE__*/React.memo(DndContainer$3);
|
|
313584
|
+
|
|
313585
|
+
var SortableBox$2 = function SortableBox(_ref) {
|
|
313586
|
+
var items = _ref.items,
|
|
313587
|
+
children = _ref.children;
|
|
313588
|
+
return /*#__PURE__*/React__default['default'].createElement(SortableContext$1, {
|
|
313589
|
+
items: items,
|
|
313590
|
+
strategy: verticalListSortingStrategy
|
|
313591
|
+
}, children);
|
|
313592
|
+
};
|
|
313593
|
+
|
|
313594
|
+
var _excluded$2T = ["keys", "onSortEnd", "virtual", "rowKey", "options", "tableWidth"];
|
|
313595
|
+
|
|
313596
|
+
var DraggableContainer = function DraggableContainer(_ref) {
|
|
313597
|
+
var keys = _ref.keys,
|
|
313598
|
+
onSortEnd = _ref.onSortEnd,
|
|
313599
|
+
virtual = _ref.virtual,
|
|
313600
|
+
rowKey = _ref.rowKey,
|
|
313601
|
+
options = _ref.options,
|
|
313602
|
+
tableWidth = _ref.tableWidth,
|
|
313603
|
+
props = _objectWithoutProperties$1(_ref, _excluded$2T);
|
|
313604
|
+
|
|
313605
|
+
return /*#__PURE__*/React__default['default'].createElement(DndContainer$4, {
|
|
313606
|
+
move: onSortEnd,
|
|
313607
|
+
items: keys,
|
|
313608
|
+
rowKey: rowKey,
|
|
313609
|
+
options: options,
|
|
313610
|
+
tableWidth: tableWidth
|
|
313611
|
+
}, /*#__PURE__*/React__default['default'].createElement(SortableBox$2, {
|
|
313612
|
+
items: keys
|
|
313613
|
+
}, virtual ? /*#__PURE__*/React__default['default'].createElement(VirtualWrapper$1, _objectSpread({}, props)) : /*#__PURE__*/React__default['default'].createElement("tbody", _objectSpread({}, props))));
|
|
313614
|
+
};
|
|
313615
|
+
|
|
313616
|
+
var BottomOpetateComponent = function BottomOpetateComponent(props) {
|
|
313617
|
+
var isShowAddAction = props.isShowAddAction,
|
|
313618
|
+
recordCreatorProps = props.recordCreatorProps,
|
|
313619
|
+
handleAdd = props.handleAdd,
|
|
313620
|
+
_props$disabled = props.disabled,
|
|
313621
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled;
|
|
313622
|
+
return isShowAddAction ? /*#__PURE__*/React__default['default'].createElement(LMButton, {
|
|
313623
|
+
className: "lm_editTable_add_bar",
|
|
313624
|
+
type: "dashed",
|
|
313625
|
+
disabled: disabled,
|
|
313626
|
+
onClick: (recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.customAddClick) || handleAdd,
|
|
313627
|
+
style: _objectSpread({
|
|
313628
|
+
marginTop: 8
|
|
313629
|
+
}, (recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.style) || {})
|
|
313630
|
+
}, /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
313631
|
+
type: "lmweb-plus"
|
|
313632
|
+
}), (recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.creatorButtonText) || '新增') : null;
|
|
313633
|
+
};
|
|
313634
|
+
|
|
313635
|
+
var getRenderPropValue$1 = function getRenderPropValue(propValue) {
|
|
313636
|
+
if (!propValue) {
|
|
313637
|
+
return null;
|
|
313638
|
+
}
|
|
313639
|
+
|
|
313640
|
+
var isRenderFunction = typeof propValue === 'function';
|
|
313641
|
+
|
|
313642
|
+
if (isRenderFunction) {
|
|
313643
|
+
return propValue();
|
|
313644
|
+
}
|
|
313009
313645
|
|
|
313646
|
+
return propValue;
|
|
313647
|
+
};
|
|
313648
|
+
|
|
313649
|
+
var _excluded$2U = ["prefixCls", "title", "content", "_overlay"];
|
|
313650
|
+
var Popover$1 = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
313651
|
+
var customizePrefixCls = _ref.prefixCls,
|
|
313652
|
+
title = _ref.title,
|
|
313653
|
+
content = _ref.content,
|
|
313654
|
+
_overlay = _ref._overlay,
|
|
313655
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$2U);
|
|
313656
|
+
|
|
313657
|
+
var _React$useContext = React.useContext(ConfigContext),
|
|
313658
|
+
getPrefixCls = _React$useContext.getPrefixCls;
|
|
313659
|
+
|
|
313660
|
+
var getOverlay = function getOverlay(prefixCls) {
|
|
313661
|
+
if (!title && !content) return undefined;
|
|
313662
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, title && /*#__PURE__*/React.createElement("div", {
|
|
313663
|
+
className: "".concat(prefixCls, "-title")
|
|
313664
|
+
}, getRenderPropValue$1(title)), /*#__PURE__*/React.createElement("div", {
|
|
313665
|
+
className: "".concat(prefixCls, "-inner-content")
|
|
313666
|
+
}, getRenderPropValue$1(content)));
|
|
313667
|
+
};
|
|
313668
|
+
|
|
313669
|
+
var prefixCls = getPrefixCls('popover', customizePrefixCls);
|
|
313670
|
+
var rootPrefixCls = getPrefixCls();
|
|
313671
|
+
return /*#__PURE__*/React.createElement(Tooltip$4, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
313672
|
+
prefixCls: prefixCls,
|
|
313673
|
+
ref: ref,
|
|
313674
|
+
overlay: _overlay || getOverlay(prefixCls),
|
|
313675
|
+
transitionName: getTransitionName$9(rootPrefixCls, 'zoom-big', otherProps.transitionName)
|
|
313676
|
+
}));
|
|
313677
|
+
});
|
|
313010
313678
|
|
|
313011
|
-
|
|
313012
|
-
|
|
313013
|
-
|
|
313014
|
-
|
|
313015
|
-
|
|
313016
|
-
|
|
313017
|
-
|
|
313018
|
-
|
|
313019
|
-
|
|
313679
|
+
{
|
|
313680
|
+
Popover$1.displayName = 'Popover';
|
|
313681
|
+
}
|
|
313682
|
+
|
|
313683
|
+
Popover$1.defaultProps = {
|
|
313684
|
+
placement: 'top',
|
|
313685
|
+
trigger: 'hover',
|
|
313686
|
+
mouseEnterDelay: 0.1,
|
|
313687
|
+
mouseLeaveDelay: 0.1,
|
|
313688
|
+
overlayStyle: {}
|
|
313689
|
+
};
|
|
313690
|
+
Popover$1.AntdPopover = Popover;
|
|
313691
|
+
|
|
313692
|
+
var QuickOpetate = function QuickOpetate(_ref) {
|
|
313693
|
+
var record = _ref.record,
|
|
313694
|
+
rowKey = _ref.rowKey,
|
|
313695
|
+
handleAdd = _ref.handleAdd,
|
|
313696
|
+
handleDelete = _ref.handleDelete,
|
|
313697
|
+
_ref$options = _ref.options,
|
|
313698
|
+
options = _ref$options === void 0 ? ['add', 'delete'] : _ref$options,
|
|
313699
|
+
getLength = _ref.getLength,
|
|
313700
|
+
quickOpetateClearAll = _ref.quickOpetateClearAll;
|
|
313701
|
+
var disabled = React__default['default'].useContext(DisabledContext$1) || false;
|
|
313020
313702
|
|
|
313021
313703
|
var appendChildren = function appendChildren() {
|
|
313022
313704
|
handleAdd === null || handleAdd === void 0 ? void 0 : handleAdd(record, true);
|
|
@@ -313036,7 +313718,7 @@
|
|
|
313036
313718
|
}, options.includes('delete') && /*#__PURE__*/React__default['default'].createElement(LMButton, {
|
|
313037
313719
|
type: "link",
|
|
313038
313720
|
size: "small",
|
|
313039
|
-
disabled: !quickOpetateClearAll && getLength < 2,
|
|
313721
|
+
disabled: !quickOpetateClearAll && getLength < 2 || disabled,
|
|
313040
313722
|
icon: /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
313041
313723
|
type: "lmweb-minus-circle",
|
|
313042
313724
|
style: {
|
|
@@ -313048,7 +313730,7 @@
|
|
|
313048
313730
|
}
|
|
313049
313731
|
}), (options === null || options === void 0 ? void 0 : options.includes('add')) && (options === null || options === void 0 ? void 0 : options.includes('addInChildren')) ? /*#__PURE__*/React__default['default'].createElement(Popover$1, {
|
|
313050
313732
|
placement: "bottom",
|
|
313051
|
-
overlayClassName:
|
|
313733
|
+
overlayClassName: "lm_table_append_add_popover",
|
|
313052
313734
|
open: open,
|
|
313053
313735
|
title: null,
|
|
313054
313736
|
content: /*#__PURE__*/React__default['default'].createElement("ul", null, /*#__PURE__*/React__default['default'].createElement("li", {
|
|
@@ -313069,6 +313751,7 @@
|
|
|
313069
313751
|
})) : (options === null || options === void 0 ? void 0 : options.includes('add')) || (options === null || options === void 0 ? void 0 : options.includes('addInChildren')) ? /*#__PURE__*/React__default['default'].createElement(LMButton, {
|
|
313070
313752
|
type: "link",
|
|
313071
313753
|
size: "small",
|
|
313754
|
+
disabled: disabled,
|
|
313072
313755
|
icon: /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
313073
313756
|
type: "lmweb-plus-circle-fill",
|
|
313074
313757
|
style: {
|
|
@@ -313076,17 +313759,203 @@
|
|
|
313076
313759
|
}
|
|
313077
313760
|
}),
|
|
313078
313761
|
onClick: function onClick() {
|
|
313079
|
-
return handleAdd(record, (options === null || options === void 0 ? void 0 : options.includes('addInChildren'))
|
|
313762
|
+
return handleAdd(record, !!(options === null || options === void 0 ? void 0 : options.includes('addInChildren')));
|
|
313080
313763
|
}
|
|
313081
313764
|
}) : null);
|
|
313082
|
-
};
|
|
313083
|
-
|
|
313084
|
-
|
|
313085
|
-
|
|
313086
|
-
|
|
313087
|
-
|
|
313088
|
-
|
|
313765
|
+
};
|
|
313766
|
+
|
|
313767
|
+
var ConfigContext$7 = ConfigProvider$1.ConfigContext;
|
|
313768
|
+
|
|
313769
|
+
var CustomizeRenderEmpty$1 = function CustomizeRenderEmpty() {
|
|
313770
|
+
var _React$useContext = React__default['default'].useContext(ConfigContext$7),
|
|
313771
|
+
locale = _React$useContext.locale;
|
|
313772
|
+
|
|
313773
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
313774
|
+
className: "lm_table_empty"
|
|
313775
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
313776
|
+
className: "empty_img",
|
|
313777
|
+
style: {
|
|
313778
|
+
width: '130px',
|
|
313779
|
+
height: '80px'
|
|
313780
|
+
}
|
|
313781
|
+
}), /*#__PURE__*/React__default['default'].createElement("span", null, (locale === null || locale === void 0 ? void 0 : locale.locale) === 'en' ? 'no Data' : '暂无数据'));
|
|
313782
|
+
};
|
|
313783
|
+
|
|
313784
|
+
var _excluded$2V = ["index", "virtual"],
|
|
313785
|
+
_excluded2$I = ["index"],
|
|
313786
|
+
_excluded3$b = ["value", "onChange", "record", "rowIndex", "colIndex", "validator"],
|
|
313787
|
+
_excluded4$2 = ["record", "rowKey", "isEdit", "col", "rowIndex", "colIndex", "handleTableRowDelete", "handleTableRowAdd", "quickOpetateClearAll", "getLength", "isHoverEdit", "editEnum", "valueType", "children", "handleSave", "handleAdd", "handleDelete", "handleCopy", "itemProps"],
|
|
313788
|
+
_excluded5 = ["onMouseEnter", "onMouseLeave"],
|
|
313789
|
+
_excluded6 = ["value", "columns", "isEdit", "isAdd", "onChange", "rowKey", "rowHoverEdit", "isUseForm", "isHoverEdit", "useQuickOpetate", "quickOpetateClearAll", "rowSelection", "rowDisabled", "virtual", "sortOpen", "disabled", "colSortOpen", "indexCol", "filterChange", "size", "recordCreatorProps", "shouldUpdate", "loading", "autoSizer"];
|
|
313790
|
+
var UploadBtn$1 = UploadOss.UploadBtn;
|
|
313791
|
+
var EditableContext$1 = /*#__PURE__*/React__default['default'].createContext(null); // 表格行
|
|
313792
|
+
|
|
313793
|
+
var EditableRow$1 = function EditableRow(_ref) {
|
|
313794
|
+
var index = _ref.index,
|
|
313795
|
+
virtual = _ref.virtual,
|
|
313796
|
+
props = _objectWithoutProperties$1(_ref, _excluded$2V);
|
|
313797
|
+
|
|
313798
|
+
var _Form$useForm = Form$4.useForm(),
|
|
313799
|
+
_Form$useForm2 = _slicedToArray$1(_Form$useForm, 1),
|
|
313800
|
+
form = _Form$useForm2[0];
|
|
313801
|
+
|
|
313802
|
+
var dataKey = props.dataKey,
|
|
313803
|
+
pushAllForm = props.pushAllForm;
|
|
313804
|
+
pushAllForm === null || pushAllForm === void 0 ? void 0 : pushAllForm(form, dataKey, index);
|
|
313805
|
+
return /*#__PURE__*/React__default['default'].createElement(Form$4, {
|
|
313806
|
+
form: form,
|
|
313807
|
+
disabled: props.disabled || false,
|
|
313808
|
+
component: false
|
|
313809
|
+
}, /*#__PURE__*/React__default['default'].createElement(EditableContext$1.Provider, {
|
|
313810
|
+
value: form
|
|
313811
|
+
}, virtual ? /*#__PURE__*/React__default['default'].createElement(VirtualRow$1, _objectSpread({}, props)) : /*#__PURE__*/React__default['default'].createElement("tr", _objectSpread({}, props))));
|
|
313812
|
+
};
|
|
313813
|
+
|
|
313814
|
+
var EditableSortRow = function EditableSortRow(_ref2) {
|
|
313815
|
+
var index = _ref2.index,
|
|
313816
|
+
props = _objectWithoutProperties$1(_ref2, _excluded2$I);
|
|
313817
|
+
|
|
313818
|
+
var _Form$useForm3 = Form$4.useForm(),
|
|
313819
|
+
_Form$useForm4 = _slicedToArray$1(_Form$useForm3, 1),
|
|
313820
|
+
form = _Form$useForm4[0];
|
|
313821
|
+
|
|
313822
|
+
var dataKey = props.dataKey,
|
|
313823
|
+
pushAllForm = props.pushAllForm;
|
|
313824
|
+
pushAllForm === null || pushAllForm === void 0 ? void 0 : pushAllForm(form, dataKey, index);
|
|
313825
|
+
return /*#__PURE__*/React__default['default'].createElement(Form$4, {
|
|
313826
|
+
form: form,
|
|
313827
|
+
disabled: props.disabled || false,
|
|
313828
|
+
component: false
|
|
313829
|
+
}, /*#__PURE__*/React__default['default'].createElement(EditableContext$1.Provider, {
|
|
313830
|
+
value: form
|
|
313831
|
+
}, /*#__PURE__*/React__default['default'].createElement(SortableItem$2, _objectSpread({}, props))));
|
|
313832
|
+
};
|
|
313833
|
+
|
|
313834
|
+
var UploadSingle$1 = function UploadSingle(props) {
|
|
313835
|
+
var value = props.value,
|
|
313836
|
+
onChange = props.onChange,
|
|
313837
|
+
editEnum = props.editEnum;
|
|
313838
|
+
|
|
313839
|
+
var handleDelete = function handleDelete() {
|
|
313840
|
+
onChange === null || onChange === void 0 ? void 0 : onChange();
|
|
313841
|
+
};
|
|
313842
|
+
|
|
313843
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
313844
|
+
className: "upload_single"
|
|
313845
|
+
}, value ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
313846
|
+
type: "lmweb-link",
|
|
313847
|
+
style: {
|
|
313848
|
+
fontSize: 14,
|
|
313849
|
+
color: '#1890ff'
|
|
313850
|
+
}
|
|
313851
|
+
}), /*#__PURE__*/React__default['default'].createElement("a", {
|
|
313852
|
+
href: "".concat(value === null || value === void 0 ? void 0 : value.externalUrl, "/").concat(value === null || value === void 0 ? void 0 : value.filePath).concat(value === null || value === void 0 ? void 0 : value.realFileName),
|
|
313853
|
+
target: "_blank",
|
|
313854
|
+
rel: "noreferrer"
|
|
313855
|
+
}, value === null || value === void 0 ? void 0 : value.fileName), /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
313856
|
+
type: "lmweb-delete",
|
|
313857
|
+
style: {
|
|
313858
|
+
fontSize: 14,
|
|
313859
|
+
color: '#1890ff'
|
|
313860
|
+
},
|
|
313861
|
+
onClick: handleDelete
|
|
313862
|
+
})) : /*#__PURE__*/React__default['default'].createElement(UploadBtn$1, _objectSpread(_objectSpread({}, editEnum), {}, {
|
|
313863
|
+
value: value,
|
|
313864
|
+
onChange: onChange
|
|
313865
|
+
})));
|
|
313866
|
+
};
|
|
313089
313867
|
|
|
313868
|
+
var InputRange$1 = function InputRange(_ref3) {
|
|
313869
|
+
var _ref3$value = _ref3.value,
|
|
313870
|
+
value = _ref3$value === void 0 ? ['', ''] : _ref3$value,
|
|
313871
|
+
onChange = _ref3.onChange,
|
|
313872
|
+
record = _ref3.record,
|
|
313873
|
+
rowIndex = _ref3.rowIndex,
|
|
313874
|
+
colIndex = _ref3.colIndex,
|
|
313875
|
+
validator = _ref3.validator,
|
|
313876
|
+
editEnum = _objectWithoutProperties$1(_ref3, _excluded3$b);
|
|
313877
|
+
|
|
313878
|
+
// 输入值改变
|
|
313879
|
+
var history = React.useRef([]);
|
|
313880
|
+
|
|
313881
|
+
var _useState = React.useState([]),
|
|
313882
|
+
_useState2 = _slicedToArray$1(_useState, 2),
|
|
313883
|
+
nValue = _useState2[0],
|
|
313884
|
+
setValue = _useState2[1];
|
|
313885
|
+
|
|
313886
|
+
React.useEffect(function () {
|
|
313887
|
+
setValue(value);
|
|
313888
|
+
}, value);
|
|
313889
|
+
|
|
313890
|
+
var handleFocus = function handleFocus() {
|
|
313891
|
+
history.current.push(nValue);
|
|
313892
|
+
};
|
|
313893
|
+
|
|
313894
|
+
var handleInput = function handleInput(e, type) {
|
|
313895
|
+
var v = type === 'prev' ? [e.target.value, nValue[1]] : [nValue[0], e.target.value];
|
|
313896
|
+
setValue(v);
|
|
313897
|
+
onChange(v);
|
|
313898
|
+
history.current.push(v);
|
|
313899
|
+
};
|
|
313900
|
+
|
|
313901
|
+
var handleBlur = function handleBlur(e, type) {
|
|
313902
|
+
var isFun = lodash.isFunction(validator); // 验证历史记录
|
|
313903
|
+
|
|
313904
|
+
var traverse = function traverse(arr) {
|
|
313905
|
+
if (!arr || !arr.length) {
|
|
313906
|
+
if (type === 'prev') {
|
|
313907
|
+
setValue(['', nValue[1]]);
|
|
313908
|
+
} else if (type === 'next') {
|
|
313909
|
+
setValue([nValue[0], '']);
|
|
313910
|
+
}
|
|
313911
|
+
|
|
313912
|
+
history.current = [];
|
|
313913
|
+
return;
|
|
313914
|
+
}
|
|
313915
|
+
|
|
313916
|
+
var value = arr.pop();
|
|
313917
|
+
|
|
313918
|
+
if (isFun && validator(record, value, rowIndex, colIndex)) {
|
|
313919
|
+
setValue(value);
|
|
313920
|
+
history.current = [];
|
|
313921
|
+
} else {
|
|
313922
|
+
traverse(arr);
|
|
313923
|
+
}
|
|
313924
|
+
};
|
|
313925
|
+
|
|
313926
|
+
traverse(history.current);
|
|
313927
|
+
};
|
|
313928
|
+
|
|
313929
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
313930
|
+
className: "lm_editTable_wrapperRange"
|
|
313931
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
313932
|
+
className: "inputRange"
|
|
313933
|
+
}, /*#__PURE__*/React__default['default'].createElement(LmInput, _objectSpread({
|
|
313934
|
+
value: nValue === null || nValue === void 0 ? void 0 : nValue[0],
|
|
313935
|
+
placeholder: "\u8BF7\u8F93\u5165",
|
|
313936
|
+
onFocus: function onFocus(e) {
|
|
313937
|
+
return handleFocus();
|
|
313938
|
+
},
|
|
313939
|
+
onBlur: function onBlur(e) {
|
|
313940
|
+
return handleBlur(e, 'prev');
|
|
313941
|
+
},
|
|
313942
|
+
onChange: function onChange(e) {
|
|
313943
|
+
return handleInput(e, 'prev');
|
|
313944
|
+
}
|
|
313945
|
+
}, editEnum)), "~", /*#__PURE__*/React__default['default'].createElement(LmInput, _objectSpread({
|
|
313946
|
+
value: nValue === null || nValue === void 0 ? void 0 : nValue[1],
|
|
313947
|
+
placeholder: "\u8BF7\u8F93\u5165",
|
|
313948
|
+
onFocus: function onFocus(e) {
|
|
313949
|
+
return handleFocus();
|
|
313950
|
+
},
|
|
313951
|
+
onBlur: function onBlur(e) {
|
|
313952
|
+
return handleBlur(e, 'next');
|
|
313953
|
+
},
|
|
313954
|
+
onChange: function onChange(e) {
|
|
313955
|
+
return handleInput(e, 'next');
|
|
313956
|
+
}
|
|
313957
|
+
}, editEnum))));
|
|
313958
|
+
};
|
|
313090
313959
|
/*
|
|
313091
313960
|
表格单元格
|
|
313092
313961
|
editEnum: 下拉框时的数据数组(非数组时是配置设置)
|
|
@@ -313116,8 +313985,6 @@
|
|
|
313116
313985
|
handleDelete = props.handleDelete,
|
|
313117
313986
|
handleCopy = props.handleCopy,
|
|
313118
313987
|
itemProps = props.itemProps,
|
|
313119
|
-
setValid = props.setValid,
|
|
313120
|
-
reWriteOriginSource = props.reWriteOriginSource,
|
|
313121
313988
|
restProps = _objectWithoutProperties$1(props, _excluded4$2);
|
|
313122
313989
|
/** 去除移入移出功能,保留最纯粹的功能,优化性能 */
|
|
313123
313990
|
|
|
@@ -313138,6 +314005,12 @@
|
|
|
313138
314005
|
|
|
313139
314006
|
var inputRef = React.useRef(null);
|
|
313140
314007
|
var form = React.useContext(EditableContext$1);
|
|
314008
|
+
|
|
314009
|
+
var _useState5 = React.useState(false),
|
|
314010
|
+
_useState6 = _slicedToArray$1(_useState5, 2),
|
|
314011
|
+
hoverStatus = _useState6[0],
|
|
314012
|
+
setHoverStatus = _useState6[1];
|
|
314013
|
+
|
|
313141
314014
|
React.useEffect(function () {
|
|
313142
314015
|
if (editing) {
|
|
313143
314016
|
var _inputRef$current;
|
|
@@ -313148,17 +314021,11 @@
|
|
|
313148
314021
|
|
|
313149
314022
|
var toggleEdit = function toggleEdit() {
|
|
313150
314023
|
setEditing(!editing); // form.setFieldsValue({ [dataIndex]: record[dataIndex] });
|
|
313151
|
-
}; //
|
|
313152
|
-
// const focusCapturedRef = useRef(false);
|
|
313153
|
-
// const curValue = useMemo(() => {
|
|
313154
|
-
// return record?.dataIndex
|
|
313155
|
-
// }, [record])
|
|
313156
|
-
// const curValueIsValid = isValidValue(curValue);
|
|
313157
|
-
// 校验保存
|
|
314024
|
+
}; // 校验保存
|
|
313158
314025
|
|
|
313159
314026
|
|
|
313160
314027
|
var save = /*#__PURE__*/function () {
|
|
313161
|
-
var
|
|
314028
|
+
var _ref4 = _asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime$1().mark(function _callee(row) {
|
|
313162
314029
|
var values, resultComponentProps;
|
|
313163
314030
|
return _regeneratorRuntime$1().wrap(function _callee$(_context) {
|
|
313164
314031
|
while (1) {
|
|
@@ -313206,13 +314073,7 @@
|
|
|
313206
314073
|
case 13:
|
|
313207
314074
|
if (col === null || col === void 0 ? void 0 : col.hoverEdit) {
|
|
313208
314075
|
toggleEdit();
|
|
313209
|
-
}
|
|
313210
|
-
// setValid((old) => {
|
|
313211
|
-
// const obj = { ...old }
|
|
313212
|
-
// delete obj[record[rowKey]]
|
|
313213
|
-
// return obj
|
|
313214
|
-
// })
|
|
313215
|
-
|
|
314076
|
+
}
|
|
313216
314077
|
|
|
313217
314078
|
_context.next = 18;
|
|
313218
314079
|
break;
|
|
@@ -313230,7 +314091,7 @@
|
|
|
313230
314091
|
}));
|
|
313231
314092
|
|
|
313232
314093
|
return function save(_x) {
|
|
313233
|
-
return
|
|
314094
|
+
return _ref4.apply(this, arguments);
|
|
313234
314095
|
};
|
|
313235
314096
|
}(); // 触发保存
|
|
313236
314097
|
|
|
@@ -313241,16 +314102,15 @@
|
|
|
313241
314102
|
/** 快捷刷子,把当前的所有列的值,刷成当前的选中的列 */
|
|
313242
314103
|
|
|
313243
314104
|
|
|
313244
|
-
var copyKey = function copyKey(e) {
|
|
314105
|
+
var copyKey = function copyKey(e, type) {
|
|
313245
314106
|
e === null || e === void 0 ? void 0 : e.stopPropagation();
|
|
313246
314107
|
var dataIndex = col.dataIndex;
|
|
313247
|
-
handleCopy === null || handleCopy === void 0 ? void 0 : handleCopy(dataIndex, record[dataIndex]);
|
|
314108
|
+
handleCopy === null || handleCopy === void 0 ? void 0 : handleCopy(dataIndex, record[dataIndex], type, props.rowIndex);
|
|
313248
314109
|
};
|
|
313249
314110
|
|
|
313250
314111
|
var Control = function Control(con) {
|
|
313251
314112
|
var _col$newOptions;
|
|
313252
314113
|
|
|
313253
|
-
// const resultComponentProps = isFunction(componentProps) ? componentProps?.(record, col) : componentProps
|
|
313254
314114
|
var resultComponentProps = lodash.isFunction(componentProps) ? componentProps === null || componentProps === void 0 ? void 0 : componentProps(record, col) : componentProps;
|
|
313255
314115
|
|
|
313256
314116
|
if (lodash.isFunction(componentProps) && (col === null || col === void 0 ? void 0 : (_col$newOptions = col.newOptions) === null || _col$newOptions === void 0 ? void 0 : _col$newOptions.length)) {
|
|
@@ -313259,7 +314119,7 @@
|
|
|
313259
314119
|
});
|
|
313260
314120
|
}
|
|
313261
314121
|
|
|
313262
|
-
var clearAttrComponentProps = lodash.omit(resultComponentProps, ['optionOnly', 'isOnlyValue']);
|
|
314122
|
+
var clearAttrComponentProps = lodash.omit(resultComponentProps, ['optionOnly', 'isOnlyValue', 'quickcopy']);
|
|
313263
314123
|
|
|
313264
314124
|
switch (con) {
|
|
313265
314125
|
case 'input':
|
|
@@ -313280,19 +314140,12 @@
|
|
|
313280
314140
|
noStyle: true
|
|
313281
314141
|
}, /*#__PURE__*/React__default['default'].cloneElement(resultComponentProps.addonAfter, {
|
|
313282
314142
|
onChange: handleFormItemChange
|
|
313283
|
-
})) : null,
|
|
313284
|
-
suffix: resultComponentProps.quickcopy ? /*#__PURE__*/React__default['default'].createElement("span", {
|
|
313285
|
-
className: 'lm_table_quickcopy'
|
|
313286
|
-
}, /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
313287
|
-
onClick: copyKey,
|
|
313288
|
-
type: 'lmweb-icon_m_brush'
|
|
313289
314143
|
})) : null
|
|
313290
314144
|
}));
|
|
313291
314145
|
|
|
313292
314146
|
case 'inputRange':
|
|
313293
314147
|
return /*#__PURE__*/React__default['default'].createElement(InputRange$1, _objectSpread(_objectSpread({
|
|
313294
|
-
onChange: handleFormItemChange
|
|
313295
|
-
ref: inputRef
|
|
314148
|
+
onChange: handleFormItemChange
|
|
313296
314149
|
}, resultComponentProps), {}, {
|
|
313297
314150
|
record: record,
|
|
313298
314151
|
rowIndex: rowIndex,
|
|
@@ -313356,8 +314209,7 @@
|
|
|
313356
314209
|
|
|
313357
314210
|
case 'radio':
|
|
313358
314211
|
return /*#__PURE__*/React__default['default'].createElement(LMRadio, _objectSpread({
|
|
313359
|
-
onChange: handleFormItemChange
|
|
313360
|
-
ref: inputRef
|
|
314212
|
+
onChange: handleFormItemChange
|
|
313361
314213
|
}, clearAttrComponentProps));
|
|
313362
314214
|
|
|
313363
314215
|
case 'radioGroup':
|
|
@@ -313368,7 +314220,7 @@
|
|
|
313368
314220
|
|
|
313369
314221
|
case 'switch':
|
|
313370
314222
|
return /*#__PURE__*/React__default['default'].createElement(Switch$2, _objectSpread(_objectSpread({
|
|
313371
|
-
size:
|
|
314223
|
+
size: "small"
|
|
313372
314224
|
}, clearAttrComponentProps), {}, {
|
|
313373
314225
|
onChange: handleFormItemChange
|
|
313374
314226
|
}));
|
|
@@ -313382,10 +314234,9 @@
|
|
|
313382
314234
|
|
|
313383
314235
|
case 'operate':
|
|
313384
314236
|
case 'lm_edit_opetate':
|
|
313385
|
-
return /*#__PURE__*/React__default['default'].createElement(
|
|
314237
|
+
return /*#__PURE__*/React__default['default'].createElement(QuickOpetate, _objectSpread({
|
|
313386
314238
|
record: record,
|
|
313387
314239
|
rowKey: rowKey,
|
|
313388
|
-
ref: inputRef,
|
|
313389
314240
|
handleAdd: handleTableRowAdd,
|
|
313390
314241
|
handleDelete: handleTableRowDelete,
|
|
313391
314242
|
getLength: getLength,
|
|
@@ -313399,7 +314250,7 @@
|
|
|
313399
314250
|
var fromData = form.getFieldsValue();
|
|
313400
314251
|
return render === null || render === void 0 ? void 0 : render(_objectSpread(_objectSpread({}, !isObjEmpty(fromData) ? _objectSpread(_objectSpread({}, record), {}, _defineProperty$1({}, dataIndex, fromData[dataIndex])) : record), {}, {
|
|
313401
314252
|
onChange: save
|
|
313402
|
-
}));
|
|
314253
|
+
}), rowIndex);
|
|
313403
314254
|
}
|
|
313404
314255
|
|
|
313405
314256
|
default:
|
|
@@ -313434,7 +314285,8 @@
|
|
|
313434
314285
|
valuePropName: editable === 'switch' ? 'checked' : 'value',
|
|
313435
314286
|
style: {
|
|
313436
314287
|
margin: 0
|
|
313437
|
-
}
|
|
314288
|
+
},
|
|
314289
|
+
noStyle: formProps ? false : true
|
|
313438
314290
|
}, formProps), {}, {
|
|
313439
314291
|
name: dataIndex
|
|
313440
314292
|
}), Control(editable)));
|
|
@@ -313446,6 +314298,7 @@
|
|
|
313446
314298
|
margin: 0
|
|
313447
314299
|
}
|
|
313448
314300
|
}, formProps), {}, {
|
|
314301
|
+
noStyle: formProps ? false : true,
|
|
313449
314302
|
name: [dataIndex, 'value']
|
|
313450
314303
|
}), Control(editable)));
|
|
313451
314304
|
}
|
|
@@ -313458,31 +314311,68 @@
|
|
|
313458
314311
|
}
|
|
313459
314312
|
|
|
313460
314313
|
return childNode;
|
|
313461
|
-
}, [col, isEdit, editing, getLength]); //
|
|
313462
|
-
// 出现死循环找我
|
|
314314
|
+
}, [col, isEdit, editing, getLength, record]); // 出现死循环找我
|
|
313463
314315
|
|
|
313464
314316
|
React.useEffect(function () {
|
|
313465
314317
|
var editable = col.editable,
|
|
313466
314318
|
dataIndex = col.dataIndex;
|
|
313467
314319
|
|
|
313468
314320
|
if (isEdit && editable) {
|
|
313469
|
-
form.setFieldsValue(_defineProperty$1({}, dataIndex, editable === 'date' ? hooks(record[dataIndex]) : record[dataIndex]));
|
|
313470
|
-
}
|
|
313471
|
-
// (isEdit && editable && record[dataIndex]) ||
|
|
313472
|
-
// (isHoverEdit && editable && record[dataIndex])
|
|
313473
|
-
// ) {
|
|
313474
|
-
// form.setFieldsValue({
|
|
313475
|
-
// [dataIndex]: editable === 'date' ? moment(record[dataIndex]) : record[dataIndex],
|
|
313476
|
-
// })
|
|
313477
|
-
// }
|
|
313478
|
-
|
|
314321
|
+
form.setFieldsValue(_defineProperty$1({}, dataIndex, editable === 'date' && record[dataIndex] ? hooks(record[dataIndex]) : record[dataIndex]));
|
|
314322
|
+
}
|
|
313479
314323
|
}, [record]);
|
|
314324
|
+
|
|
314325
|
+
var handleTdHover = function handleTdHover() {
|
|
314326
|
+
setHoverStatus(true);
|
|
314327
|
+
};
|
|
314328
|
+
|
|
314329
|
+
var handleTdMouseOut = function handleTdMouseOut() {
|
|
314330
|
+
setHoverStatus(false);
|
|
314331
|
+
};
|
|
314332
|
+
|
|
313480
314333
|
return /*#__PURE__*/React__default['default'].createElement("td", _objectSpread(_objectSpread({}, lodash.omit(clearProps, ['dataIndex'])), {}, {
|
|
313481
314334
|
className: classnames(clearProps === null || clearProps === void 0 ? void 0 : clearProps.className, 'lm_custom_cell_td'),
|
|
314335
|
+
onMouseEnter: componentProps.quickcopy ? handleTdHover : undefined,
|
|
314336
|
+
onMouseLeave: componentProps.quickcopy ? handleTdMouseOut : undefined,
|
|
313482
314337
|
key: "r".concat(rowIndex, "_c").concat(colIndex)
|
|
313483
|
-
}),
|
|
314338
|
+
}), hoverStatus && props.rowIndex > 0 && /*#__PURE__*/React__default['default'].createElement("span", {
|
|
314339
|
+
className: 'quick_copy_warp quick_copy_up',
|
|
314340
|
+
onClick: function onClick(e) {
|
|
314341
|
+
return copyKey(e, 'up');
|
|
314342
|
+
}
|
|
314343
|
+
}, /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
314344
|
+
type: 'lmweb-icon_up'
|
|
314345
|
+
})), getMemoChildNode, hoverStatus && props.rowIndex < props.getLength - 1 && /*#__PURE__*/React__default['default'].createElement("span", {
|
|
314346
|
+
className: 'quick_copy_warp quick_copy_down',
|
|
314347
|
+
onClick: function onClick(e) {
|
|
314348
|
+
return copyKey(e, 'down');
|
|
314349
|
+
}
|
|
314350
|
+
}, /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
314351
|
+
type: 'lmweb-icon_down'
|
|
314352
|
+
})));
|
|
313484
314353
|
};
|
|
314354
|
+
/** true 不刷新, false 刷新 */
|
|
314355
|
+
|
|
314356
|
+
|
|
314357
|
+
var MemoEditableCell = /*#__PURE__*/React.memo(EditableCell$1, function (prev, next) {
|
|
314358
|
+
var pickProps = ['record', 'colIndex'];
|
|
314359
|
+
var p = lodash.pick(prev, pickProps);
|
|
314360
|
+
var n = lodash.pick(next, pickProps);
|
|
314361
|
+
|
|
314362
|
+
if (next === null || next === void 0 ? void 0 : next.shouldUpdate) {
|
|
314363
|
+
return false;
|
|
314364
|
+
} // console.log(!checkMemoShouldUploadSpecialFun(prev, next), isEqual(p, n), '22', prev.record, next.record)
|
|
314365
|
+
// console.log('333', checkMemoShouldUploadSpecialFun(prev, next), isEqual(p, n))
|
|
314366
|
+
|
|
314367
|
+
/** TODO: 在record中带有children,子列表数据修改之后,会导致父级的record对比不一样 */
|
|
314368
|
+
|
|
314369
|
+
|
|
314370
|
+
if (!checkMemoShouldUploadSpecialFun(prev, next)) {
|
|
314371
|
+
return false;
|
|
314372
|
+
}
|
|
313485
314373
|
|
|
314374
|
+
return lodash.isEqual(p, n);
|
|
314375
|
+
});
|
|
313486
314376
|
var EditTable$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
313487
314377
|
var _localRowSelectList$s2;
|
|
313488
314378
|
|
|
@@ -313501,16 +314391,24 @@
|
|
|
313501
314391
|
_props$quickOpetateCl = props.quickOpetateClearAll,
|
|
313502
314392
|
quickOpetateClearAll = _props$quickOpetateCl === void 0 ? true : _props$quickOpetateCl,
|
|
313503
314393
|
rowSelection = props.rowSelection,
|
|
314394
|
+
rowDisabled = props.rowDisabled,
|
|
314395
|
+
virtual = props.virtual,
|
|
313504
314396
|
sortOpen = props.sortOpen,
|
|
314397
|
+
disabled = props.disabled,
|
|
313505
314398
|
colSortOpen = props.colSortOpen,
|
|
314399
|
+
_props$indexCol = props.indexCol,
|
|
314400
|
+
indexCol = _props$indexCol === void 0 ? false : _props$indexCol,
|
|
313506
314401
|
filterChange = props.filterChange,
|
|
313507
314402
|
_props$size = props.size,
|
|
313508
314403
|
size = _props$size === void 0 ? 'small' : _props$size,
|
|
313509
314404
|
recordCreatorProps = props.recordCreatorProps,
|
|
313510
314405
|
_props$shouldUpdate = props.shouldUpdate,
|
|
313511
314406
|
shouldUpdate = _props$shouldUpdate === void 0 ? false : _props$shouldUpdate,
|
|
313512
|
-
|
|
313513
|
-
|
|
314407
|
+
_props$loading = props.loading,
|
|
314408
|
+
loading = _props$loading === void 0 ? false : _props$loading,
|
|
314409
|
+
_props$autoSizer = props.autoSizer,
|
|
314410
|
+
autoSizer = _props$autoSizer === void 0 ? false : _props$autoSizer,
|
|
314411
|
+
resetProps = _objectWithoutProperties$1(props, _excluded6);
|
|
313514
314412
|
|
|
313515
314413
|
var _useControllableValue = useControllableValue({
|
|
313516
314414
|
value: checkRowKeyByDataSource(props.value, _rowKey),
|
|
@@ -313518,14 +314416,7 @@
|
|
|
313518
314416
|
}),
|
|
313519
314417
|
_useControllableValue2 = _slicedToArray$1(_useControllableValue, 2),
|
|
313520
314418
|
dataSource = _useControllableValue2[0],
|
|
313521
|
-
setDataSource = _useControllableValue2[1];
|
|
313522
|
-
|
|
313523
|
-
|
|
313524
|
-
var _useState5 = React.useState({}),
|
|
313525
|
-
_useState6 = _slicedToArray$1(_useState5, 2),
|
|
313526
|
-
_valid = _useState6[0],
|
|
313527
|
-
setValid = _useState6[1]; // const [localRowSelectList, setLocalRowSelectList] = useState([])
|
|
313528
|
-
|
|
314419
|
+
setDataSource = _useControllableValue2[1];
|
|
313529
314420
|
|
|
313530
314421
|
var transformRowSelect = function transformRowSelect(selectedRowKeys, selectedRows, info) {
|
|
313531
314422
|
var _rowSelection$onChang;
|
|
@@ -313543,42 +314434,44 @@
|
|
|
313543
314434
|
localRowSelectList = _useControllableValue4[0],
|
|
313544
314435
|
setLocalRowSelectList = _useControllableValue4[1];
|
|
313545
314436
|
|
|
313546
|
-
var
|
|
313547
|
-
|
|
313548
|
-
|
|
313549
|
-
|
|
313550
|
-
|
|
313551
|
-
|
|
314437
|
+
var _useControllableValue5 = useControllableValue({
|
|
314438
|
+
value: {
|
|
314439
|
+
disabledRows: (rowDisabled === null || rowDisabled === void 0 ? void 0 : rowDisabled.disabledRows) || []
|
|
314440
|
+
}
|
|
314441
|
+
}),
|
|
314442
|
+
_useControllableValue6 = _slicedToArray$1(_useControllableValue5, 1),
|
|
314443
|
+
localDisabledRows = _useControllableValue6[0];
|
|
314444
|
+
/** TODO: 当前展开的列 */
|
|
313552
314445
|
|
|
313553
|
-
var _useState9 = React.useState([]),
|
|
313554
|
-
_useState10 = _slicedToArray$1(_useState9, 2),
|
|
313555
|
-
expandedRowKeys = _useState10[0],
|
|
313556
|
-
setExpandedRowKeys = _useState10[1];
|
|
313557
314446
|
|
|
313558
|
-
var
|
|
313559
|
-
|
|
313560
|
-
|
|
313561
|
-
|
|
313562
|
-
|
|
313563
|
-
|
|
314447
|
+
var _useState7 = React.useState([]),
|
|
314448
|
+
_useState8 = _slicedToArray$1(_useState7, 2),
|
|
314449
|
+
expandedRowKeys = _useState8[0],
|
|
314450
|
+
setExpandedRowKeys = _useState8[1];
|
|
314451
|
+
|
|
314452
|
+
var dataSourceRef = React.useRef(dataSource);
|
|
314453
|
+
var deepDataSourceRef = React.useRef(deepDataSourcePreKeys(dataSource, _rowKey));
|
|
314454
|
+
dataSourceRef.current = dataSource;
|
|
314455
|
+
deepDataSourceRef.current = deepDataSourcePreKeys(dataSource, _rowKey);
|
|
314456
|
+
var disabledDataSourceRowKeys = React.useRef(checkTableRowIsDisable(deepDataSourceRef.current, localDisabledRows.disabledRows, _rowKey));
|
|
314457
|
+
disabledDataSourceRowKeys.current = checkTableRowIsDisable(deepDataSourceRef.current, localDisabledRows.disabledRows, _rowKey);
|
|
314458
|
+
var tableWarpRef = React.useRef(null);
|
|
314459
|
+
var autoSizerRef = React.useRef(null);
|
|
314460
|
+
var allFormListRef = React.useRef({});
|
|
314461
|
+
var scrollToIndexRef = React.useRef(null);
|
|
313564
314462
|
|
|
313565
|
-
|
|
313566
|
-
|
|
313567
|
-
|
|
313568
|
-
var newIndex = cloneArr.findIndex(function (v) {
|
|
313569
|
-
return v[_rowKey] === over;
|
|
313570
|
-
});
|
|
313571
|
-
setDataSource(arrayMove(cloneArr, oldIndex, newIndex));
|
|
313572
|
-
};
|
|
314463
|
+
var _Form$useForm5 = Form$4.useForm(),
|
|
314464
|
+
_Form$useForm6 = _slicedToArray$1(_Form$useForm5, 1),
|
|
314465
|
+
checkForm = _Form$useForm6[0];
|
|
313573
314466
|
|
|
313574
314467
|
var onColSortEnd = function onColSortEnd(active, over) {
|
|
313575
314468
|
var _arrayMove;
|
|
313576
314469
|
|
|
313577
314470
|
var oldIndex = columns.findIndex(function (item) {
|
|
313578
|
-
return item
|
|
314471
|
+
return item.dataIndex === active;
|
|
313579
314472
|
});
|
|
313580
314473
|
var newIndex = columns.findIndex(function (item) {
|
|
313581
|
-
return item
|
|
314474
|
+
return item.dataIndex === over;
|
|
313582
314475
|
});
|
|
313583
314476
|
filterChange === null || filterChange === void 0 ? void 0 : filterChange((_arrayMove = arrayMove(columns, oldIndex, newIndex)) === null || _arrayMove === void 0 ? void 0 : _arrayMove.map(function (item, index) {
|
|
313584
314477
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
@@ -313591,55 +314484,21 @@
|
|
|
313591
314484
|
var handleDelete = function handleDelete(key) {
|
|
313592
314485
|
var nValue = dataSource.filter(function (item) {
|
|
313593
314486
|
return item[_rowKey] !== key;
|
|
313594
|
-
});
|
|
313595
|
-
|
|
314487
|
+
});
|
|
313596
314488
|
setDataSource(nValue);
|
|
313597
314489
|
};
|
|
313598
|
-
/**
|
|
314490
|
+
/** 点击底部添加按钮添加 */
|
|
313599
314491
|
|
|
313600
314492
|
|
|
313601
|
-
var handleAdd = function
|
|
314493
|
+
var handleAdd = lodash.debounce(function (row) {
|
|
313602
314494
|
var _recordCreatorProps$i;
|
|
313603
314495
|
|
|
313604
314496
|
var addDataInfo = lodash.isFunction(recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.initData) ? recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : (_recordCreatorProps$i = recordCreatorProps.initData) === null || _recordCreatorProps$i === void 0 ? void 0 : _recordCreatorProps$i.call(recordCreatorProps) : recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.initData;
|
|
313605
314497
|
var res = fn(dataSourceRef.current, function (draft) {
|
|
313606
314498
|
draft.push(_objectSpread(_defineProperty$1({}, _rowKey, "".concat(Date.now())), addDataInfo || {}));
|
|
313607
314499
|
});
|
|
313608
|
-
setDataSource(res);
|
|
313609
|
-
};
|
|
313610
|
-
|
|
313611
|
-
React.useEffect(function () {
|
|
313612
|
-
dataSourceRef.current = dataSource;
|
|
313613
|
-
deepDataSourceRef.current = deepDataSourcePreKeys(dataSource, _rowKey);
|
|
313614
|
-
|
|
313615
|
-
if (sortOpen) {
|
|
313616
|
-
var _sortDataSorceRef$cur;
|
|
313617
|
-
|
|
313618
|
-
var dataSourceKeys = dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
|
|
313619
|
-
return item[_rowKey];
|
|
313620
|
-
}).join(',');
|
|
313621
|
-
var setCallBackFalgKeys = ((_sortDataSorceRef$cur = sortDataSorceRef.current) === null || _sortDataSorceRef$cur === void 0 ? void 0 : _sortDataSorceRef$cur.map(function (item) {
|
|
313622
|
-
return item[_rowKey];
|
|
313623
|
-
}).join(',')) || '';
|
|
313624
|
-
|
|
313625
|
-
if (dataSourceKeys !== setCallBackFalgKeys) {
|
|
313626
|
-
setCallBackFalg(dataSource);
|
|
313627
|
-
sortDataSorceRef.current = dataSource;
|
|
313628
|
-
}
|
|
313629
|
-
}
|
|
313630
|
-
}, [dataSource]); // /** 本地缓存一个选择数据 */
|
|
313631
|
-
// useEffect(() => {
|
|
313632
|
-
// if (rowSelection) {
|
|
313633
|
-
// const { selectedRowKeys } = rowSelection
|
|
313634
|
-
// if (selectedRowKeys) {
|
|
313635
|
-
// setLocalRowSelectList(localRowSelectList || [])
|
|
313636
|
-
// }
|
|
313637
|
-
// }
|
|
313638
|
-
// }, [rowSelection])
|
|
313639
|
-
// const editTableRowChange = (selectRows) => {
|
|
313640
|
-
// setLocalRowSelectList(selectRows);
|
|
313641
|
-
// // (rowSelection?.onChange as any)?.(selectRows)
|
|
313642
|
-
// }
|
|
314500
|
+
setDataSource(res);
|
|
314501
|
+
}, 40);
|
|
313643
314502
|
|
|
313644
314503
|
var handleSave = function handleSave(row, options) {
|
|
313645
314504
|
var _deepDataSourceRef$cu, _deepDataSourceRef$cu2;
|
|
@@ -313712,25 +314571,26 @@
|
|
|
313712
314571
|
}
|
|
313713
314572
|
});
|
|
313714
314573
|
setDataSource(res);
|
|
313715
|
-
};
|
|
313716
|
-
|
|
313717
|
-
|
|
313718
|
-
|
|
313719
|
-
|
|
313720
|
-
|
|
313721
|
-
|
|
313722
|
-
|
|
314574
|
+
}; // const reWriteOriginSource = (rowKey: string, rowValue, dataIndex: number, nextValue) => {
|
|
314575
|
+
// setDataSource((prevDataSource) => {
|
|
314576
|
+
// return prevDataSource?.map((item) => {
|
|
314577
|
+
// if (get(item, rowKey) === rowValue) {
|
|
314578
|
+
// set(item, dataIndex, nextValue)
|
|
314579
|
+
// }
|
|
314580
|
+
// return item
|
|
314581
|
+
// })
|
|
314582
|
+
// })
|
|
314583
|
+
// }
|
|
314584
|
+
// @ts-ignore
|
|
313723
314585
|
|
|
313724
|
-
|
|
313725
|
-
});
|
|
313726
|
-
});
|
|
313727
|
-
}; // @ts-ignore
|
|
314586
|
+
/** 删除当前行 */
|
|
313728
314587
|
|
|
313729
314588
|
|
|
313730
|
-
var handleTableRowDelete = function
|
|
314589
|
+
var handleTableRowDelete = lodash.debounce(function (key) {
|
|
313731
314590
|
var _deepDataSourceRef$cu3, _deepDataSourceRef$cu4;
|
|
313732
314591
|
|
|
313733
|
-
var
|
|
314592
|
+
var rkey = lodash.isObject(key) ? key[_rowKey] : key;
|
|
314593
|
+
var preKeys = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : (_deepDataSourceRef$cu3 = deepDataSourceRef.current) === null || _deepDataSourceRef$cu3 === void 0 ? void 0 : (_deepDataSourceRef$cu4 = _deepDataSourceRef$cu3[rkey]) === null || _deepDataSourceRef$cu4 === void 0 ? void 0 : _deepDataSourceRef$cu4.preKeys;
|
|
313734
314594
|
|
|
313735
314595
|
if (preKeys.length > 1) {
|
|
313736
314596
|
/** 说明删除的是children中的数据 */
|
|
@@ -313751,7 +314611,7 @@
|
|
|
313751
314611
|
return newData;
|
|
313752
314612
|
};
|
|
313753
314613
|
|
|
313754
|
-
var res = filter(
|
|
314614
|
+
var res = filter(dataSourceRef.current, key);
|
|
313755
314615
|
setDataSource(res);
|
|
313756
314616
|
} else {
|
|
313757
314617
|
var _dataSourceRef$curren;
|
|
@@ -313772,32 +314632,74 @@
|
|
|
313772
314632
|
|
|
313773
314633
|
setDataSource(_res);
|
|
313774
314634
|
}
|
|
313775
|
-
};
|
|
313776
|
-
/** 快捷添加 */
|
|
313777
314635
|
|
|
314636
|
+
return null;
|
|
314637
|
+
}, 40);
|
|
314638
|
+
/** 替换当前行 */
|
|
313778
314639
|
|
|
313779
|
-
var
|
|
314640
|
+
var handleTableRowReplace = lodash.debounce(function (record, defaultRecord) {
|
|
313780
314641
|
var _deepDataSourceRef$cu5, _deepDataSourceRef$cu6;
|
|
313781
314642
|
|
|
313782
|
-
var
|
|
314643
|
+
var rkey = lodash.isObject(record) ? record[_rowKey] : record;
|
|
314644
|
+
var preKeys = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : (_deepDataSourceRef$cu5 = deepDataSourceRef.current) === null || _deepDataSourceRef$cu5 === void 0 ? void 0 : (_deepDataSourceRef$cu6 = _deepDataSourceRef$cu5[rkey]) === null || _deepDataSourceRef$cu6 === void 0 ? void 0 : _deepDataSourceRef$cu6.preKeys; // const res = cloneDeep(dataSourceRef.current)
|
|
314645
|
+
|
|
314646
|
+
var deep = function deep(children) {
|
|
314647
|
+
return children.map(function (item) {
|
|
314648
|
+
if (item[_rowKey] === rkey) {
|
|
314649
|
+
return defaultRecord;
|
|
314650
|
+
} else if (preKeys.includes(item[_rowKey]) && item.children) {
|
|
314651
|
+
var child = deep(item.children);
|
|
314652
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
314653
|
+
children: child
|
|
314654
|
+
});
|
|
314655
|
+
} else {
|
|
314656
|
+
return item;
|
|
314657
|
+
}
|
|
314658
|
+
});
|
|
314659
|
+
};
|
|
314660
|
+
|
|
314661
|
+
var res = deep(dataSourceRef.current);
|
|
314662
|
+
setDataSource(res);
|
|
314663
|
+
}, 40);
|
|
314664
|
+
/** 快捷添加 */
|
|
314665
|
+
|
|
314666
|
+
var handleTableRowAdd = lodash.debounce(function (record, isAppendInChindren, defaultRecord) {
|
|
314667
|
+
var _deepDataSourceRef$cu7, _deepDataSourceRef$cu8;
|
|
314668
|
+
|
|
314669
|
+
var rkey = lodash.isObject(record) ? record[_rowKey] : record;
|
|
314670
|
+
var preKeys = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : (_deepDataSourceRef$cu7 = deepDataSourceRef.current) === null || _deepDataSourceRef$cu7 === void 0 ? void 0 : (_deepDataSourceRef$cu8 = _deepDataSourceRef$cu7[rkey]) === null || _deepDataSourceRef$cu8 === void 0 ? void 0 : _deepDataSourceRef$cu8.preKeys;
|
|
313783
314671
|
var res = fn(dataSourceRef.current, function (draft) {
|
|
313784
|
-
if (preKeys.length > 1) {
|
|
314672
|
+
if ((preKeys === null || preKeys === void 0 ? void 0 : preKeys.length) > 1) {
|
|
313785
314673
|
var deeps = function deeps(children) {
|
|
313786
314674
|
children === null || children === void 0 ? void 0 : children.forEach(function (item, index) {
|
|
313787
314675
|
if (preKeys === null || preKeys === void 0 ? void 0 : preKeys.includes(item[_rowKey])) {
|
|
313788
|
-
if (item[_rowKey] ===
|
|
314676
|
+
if (item[_rowKey] === rkey) {
|
|
313789
314677
|
if (isAppendInChindren) {
|
|
313790
314678
|
if (item === null || item === void 0 ? void 0 : item.children) {
|
|
313791
|
-
|
|
314679
|
+
if (Array.isArray(defaultRecord)) {
|
|
314680
|
+
var _item$children;
|
|
314681
|
+
|
|
314682
|
+
item === null || item === void 0 ? void 0 : (_item$children = item.children) === null || _item$children === void 0 ? void 0 : _item$children.push.apply(_item$children, _toConsumableArray$1(defaultRecord));
|
|
314683
|
+
} else {
|
|
314684
|
+
var _item$children2;
|
|
313792
314685
|
|
|
313793
|
-
|
|
314686
|
+
item === null || item === void 0 ? void 0 : (_item$children2 = item.children) === null || _item$children2 === void 0 ? void 0 : _item$children2.push(defaultRecord || _defineProperty$1({}, _rowKey, "".concat(Date.now())));
|
|
314687
|
+
}
|
|
313794
314688
|
} else {
|
|
313795
|
-
|
|
314689
|
+
if (Array.isArray(defaultRecord)) {
|
|
314690
|
+
item.children = _toConsumableArray$1(defaultRecord);
|
|
314691
|
+
} else {
|
|
314692
|
+
item.children = [defaultRecord || _defineProperty$1({}, _rowKey, "".concat(Date.now()))];
|
|
314693
|
+
}
|
|
313796
314694
|
}
|
|
313797
314695
|
|
|
313798
314696
|
!expandedRowKeys.includes(item[_rowKey]) && setExpandedRowKeys([].concat(_toConsumableArray$1(expandedRowKeys), [item[_rowKey]]));
|
|
313799
314697
|
} else {
|
|
313800
|
-
|
|
314698
|
+
if (Array.isArray(defaultRecord)) {
|
|
314699
|
+
children.splice.apply(children, [index + 1, 0].concat(_toConsumableArray$1(defaultRecord)));
|
|
314700
|
+
} else {
|
|
314701
|
+
children.splice(index + 1, 0, defaultRecord || _defineProperty$1({}, _rowKey, "".concat(Date.now())));
|
|
314702
|
+
}
|
|
313801
314703
|
}
|
|
313802
314704
|
} else if (item.children) {
|
|
313803
314705
|
deeps(item.children);
|
|
@@ -313809,7 +314711,7 @@
|
|
|
313809
314711
|
deeps(draft);
|
|
313810
314712
|
} else {
|
|
313811
314713
|
var index = draft.findIndex(function (item) {
|
|
313812
|
-
return
|
|
314714
|
+
return rkey === item[_rowKey];
|
|
313813
314715
|
});
|
|
313814
314716
|
|
|
313815
314717
|
if (index !== -1) {
|
|
@@ -313817,27 +314719,40 @@
|
|
|
313817
314719
|
var _draft$index$children, _draft$index, _draft$index2;
|
|
313818
314720
|
|
|
313819
314721
|
if ((_draft$index$children = draft[index].children) === null || _draft$index$children === void 0 ? void 0 : _draft$index$children.length) {
|
|
313820
|
-
|
|
314722
|
+
if (Array.isArray(defaultRecord)) {
|
|
314723
|
+
var _draft$index$children2;
|
|
313821
314724
|
|
|
313822
|
-
|
|
314725
|
+
(_draft$index$children2 = draft[index].children) === null || _draft$index$children2 === void 0 ? void 0 : _draft$index$children2.push.apply(_draft$index$children2, _toConsumableArray$1(defaultRecord));
|
|
314726
|
+
} else {
|
|
314727
|
+
var _draft$index$children3;
|
|
314728
|
+
|
|
314729
|
+
(_draft$index$children3 = draft[index].children) === null || _draft$index$children3 === void 0 ? void 0 : _draft$index$children3.push(defaultRecord || _defineProperty$1({}, _rowKey, "".concat(Date.now())));
|
|
314730
|
+
}
|
|
313823
314731
|
} else {
|
|
313824
|
-
draft[index].children = [_defineProperty$1({}, _rowKey, "".concat(Date.now()))];
|
|
314732
|
+
draft[index].children = Array.isArray(defaultRecord) ? _toConsumableArray$1(defaultRecord) : [defaultRecord || _defineProperty$1({}, _rowKey, "".concat(Date.now()))];
|
|
313825
314733
|
}
|
|
313826
314734
|
|
|
313827
314735
|
!expandedRowKeys.includes((_draft$index = draft[index]) === null || _draft$index === void 0 ? void 0 : _draft$index[_rowKey]) && setExpandedRowKeys([].concat(_toConsumableArray$1(expandedRowKeys), [(_draft$index2 = draft[index]) === null || _draft$index2 === void 0 ? void 0 : _draft$index2[_rowKey]]));
|
|
313828
314736
|
} else {
|
|
313829
|
-
|
|
314737
|
+
if (Array.isArray(defaultRecord)) {
|
|
314738
|
+
draft.splice.apply(draft, [index + 1, 0].concat(_toConsumableArray$1(defaultRecord)));
|
|
314739
|
+
} else {
|
|
314740
|
+
draft.splice(index + 1, 0, defaultRecord || _defineProperty$1({}, _rowKey, "".concat(Date.now())));
|
|
314741
|
+
}
|
|
313830
314742
|
}
|
|
313831
314743
|
}
|
|
313832
314744
|
}
|
|
313833
314745
|
});
|
|
313834
314746
|
setDataSource(res);
|
|
313835
|
-
};
|
|
314747
|
+
}, 50);
|
|
314748
|
+
/** 快捷刷子功能 */
|
|
313836
314749
|
|
|
313837
|
-
var handleCopy = function handleCopy(key, value) {
|
|
314750
|
+
var handleCopy = function handleCopy(key, value, type, rowIndex) {
|
|
313838
314751
|
var res = fn(dataSourceRef.current, function (draft) {
|
|
313839
|
-
draft === null || draft === void 0 ? void 0 : draft.forEach(function (item) {
|
|
313840
|
-
|
|
314752
|
+
draft === null || draft === void 0 ? void 0 : draft.forEach(function (item, index) {
|
|
314753
|
+
if (type === 'up' && index < rowIndex || type === 'down' && index > rowIndex) {
|
|
314754
|
+
item[key] = value;
|
|
314755
|
+
}
|
|
313841
314756
|
});
|
|
313842
314757
|
});
|
|
313843
314758
|
setDataSource(res);
|
|
@@ -313846,17 +314761,16 @@
|
|
|
313846
314761
|
|
|
313847
314762
|
|
|
313848
314763
|
var hasDisableOptions = React.useMemo(function () {
|
|
313849
|
-
// const hasOnlyOptionsDatas = columns.filter(item => item?.['componentProps']?.optionOnly)
|
|
313850
314764
|
var hasOnlyOptionsDatas = columns.filter(function (item) {
|
|
313851
314765
|
var _item$componentProps;
|
|
313852
314766
|
|
|
313853
314767
|
var resultComponentProps = lodash.isFunction(item === null || item === void 0 ? void 0 : item.componentProps) ? item === null || item === void 0 ? void 0 : (_item$componentProps = item.componentProps) === null || _item$componentProps === void 0 ? void 0 : _item$componentProps.call(item, {}, item) : item === null || item === void 0 ? void 0 : item.componentProps;
|
|
313854
314768
|
return resultComponentProps === null || resultComponentProps === void 0 ? void 0 : resultComponentProps.optionOnly;
|
|
313855
|
-
});
|
|
314769
|
+
}); // const hasOnlyOptionsDatas = columns.filter((item) => item?.componentProps?.optionOnly)
|
|
313856
314770
|
|
|
313857
314771
|
if (hasOnlyOptionsDatas.length) {
|
|
313858
314772
|
return hasOnlyOptionsDatas === null || hasOnlyOptionsDatas === void 0 ? void 0 : hasOnlyOptionsDatas.map(function (item) {
|
|
313859
|
-
return item
|
|
314773
|
+
return item.dataIndex;
|
|
313860
314774
|
});
|
|
313861
314775
|
}
|
|
313862
314776
|
|
|
@@ -313868,12 +314782,11 @@
|
|
|
313868
314782
|
var newColumns = columns === null || columns === void 0 ? void 0 : columns.map(function (item) {
|
|
313869
314783
|
var _item$componentProps2;
|
|
313870
314784
|
|
|
313871
|
-
var resultComponentProps = lodash.isFunction(item.componentProps) ?
|
|
313872
|
-
|
|
313873
|
-
var _ref8 = resultComponentProps || {},
|
|
313874
|
-
optionOnly = _ref8.optionOnly,
|
|
313875
|
-
options = _ref8.options; // const { optionOnly, options } = item['componentProps'] || {}
|
|
314785
|
+
var resultComponentProps = lodash.isFunction(item.componentProps) ? (_item$componentProps2 = item.componentProps) === null || _item$componentProps2 === void 0 ? void 0 : _item$componentProps2.call(item, {}, item) : item.componentProps;
|
|
313876
314786
|
|
|
314787
|
+
var _ref11 = resultComponentProps || {},
|
|
314788
|
+
optionOnly = _ref11.optionOnly,
|
|
314789
|
+
options = _ref11.options;
|
|
313877
314790
|
|
|
313878
314791
|
if (optionOnly && options) {
|
|
313879
314792
|
var dataIndex = item.dataIndex;
|
|
@@ -313893,7 +314806,7 @@
|
|
|
313893
314806
|
}
|
|
313894
314807
|
|
|
313895
314808
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
313896
|
-
componentProps: _objectSpread(_objectSpread({}, item
|
|
314809
|
+
componentProps: _objectSpread(_objectSpread({}, item.componentProps), {}, {
|
|
313897
314810
|
options: newOptions
|
|
313898
314811
|
})
|
|
313899
314812
|
});
|
|
@@ -313909,21 +314822,53 @@
|
|
|
313909
314822
|
/** 组装之后的最终columns */
|
|
313910
314823
|
|
|
313911
314824
|
var resultColumns = React.useMemo(function () {
|
|
313912
|
-
var _localColumns;
|
|
314825
|
+
var _localColumns, _localColumns2, _localColumns3;
|
|
313913
314826
|
|
|
313914
314827
|
var rColumns = hasDisableOptions ? DisableOptions : columns;
|
|
313915
314828
|
var localColumns = [sortOpen ? {
|
|
313916
314829
|
title: '排序',
|
|
313917
|
-
dataIndex: '
|
|
314830
|
+
dataIndex: '_sort',
|
|
313918
314831
|
width: 48,
|
|
313919
314832
|
maxWidth: 48,
|
|
313920
314833
|
className: 'drag-visible',
|
|
314834
|
+
fixed: 'left',
|
|
313921
314835
|
render: function render(_, record) {
|
|
313922
314836
|
return /*#__PURE__*/React__default['default'].createElement(Dragger$1, {
|
|
313923
|
-
id: record[_rowKey] || record.id
|
|
314837
|
+
id: (record === null || record === void 0 ? void 0 : record[_rowKey]) || (record === null || record === void 0 ? void 0 : record.id)
|
|
313924
314838
|
});
|
|
313925
314839
|
}
|
|
313926
|
-
} : null
|
|
314840
|
+
} : null, indexCol ? lodash.isBoolean(indexCol) ? {
|
|
314841
|
+
title: '',
|
|
314842
|
+
dataIndex: '_index',
|
|
314843
|
+
width: 48,
|
|
314844
|
+
maxWidth: 48,
|
|
314845
|
+
ellipsis: true,
|
|
314846
|
+
fixed: 'left',
|
|
314847
|
+
render: function render(_, record, index) {
|
|
314848
|
+
var _deepDataSourceRef$cu9, _deepDataSourceRef$cu10, _deepDataSourceRef$cu11;
|
|
314849
|
+
|
|
314850
|
+
return ((_deepDataSourceRef$cu9 = deepDataSourceRef.current) === null || _deepDataSourceRef$cu9 === void 0 ? void 0 : (_deepDataSourceRef$cu10 = _deepDataSourceRef$cu9[record[_rowKey]]) === null || _deepDataSourceRef$cu10 === void 0 ? void 0 : (_deepDataSourceRef$cu11 = _deepDataSourceRef$cu10['_deepIds']) === null || _deepDataSourceRef$cu11 === void 0 ? void 0 : _deepDataSourceRef$cu11.join('-')) || "".concat(index + 1);
|
|
314851
|
+
}
|
|
314852
|
+
} : _objectSpread(_objectSpread({
|
|
314853
|
+
title: '',
|
|
314854
|
+
dataIndex: '_index',
|
|
314855
|
+
width: 48,
|
|
314856
|
+
ellipsis: true,
|
|
314857
|
+
maxWidth: 48,
|
|
314858
|
+
fixed: 'left'
|
|
314859
|
+
}, indexCol || {}), {}, {
|
|
314860
|
+
render: function render(_, record, index) {
|
|
314861
|
+
var _deepDataSourceRef$cu14, _deepDataSourceRef$cu15, _deepDataSourceRef$cu16;
|
|
314862
|
+
|
|
314863
|
+
if (lodash.isFunction(indexCol === null || indexCol === void 0 ? void 0 : indexCol.render)) {
|
|
314864
|
+
var _indexCol$render, _deepDataSourceRef$cu12, _deepDataSourceRef$cu13;
|
|
314865
|
+
|
|
314866
|
+
return indexCol === null || indexCol === void 0 ? void 0 : (_indexCol$render = indexCol.render) === null || _indexCol$render === void 0 ? void 0 : _indexCol$render.call(indexCol, record, (_deepDataSourceRef$cu12 = deepDataSourceRef.current) === null || _deepDataSourceRef$cu12 === void 0 ? void 0 : (_deepDataSourceRef$cu13 = _deepDataSourceRef$cu12[record[_rowKey]]) === null || _deepDataSourceRef$cu13 === void 0 ? void 0 : _deepDataSourceRef$cu13['_deepIds']);
|
|
314867
|
+
}
|
|
314868
|
+
|
|
314869
|
+
return ((_deepDataSourceRef$cu14 = deepDataSourceRef.current) === null || _deepDataSourceRef$cu14 === void 0 ? void 0 : (_deepDataSourceRef$cu15 = _deepDataSourceRef$cu14[record[_rowKey]]) === null || _deepDataSourceRef$cu15 === void 0 ? void 0 : (_deepDataSourceRef$cu16 = _deepDataSourceRef$cu15['_deepIds']) === null || _deepDataSourceRef$cu16 === void 0 ? void 0 : _deepDataSourceRef$cu16.join('-')) || "".concat(index + 1);
|
|
314870
|
+
}
|
|
314871
|
+
}) : null].concat(_toConsumableArray$1(rColumns), [useQuickOpetate ? {
|
|
313927
314872
|
title: '操作',
|
|
313928
314873
|
dataIndex: 'lm_edit_opetate',
|
|
313929
314874
|
width: 68,
|
|
@@ -313934,11 +314879,11 @@
|
|
|
313934
314879
|
options: Array.isArray(useQuickOpetate) ? useQuickOpetate : ['add', 'delete']
|
|
313935
314880
|
}
|
|
313936
314881
|
} : null]).filter(function (item) {
|
|
313937
|
-
return item && item.show !== false;
|
|
314882
|
+
return item && (item === null || item === void 0 ? void 0 : item.show) !== false;
|
|
313938
314883
|
});
|
|
313939
|
-
localColumns = localColumns.map(function (item, index) {
|
|
314884
|
+
localColumns = (_localColumns = localColumns) === null || _localColumns === void 0 ? void 0 : _localColumns.map(function (item, index) {
|
|
313940
314885
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
313941
|
-
order: [null, undefined].includes(item
|
|
314886
|
+
order: [null, undefined].includes(item.order) ? index : item.order
|
|
313942
314887
|
});
|
|
313943
314888
|
}).sort(function (a, b) {
|
|
313944
314889
|
return a.order - b.order;
|
|
@@ -313946,7 +314891,7 @@
|
|
|
313946
314891
|
var leftColumns = [];
|
|
313947
314892
|
var mainColumns = [];
|
|
313948
314893
|
var rightColumns = [];
|
|
313949
|
-
(
|
|
314894
|
+
(_localColumns2 = localColumns) === null || _localColumns2 === void 0 ? void 0 : _localColumns2.forEach(function (item) {
|
|
313950
314895
|
if ((item === null || item === void 0 ? void 0 : item.fixed) === 'left') {
|
|
313951
314896
|
leftColumns.push(item);
|
|
313952
314897
|
} else if ((item === null || item === void 0 ? void 0 : item.fixed) === 'right') {
|
|
@@ -313961,29 +314906,22 @@
|
|
|
313961
314906
|
var mapColumns = function mapColumns(col, index) {
|
|
313962
314907
|
var _col$children;
|
|
313963
314908
|
|
|
313964
|
-
if (!col.editable && !((_col$children = col.children) === null || _col$children === void 0 ? void 0 : _col$children.length)) {
|
|
313965
|
-
|
|
313966
|
-
|
|
313967
|
-
|
|
313968
|
-
|
|
313969
|
-
shouldCellUpdate: function shouldCellUpdate(record, prevRecord) {
|
|
313970
|
-
var _col$componentProps2;
|
|
313971
|
-
|
|
313972
|
-
var dataIndex = col.dataIndex,
|
|
313973
|
-
editable = col.editable,
|
|
313974
|
-
relevanceCols = col.relevanceCols,
|
|
313975
|
-
componentProps = col.componentProps;
|
|
314909
|
+
if (!col.editable && !((_col$children = col.children) === null || _col$children === void 0 ? void 0 : _col$children.length) && (col === null || col === void 0 ? void 0 : col.dataIndex) === '_sort') {
|
|
314910
|
+
var fn = col === null || col === void 0 ? void 0 : col.render;
|
|
314911
|
+
return _objectSpread(_objectSpread({}, col), {}, {
|
|
314912
|
+
render: function render(text, record, i) {
|
|
314913
|
+
var _dataSource$i;
|
|
313976
314914
|
|
|
313977
|
-
|
|
313978
|
-
return true;
|
|
314915
|
+
return fn === null || fn === void 0 ? void 0 : fn((_dataSource$i = dataSource[i]) === null || _dataSource$i === void 0 ? void 0 : _dataSource$i[col.dataIndex], dataSource[i], i);
|
|
313979
314916
|
}
|
|
314917
|
+
});
|
|
314918
|
+
}
|
|
313980
314919
|
|
|
313981
|
-
|
|
313982
|
-
|
|
313983
|
-
|
|
314920
|
+
if (isEdit && (col === null || col === void 0 ? void 0 : col.render) && (col === null || col === void 0 ? void 0 : col.editable) === 'render') {
|
|
314921
|
+
delete col.render;
|
|
314922
|
+
}
|
|
313984
314923
|
|
|
313985
|
-
|
|
313986
|
-
},
|
|
314924
|
+
var newCol = _objectSpread({
|
|
313987
314925
|
onCell: function onCell(record, rowIndex) {
|
|
313988
314926
|
return {
|
|
313989
314927
|
getLength: dataSource.length,
|
|
@@ -313998,7 +314936,7 @@
|
|
|
313998
314936
|
editable: col.editable,
|
|
313999
314937
|
dataIndex: col.dataIndex,
|
|
314000
314938
|
itemProps: col.itemProps,
|
|
314001
|
-
|
|
314939
|
+
shouldUpdate: shouldUpdate,
|
|
314002
314940
|
isEdit: isEdit,
|
|
314003
314941
|
isHoverEdit: isHoverEdit,
|
|
314004
314942
|
handleAdd: handleAdd,
|
|
@@ -314006,11 +314944,10 @@
|
|
|
314006
314944
|
handleCopy: handleCopy,
|
|
314007
314945
|
editEnum: typeof col.editEnum === 'function' ? col.editEnum(record) : col.editEnum,
|
|
314008
314946
|
valueType: typeof col.valueType === 'function' ? col.valueType(record) : col.valueType,
|
|
314009
|
-
handleSave: handleSave
|
|
314010
|
-
reWriteOriginSource: reWriteOriginSource
|
|
314947
|
+
handleSave: handleSave
|
|
314011
314948
|
};
|
|
314012
314949
|
}
|
|
314013
|
-
});
|
|
314950
|
+
}, col);
|
|
314014
314951
|
|
|
314015
314952
|
if (col === null || col === void 0 ? void 0 : col.children) {
|
|
314016
314953
|
var _col$children2;
|
|
@@ -314021,28 +314958,28 @@
|
|
|
314021
314958
|
return newCol;
|
|
314022
314959
|
};
|
|
314023
314960
|
|
|
314024
|
-
var res = localColumns.map(function (col, index) {
|
|
314961
|
+
var res = (_localColumns3 = localColumns) === null || _localColumns3 === void 0 ? void 0 : _localColumns3.map(function (col, index) {
|
|
314025
314962
|
return mapColumns(col, index);
|
|
314026
314963
|
});
|
|
314027
314964
|
return res;
|
|
314028
|
-
}, [columns, isAdd, sortOpen, useQuickOpetate,
|
|
314029
|
-
var DraggableContainer = React.useCallback(function (_ref9) {
|
|
314030
|
-
var _dataSourceRef$curren2;
|
|
314965
|
+
}, [columns, isAdd, sortOpen, useQuickOpetate, dataSource, _toConsumableArray$1(memoOptions)]);
|
|
314031
314966
|
|
|
314032
|
-
|
|
314967
|
+
var onSortEnd = function onSortEnd(active, over) {
|
|
314968
|
+
var cloneArr = _toConsumableArray$1(dataSourceRef.current);
|
|
314033
314969
|
|
|
314034
|
-
|
|
314035
|
-
|
|
314036
|
-
}
|
|
314037
|
-
|
|
314038
|
-
|
|
314039
|
-
|
|
314040
|
-
|
|
314041
|
-
}
|
|
314042
|
-
|
|
314970
|
+
var oldIndex = cloneArr.findIndex(function (v) {
|
|
314971
|
+
return v[_rowKey] === active;
|
|
314972
|
+
});
|
|
314973
|
+
var newIndex = cloneArr.findIndex(function (v) {
|
|
314974
|
+
return v[_rowKey] === over;
|
|
314975
|
+
});
|
|
314976
|
+
setDataSource(arrayMove(cloneArr, oldIndex, newIndex));
|
|
314977
|
+
};
|
|
314978
|
+
|
|
314979
|
+
var colDraggableContainer = React.useCallback(function (_ref12) {
|
|
314043
314980
|
var _React$Children;
|
|
314044
314981
|
|
|
314045
|
-
var props = _extends$2({},
|
|
314982
|
+
var props = _extends$2({}, _ref12);
|
|
314046
314983
|
|
|
314047
314984
|
return /*#__PURE__*/React__default['default'].createElement("tr", null, (_React$Children = React__default['default'].Children) === null || _React$Children === void 0 ? void 0 : _React$Children.map(props.children, function (child) {
|
|
314048
314985
|
var _child$props, _child$props$column;
|
|
@@ -314051,45 +314988,23 @@
|
|
|
314051
314988
|
return child;
|
|
314052
314989
|
}
|
|
314053
314990
|
|
|
314054
|
-
return /*#__PURE__*/React__default['default'].createElement(SortableItem$
|
|
314991
|
+
return /*#__PURE__*/React__default['default'].createElement(SortableItem$3, {
|
|
314055
314992
|
id: child.key
|
|
314056
314993
|
}, child);
|
|
314057
314994
|
}));
|
|
314058
314995
|
}, [columns]);
|
|
314059
|
-
var config = React.useMemo(function () {
|
|
314060
|
-
var component = {
|
|
314061
|
-
body: Object.assign({
|
|
314062
|
-
row: sortOpen ? EditableSortRow : EditableRow$1,
|
|
314063
|
-
cell: EditableCell$1
|
|
314064
|
-
}, sortOpen ? {
|
|
314065
|
-
wrapper: DraggableContainer
|
|
314066
|
-
} : {})
|
|
314067
|
-
};
|
|
314068
|
-
|
|
314069
|
-
if (colSortOpen) {
|
|
314070
|
-
component['header'] = {
|
|
314071
|
-
row: colDraggableContainer
|
|
314072
|
-
};
|
|
314073
|
-
}
|
|
314074
|
-
|
|
314075
|
-
return _objectSpread({
|
|
314076
|
-
pagination: false,
|
|
314077
|
-
tableLayout: 'fixed',
|
|
314078
|
-
scroll: {
|
|
314079
|
-
x: '100%'
|
|
314080
|
-
},
|
|
314081
|
-
rowKey: function rowKey(record) {
|
|
314082
|
-
return record[_rowKey] || record.index || Math.random();
|
|
314083
|
-
},
|
|
314084
|
-
components: component
|
|
314085
|
-
}, resetProps);
|
|
314086
|
-
}, [resultColumns, dataSource, sortOpen, colSortOpen, size]);
|
|
314087
314996
|
React.useImperativeHandle(ref, function () {
|
|
314088
314997
|
return {
|
|
314089
314998
|
setRow: handleSave,
|
|
314090
314999
|
getCheckboxRecords: function getCheckboxRecords() {
|
|
314091
315000
|
return localRowSelectList.selectedRows;
|
|
314092
315001
|
},
|
|
315002
|
+
deleteRowData: function deleteRowData(data) {
|
|
315003
|
+
return handleTableRowDelete(data);
|
|
315004
|
+
},
|
|
315005
|
+
addRowData: function addRowData(data, defaultValue, addInChild) {
|
|
315006
|
+
return addInChild === 'replace' ? handleTableRowReplace(data, defaultValue) : handleTableRowAdd(data, addInChild, defaultValue);
|
|
315007
|
+
},
|
|
314093
315008
|
clearSelect: function clearSelect() {
|
|
314094
315009
|
setLocalRowSelectList({
|
|
314095
315010
|
selectedRows: []
|
|
@@ -314100,33 +315015,373 @@
|
|
|
314100
315015
|
selectedRows: value
|
|
314101
315016
|
});
|
|
314102
315017
|
},
|
|
314103
|
-
|
|
314104
|
-
return
|
|
314105
|
-
}
|
|
315018
|
+
columns: columns.map(function (item) {
|
|
315019
|
+
return lodash.omit(item, ['render', 'sorter', 'onFilter', 'filters', 'componentProps', 'formProps', 'editable']);
|
|
315020
|
+
}),
|
|
315021
|
+
// verify: async () => {
|
|
315022
|
+
// let allRule = {}
|
|
315023
|
+
// let time
|
|
315024
|
+
// let fullNum = 0
|
|
315025
|
+
// columns.forEach((col: any) => {
|
|
315026
|
+
// if (col?.formProps?.rules) {
|
|
315027
|
+
// allRule[col.dataIndex] = col?.formProps?.rules || []
|
|
315028
|
+
// }
|
|
315029
|
+
// })
|
|
315030
|
+
// const validator = new AsyncValidator(allRule);
|
|
315031
|
+
// let flag = true
|
|
315032
|
+
// let messageIndex = null
|
|
315033
|
+
// let errorRowKey = null
|
|
315034
|
+
// let errorInfo = null
|
|
315035
|
+
// const deepValidator = async (data, index) => {
|
|
315036
|
+
// for (let i = 0; i < data.length; i++) {
|
|
315037
|
+
// if (flag) {
|
|
315038
|
+
// try {
|
|
315039
|
+
// await validator.validate(data[i], (errors, fields) => {
|
|
315040
|
+
// if (errors) {
|
|
315041
|
+
// errorInfo = { errors, fields, value: data[i] };
|
|
315042
|
+
// flag = false
|
|
315043
|
+
// messageIndex = index === null ? i : index
|
|
315044
|
+
// errorRowKey = data?.[i]?.[rowKey]
|
|
315045
|
+
// } else if (data[i].children) {
|
|
315046
|
+
// deepValidator(data[i].children, i)
|
|
315047
|
+
// }
|
|
315048
|
+
// })
|
|
315049
|
+
// } catch (error) {
|
|
315050
|
+
// break;
|
|
315051
|
+
// }
|
|
315052
|
+
// }
|
|
315053
|
+
// }
|
|
315054
|
+
// }
|
|
315055
|
+
// await deepValidator(dataSource, null)
|
|
315056
|
+
// console.log(flag, 'fff')
|
|
315057
|
+
// if (flag) {
|
|
315058
|
+
// return Promise.resolve(dataSource)
|
|
315059
|
+
// } else {
|
|
315060
|
+
// setTimeout(() => {
|
|
315061
|
+
// if (messageIndex !== null) {
|
|
315062
|
+
// scrollToIndexRef.current?.(messageIndex, { align: 'center' })
|
|
315063
|
+
// time = setInterval(async () => {
|
|
315064
|
+
// fullNum++
|
|
315065
|
+
// if (fullNum > 5) {
|
|
315066
|
+
// clearInterval(time)
|
|
315067
|
+
// } else {
|
|
315068
|
+
// const form = (Object.values(allFormListRef.current || []).find((item: any) => item.key === errorRowKey) as any)?.form
|
|
315069
|
+
// if (form) {
|
|
315070
|
+
// try {
|
|
315071
|
+
// await form.validateFields()
|
|
315072
|
+
// console.log('验证成功')
|
|
315073
|
+
// } catch (error) {
|
|
315074
|
+
// console.log('验证失败', error)
|
|
315075
|
+
// return error
|
|
315076
|
+
// } finally {
|
|
315077
|
+
// clearInterval(time)
|
|
315078
|
+
// }
|
|
315079
|
+
// }
|
|
315080
|
+
// }
|
|
315081
|
+
// }, 500)
|
|
315082
|
+
// }
|
|
315083
|
+
// }, 100)
|
|
315084
|
+
// return Promise.reject(errorInfo)
|
|
315085
|
+
// }
|
|
315086
|
+
// },
|
|
315087
|
+
verify: function () {
|
|
315088
|
+
var _verify = _asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime$1().mark(function _callee4() {
|
|
315089
|
+
var time, fullNum, flag, messageIndex, errorRowKey, errorInfo, deepValidator;
|
|
315090
|
+
return _regeneratorRuntime$1().wrap(function _callee4$(_context4) {
|
|
315091
|
+
while (1) {
|
|
315092
|
+
switch (_context4.prev = _context4.next) {
|
|
315093
|
+
case 0:
|
|
315094
|
+
fullNum = 0;
|
|
315095
|
+
flag = true;
|
|
315096
|
+
messageIndex = null;
|
|
315097
|
+
errorRowKey = null;
|
|
315098
|
+
errorInfo = null;
|
|
315099
|
+
|
|
315100
|
+
deepValidator = /*#__PURE__*/function () {
|
|
315101
|
+
var _ref13 = _asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime$1().mark(function _callee2(data, index) {
|
|
315102
|
+
var i, _data$i;
|
|
315103
|
+
|
|
315104
|
+
return _regeneratorRuntime$1().wrap(function _callee2$(_context2) {
|
|
315105
|
+
while (1) {
|
|
315106
|
+
switch (_context2.prev = _context2.next) {
|
|
315107
|
+
case 0:
|
|
315108
|
+
i = 0;
|
|
315109
|
+
|
|
315110
|
+
case 1:
|
|
315111
|
+
if (!(i < data.length)) {
|
|
315112
|
+
_context2.next = 23;
|
|
315113
|
+
break;
|
|
315114
|
+
}
|
|
315115
|
+
|
|
315116
|
+
if (!flag) {
|
|
315117
|
+
_context2.next = 20;
|
|
315118
|
+
break;
|
|
315119
|
+
}
|
|
315120
|
+
|
|
315121
|
+
_context2.prev = 3;
|
|
315122
|
+
checkForm.resetFields();
|
|
315123
|
+
checkForm.setFieldsValue(data[i]);
|
|
315124
|
+
_context2.next = 8;
|
|
315125
|
+
return checkForm.validateFields();
|
|
315126
|
+
|
|
315127
|
+
case 8:
|
|
315128
|
+
if (!data[i].children) {
|
|
315129
|
+
_context2.next = 11;
|
|
315130
|
+
break;
|
|
315131
|
+
}
|
|
315132
|
+
|
|
315133
|
+
_context2.next = 11;
|
|
315134
|
+
return deepValidator(data[i].children, i);
|
|
315135
|
+
|
|
315136
|
+
case 11:
|
|
315137
|
+
_context2.next = 20;
|
|
315138
|
+
break;
|
|
315139
|
+
|
|
315140
|
+
case 13:
|
|
315141
|
+
_context2.prev = 13;
|
|
315142
|
+
_context2.t0 = _context2["catch"](3);
|
|
315143
|
+
errorInfo = {
|
|
315144
|
+
error: _context2.t0,
|
|
315145
|
+
value: data[i]
|
|
315146
|
+
};
|
|
315147
|
+
flag = false;
|
|
315148
|
+
messageIndex = index === null ? i : index;
|
|
315149
|
+
errorRowKey = data === null || data === void 0 ? void 0 : (_data$i = data[i]) === null || _data$i === void 0 ? void 0 : _data$i[_rowKey];
|
|
315150
|
+
return _context2.abrupt("break", 23);
|
|
315151
|
+
|
|
315152
|
+
case 20:
|
|
315153
|
+
i++;
|
|
315154
|
+
_context2.next = 1;
|
|
315155
|
+
break;
|
|
315156
|
+
|
|
315157
|
+
case 23:
|
|
315158
|
+
case "end":
|
|
315159
|
+
return _context2.stop();
|
|
315160
|
+
}
|
|
315161
|
+
}
|
|
315162
|
+
}, _callee2, null, [[3, 13]]);
|
|
315163
|
+
}));
|
|
315164
|
+
|
|
315165
|
+
return function deepValidator(_x2, _x3) {
|
|
315166
|
+
return _ref13.apply(this, arguments);
|
|
315167
|
+
};
|
|
315168
|
+
}();
|
|
315169
|
+
|
|
315170
|
+
_context4.next = 8;
|
|
315171
|
+
return deepValidator(dataSource, null);
|
|
315172
|
+
|
|
315173
|
+
case 8:
|
|
315174
|
+
if (!flag) {
|
|
315175
|
+
_context4.next = 12;
|
|
315176
|
+
break;
|
|
315177
|
+
}
|
|
315178
|
+
|
|
315179
|
+
return _context4.abrupt("return", Promise.resolve(dataSource));
|
|
315180
|
+
|
|
315181
|
+
case 12:
|
|
315182
|
+
setTimeout(function () {
|
|
315183
|
+
if (messageIndex !== null) {
|
|
315184
|
+
var _scrollToIndexRef$cur;
|
|
315185
|
+
|
|
315186
|
+
(_scrollToIndexRef$cur = scrollToIndexRef.current) === null || _scrollToIndexRef$cur === void 0 ? void 0 : _scrollToIndexRef$cur.call(scrollToIndexRef, messageIndex, {
|
|
315187
|
+
align: 'center'
|
|
315188
|
+
});
|
|
315189
|
+
time = setInterval( /*#__PURE__*/_asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime$1().mark(function _callee3() {
|
|
315190
|
+
var _Object$values$find, form;
|
|
315191
|
+
|
|
315192
|
+
return _regeneratorRuntime$1().wrap(function _callee3$(_context3) {
|
|
315193
|
+
while (1) {
|
|
315194
|
+
switch (_context3.prev = _context3.next) {
|
|
315195
|
+
case 0:
|
|
315196
|
+
fullNum++;
|
|
315197
|
+
|
|
315198
|
+
if (!(fullNum > 5)) {
|
|
315199
|
+
_context3.next = 5;
|
|
315200
|
+
break;
|
|
315201
|
+
}
|
|
315202
|
+
|
|
315203
|
+
clearInterval(time);
|
|
315204
|
+
_context3.next = 20;
|
|
315205
|
+
break;
|
|
315206
|
+
|
|
315207
|
+
case 5:
|
|
315208
|
+
form = (_Object$values$find = Object.values(allFormListRef.current || []).find(function (item) {
|
|
315209
|
+
return item.key === errorRowKey;
|
|
315210
|
+
})) === null || _Object$values$find === void 0 ? void 0 : _Object$values$find.form;
|
|
315211
|
+
|
|
315212
|
+
if (!form) {
|
|
315213
|
+
_context3.next = 20;
|
|
315214
|
+
break;
|
|
315215
|
+
}
|
|
315216
|
+
|
|
315217
|
+
_context3.prev = 7;
|
|
315218
|
+
_context3.next = 10;
|
|
315219
|
+
return form.validateFields();
|
|
315220
|
+
|
|
315221
|
+
case 10:
|
|
315222
|
+
console.log('验证成功');
|
|
315223
|
+
_context3.next = 17;
|
|
315224
|
+
break;
|
|
315225
|
+
|
|
315226
|
+
case 13:
|
|
315227
|
+
_context3.prev = 13;
|
|
315228
|
+
_context3.t0 = _context3["catch"](7);
|
|
315229
|
+
console.log('验证失败', _context3.t0);
|
|
315230
|
+
return _context3.abrupt("return", _context3.t0);
|
|
315231
|
+
|
|
315232
|
+
case 17:
|
|
315233
|
+
_context3.prev = 17;
|
|
315234
|
+
clearInterval(time);
|
|
315235
|
+
return _context3.finish(17);
|
|
315236
|
+
|
|
315237
|
+
case 20:
|
|
315238
|
+
case "end":
|
|
315239
|
+
return _context3.stop();
|
|
315240
|
+
}
|
|
315241
|
+
}
|
|
315242
|
+
}, _callee3, null, [[7, 13, 17, 20]]);
|
|
315243
|
+
})), 300);
|
|
315244
|
+
}
|
|
315245
|
+
}, 100);
|
|
315246
|
+
return _context4.abrupt("return", Promise.reject(errorInfo));
|
|
315247
|
+
|
|
315248
|
+
case 14:
|
|
315249
|
+
case "end":
|
|
315250
|
+
return _context4.stop();
|
|
315251
|
+
}
|
|
315252
|
+
}
|
|
315253
|
+
}, _callee4);
|
|
315254
|
+
}));
|
|
315255
|
+
|
|
315256
|
+
function verify() {
|
|
315257
|
+
return _verify.apply(this, arguments);
|
|
315258
|
+
}
|
|
315259
|
+
|
|
315260
|
+
return verify;
|
|
315261
|
+
}()
|
|
314106
315262
|
};
|
|
314107
315263
|
});
|
|
314108
315264
|
var isShowAddAction = React.useMemo(function () {
|
|
314109
315265
|
return isEdit && isAdd || isHoverEdit && isAdd;
|
|
314110
315266
|
}, [isEdit, isAdd, isHoverEdit]);
|
|
314111
315267
|
|
|
315268
|
+
var pushAllForm = function pushAllForm(form, key, index) {
|
|
315269
|
+
allFormListRef.current[key] = {
|
|
315270
|
+
form: form,
|
|
315271
|
+
key: key,
|
|
315272
|
+
index: index
|
|
315273
|
+
};
|
|
315274
|
+
};
|
|
315275
|
+
|
|
315276
|
+
var config = React.useRef(_objectSpread({
|
|
315277
|
+
pagination: false,
|
|
315278
|
+
tableLayout: 'fixed',
|
|
315279
|
+
scroll: {
|
|
315280
|
+
x: '100%'
|
|
315281
|
+
},
|
|
315282
|
+
rowKey: function rowKey(record) {
|
|
315283
|
+
return record[_rowKey] || record.index || Math.random();
|
|
315284
|
+
},
|
|
315285
|
+
components: {
|
|
315286
|
+
table: virtual ? function (props) {
|
|
315287
|
+
return /*#__PURE__*/React__default['default'].createElement(VirtualTable$1, _objectSpread(_objectSpread({}, props), {}, {
|
|
315288
|
+
fn: scrollToIndexRef
|
|
315289
|
+
}));
|
|
315290
|
+
} : null,
|
|
315291
|
+
body: Object.assign({
|
|
315292
|
+
row: function row(rowProps) {
|
|
315293
|
+
return sortOpen ? EditableSortRow(_objectSpread(_objectSpread({}, rowProps), {}, {
|
|
315294
|
+
virtual: virtual
|
|
315295
|
+
})) : EditableRow$1(_objectSpread(_objectSpread({}, rowProps), {}, {
|
|
315296
|
+
virtual: virtual
|
|
315297
|
+
}));
|
|
315298
|
+
},
|
|
315299
|
+
cell: props.shouldUpdate ? EditableCell$1 : MemoEditableCell
|
|
315300
|
+
}, sortOpen ? {
|
|
315301
|
+
wrapper: function wrapper(wrapperProps) {
|
|
315302
|
+
var _dataSourceRef$curren2, _tableWarpRef$current, _tableWarpRef$current2;
|
|
315303
|
+
|
|
315304
|
+
return DraggableContainer(_objectSpread(_objectSpread({}, wrapperProps), {}, {
|
|
315305
|
+
virtual: virtual,
|
|
315306
|
+
keys: (_dataSourceRef$curren2 = dataSourceRef.current) === null || _dataSourceRef$curren2 === void 0 ? void 0 : _dataSourceRef$curren2.map(function (item) {
|
|
315307
|
+
return item[_rowKey];
|
|
315308
|
+
}),
|
|
315309
|
+
options: dataSourceRef.current,
|
|
315310
|
+
rowKey: _rowKey,
|
|
315311
|
+
onSortEnd: onSortEnd,
|
|
315312
|
+
tableWidth: tableWarpRef === null || tableWarpRef === void 0 ? void 0 : (_tableWarpRef$current = tableWarpRef.current) === null || _tableWarpRef$current === void 0 ? void 0 : (_tableWarpRef$current2 = _tableWarpRef$current.getBoundingClientRect()) === null || _tableWarpRef$current2 === void 0 ? void 0 : _tableWarpRef$current2.width
|
|
315313
|
+
}));
|
|
315314
|
+
}
|
|
315315
|
+
} : virtual ? {
|
|
315316
|
+
wrapper: VirtualWrapper$1
|
|
315317
|
+
} : {}),
|
|
315318
|
+
header: {
|
|
315319
|
+
row: colSortOpen ? colDraggableContainer : null
|
|
315320
|
+
}
|
|
315321
|
+
},
|
|
315322
|
+
onRow: function onRow(record, index) {
|
|
315323
|
+
var _disabledDataSourceRo;
|
|
315324
|
+
|
|
315325
|
+
return {
|
|
315326
|
+
disabled: disabled || !!((_disabledDataSourceRo = disabledDataSourceRowKeys.current) === null || _disabledDataSourceRo === void 0 ? void 0 : _disabledDataSourceRo.includes(record[_rowKey])),
|
|
315327
|
+
dataKey: record[_rowKey],
|
|
315328
|
+
index: index,
|
|
315329
|
+
pushAllForm: pushAllForm
|
|
315330
|
+
};
|
|
315331
|
+
}
|
|
315332
|
+
}, resetProps));
|
|
315333
|
+
React.useEffect(function () {
|
|
315334
|
+
if (autoSizer) {
|
|
315335
|
+
var _tableWarpRef$current3;
|
|
315336
|
+
|
|
315337
|
+
var tableClient = tableWarpRef === null || tableWarpRef === void 0 ? void 0 : (_tableWarpRef$current3 = tableWarpRef.current) === null || _tableWarpRef$current3 === void 0 ? void 0 : _tableWarpRef$current3.getBoundingClientRect();
|
|
315338
|
+
var height = (tableClient === null || tableClient === void 0 ? void 0 : tableClient.height) || '100%';
|
|
315339
|
+
var TailorHeight = size === 'middle' ? 48 : 40;
|
|
315340
|
+
|
|
315341
|
+
if (isAdd) {
|
|
315342
|
+
TailorHeight += 48;
|
|
315343
|
+
}
|
|
315344
|
+
|
|
315345
|
+
if (props.summary) {
|
|
315346
|
+
TailorHeight += 48;
|
|
315347
|
+
}
|
|
315348
|
+
|
|
315349
|
+
if (props.pagination) {
|
|
315350
|
+
TailorHeight += 48;
|
|
315351
|
+
}
|
|
315352
|
+
|
|
315353
|
+
autoSizerRef.current = {
|
|
315354
|
+
width: tableClient === null || tableClient === void 0 ? void 0 : tableClient.width,
|
|
315355
|
+
height: typeof height === 'string' ? "calc(".concat(height, " - ").concat(TailorHeight, "px)") : height - TailorHeight
|
|
315356
|
+
};
|
|
315357
|
+
}
|
|
315358
|
+
}, []);
|
|
315359
|
+
|
|
314112
315360
|
if (colSortOpen) {
|
|
314113
315361
|
var _localRowSelectList$s;
|
|
314114
315362
|
|
|
314115
315363
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
314116
|
-
className: "lm_editTable_warpper"
|
|
314117
|
-
|
|
315364
|
+
className: "lm_editTable_warpper",
|
|
315365
|
+
ref: tableWarpRef
|
|
315366
|
+
}, /*#__PURE__*/React__default['default'].createElement(ConfigProvider$1, {
|
|
315367
|
+
renderEmpty: loading ? function () {
|
|
315368
|
+
return null;
|
|
315369
|
+
} : CustomizeRenderEmpty$1
|
|
315370
|
+
}, /*#__PURE__*/React__default['default'].createElement(DndContainer$2, {
|
|
315371
|
+
rowKey: _rowKey,
|
|
315372
|
+
options: resultColumns,
|
|
314118
315373
|
move: onColSortEnd
|
|
314119
|
-
}, /*#__PURE__*/React__default['default'].createElement(SortableBox$
|
|
315374
|
+
}, /*#__PURE__*/React__default['default'].createElement(SortableBox$1, {
|
|
314120
315375
|
items: columns.reduce(function (acc, item) {
|
|
314121
315376
|
return [].concat(_toConsumableArray$1(acc), [item.dataIndex]);
|
|
314122
315377
|
}, [])
|
|
314123
|
-
}, /*#__PURE__*/React__default['default'].createElement(Table$1, _objectSpread(_objectSpread({}, config), {}, {
|
|
315378
|
+
}, /*#__PURE__*/React__default['default'].createElement(Table$1, _objectSpread(_objectSpread({}, checkDataSourceIsEmpty(config.current, dataSourceRef.current, autoSizerRef.current)), {}, {
|
|
315379
|
+
loading: loading,
|
|
314124
315380
|
size: size || 'small',
|
|
314125
315381
|
columns: resultColumns,
|
|
314126
315382
|
rowClassName: "editable-row",
|
|
314127
315383
|
bordered: true,
|
|
314128
315384
|
pagination: false,
|
|
314129
|
-
// components={tableComponents}
|
|
314130
315385
|
rowSelection: !rowSelection ? undefined : _objectSpread(_objectSpread({
|
|
314131
315386
|
fixed: true,
|
|
314132
315387
|
type: 'checkbox',
|
|
@@ -314136,36 +315391,59 @@
|
|
|
314136
315391
|
return lodash.isObject(v) ? v[_rowKey] : v;
|
|
314137
315392
|
}),
|
|
314138
315393
|
onChange: function onChange(selectedRowKeys, selectedRows, info) {
|
|
314139
|
-
// editTableRowChange(selectedRowKeys, selectedRows, info)
|
|
314140
315394
|
setLocalRowSelectList(selectedRowKeys, selectedRows, info);
|
|
314141
315395
|
}
|
|
314142
315396
|
}),
|
|
314143
315397
|
dataSource: dataSource
|
|
314144
|
-
})))),
|
|
314145
|
-
|
|
314146
|
-
|
|
314147
|
-
|
|
315398
|
+
}))))), /*#__PURE__*/React__default['default'].createElement(BottomOpetateComponent, {
|
|
315399
|
+
disabled: disabled,
|
|
315400
|
+
isShowAddAction: isShowAddAction,
|
|
315401
|
+
recordCreatorProps: recordCreatorProps,
|
|
315402
|
+
handleAdd: handleAdd
|
|
315403
|
+
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
314148
315404
|
style: {
|
|
314149
|
-
|
|
315405
|
+
display: 'none'
|
|
314150
315406
|
}
|
|
314151
|
-
}, /*#__PURE__*/React__default['default'].createElement(
|
|
314152
|
-
|
|
314153
|
-
|
|
315407
|
+
}, /*#__PURE__*/React__default['default'].createElement(Form$4, {
|
|
315408
|
+
form: checkForm,
|
|
315409
|
+
component: false
|
|
315410
|
+
}, columns.map(function (item) {
|
|
315411
|
+
return /*#__PURE__*/React__default['default'].createElement(Form$4.Item, _objectSpread({
|
|
315412
|
+
noStyle: true,
|
|
315413
|
+
key: item.dataIndex,
|
|
315414
|
+
name: item.dataIndex
|
|
315415
|
+
}, (item === null || item === void 0 ? void 0 : item['formProps']) || {}), item.dataIndex || 'text');
|
|
315416
|
+
}))));
|
|
314154
315417
|
} // @ts-ignore
|
|
314155
315418
|
|
|
314156
315419
|
|
|
314157
315420
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
314158
|
-
className:
|
|
314159
|
-
|
|
315421
|
+
className: classnames('lm_editTable_warpper', autoSizer && 'lm_editable_autosize'),
|
|
315422
|
+
ref: tableWarpRef
|
|
315423
|
+
}, /*#__PURE__*/React__default['default'].createElement(ConfigProvider$1, {
|
|
315424
|
+
renderEmpty: loading ? function () {
|
|
315425
|
+
return null;
|
|
315426
|
+
} : CustomizeRenderEmpty$1
|
|
315427
|
+
}, /*#__PURE__*/React__default['default'].createElement(Table$1, _objectSpread(_objectSpread({}, checkDataSourceIsEmpty(config.current, dataSourceRef.current, autoSizerRef.current)), {}, {
|
|
314160
315428
|
size: size || 'small',
|
|
314161
315429
|
columns: resultColumns,
|
|
314162
315430
|
rowClassName: "editable-row",
|
|
314163
315431
|
bordered: true,
|
|
315432
|
+
loading: loading,
|
|
315433
|
+
style: autoSizer ? {
|
|
315434
|
+
height: isAdd ? "calc(100% - ".concat(48, "px)") : '100%'
|
|
315435
|
+
} : undefined,
|
|
314164
315436
|
pagination: false,
|
|
314165
315437
|
// components={tableComponents}
|
|
314166
315438
|
expandable: (resetProps === null || resetProps === void 0 ? void 0 : resetProps.expandable) || {
|
|
314167
315439
|
expandedRowKeys: expandedRowKeys,
|
|
314168
315440
|
fixed: true,
|
|
315441
|
+
// indentSize: 0,
|
|
315442
|
+
expandIconColumnIndex: checkExpandIconColumnIndex({
|
|
315443
|
+
rowSelection: rowSelection,
|
|
315444
|
+
sortOpen: sortOpen,
|
|
315445
|
+
indexCol: indexCol
|
|
315446
|
+
}) || 0,
|
|
314169
315447
|
onExpandedRowsChange: function onExpandedRowsChange(expandedRows) {
|
|
314170
315448
|
return setExpandedRowKeys(expandedRows);
|
|
314171
315449
|
}
|
|
@@ -314183,16 +315461,25 @@
|
|
|
314183
315461
|
}
|
|
314184
315462
|
}),
|
|
314185
315463
|
dataSource: dataSource
|
|
314186
|
-
})),
|
|
314187
|
-
|
|
314188
|
-
|
|
314189
|
-
|
|
314190
|
-
|
|
314191
|
-
|
|
314192
|
-
|
|
314193
|
-
|
|
314194
|
-
|
|
314195
|
-
}
|
|
315464
|
+
}))), /*#__PURE__*/React__default['default'].createElement(BottomOpetateComponent, {
|
|
315465
|
+
disabled: disabled,
|
|
315466
|
+
isShowAddAction: isShowAddAction,
|
|
315467
|
+
recordCreatorProps: recordCreatorProps,
|
|
315468
|
+
handleAdd: handleAdd
|
|
315469
|
+
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
315470
|
+
style: {
|
|
315471
|
+
display: 'none'
|
|
315472
|
+
}
|
|
315473
|
+
}, /*#__PURE__*/React__default['default'].createElement(Form$4, {
|
|
315474
|
+
form: checkForm,
|
|
315475
|
+
component: false
|
|
315476
|
+
}, columns.map(function (item) {
|
|
315477
|
+
return /*#__PURE__*/React__default['default'].createElement(Form$4.Item, _objectSpread({
|
|
315478
|
+
noStyle: true,
|
|
315479
|
+
key: item.dataIndex,
|
|
315480
|
+
name: item.dataIndex
|
|
315481
|
+
}, (item === null || item === void 0 ? void 0 : item['formProps']) || {}), item.dataIndex || 'text');
|
|
315482
|
+
}))));
|
|
314196
315483
|
});
|
|
314197
315484
|
var LmEditTable = /*#__PURE__*/React.memo(EditTable$1);
|
|
314198
315485
|
|
|
@@ -314868,7 +316155,7 @@
|
|
|
314868
316155
|
}
|
|
314869
316156
|
}
|
|
314870
316157
|
|
|
314871
|
-
var _excluded$
|
|
316158
|
+
var _excluded$2W = ["prefixCls", "getPopupContainer", "className", "placement", "size", "disabled", "bordered", "placeholder", "status"];
|
|
314872
316159
|
function generateRangePicker$1(generateConfig) {
|
|
314873
316160
|
var RangePicker$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
314874
316161
|
var customizePrefixCls = props.prefixCls,
|
|
@@ -314881,7 +316168,7 @@
|
|
|
314881
316168
|
bordered = _props$bordered === void 0 ? true : _props$bordered,
|
|
314882
316169
|
placeholder = props.placeholder,
|
|
314883
316170
|
customStatus = props.status,
|
|
314884
|
-
restProps = _objectWithoutProperties$1(props, _excluded$
|
|
316171
|
+
restProps = _objectWithoutProperties$1(props, _excluded$2W);
|
|
314885
316172
|
|
|
314886
316173
|
var innerRef = React.useRef(null);
|
|
314887
316174
|
|
|
@@ -314981,7 +316268,7 @@
|
|
|
314981
316268
|
return RangePicker$1;
|
|
314982
316269
|
}
|
|
314983
316270
|
|
|
314984
|
-
var _excluded$
|
|
316271
|
+
var _excluded$2X = ["prefixCls", "getPopupContainer", "className", "size", "bordered", "placement", "placeholder", "disabled", "status"];
|
|
314985
316272
|
function generatePicker$2(generateConfig) {
|
|
314986
316273
|
function getPicker(picker, displayName) {
|
|
314987
316274
|
var Picker$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
@@ -314995,7 +316282,7 @@
|
|
|
314995
316282
|
placeholder = props.placeholder,
|
|
314996
316283
|
customDisabled = props.disabled,
|
|
314997
316284
|
customStatus = props.status,
|
|
314998
|
-
restProps = _objectWithoutProperties$1(props, _excluded$
|
|
316285
|
+
restProps = _objectWithoutProperties$1(props, _excluded$2X);
|
|
314999
316286
|
|
|
315000
316287
|
warning$6(picker !== 'quarter', displayName, "DatePicker.".concat(displayName, " is legacy usage. Please use DatePicker[picker='").concat(picker, "'] directly."));
|
|
315001
316288
|
|
|
@@ -315203,63 +316490,6 @@
|
|
|
315203
316490
|
var DatePicker$1 = generatePicker$3(momentGenerateConfig);
|
|
315204
316491
|
DatePicker$1.AntdDatePicker = DatePicker;
|
|
315205
316492
|
|
|
315206
|
-
var getRenderPropValue$1 = function getRenderPropValue(propValue) {
|
|
315207
|
-
if (!propValue) {
|
|
315208
|
-
return null;
|
|
315209
|
-
}
|
|
315210
|
-
|
|
315211
|
-
var isRenderFunction = typeof propValue === 'function';
|
|
315212
|
-
|
|
315213
|
-
if (isRenderFunction) {
|
|
315214
|
-
return propValue();
|
|
315215
|
-
}
|
|
315216
|
-
|
|
315217
|
-
return propValue;
|
|
315218
|
-
};
|
|
315219
|
-
|
|
315220
|
-
var _excluded$2U = ["prefixCls", "title", "content", "_overlay"];
|
|
315221
|
-
var Popover$1 = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
315222
|
-
var customizePrefixCls = _ref.prefixCls,
|
|
315223
|
-
title = _ref.title,
|
|
315224
|
-
content = _ref.content,
|
|
315225
|
-
_overlay = _ref._overlay,
|
|
315226
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$2U);
|
|
315227
|
-
|
|
315228
|
-
var _React$useContext = React.useContext(ConfigContext),
|
|
315229
|
-
getPrefixCls = _React$useContext.getPrefixCls;
|
|
315230
|
-
|
|
315231
|
-
var getOverlay = function getOverlay(prefixCls) {
|
|
315232
|
-
if (!title && !content) return undefined;
|
|
315233
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, title && /*#__PURE__*/React.createElement("div", {
|
|
315234
|
-
className: "".concat(prefixCls, "-title")
|
|
315235
|
-
}, getRenderPropValue$1(title)), /*#__PURE__*/React.createElement("div", {
|
|
315236
|
-
className: "".concat(prefixCls, "-inner-content")
|
|
315237
|
-
}, getRenderPropValue$1(content)));
|
|
315238
|
-
};
|
|
315239
|
-
|
|
315240
|
-
var prefixCls = getPrefixCls('popover', customizePrefixCls);
|
|
315241
|
-
var rootPrefixCls = getPrefixCls();
|
|
315242
|
-
return /*#__PURE__*/React.createElement(Tooltip$4, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
315243
|
-
prefixCls: prefixCls,
|
|
315244
|
-
ref: ref,
|
|
315245
|
-
overlay: _overlay || getOverlay(prefixCls),
|
|
315246
|
-
transitionName: getTransitionName$9(rootPrefixCls, 'zoom-big', otherProps.transitionName)
|
|
315247
|
-
}));
|
|
315248
|
-
});
|
|
315249
|
-
|
|
315250
|
-
{
|
|
315251
|
-
Popover$1.displayName = 'Popover';
|
|
315252
|
-
}
|
|
315253
|
-
|
|
315254
|
-
Popover$1.defaultProps = {
|
|
315255
|
-
placement: 'top',
|
|
315256
|
-
trigger: 'hover',
|
|
315257
|
-
mouseEnterDelay: 0.1,
|
|
315258
|
-
mouseLeaveDelay: 0.1,
|
|
315259
|
-
overlayStyle: {}
|
|
315260
|
-
};
|
|
315261
|
-
Popover$1.AntdPopover = Popover;
|
|
315262
|
-
|
|
315263
316493
|
var CheckOutlined_1 = createCommonjsModule(function (module, exports) {
|
|
315264
316494
|
// This icon file is generated automatically.
|
|
315265
316495
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -316072,7 +317302,7 @@
|
|
|
316072
317302
|
|
|
316073
317303
|
var KeyCode$1 = /*@__PURE__*/getDefaultExportFromCjs(KeyCode_1);
|
|
316074
317304
|
|
|
316075
|
-
var _excluded$
|
|
317305
|
+
var _excluded$2Y = ["style", "noStyle", "disabled"];
|
|
316076
317306
|
var inlineStyle$1 = {
|
|
316077
317307
|
border: 0,
|
|
316078
317308
|
background: 'transparent',
|
|
@@ -316101,7 +317331,7 @@
|
|
|
316101
317331
|
var style = props.style,
|
|
316102
317332
|
noStyle = props.noStyle,
|
|
316103
317333
|
disabled = props.disabled,
|
|
316104
|
-
restProps = _objectWithoutProperties$1(props, _excluded$
|
|
317334
|
+
restProps = _objectWithoutProperties$1(props, _excluded$2Y);
|
|
316105
317335
|
|
|
316106
317336
|
var mergedStyle = {};
|
|
316107
317337
|
|
|
@@ -316312,7 +317542,7 @@
|
|
|
316312
317542
|
}, conditions);
|
|
316313
317543
|
});
|
|
316314
317544
|
|
|
316315
|
-
var _excluded$
|
|
317545
|
+
var _excluded$2Z = ["prefixCls", "component", "className", "aria-label", "setContentRef", "children"];
|
|
316316
317546
|
|
|
316317
317547
|
var Typography$2 = function Typography(_ref, ref) {
|
|
316318
317548
|
var customizePrefixCls = _ref.prefixCls,
|
|
@@ -316322,7 +317552,7 @@
|
|
|
316322
317552
|
ariaLabel = _ref['aria-label'],
|
|
316323
317553
|
setContentRef = _ref.setContentRef,
|
|
316324
317554
|
children = _ref.children,
|
|
316325
|
-
restProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
317555
|
+
restProps = _objectWithoutProperties$1(_ref, _excluded$2Z);
|
|
316326
317556
|
|
|
316327
317557
|
var _React$useContext = React.useContext(ConfigContext),
|
|
316328
317558
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
@@ -316565,7 +317795,7 @@
|
|
|
316565
317795
|
EllipsisTooltip$1.displayName = 'EllipsisTooltip';
|
|
316566
317796
|
}
|
|
316567
317797
|
|
|
316568
|
-
var _excluded$
|
|
317798
|
+
var _excluded$2_ = ["prefixCls", "className", "style", "type", "disabled", "children", "ellipsis", "editable", "copyable", "component", "title"];
|
|
316569
317799
|
|
|
316570
317800
|
function wrapperDecorations$1(_ref, content) {
|
|
316571
317801
|
var mark = _ref.mark,
|
|
@@ -316617,7 +317847,7 @@
|
|
|
316617
317847
|
copyable = props.copyable,
|
|
316618
317848
|
component = props.component,
|
|
316619
317849
|
title = props.title,
|
|
316620
|
-
restProps = _objectWithoutProperties$1(props, _excluded$
|
|
317850
|
+
restProps = _objectWithoutProperties$1(props, _excluded$2_);
|
|
316621
317851
|
|
|
316622
317852
|
var _React$useContext = React.useContext(ConfigContext),
|
|
316623
317853
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
@@ -317035,12 +318265,12 @@
|
|
|
317035
318265
|
});
|
|
317036
318266
|
});
|
|
317037
318267
|
|
|
317038
|
-
var _excluded$
|
|
318268
|
+
var _excluded$2$ = ["ellipsis", "rel"];
|
|
317039
318269
|
|
|
317040
318270
|
var Link$2 = function Link(_ref, ref) {
|
|
317041
318271
|
var ellipsis = _ref.ellipsis,
|
|
317042
318272
|
rel = _ref.rel,
|
|
317043
|
-
restProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
318273
|
+
restProps = _objectWithoutProperties$1(_ref, _excluded$2$);
|
|
317044
318274
|
|
|
317045
318275
|
warning$6(_typeof$1(ellipsis) !== 'object', 'Typography.Link', '`ellipsis` only supports boolean value.');
|
|
317046
318276
|
var baseRef = React.useRef(null);
|
|
@@ -317074,11 +318304,11 @@
|
|
|
317074
318304
|
|
|
317075
318305
|
var Paragraph$7 = /*#__PURE__*/React.forwardRef(Paragraph$6);
|
|
317076
318306
|
|
|
317077
|
-
var _excluded$
|
|
318307
|
+
var _excluded$30 = ["ellipsis"];
|
|
317078
318308
|
|
|
317079
318309
|
var Text$2 = function Text(_ref, ref) {
|
|
317080
318310
|
var ellipsis = _ref.ellipsis,
|
|
317081
|
-
restProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
318311
|
+
restProps = _objectWithoutProperties$1(_ref, _excluded$30);
|
|
317082
318312
|
|
|
317083
318313
|
var mergedEllipsis = React.useMemo(function () {
|
|
317084
318314
|
if (ellipsis && _typeof$1(ellipsis) === 'object') {
|
|
@@ -317098,13 +318328,13 @@
|
|
|
317098
318328
|
|
|
317099
318329
|
var Text$3 = /*#__PURE__*/React.forwardRef(Text$2);
|
|
317100
318330
|
|
|
317101
|
-
var _excluded$
|
|
318331
|
+
var _excluded$31 = ["level"];
|
|
317102
318332
|
var TITLE_ELE_LIST$1 = tupleNum$1(1, 2, 3, 4, 5);
|
|
317103
318333
|
|
|
317104
318334
|
var Title$4 = function Title(props, ref) {
|
|
317105
318335
|
var _props$level = props.level,
|
|
317106
318336
|
level = _props$level === void 0 ? 1 : _props$level,
|
|
317107
|
-
restProps = _objectWithoutProperties$1(props, _excluded$
|
|
318337
|
+
restProps = _objectWithoutProperties$1(props, _excluded$31);
|
|
317108
318338
|
|
|
317109
318339
|
var component;
|
|
317110
318340
|
|
|
@@ -317209,7 +318439,7 @@
|
|
|
317209
318439
|
RefAutoComplete$1.Option = Option;
|
|
317210
318440
|
RefAutoComplete$1.AntdAutoComplete = RefAutoComplete;
|
|
317211
318441
|
|
|
317212
|
-
var _excluded$
|
|
318442
|
+
var _excluded$32 = ["children", "treeData", "value", "defaultLabel", "disabled", "size"];
|
|
317213
318443
|
var CLMTreeSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
317214
318444
|
var children = props.children,
|
|
317215
318445
|
treeData = props.treeData,
|
|
@@ -317217,7 +318447,7 @@
|
|
|
317217
318447
|
defaultLabel = props.defaultLabel,
|
|
317218
318448
|
customDisabled = props.disabled,
|
|
317219
318449
|
customizeSize = props.size,
|
|
317220
|
-
resetProps = _objectWithoutProperties$1(props, _excluded$
|
|
318450
|
+
resetProps = _objectWithoutProperties$1(props, _excluded$32); // ===================== Disabled =====================
|
|
317221
318451
|
|
|
317222
318452
|
|
|
317223
318453
|
var disabled = React__default['default'].useContext(DisabledContext$1);
|
|
@@ -317352,7 +318582,7 @@
|
|
|
317352
318582
|
return ErrorBoundary;
|
|
317353
318583
|
}(React.Component);
|
|
317354
318584
|
|
|
317355
|
-
var _excluded$
|
|
318585
|
+
var _excluded$33 = ["description", "prefixCls", "message", "banner", "className", "style", "onMouseEnter", "onMouseLeave", "onClick", "afterClose", "showIcon", "closable", "closeText", "closeIcon", "action", "duration"];
|
|
317356
318586
|
var iconMapFilled$1 = {
|
|
317357
318587
|
success: CheckCircleFilled$2,
|
|
317358
318588
|
info: InfoCircleFilled$2,
|
|
@@ -317425,7 +318655,7 @@
|
|
|
317425
318655
|
closeIcon = _ref$closeIcon === void 0 ? /*#__PURE__*/React.createElement(CloseOutlined$2, null) : _ref$closeIcon,
|
|
317426
318656
|
action = _ref.action,
|
|
317427
318657
|
duration = _ref.duration,
|
|
317428
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
318658
|
+
props = _objectWithoutProperties$1(_ref, _excluded$33);
|
|
317429
318659
|
|
|
317430
318660
|
var _React$useState = React.useState(false),
|
|
317431
318661
|
_React$useState2 = _slicedToArray$1(_React$useState, 2),
|
|
@@ -317855,7 +319085,7 @@
|
|
|
317855
319085
|
};
|
|
317856
319086
|
};
|
|
317857
319087
|
|
|
317858
|
-
var _excluded$
|
|
319088
|
+
var _excluded$34 = ["className", "onUrge", "onDeleteComment"];
|
|
317859
319089
|
var prefixCls$b = 'lm_approval';
|
|
317860
319090
|
var colors = ['#36BCF1', '#AE86DC', '#8BD248', '#F5A173'];
|
|
317861
319091
|
var cacheColorMap = new Map();
|
|
@@ -318263,7 +319493,7 @@
|
|
|
318263
319493
|
onUrge = _props$onUrge === void 0 ? function () {} : _props$onUrge,
|
|
318264
319494
|
_props$onDeleteCommen2 = props.onDeleteComment,
|
|
318265
319495
|
onDeleteComment = _props$onDeleteCommen2 === void 0 ? function () {} : _props$onDeleteCommen2,
|
|
318266
|
-
others = _objectWithoutProperties$1(props, _excluded$
|
|
319496
|
+
others = _objectWithoutProperties$1(props, _excluded$34);
|
|
318267
319497
|
|
|
318268
319498
|
var _useState = React.useState(false),
|
|
318269
319499
|
_useState2 = _slicedToArray$1(_useState, 2),
|
|
@@ -320054,9 +321284,9 @@
|
|
|
320054
321284
|
return nodes;
|
|
320055
321285
|
}
|
|
320056
321286
|
|
|
320057
|
-
var _excluded$
|
|
321287
|
+
var _excluded$35 = ["defaultExpandAll", "defaultExpandParent", "defaultExpandedKeys"],
|
|
320058
321288
|
_excluded2$J = ["prefixCls", "className"];
|
|
320059
|
-
var ConfigContext$
|
|
321289
|
+
var ConfigContext$8 = ConfigProvider$1.ConfigContext;
|
|
320060
321290
|
|
|
320061
321291
|
function getIcon$1(props) {
|
|
320062
321292
|
var isLeaf = props.isLeaf,
|
|
@@ -320079,7 +321309,7 @@
|
|
|
320079
321309
|
var defaultExpandAll = _ref2.defaultExpandAll,
|
|
320080
321310
|
defaultExpandParent = _ref2.defaultExpandParent,
|
|
320081
321311
|
defaultExpandedKeys = _ref2.defaultExpandedKeys,
|
|
320082
|
-
props = _objectWithoutProperties$1(_ref2, _excluded$
|
|
321312
|
+
props = _objectWithoutProperties$1(_ref2, _excluded$35);
|
|
320083
321313
|
|
|
320084
321314
|
// Shift click usage
|
|
320085
321315
|
var lastSelectedKey = React.useRef();
|
|
@@ -320190,7 +321420,7 @@
|
|
|
320190
321420
|
}
|
|
320191
321421
|
};
|
|
320192
321422
|
|
|
320193
|
-
var _React$useContext = React.useContext(ConfigContext$
|
|
321423
|
+
var _React$useContext = React.useContext(ConfigContext$8),
|
|
320194
321424
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
320195
321425
|
direction = _React$useContext.direction;
|
|
320196
321426
|
|
|
@@ -320497,11 +321727,11 @@
|
|
|
320497
321727
|
});
|
|
320498
321728
|
}
|
|
320499
321729
|
|
|
320500
|
-
var ConfigContext$
|
|
321730
|
+
var ConfigContext$9 = ConfigProvider$1.ConfigContext;
|
|
320501
321731
|
var Tree$2 = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
320502
321732
|
var _classNames;
|
|
320503
321733
|
|
|
320504
|
-
var _React$useContext = React.useContext(ConfigContext$
|
|
321734
|
+
var _React$useContext = React.useContext(ConfigContext$9),
|
|
320505
321735
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
320506
321736
|
direction = _React$useContext.direction,
|
|
320507
321737
|
virtual = _React$useContext.virtual;
|
|
@@ -320577,11 +321807,11 @@
|
|
|
320577
321807
|
blockNode: false
|
|
320578
321808
|
};
|
|
320579
321809
|
|
|
320580
|
-
var _excluded$
|
|
321810
|
+
var _excluded$36 = ["className"];
|
|
320581
321811
|
var prefixCls$c = 'lm_tree';
|
|
320582
321812
|
var LmTree = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
320583
321813
|
var className = props.className,
|
|
320584
|
-
rest = _objectWithoutProperties$1(props, _excluded$
|
|
321814
|
+
rest = _objectWithoutProperties$1(props, _excluded$36);
|
|
320585
321815
|
|
|
320586
321816
|
return /*#__PURE__*/React__default['default'].createElement(Tree$2, _objectSpread(_objectSpread({
|
|
320587
321817
|
ref: ref
|
|
@@ -321640,7 +322870,7 @@
|
|
|
321640
322870
|
}, unitNodes);
|
|
321641
322871
|
}
|
|
321642
322872
|
|
|
321643
|
-
var _excluded$
|
|
322873
|
+
var _excluded$37 = ["prefixCls", "count", "className", "motionClassName", "style", "title", "show", "component", "children"];
|
|
321644
322874
|
|
|
321645
322875
|
var ScrollNumber$1 = function ScrollNumber(_ref) {
|
|
321646
322876
|
var customizePrefixCls = _ref.prefixCls,
|
|
@@ -321653,7 +322883,7 @@
|
|
|
321653
322883
|
_ref$component = _ref.component,
|
|
321654
322884
|
component = _ref$component === void 0 ? 'sup' : _ref$component,
|
|
321655
322885
|
children = _ref.children,
|
|
321656
|
-
restProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
322886
|
+
restProps = _objectWithoutProperties$1(_ref, _excluded$37);
|
|
321657
322887
|
|
|
321658
322888
|
var _React$useContext = React.useContext(ConfigContext$1),
|
|
321659
322889
|
getPrefixCls = _React$useContext.getPrefixCls;
|
|
@@ -321703,7 +322933,7 @@
|
|
|
321703
322933
|
return /*#__PURE__*/React.createElement(component, newProps, numberNodes);
|
|
321704
322934
|
};
|
|
321705
322935
|
|
|
321706
|
-
var _excluded$
|
|
322936
|
+
var _excluded$38 = ["prefixCls", "scrollNumberPrefixCls", "children", "status", "text", "color", "count", "overflowCount", "dot", "size", "title", "offset", "style", "className", "showZero"];
|
|
321707
322937
|
|
|
321708
322938
|
var Badge$1 = function Badge(_ref) {
|
|
321709
322939
|
var _classNames, _classNames2;
|
|
@@ -321728,7 +322958,7 @@
|
|
|
321728
322958
|
className = _ref.className,
|
|
321729
322959
|
_ref$showZero = _ref.showZero,
|
|
321730
322960
|
showZero = _ref$showZero === void 0 ? false : _ref$showZero,
|
|
321731
|
-
restProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
322961
|
+
restProps = _objectWithoutProperties$1(_ref, _excluded$38);
|
|
321732
322962
|
|
|
321733
322963
|
var _React$useContext = React.useContext(ConfigContext$1),
|
|
321734
322964
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
@@ -321863,7 +323093,7 @@
|
|
|
321863
323093
|
|
|
321864
323094
|
Badge$1.Ribbon = Ribbon$1;
|
|
321865
323095
|
|
|
321866
|
-
var _excluded$
|
|
323096
|
+
var _excluded$39 = ["prefixCls", "type", "orientation", "orientationMargin", "className", "children", "dashed", "plain"];
|
|
321867
323097
|
|
|
321868
323098
|
var Divider$5 = function Divider(props) {
|
|
321869
323099
|
var _classNames;
|
|
@@ -321882,7 +323112,7 @@
|
|
|
321882
323112
|
children = props.children,
|
|
321883
323113
|
dashed = props.dashed,
|
|
321884
323114
|
plain = props.plain,
|
|
321885
|
-
restProps = _objectWithoutProperties$1(props, _excluded$
|
|
323115
|
+
restProps = _objectWithoutProperties$1(props, _excluded$39);
|
|
321886
323116
|
|
|
321887
323117
|
var prefixCls = getPrefixCls('divider', customizePrefixCls);
|
|
321888
323118
|
var orientationPrefix = orientation.length > 0 ? "-".concat(orientation) : orientation;
|
|
@@ -322268,7 +323498,7 @@
|
|
|
322268
323498
|
}
|
|
322269
323499
|
}; // 状态管理操作
|
|
322270
323500
|
|
|
322271
|
-
var reducer$
|
|
323501
|
+
var reducer$6 = function reducer(state, action) {
|
|
322272
323502
|
var resize = action.resize,
|
|
322273
323503
|
transform = action.transform,
|
|
322274
323504
|
current = action.current;
|
|
@@ -322296,7 +323526,7 @@
|
|
|
322296
323526
|
}
|
|
322297
323527
|
}; // 仅在初始化时触发一次
|
|
322298
323528
|
|
|
322299
|
-
var initialState$
|
|
323529
|
+
var initialState$4 = function initialState(props) {
|
|
322300
323530
|
var initialIndex = props.initialIndex;
|
|
322301
323531
|
return _objectSpread(_objectSpread({}, defaultState), {}, {
|
|
322302
323532
|
currentIndex: initialIndex
|
|
@@ -322647,10 +323877,10 @@
|
|
|
322647
323877
|
var Root = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
322648
323878
|
var bodyRef = React.useRef(null);
|
|
322649
323879
|
var initialState = React.useMemo(function () {
|
|
322650
|
-
return initialState$
|
|
323880
|
+
return initialState$4(props);
|
|
322651
323881
|
}, []);
|
|
322652
323882
|
|
|
322653
|
-
var _useReducer = React.useReducer(reducer$
|
|
323883
|
+
var _useReducer = React.useReducer(reducer$6, initialState),
|
|
322654
323884
|
_useReducer2 = _slicedToArray$1(_useReducer, 2),
|
|
322655
323885
|
state = _useReducer2[0],
|
|
322656
323886
|
dispatch = _useReducer2[1]; // 获取核心Methods
|
|
@@ -322716,7 +323946,7 @@
|
|
|
322716
323946
|
|
|
322717
323947
|
}; // 状态管理操作
|
|
322718
323948
|
|
|
322719
|
-
var reducer$
|
|
323949
|
+
var reducer$7 = function reducer(state, action) {
|
|
322720
323950
|
var result = action.result,
|
|
322721
323951
|
init = action.init;
|
|
322722
323952
|
|
|
@@ -322732,7 +323962,7 @@
|
|
|
322732
323962
|
}
|
|
322733
323963
|
}; // 仅在初始化时触发一次
|
|
322734
323964
|
|
|
322735
|
-
var initialState$
|
|
323965
|
+
var initialState$5 = function initialState() {
|
|
322736
323966
|
return _objectSpread({}, defaultState$1);
|
|
322737
323967
|
};
|
|
322738
323968
|
|
|
@@ -324406,14 +325636,14 @@
|
|
|
324406
325636
|
|
|
324407
325637
|
var Body$1 = /*#__PURE__*/React__default['default'].memo(Index$b);
|
|
324408
325638
|
|
|
324409
|
-
var _excluded$
|
|
325639
|
+
var _excluded$3a = ["value", "onChange", "leftIcon", "rightIcon"];
|
|
324410
325640
|
|
|
324411
325641
|
var ResetSlider = function ResetSlider(_ref) {
|
|
324412
325642
|
var value = _ref.value,
|
|
324413
325643
|
_onChange = _ref.onChange,
|
|
324414
325644
|
leftIcon = _ref.leftIcon,
|
|
324415
325645
|
rightIcon = _ref.rightIcon,
|
|
324416
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
325646
|
+
props = _objectWithoutProperties$1(_ref, _excluded$3a);
|
|
324417
325647
|
|
|
324418
325648
|
// 减
|
|
324419
325649
|
var decrement = function decrement() {
|
|
@@ -324567,10 +325797,10 @@
|
|
|
324567
325797
|
|
|
324568
325798
|
var LmBox = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
324569
325799
|
var initialState = React.useMemo(function () {
|
|
324570
|
-
return initialState$
|
|
325800
|
+
return initialState$5();
|
|
324571
325801
|
}, []);
|
|
324572
325802
|
|
|
324573
|
-
var _useReducer = React.useReducer(reducer$
|
|
325803
|
+
var _useReducer = React.useReducer(reducer$7, initialState),
|
|
324574
325804
|
_useReducer2 = _slicedToArray$1(_useReducer, 2),
|
|
324575
325805
|
state = _useReducer2[0],
|
|
324576
325806
|
dispatch = _useReducer2[1]; // 获取核心Methods
|
|
@@ -324633,7 +325863,7 @@
|
|
|
324633
325863
|
|
|
324634
325864
|
}; // 状态管理操作
|
|
324635
325865
|
|
|
324636
|
-
var reducer$
|
|
325866
|
+
var reducer$8 = function reducer(state, action) {
|
|
324637
325867
|
var transform = action.transform,
|
|
324638
325868
|
current = action.current,
|
|
324639
325869
|
visible = action.visible;
|
|
@@ -324666,7 +325896,7 @@
|
|
|
324666
325896
|
}
|
|
324667
325897
|
}; // 仅在初始化时触发一次
|
|
324668
325898
|
|
|
324669
|
-
var initialState$
|
|
325899
|
+
var initialState$6 = function initialState(props) {
|
|
324670
325900
|
var initialIndex = props.initialIndex;
|
|
324671
325901
|
return _objectSpread(_objectSpread({}, defaultState$2), {}, {
|
|
324672
325902
|
currentIndex: initialIndex
|
|
@@ -325056,10 +326286,10 @@
|
|
|
325056
326286
|
var LmImageViewerRoot = function LmImageViewerRoot(props, ref) {
|
|
325057
326287
|
var previewRef = React.useRef(null);
|
|
325058
326288
|
var initialState = React.useMemo(function () {
|
|
325059
|
-
return initialState$
|
|
326289
|
+
return initialState$6(props);
|
|
325060
326290
|
}, []);
|
|
325061
326291
|
|
|
325062
|
-
var _useReducer = React.useReducer(reducer$
|
|
326292
|
+
var _useReducer = React.useReducer(reducer$8, initialState),
|
|
325063
326293
|
_useReducer2 = _slicedToArray$1(_useReducer, 2),
|
|
325064
326294
|
state = _useReducer2[0],
|
|
325065
326295
|
dispatch = _useReducer2[1]; // 获取核心Methods
|
|
@@ -325114,7 +326344,7 @@
|
|
|
325114
326344
|
|
|
325115
326345
|
var LmImageViewer$1 = /*#__PURE__*/React.forwardRef(LmImageViewer);
|
|
325116
326346
|
|
|
325117
|
-
var SortableItem$
|
|
326347
|
+
var SortableItem$4 = function SortableItem(_ref) {
|
|
325118
326348
|
var index = _ref.index,
|
|
325119
326349
|
item = _ref.item,
|
|
325120
326350
|
instance = _ref.instance;
|
|
@@ -325150,7 +326380,7 @@
|
|
|
325150
326380
|
})));
|
|
325151
326381
|
};
|
|
325152
326382
|
|
|
325153
|
-
var SortableItem$
|
|
326383
|
+
var SortableItem$5 = /*#__PURE__*/React__default['default'].memo(SortableItem$4);
|
|
325154
326384
|
|
|
325155
326385
|
var SortableBox$3 = function SortableBox(_ref) {
|
|
325156
326386
|
var instance = _ref.instance;
|
|
@@ -325161,7 +326391,7 @@
|
|
|
325161
326391
|
items: items,
|
|
325162
326392
|
strategy: rectSortingStrategy
|
|
325163
326393
|
}, options === null || options === void 0 ? void 0 : options.map(function (item, idx) {
|
|
325164
|
-
return /*#__PURE__*/React__default['default'].createElement(SortableItem$
|
|
326394
|
+
return /*#__PURE__*/React__default['default'].createElement(SortableItem$5, {
|
|
325165
326395
|
instance: instance,
|
|
325166
326396
|
index: idx,
|
|
325167
326397
|
key: item[rowKey] || idx,
|
|
@@ -325172,7 +326402,7 @@
|
|
|
325172
326402
|
|
|
325173
326403
|
var SortableBox$4 = /*#__PURE__*/React__default['default'].memo(SortableBox$3);
|
|
325174
326404
|
|
|
325175
|
-
var DragOver = /*#__PURE__*/React__default['default'].memo(function (_ref) {
|
|
326405
|
+
var DragOver$1 = /*#__PURE__*/React__default['default'].memo(function (_ref) {
|
|
325176
326406
|
var instance = _ref.instance;
|
|
325177
326407
|
var isDragging = instance.isDragging,
|
|
325178
326408
|
activeId = instance.activeId,
|
|
@@ -325194,7 +326424,7 @@
|
|
|
325194
326424
|
*/
|
|
325195
326425
|
// 可拖拽容器
|
|
325196
326426
|
|
|
325197
|
-
var DndContainer$
|
|
326427
|
+
var DndContainer$5 = function DndContainer(_ref2) {
|
|
325198
326428
|
var options = _ref2.options,
|
|
325199
326429
|
rowKey = _ref2.rowKey,
|
|
325200
326430
|
children = _ref2.children,
|
|
@@ -325281,7 +326511,7 @@
|
|
|
325281
326511
|
collisionDetection: closestCenter
|
|
325282
326512
|
}, /*#__PURE__*/React__default['default'].createElement(SortableBox$4, {
|
|
325283
326513
|
instance: instance
|
|
325284
|
-
}), /*#__PURE__*/React__default['default'].createElement(DragOver, {
|
|
326514
|
+
}), /*#__PURE__*/React__default['default'].createElement(DragOver$1, {
|
|
325285
326515
|
instance: instance
|
|
325286
326516
|
}));
|
|
325287
326517
|
};
|
|
@@ -325291,7 +326521,7 @@
|
|
|
325291
326521
|
React.useImperativeHandle(ref, function () {
|
|
325292
326522
|
return {};
|
|
325293
326523
|
});
|
|
325294
|
-
return /*#__PURE__*/React__default['default'].createElement(DndContainer$
|
|
326524
|
+
return /*#__PURE__*/React__default['default'].createElement(DndContainer$5, _objectSpread({}, props));
|
|
325295
326525
|
};
|
|
325296
326526
|
|
|
325297
326527
|
var Root$2 = /*#__PURE__*/React.forwardRef(Root$1);
|