@lemon-fe/kits 1.5.3 → 1.5.5
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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ButtonProps } from 'antd';
|
|
1
2
|
import { type ReactElement } from 'react';
|
|
2
3
|
import type { Key, ReactNode } from 'react';
|
|
3
4
|
import type { ColType, DataGridProps } from '@lemon-fe/components';
|
|
@@ -125,6 +126,22 @@ interface Props<RecordType extends Record<string, any> = Record<string, any>, Re
|
|
|
125
126
|
* 处理结果列配置
|
|
126
127
|
*/
|
|
127
128
|
resultColType?: Partial<ColType<RecordType>>;
|
|
129
|
+
/**
|
|
130
|
+
* @description 开始执行/继续执行按钮属性
|
|
131
|
+
*/
|
|
132
|
+
executeActionProps?: ButtonProps;
|
|
133
|
+
/**
|
|
134
|
+
* 开始执行按钮替换文案
|
|
135
|
+
*/
|
|
136
|
+
executeStartExecText?: string;
|
|
137
|
+
/**
|
|
138
|
+
* 继续执行按钮替换文案
|
|
139
|
+
*/
|
|
140
|
+
executeContinueText?: string;
|
|
141
|
+
/**
|
|
142
|
+
* 暂停按钮属性
|
|
143
|
+
*/
|
|
144
|
+
suspendActionProps?: ButtonProps;
|
|
128
145
|
}
|
|
129
146
|
export default function useBatchOperate<RecordType extends Record<string, any> = Record<string, any>, ResultType = any, ParamsType = any>(options: Props<RecordType, ResultType, ParamsType>): {
|
|
130
147
|
run: (rows: RecordType[], otherOpts?: Partial<Props<RecordType, ResultType, ParamsType>>) => void;
|
|
@@ -671,7 +671,11 @@ var BatchOperate = /*#__PURE__*/function (_Component) {
|
|
|
671
671
|
_this$props4$footer = _this$props4.footer,
|
|
672
672
|
footer = _this$props4$footer === void 0 ? null : _this$props4$footer,
|
|
673
673
|
sideBar = _this$props4.sideBar,
|
|
674
|
-
customColumnPanelStorage = _this$props4.customColumnPanelStorage
|
|
674
|
+
customColumnPanelStorage = _this$props4.customColumnPanelStorage,
|
|
675
|
+
executeActionProps = _this$props4.executeActionProps,
|
|
676
|
+
executeContinueText = _this$props4.executeContinueText,
|
|
677
|
+
executeStartExecText = _this$props4.executeStartExecText,
|
|
678
|
+
suspendActionProps = _this$props4.suspendActionProps;
|
|
675
679
|
var _this$state = this.state,
|
|
676
680
|
results = _this$state.results,
|
|
677
681
|
open = _this$state.open,
|
|
@@ -683,6 +687,7 @@ var BatchOperate = /*#__PURE__*/function (_Component) {
|
|
|
683
687
|
continueText = _this$locale3.continueText,
|
|
684
688
|
startExecText = _this$locale3.startExecText,
|
|
685
689
|
suspendExecText = _this$locale3.suspendExecText;
|
|
690
|
+
var executeActionText = this.queue.size > 0 ? executeContinueText || continueText : executeStartExecText || startExecText;
|
|
686
691
|
return /*#__PURE__*/_jsx(Modal, {
|
|
687
692
|
title: modalTitle,
|
|
688
693
|
width: 1000,
|
|
@@ -721,9 +726,9 @@ var BatchOperate = /*#__PURE__*/function (_Component) {
|
|
|
721
726
|
children: [/*#__PURE__*/_jsx("span", {
|
|
722
727
|
children: "".concat(detailsText).concat(results.size > 0 ? "(".concat(results.size, "/").concat(data.length, ")") : '')
|
|
723
728
|
}), /*#__PURE__*/_jsx(Actions, {
|
|
724
|
-
actions: [paused ? {
|
|
729
|
+
actions: [paused ? _objectSpread(_objectSpread({}, executeActionProps), {}, {
|
|
725
730
|
disabled: data.length <= 0 || results.size >= data.length,
|
|
726
|
-
text:
|
|
731
|
+
text: executeActionText,
|
|
727
732
|
onClick: function onClick() {
|
|
728
733
|
if (_this6.queue.size === 0) {
|
|
729
734
|
_this6.queue.addAll(_this6.state.data.map(function (row) {
|
|
@@ -737,7 +742,7 @@ var BatchOperate = /*#__PURE__*/function (_Component) {
|
|
|
737
742
|
paused: false
|
|
738
743
|
});
|
|
739
744
|
}
|
|
740
|
-
} : {
|
|
745
|
+
}) : _objectSpread(_objectSpread({}, suspendActionProps), {}, {
|
|
741
746
|
disabled: data.length <= 0,
|
|
742
747
|
text: suspendExecText,
|
|
743
748
|
onClick: function onClick() {
|
|
@@ -746,7 +751,7 @@ var BatchOperate = /*#__PURE__*/function (_Component) {
|
|
|
746
751
|
paused: true
|
|
747
752
|
});
|
|
748
753
|
}
|
|
749
|
-
}]
|
|
754
|
+
})]
|
|
750
755
|
})]
|
|
751
756
|
}),
|
|
752
757
|
children: /*#__PURE__*/_jsx(Section, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lemon-fe/kits",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.5",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "ISC",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"registry": "https://registry.npmjs.org"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "a9f97cb2b47c02f4d8deed3d9737298c215d88ba"
|
|
51
51
|
}
|