ls-pro-common 3.0.16 → 3.0.18
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/common.css +25 -21
- package/dist/common.js +1 -1
- package/dist/common.min.css +25 -21
- package/dist/common.min.js +1 -1
- package/es/components/InputTable.js +32 -24
- package/es/components/antd-custom.less +22 -17
- package/lib/components/InputTable.js +32 -24
- package/lib/components/antd-custom.less +22 -17
- package/package.json +2 -2
- package/CHANGELOG.md +0 -746
|
@@ -23,6 +23,7 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
23
23
|
//@ts-ignore
|
|
24
24
|
var _useContext = useContext(ProFormContext),
|
|
25
25
|
formRef = _useContext.formRef;
|
|
26
|
+
// const inputRef=useRef<any>();
|
|
26
27
|
var tableRef = useRef();
|
|
27
28
|
var selectRowRef = useRef([]);
|
|
28
29
|
var _useState = useState(false),
|
|
@@ -79,6 +80,7 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
79
80
|
arrowPointAtCenter = _prop$arrowPointAtCen === void 0 ? true : _prop$arrowPointAtCen,
|
|
80
81
|
rowKey = prop.rowKey,
|
|
81
82
|
rest = _objectWithoutProperties(prop, _excluded);
|
|
83
|
+
var tableKey = (tableConfig === null || tableConfig === void 0 ? void 0 : tableConfig.rowKey) || 'id';
|
|
82
84
|
//显示输入框绑定的name,如果不设置textName,设置为$name__text
|
|
83
85
|
var textNameProp = useMemo(function () {
|
|
84
86
|
return textName || name + '__text';
|
|
@@ -139,6 +141,7 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
139
141
|
if (afterLoad) {
|
|
140
142
|
afterLoad(rows);
|
|
141
143
|
}
|
|
144
|
+
//todo 加载数据时自动勾选
|
|
142
145
|
return _context.abrupt("return", {
|
|
143
146
|
data: rows,
|
|
144
147
|
total: Number(result.total || 0),
|
|
@@ -174,14 +177,16 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
174
177
|
if (txt) {
|
|
175
178
|
setText(txt);
|
|
176
179
|
} else if (val) {
|
|
180
|
+
var _formRef$current4, _formRef$current4$set;
|
|
177
181
|
setText(val);
|
|
182
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 ? void 0 : (_formRef$current4$set = _formRef$current4.setFieldsValue) === null || _formRef$current4$set === void 0 ? void 0 : _formRef$current4$set.call(_formRef$current4, _defineProperty({}, textNameProp, val));
|
|
178
183
|
}
|
|
179
184
|
}, 0);
|
|
180
185
|
}, [rowKey]);
|
|
181
186
|
// 处理返回数据
|
|
182
187
|
var handleValue = function handleValue(row) {
|
|
183
|
-
var _formRef$
|
|
184
|
-
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$
|
|
188
|
+
var _formRef$current5, _formRef$current5$get;
|
|
189
|
+
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 ? void 0 : (_formRef$current5$get = _formRef$current5.getFieldsValue) === null || _formRef$current5$get === void 0 ? void 0 : _formRef$current5$get.call(_formRef$current5)) || {};
|
|
185
190
|
if (rowKey) {
|
|
186
191
|
formValue = formValue[rowKey] || {};
|
|
187
192
|
}
|
|
@@ -221,11 +226,11 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
221
226
|
setText(txt);
|
|
222
227
|
setVisible(false);
|
|
223
228
|
if (rowKey) {
|
|
224
|
-
var _formRef$current5, _formRef$current5$set;
|
|
225
|
-
formRef === null || formRef === void 0 ? void 0 : (_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 ? void 0 : (_formRef$current5$set = _formRef$current5.setFieldsValue) === null || _formRef$current5$set === void 0 ? void 0 : _formRef$current5$set.call(_formRef$current5, _defineProperty({}, rowKey, formValue));
|
|
226
|
-
} else {
|
|
227
229
|
var _formRef$current6, _formRef$current6$set;
|
|
228
|
-
formRef === null || formRef === void 0 ? void 0 : (_formRef$current6 = formRef.current) === null || _formRef$current6 === void 0 ? void 0 : (_formRef$current6$set = _formRef$current6.setFieldsValue) === null || _formRef$current6$set === void 0 ? void 0 : _formRef$current6$set.call(_formRef$current6,
|
|
230
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current6 = formRef.current) === null || _formRef$current6 === void 0 ? void 0 : (_formRef$current6$set = _formRef$current6.setFieldsValue) === null || _formRef$current6$set === void 0 ? void 0 : _formRef$current6$set.call(_formRef$current6, _defineProperty({}, rowKey, formValue));
|
|
231
|
+
} else {
|
|
232
|
+
var _formRef$current7, _formRef$current7$set;
|
|
233
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current7 = formRef.current) === null || _formRef$current7 === void 0 ? void 0 : (_formRef$current7$set = _formRef$current7.setFieldsValue) === null || _formRef$current7$set === void 0 ? void 0 : _formRef$current7$set.call(_formRef$current7, _objectSpread({}, formValue));
|
|
229
234
|
}
|
|
230
235
|
onSelectChange === null || onSelectChange === void 0 ? void 0 : onSelectChange(row, formRef);
|
|
231
236
|
};
|
|
@@ -256,8 +261,8 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
256
261
|
};
|
|
257
262
|
//直接输入不回车,value 和 text 为同一个值
|
|
258
263
|
var onInput = function onInput(e) {
|
|
259
|
-
var _formRef$
|
|
260
|
-
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$
|
|
264
|
+
var _formRef$current8, _formRef$current8$get;
|
|
265
|
+
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current8 = formRef.current) === null || _formRef$current8 === void 0 ? void 0 : (_formRef$current8$get = _formRef$current8.getFieldsValue) === null || _formRef$current8$get === void 0 ? void 0 : _formRef$current8$get.call(_formRef$current8)) || {};
|
|
261
266
|
if (rowKey) {
|
|
262
267
|
formValue = formValue[rowKey] || {};
|
|
263
268
|
}
|
|
@@ -266,30 +271,30 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
266
271
|
formValue[textNameProp] = val;
|
|
267
272
|
setText(val);
|
|
268
273
|
if (rowKey) {
|
|
269
|
-
var _formRef$current8, _formRef$current8$set;
|
|
270
|
-
formRef === null || formRef === void 0 ? void 0 : (_formRef$current8 = formRef.current) === null || _formRef$current8 === void 0 ? void 0 : (_formRef$current8$set = _formRef$current8.setFieldsValue) === null || _formRef$current8$set === void 0 ? void 0 : _formRef$current8$set.call(_formRef$current8, _defineProperty({}, rowKey, formValue));
|
|
271
|
-
} else {
|
|
272
274
|
var _formRef$current9, _formRef$current9$set;
|
|
273
|
-
formRef === null || formRef === void 0 ? void 0 : (_formRef$current9 = formRef.current) === null || _formRef$current9 === void 0 ? void 0 : (_formRef$current9$set = _formRef$current9.setFieldsValue) === null || _formRef$current9$set === void 0 ? void 0 : _formRef$current9$set.call(_formRef$current9,
|
|
275
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current9 = formRef.current) === null || _formRef$current9 === void 0 ? void 0 : (_formRef$current9$set = _formRef$current9.setFieldsValue) === null || _formRef$current9$set === void 0 ? void 0 : _formRef$current9$set.call(_formRef$current9, _defineProperty({}, rowKey, formValue));
|
|
276
|
+
} else {
|
|
277
|
+
var _formRef$current10, _formRef$current10$se;
|
|
278
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current10 = formRef.current) === null || _formRef$current10 === void 0 ? void 0 : (_formRef$current10$se = _formRef$current10.setFieldsValue) === null || _formRef$current10$se === void 0 ? void 0 : _formRef$current10$se.call(_formRef$current10, _objectSpread({}, formValue));
|
|
274
279
|
}
|
|
275
280
|
};
|
|
276
281
|
// 当表单重置或点clear时,处理值
|
|
277
282
|
var clearValue = function clearValue(e) {
|
|
278
283
|
if (!e.target.value) {
|
|
279
|
-
var _formRef$
|
|
284
|
+
var _formRef$current11, _formRef$current11$ge;
|
|
280
285
|
setText('');
|
|
281
|
-
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$
|
|
286
|
+
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current11 = formRef.current) === null || _formRef$current11 === void 0 ? void 0 : (_formRef$current11$ge = _formRef$current11.getFieldsValue) === null || _formRef$current11$ge === void 0 ? void 0 : _formRef$current11$ge.call(_formRef$current11)) || {};
|
|
282
287
|
if (rowKey) {
|
|
283
288
|
formValue = formValue[rowKey] || {};
|
|
284
289
|
}
|
|
285
290
|
formValue[name] = '';
|
|
286
291
|
formValue[textNameProp] = '';
|
|
287
292
|
if (rowKey) {
|
|
288
|
-
var _formRef$current11, _formRef$current11$se;
|
|
289
|
-
formRef === null || formRef === void 0 ? void 0 : (_formRef$current11 = formRef.current) === null || _formRef$current11 === void 0 ? void 0 : (_formRef$current11$se = _formRef$current11.setFieldsValue) === null || _formRef$current11$se === void 0 ? void 0 : _formRef$current11$se.call(_formRef$current11, _defineProperty({}, rowKey, formValue));
|
|
290
|
-
} else {
|
|
291
293
|
var _formRef$current12, _formRef$current12$se;
|
|
292
|
-
formRef === null || formRef === void 0 ? void 0 : (_formRef$current12 = formRef.current) === null || _formRef$current12 === void 0 ? void 0 : (_formRef$current12$se = _formRef$current12.setFieldsValue) === null || _formRef$current12$se === void 0 ? void 0 : _formRef$current12$se.call(_formRef$current12,
|
|
294
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current12 = formRef.current) === null || _formRef$current12 === void 0 ? void 0 : (_formRef$current12$se = _formRef$current12.setFieldsValue) === null || _formRef$current12$se === void 0 ? void 0 : _formRef$current12$se.call(_formRef$current12, _defineProperty({}, rowKey, formValue));
|
|
295
|
+
} else {
|
|
296
|
+
var _formRef$current13, _formRef$current13$se;
|
|
297
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current13 = formRef.current) === null || _formRef$current13 === void 0 ? void 0 : (_formRef$current13$se = _formRef$current13.setFieldsValue) === null || _formRef$current13$se === void 0 ? void 0 : _formRef$current13$se.call(_formRef$current13, _objectSpread({}, formValue));
|
|
293
298
|
}
|
|
294
299
|
}
|
|
295
300
|
};
|
|
@@ -304,6 +309,14 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
304
309
|
if (!multiple) {
|
|
305
310
|
tableOptions.headerTitle = "双击选中当前行数据";
|
|
306
311
|
}
|
|
312
|
+
var rowSelection = tableConfig === null || tableConfig === void 0 ? void 0 : tableConfig.rowSelection;
|
|
313
|
+
rowSelection = rowSelection == undefined || multiple ? {
|
|
314
|
+
type: 'checkbox',
|
|
315
|
+
onChange: function onChange(keys, rows) {
|
|
316
|
+
// console.log(keys, rows, tableRef?.current?.getDatasource());
|
|
317
|
+
selectRowRef.current = rows;
|
|
318
|
+
}
|
|
319
|
+
} : false;
|
|
307
320
|
var tableDom = /*#__PURE__*/React.createElement(ProTable, _extends({
|
|
308
321
|
className: "ls-input-table",
|
|
309
322
|
columns: columns,
|
|
@@ -323,12 +336,7 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
323
336
|
btnInline: true
|
|
324
337
|
},
|
|
325
338
|
height: 'full',
|
|
326
|
-
rowSelection:
|
|
327
|
-
type: multiple ? 'checkbox' : 'radio',
|
|
328
|
-
onChange: function onChange(keys, rows) {
|
|
329
|
-
selectRowRef.current = rows;
|
|
330
|
-
}
|
|
331
|
-
},
|
|
339
|
+
rowSelection: rowSelection,
|
|
332
340
|
onRow: function onRow(record) {
|
|
333
341
|
return {
|
|
334
342
|
onDoubleClick: function onDoubleClick() {
|
|
@@ -73,6 +73,10 @@
|
|
|
73
73
|
height: 40px
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
&.ant-btn-sm {
|
|
77
|
+
height: 22px;
|
|
78
|
+
}
|
|
79
|
+
|
|
76
80
|
&:hover,
|
|
77
81
|
&:focus {
|
|
78
82
|
background-color: var(--ant-primary-2);
|
|
@@ -288,54 +292,55 @@
|
|
|
288
292
|
|
|
289
293
|
// 以下为调整字体大小及行高
|
|
290
294
|
|
|
291
|
-
.ant-picker,
|
|
292
|
-
.ant-form-item-label>label,
|
|
293
|
-
.ant-form-item,
|
|
294
|
-
.ant-input,
|
|
295
|
-
.ant-
|
|
295
|
+
.ant-picker:not(.ant-picker-large, .ant-picker-sm),
|
|
296
|
+
.ant-input:not(.ant-input-lg, .ant-input-sm) .ant-form-item-label>label,
|
|
297
|
+
.ant-form:not(.ant-form-large, .ant-form-sm) .ant-form-item,
|
|
298
|
+
.ant-input:not(.ant-input-lg, .ant-input-sm),
|
|
299
|
+
.ant-input-number:not(.ant-input-number-lg, .ant-input-number-sm),
|
|
300
|
+
.ant-select:not(.ant-select-lg, .ant-select-sm),
|
|
296
301
|
.ant-pagination,
|
|
297
302
|
.ant-badge-status-text {
|
|
298
303
|
font-size: 13px !important;
|
|
299
304
|
}
|
|
300
305
|
|
|
301
|
-
.ant-btn,
|
|
306
|
+
.ant-btn:not(.ant-btn-lg, .ant-btn-sm),
|
|
302
307
|
.ant-select-single:not(.ant-select-customize-input) .ant-select-selector,
|
|
303
|
-
.ant-form-item-label>label {
|
|
308
|
+
.ant-input:not(.ant-input-lg, .ant-input-sm) .ant-form-item-label>label {
|
|
304
309
|
height: 28px !important;
|
|
305
310
|
min-height: 28px !important;
|
|
306
311
|
}
|
|
307
312
|
|
|
308
|
-
.ant-form-item-control-input {
|
|
313
|
+
.ant-input:not(.ant-input-lg, .ant-input-sm) .ant-form-item-control-input {
|
|
309
314
|
min-height: 28px !important;
|
|
310
315
|
}
|
|
311
316
|
|
|
312
|
-
.ant-form-item {
|
|
317
|
+
.ant-form:not(.ant-form-large, .ant-form-sm) .ant-form-item {
|
|
313
318
|
margin-bottom: 12px !important;
|
|
314
319
|
}
|
|
315
320
|
|
|
316
|
-
.ant-select-single .ant-select-selector .ant-select-selection-item,
|
|
317
|
-
.ant-select-single .ant-select-selector .ant-select-selection-placeholder {
|
|
321
|
+
.ant-select-single:not(.ant-select-lg, .ant-select-sm) .ant-select-selector .ant-select-selection-item,
|
|
322
|
+
.ant-select-single:not(.ant-select-lg, .ant-select-sm) .ant-select-selector .ant-select-selection-placeholder {
|
|
318
323
|
line-height: 26px !important;
|
|
319
324
|
}
|
|
320
325
|
|
|
321
|
-
.ant-select-multiple .ant-select-selection-item {
|
|
326
|
+
.ant-select-multiple:not(.ant-select-lg, .ant-select-sm) .ant-select-selection-item {
|
|
322
327
|
margin-top: 0 !important;
|
|
323
328
|
margin-bottom: 0 !important;
|
|
324
329
|
}
|
|
325
330
|
|
|
326
|
-
.ant-select-multiple .ant-select-selector::after {
|
|
331
|
+
.ant-select-multiple:not(.ant-select-lg, .ant-select-sm) .ant-select-selector::after {
|
|
327
332
|
line-height: 20px !important;
|
|
328
333
|
}
|
|
329
334
|
|
|
330
|
-
.ant-btn,
|
|
331
|
-
.ant-picker,
|
|
332
|
-
.ant-input-affix-wrapper {
|
|
335
|
+
.ant-btn:not(.ant-btn-lg, .ant-btn-sm),
|
|
336
|
+
.ant-picker:not(.ant-picker-large, .ant-picker-sm),
|
|
337
|
+
.ant-input-affix-wrapper:not(.ant-input-affix-wrapper-lg, .ant-input-affix-wrapper-sm) {
|
|
333
338
|
padding-top: 2px !important;
|
|
334
339
|
padding-bottom: 2px !important;
|
|
335
340
|
}
|
|
336
341
|
|
|
337
342
|
|
|
338
|
-
.ant-picker-range {
|
|
343
|
+
.ant-picker-range:not(.ant-picker-large, .ant-picker-sm) {
|
|
339
344
|
padding: 2px 4px !important;
|
|
340
345
|
|
|
341
346
|
.ant-picker-range-separator {
|
|
@@ -31,6 +31,7 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
31
31
|
//@ts-ignore
|
|
32
32
|
var _useContext = (0, _react.useContext)(_lsProForm.ProFormContext),
|
|
33
33
|
formRef = _useContext.formRef;
|
|
34
|
+
// const inputRef=useRef<any>();
|
|
34
35
|
var tableRef = (0, _react.useRef)();
|
|
35
36
|
var selectRowRef = (0, _react.useRef)([]);
|
|
36
37
|
var _useState = (0, _react.useState)(false),
|
|
@@ -87,6 +88,7 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
87
88
|
arrowPointAtCenter = _prop$arrowPointAtCen === void 0 ? true : _prop$arrowPointAtCen,
|
|
88
89
|
rowKey = prop.rowKey,
|
|
89
90
|
rest = (0, _objectWithoutProperties2.default)(prop, _excluded);
|
|
91
|
+
var tableKey = (tableConfig === null || tableConfig === void 0 ? void 0 : tableConfig.rowKey) || 'id';
|
|
90
92
|
//显示输入框绑定的name,如果不设置textName,设置为$name__text
|
|
91
93
|
var textNameProp = (0, _react.useMemo)(function () {
|
|
92
94
|
return textName || name + '__text';
|
|
@@ -147,6 +149,7 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
147
149
|
if (afterLoad) {
|
|
148
150
|
afterLoad(rows);
|
|
149
151
|
}
|
|
152
|
+
//todo 加载数据时自动勾选
|
|
150
153
|
return _context.abrupt("return", {
|
|
151
154
|
data: rows,
|
|
152
155
|
total: Number(result.total || 0),
|
|
@@ -182,14 +185,16 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
182
185
|
if (txt) {
|
|
183
186
|
setText(txt);
|
|
184
187
|
} else if (val) {
|
|
188
|
+
var _formRef$current4, _formRef$current4$set;
|
|
185
189
|
setText(val);
|
|
190
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 ? void 0 : (_formRef$current4$set = _formRef$current4.setFieldsValue) === null || _formRef$current4$set === void 0 ? void 0 : _formRef$current4$set.call(_formRef$current4, (0, _defineProperty2.default)({}, textNameProp, val));
|
|
186
191
|
}
|
|
187
192
|
}, 0);
|
|
188
193
|
}, [rowKey]);
|
|
189
194
|
// 处理返回数据
|
|
190
195
|
var handleValue = function handleValue(row) {
|
|
191
|
-
var _formRef$
|
|
192
|
-
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$
|
|
196
|
+
var _formRef$current5, _formRef$current5$get;
|
|
197
|
+
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 ? void 0 : (_formRef$current5$get = _formRef$current5.getFieldsValue) === null || _formRef$current5$get === void 0 ? void 0 : _formRef$current5$get.call(_formRef$current5)) || {};
|
|
193
198
|
if (rowKey) {
|
|
194
199
|
formValue = formValue[rowKey] || {};
|
|
195
200
|
}
|
|
@@ -229,11 +234,11 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
229
234
|
setText(txt);
|
|
230
235
|
setVisible(false);
|
|
231
236
|
if (rowKey) {
|
|
232
|
-
var _formRef$current5, _formRef$current5$set;
|
|
233
|
-
formRef === null || formRef === void 0 ? void 0 : (_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 ? void 0 : (_formRef$current5$set = _formRef$current5.setFieldsValue) === null || _formRef$current5$set === void 0 ? void 0 : _formRef$current5$set.call(_formRef$current5, (0, _defineProperty2.default)({}, rowKey, formValue));
|
|
234
|
-
} else {
|
|
235
237
|
var _formRef$current6, _formRef$current6$set;
|
|
236
|
-
formRef === null || formRef === void 0 ? void 0 : (_formRef$current6 = formRef.current) === null || _formRef$current6 === void 0 ? void 0 : (_formRef$current6$set = _formRef$current6.setFieldsValue) === null || _formRef$current6$set === void 0 ? void 0 : _formRef$current6$set.call(_formRef$current6, (0,
|
|
238
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current6 = formRef.current) === null || _formRef$current6 === void 0 ? void 0 : (_formRef$current6$set = _formRef$current6.setFieldsValue) === null || _formRef$current6$set === void 0 ? void 0 : _formRef$current6$set.call(_formRef$current6, (0, _defineProperty2.default)({}, rowKey, formValue));
|
|
239
|
+
} else {
|
|
240
|
+
var _formRef$current7, _formRef$current7$set;
|
|
241
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current7 = formRef.current) === null || _formRef$current7 === void 0 ? void 0 : (_formRef$current7$set = _formRef$current7.setFieldsValue) === null || _formRef$current7$set === void 0 ? void 0 : _formRef$current7$set.call(_formRef$current7, (0, _objectSpread2.default)({}, formValue));
|
|
237
242
|
}
|
|
238
243
|
onSelectChange === null || onSelectChange === void 0 ? void 0 : onSelectChange(row, formRef);
|
|
239
244
|
};
|
|
@@ -264,8 +269,8 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
264
269
|
};
|
|
265
270
|
//直接输入不回车,value 和 text 为同一个值
|
|
266
271
|
var onInput = function onInput(e) {
|
|
267
|
-
var _formRef$
|
|
268
|
-
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$
|
|
272
|
+
var _formRef$current8, _formRef$current8$get;
|
|
273
|
+
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current8 = formRef.current) === null || _formRef$current8 === void 0 ? void 0 : (_formRef$current8$get = _formRef$current8.getFieldsValue) === null || _formRef$current8$get === void 0 ? void 0 : _formRef$current8$get.call(_formRef$current8)) || {};
|
|
269
274
|
if (rowKey) {
|
|
270
275
|
formValue = formValue[rowKey] || {};
|
|
271
276
|
}
|
|
@@ -274,30 +279,30 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
274
279
|
formValue[textNameProp] = val;
|
|
275
280
|
setText(val);
|
|
276
281
|
if (rowKey) {
|
|
277
|
-
var _formRef$current8, _formRef$current8$set;
|
|
278
|
-
formRef === null || formRef === void 0 ? void 0 : (_formRef$current8 = formRef.current) === null || _formRef$current8 === void 0 ? void 0 : (_formRef$current8$set = _formRef$current8.setFieldsValue) === null || _formRef$current8$set === void 0 ? void 0 : _formRef$current8$set.call(_formRef$current8, (0, _defineProperty2.default)({}, rowKey, formValue));
|
|
279
|
-
} else {
|
|
280
282
|
var _formRef$current9, _formRef$current9$set;
|
|
281
|
-
formRef === null || formRef === void 0 ? void 0 : (_formRef$current9 = formRef.current) === null || _formRef$current9 === void 0 ? void 0 : (_formRef$current9$set = _formRef$current9.setFieldsValue) === null || _formRef$current9$set === void 0 ? void 0 : _formRef$current9$set.call(_formRef$current9, (0,
|
|
283
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current9 = formRef.current) === null || _formRef$current9 === void 0 ? void 0 : (_formRef$current9$set = _formRef$current9.setFieldsValue) === null || _formRef$current9$set === void 0 ? void 0 : _formRef$current9$set.call(_formRef$current9, (0, _defineProperty2.default)({}, rowKey, formValue));
|
|
284
|
+
} else {
|
|
285
|
+
var _formRef$current10, _formRef$current10$se;
|
|
286
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current10 = formRef.current) === null || _formRef$current10 === void 0 ? void 0 : (_formRef$current10$se = _formRef$current10.setFieldsValue) === null || _formRef$current10$se === void 0 ? void 0 : _formRef$current10$se.call(_formRef$current10, (0, _objectSpread2.default)({}, formValue));
|
|
282
287
|
}
|
|
283
288
|
};
|
|
284
289
|
// 当表单重置或点clear时,处理值
|
|
285
290
|
var clearValue = function clearValue(e) {
|
|
286
291
|
if (!e.target.value) {
|
|
287
|
-
var _formRef$
|
|
292
|
+
var _formRef$current11, _formRef$current11$ge;
|
|
288
293
|
setText('');
|
|
289
|
-
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$
|
|
294
|
+
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current11 = formRef.current) === null || _formRef$current11 === void 0 ? void 0 : (_formRef$current11$ge = _formRef$current11.getFieldsValue) === null || _formRef$current11$ge === void 0 ? void 0 : _formRef$current11$ge.call(_formRef$current11)) || {};
|
|
290
295
|
if (rowKey) {
|
|
291
296
|
formValue = formValue[rowKey] || {};
|
|
292
297
|
}
|
|
293
298
|
formValue[name] = '';
|
|
294
299
|
formValue[textNameProp] = '';
|
|
295
300
|
if (rowKey) {
|
|
296
|
-
var _formRef$current11, _formRef$current11$se;
|
|
297
|
-
formRef === null || formRef === void 0 ? void 0 : (_formRef$current11 = formRef.current) === null || _formRef$current11 === void 0 ? void 0 : (_formRef$current11$se = _formRef$current11.setFieldsValue) === null || _formRef$current11$se === void 0 ? void 0 : _formRef$current11$se.call(_formRef$current11, (0, _defineProperty2.default)({}, rowKey, formValue));
|
|
298
|
-
} else {
|
|
299
301
|
var _formRef$current12, _formRef$current12$se;
|
|
300
|
-
formRef === null || formRef === void 0 ? void 0 : (_formRef$current12 = formRef.current) === null || _formRef$current12 === void 0 ? void 0 : (_formRef$current12$se = _formRef$current12.setFieldsValue) === null || _formRef$current12$se === void 0 ? void 0 : _formRef$current12$se.call(_formRef$current12, (0,
|
|
302
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current12 = formRef.current) === null || _formRef$current12 === void 0 ? void 0 : (_formRef$current12$se = _formRef$current12.setFieldsValue) === null || _formRef$current12$se === void 0 ? void 0 : _formRef$current12$se.call(_formRef$current12, (0, _defineProperty2.default)({}, rowKey, formValue));
|
|
303
|
+
} else {
|
|
304
|
+
var _formRef$current13, _formRef$current13$se;
|
|
305
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current13 = formRef.current) === null || _formRef$current13 === void 0 ? void 0 : (_formRef$current13$se = _formRef$current13.setFieldsValue) === null || _formRef$current13$se === void 0 ? void 0 : _formRef$current13$se.call(_formRef$current13, (0, _objectSpread2.default)({}, formValue));
|
|
301
306
|
}
|
|
302
307
|
}
|
|
303
308
|
};
|
|
@@ -312,6 +317,14 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
312
317
|
if (!multiple) {
|
|
313
318
|
tableOptions.headerTitle = "双击选中当前行数据";
|
|
314
319
|
}
|
|
320
|
+
var rowSelection = tableConfig === null || tableConfig === void 0 ? void 0 : tableConfig.rowSelection;
|
|
321
|
+
rowSelection = rowSelection == undefined || multiple ? {
|
|
322
|
+
type: 'checkbox',
|
|
323
|
+
onChange: function onChange(keys, rows) {
|
|
324
|
+
// console.log(keys, rows, tableRef?.current?.getDatasource());
|
|
325
|
+
selectRowRef.current = rows;
|
|
326
|
+
}
|
|
327
|
+
} : false;
|
|
315
328
|
var tableDom = /*#__PURE__*/_react.default.createElement(_lsProTable.default, (0, _extends2.default)({
|
|
316
329
|
className: "ls-input-table",
|
|
317
330
|
columns: columns,
|
|
@@ -331,12 +344,7 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
331
344
|
btnInline: true
|
|
332
345
|
},
|
|
333
346
|
height: 'full',
|
|
334
|
-
rowSelection:
|
|
335
|
-
type: multiple ? 'checkbox' : 'radio',
|
|
336
|
-
onChange: function onChange(keys, rows) {
|
|
337
|
-
selectRowRef.current = rows;
|
|
338
|
-
}
|
|
339
|
-
},
|
|
347
|
+
rowSelection: rowSelection,
|
|
340
348
|
onRow: function onRow(record) {
|
|
341
349
|
return {
|
|
342
350
|
onDoubleClick: function onDoubleClick() {
|
|
@@ -73,6 +73,10 @@
|
|
|
73
73
|
height: 40px
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
&.ant-btn-sm {
|
|
77
|
+
height: 22px;
|
|
78
|
+
}
|
|
79
|
+
|
|
76
80
|
&:hover,
|
|
77
81
|
&:focus {
|
|
78
82
|
background-color: var(--ant-primary-2);
|
|
@@ -288,54 +292,55 @@
|
|
|
288
292
|
|
|
289
293
|
// 以下为调整字体大小及行高
|
|
290
294
|
|
|
291
|
-
.ant-picker,
|
|
292
|
-
.ant-form-item-label>label,
|
|
293
|
-
.ant-form-item,
|
|
294
|
-
.ant-input,
|
|
295
|
-
.ant-
|
|
295
|
+
.ant-picker:not(.ant-picker-large, .ant-picker-sm),
|
|
296
|
+
.ant-input:not(.ant-input-lg, .ant-input-sm) .ant-form-item-label>label,
|
|
297
|
+
.ant-form:not(.ant-form-large, .ant-form-sm) .ant-form-item,
|
|
298
|
+
.ant-input:not(.ant-input-lg, .ant-input-sm),
|
|
299
|
+
.ant-input-number:not(.ant-input-number-lg, .ant-input-number-sm),
|
|
300
|
+
.ant-select:not(.ant-select-lg, .ant-select-sm),
|
|
296
301
|
.ant-pagination,
|
|
297
302
|
.ant-badge-status-text {
|
|
298
303
|
font-size: 13px !important;
|
|
299
304
|
}
|
|
300
305
|
|
|
301
|
-
.ant-btn,
|
|
306
|
+
.ant-btn:not(.ant-btn-lg, .ant-btn-sm),
|
|
302
307
|
.ant-select-single:not(.ant-select-customize-input) .ant-select-selector,
|
|
303
|
-
.ant-form-item-label>label {
|
|
308
|
+
.ant-input:not(.ant-input-lg, .ant-input-sm) .ant-form-item-label>label {
|
|
304
309
|
height: 28px !important;
|
|
305
310
|
min-height: 28px !important;
|
|
306
311
|
}
|
|
307
312
|
|
|
308
|
-
.ant-form-item-control-input {
|
|
313
|
+
.ant-input:not(.ant-input-lg, .ant-input-sm) .ant-form-item-control-input {
|
|
309
314
|
min-height: 28px !important;
|
|
310
315
|
}
|
|
311
316
|
|
|
312
|
-
.ant-form-item {
|
|
317
|
+
.ant-form:not(.ant-form-large, .ant-form-sm) .ant-form-item {
|
|
313
318
|
margin-bottom: 12px !important;
|
|
314
319
|
}
|
|
315
320
|
|
|
316
|
-
.ant-select-single .ant-select-selector .ant-select-selection-item,
|
|
317
|
-
.ant-select-single .ant-select-selector .ant-select-selection-placeholder {
|
|
321
|
+
.ant-select-single:not(.ant-select-lg, .ant-select-sm) .ant-select-selector .ant-select-selection-item,
|
|
322
|
+
.ant-select-single:not(.ant-select-lg, .ant-select-sm) .ant-select-selector .ant-select-selection-placeholder {
|
|
318
323
|
line-height: 26px !important;
|
|
319
324
|
}
|
|
320
325
|
|
|
321
|
-
.ant-select-multiple .ant-select-selection-item {
|
|
326
|
+
.ant-select-multiple:not(.ant-select-lg, .ant-select-sm) .ant-select-selection-item {
|
|
322
327
|
margin-top: 0 !important;
|
|
323
328
|
margin-bottom: 0 !important;
|
|
324
329
|
}
|
|
325
330
|
|
|
326
|
-
.ant-select-multiple .ant-select-selector::after {
|
|
331
|
+
.ant-select-multiple:not(.ant-select-lg, .ant-select-sm) .ant-select-selector::after {
|
|
327
332
|
line-height: 20px !important;
|
|
328
333
|
}
|
|
329
334
|
|
|
330
|
-
.ant-btn,
|
|
331
|
-
.ant-picker,
|
|
332
|
-
.ant-input-affix-wrapper {
|
|
335
|
+
.ant-btn:not(.ant-btn-lg, .ant-btn-sm),
|
|
336
|
+
.ant-picker:not(.ant-picker-large, .ant-picker-sm),
|
|
337
|
+
.ant-input-affix-wrapper:not(.ant-input-affix-wrapper-lg, .ant-input-affix-wrapper-sm) {
|
|
333
338
|
padding-top: 2px !important;
|
|
334
339
|
padding-bottom: 2px !important;
|
|
335
340
|
}
|
|
336
341
|
|
|
337
342
|
|
|
338
|
-
.ant-picker-range {
|
|
343
|
+
.ant-picker-range:not(.ant-picker-large, .ant-picker-sm) {
|
|
339
344
|
padding: 2px 4px !important;
|
|
340
345
|
|
|
341
346
|
.ant-picker-range-separator {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ls-pro-common",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.18",
|
|
4
4
|
"description": "ls-pro-common",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": [
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@ant-design/icons": "^4.3.0",
|
|
24
|
-
"ls-pro-table": "^3.0.
|
|
24
|
+
"ls-pro-table": "^3.0.11",
|
|
25
25
|
"ls-pro-form": "^3.0.6",
|
|
26
26
|
"ls-pro-descriptions": "^3.0.1",
|
|
27
27
|
"ls-pro-card": "^3.0.3",
|