@lemon-fe/kits 1.0.0-65 → 1.0.0-67
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.
|
@@ -82,8 +82,23 @@ export default /*#__PURE__*/forwardRef(function NumberEditor(props, ref) {
|
|
|
82
82
|
};
|
|
83
83
|
});
|
|
84
84
|
var text = useMemo(function () {
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
if (value === '' || value === null) {
|
|
86
|
+
return '';
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
var val;
|
|
90
|
+
|
|
91
|
+
if (typeof value !== 'number') {
|
|
92
|
+
val = +value;
|
|
93
|
+
} else {
|
|
94
|
+
val = value;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (precision !== undefined) {
|
|
98
|
+
return Math.round(val * Math.pow(10, precision)) / Math.pow(10, precision);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return val;
|
|
87
102
|
}, [value, precision]);
|
|
88
103
|
return /*#__PURE__*/React.createElement(EditorWrapper, {
|
|
89
104
|
onKeyDown: function onKeyDown(e) {
|
|
@@ -98,6 +113,7 @@ export default /*#__PURE__*/forwardRef(function NumberEditor(props, ref) {
|
|
|
98
113
|
ref: elm,
|
|
99
114
|
value: text,
|
|
100
115
|
onChange: function onChange(event) {
|
|
116
|
+
console.log(event.target.value);
|
|
101
117
|
dirty.current = true;
|
|
102
118
|
setValue(event.target.value);
|
|
103
119
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Key } from 'react';
|
|
2
2
|
import type { ColType, DataGridProps } from "../../components/DataGrid/typings";
|
|
3
3
|
declare type Result = void | string | Error | symbol;
|
|
4
|
-
export default function useBatchOperate<RecordType = Record<string, any>>(options: {
|
|
4
|
+
export default function useBatchOperate<RecordType extends Record<string, any> = Record<string, any>>(options: {
|
|
5
5
|
modalTitle: string;
|
|
6
6
|
handler: (record: RecordType) => Promise<string | void>;
|
|
7
7
|
columns?: ColType<RecordType>[];
|
|
@@ -221,7 +221,7 @@ export default function useBatchOperate(options) {
|
|
|
221
221
|
var mCols = useMemo(function () {
|
|
222
222
|
var cols = columns ? _toConsumableArray(columns) : [{
|
|
223
223
|
title: '编号',
|
|
224
|
-
|
|
224
|
+
colId: 'id',
|
|
225
225
|
dataIndex: typeof rowKey === 'string' ? rowKey : undefined,
|
|
226
226
|
render: function render(_1, _2, _3, _ref3) {
|
|
227
227
|
var node = _ref3.node;
|
|
@@ -230,7 +230,7 @@ export default function useBatchOperate(options) {
|
|
|
230
230
|
}];
|
|
231
231
|
cols.unshift({
|
|
232
232
|
title: '',
|
|
233
|
-
|
|
233
|
+
colId: 'delete',
|
|
234
234
|
width: 32,
|
|
235
235
|
render: function render(_1, _2, index, _ref4) {
|
|
236
236
|
var context = _ref4.context,
|
|
@@ -313,7 +313,7 @@ export default function useBatchOperate(options) {
|
|
|
313
313
|
}, [columns, paused, active, results]);
|
|
314
314
|
var node = /*#__PURE__*/React.createElement(Modal, {
|
|
315
315
|
title: modalTitle,
|
|
316
|
-
|
|
316
|
+
open: visible,
|
|
317
317
|
width: 896,
|
|
318
318
|
centered: true,
|
|
319
319
|
onCancel: handleClose,
|