@nokecy/qc-ui 1.0.62 → 1.0.65
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/cjs/generatedListPage/GeneratedListPage.js +28 -20
- package/dist/cjs/generatedListPage/_utils/defaultHandlers.js +24 -11
- package/dist/cjs/standardFormDialog/StandardFormDialog.js +5 -2
- package/dist/cjs/standardFormDialog/withStandardForm.js +6 -1
- package/dist/esm/generatedListPage/GeneratedListPage.js +28 -20
- package/dist/esm/generatedListPage/_utils/defaultHandlers.js +24 -11
- package/dist/esm/standardFormDialog/StandardFormDialog.js +6 -3
- package/dist/esm/standardFormDialog/withStandardForm.js +7 -2
- package/dist/umd/qc-ui.min.js +1 -1
- package/package.json +2 -2
|
@@ -125,11 +125,16 @@ var GeneratedListPage = function GeneratedListPage(config) {
|
|
|
125
125
|
clearCache = _useRequestManager.clearCache;
|
|
126
126
|
|
|
127
127
|
// 刷新函数
|
|
128
|
-
var onRefresh = (0, _react.useCallback)(
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
128
|
+
var onRefresh = (0, _react.useCallback)(function () {
|
|
129
|
+
if (externalOnRefresh) {
|
|
130
|
+
externalOnRefresh();
|
|
131
|
+
} else {
|
|
132
|
+
var _gridRef$current;
|
|
133
|
+
// 清除缓存以确保获取最新数据
|
|
134
|
+
clearCache();
|
|
135
|
+
// 立即刷新表格
|
|
136
|
+
(_gridRef$current = gridRef.current) === null || _gridRef$current === void 0 || _gridRef$current.onRefresh();
|
|
137
|
+
}
|
|
133
138
|
}, [externalOnRefresh, clearCache]);
|
|
134
139
|
|
|
135
140
|
// 操作列组件
|
|
@@ -251,8 +256,11 @@ var GeneratedListPage = function GeneratedListPage(config) {
|
|
|
251
256
|
while (1) switch (_context2.prev = _context2.next) {
|
|
252
257
|
case 0:
|
|
253
258
|
setError(null);
|
|
254
|
-
|
|
255
|
-
|
|
259
|
+
|
|
260
|
+
// 每次查询前清除缓存,确保获取最新数据
|
|
261
|
+
clearCache();
|
|
262
|
+
_context2.prev = 2;
|
|
263
|
+
_context2.next = 5;
|
|
256
264
|
return managedRequest(params, /*#__PURE__*/function () {
|
|
257
265
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(requestParams, signal) {
|
|
258
266
|
var treeData, flatData, filteredData, filterText, apiParams, data, items, _treeData, _flatData, _filteredData, _filterText;
|
|
@@ -337,13 +345,13 @@ var GeneratedListPage = function GeneratedListPage(config) {
|
|
|
337
345
|
return _ref2.apply(this, arguments);
|
|
338
346
|
};
|
|
339
347
|
}());
|
|
340
|
-
case
|
|
348
|
+
case 5:
|
|
341
349
|
return _context2.abrupt("return", _context2.sent);
|
|
342
|
-
case
|
|
343
|
-
_context2.prev =
|
|
344
|
-
_context2.t0 = _context2["catch"](
|
|
350
|
+
case 8:
|
|
351
|
+
_context2.prev = 8;
|
|
352
|
+
_context2.t0 = _context2["catch"](2);
|
|
345
353
|
if (!(retryCount < 3 && (_context2.t0.code === 'NETWORK_ERROR' || _context2.t0.code === 'TIMEOUT'))) {
|
|
346
|
-
_context2.next =
|
|
354
|
+
_context2.next = 16;
|
|
347
355
|
break;
|
|
348
356
|
}
|
|
349
357
|
console.warn("\u8BF7\u6C42\u5931\u8D25\uFF0C\u6B63\u5728\u91CD\u8BD5 (".concat(retryCount + 1, "/3):"), _context2.t0);
|
|
@@ -352,13 +360,13 @@ var GeneratedListPage = function GeneratedListPage(config) {
|
|
|
352
360
|
});
|
|
353
361
|
|
|
354
362
|
// 指数退避策略重试
|
|
355
|
-
_context2.next =
|
|
363
|
+
_context2.next = 15;
|
|
356
364
|
return new Promise(function (resolve) {
|
|
357
365
|
return setTimeout(resolve, Math.pow(2, retryCount) * 1000);
|
|
358
366
|
});
|
|
359
|
-
case 14:
|
|
360
|
-
return _context2.abrupt("return", handleRequest(params));
|
|
361
367
|
case 15:
|
|
368
|
+
return _context2.abrupt("return", handleRequest(params));
|
|
369
|
+
case 16:
|
|
362
370
|
errorMessage = "\u83B7\u53D6".concat(title, "\u6570\u636E\u5931\u8D25: ").concat(_context2.t0.message || '未知错误');
|
|
363
371
|
console.error(errorMessage, _context2.t0);
|
|
364
372
|
recordError();
|
|
@@ -368,15 +376,15 @@ var GeneratedListPage = function GeneratedListPage(config) {
|
|
|
368
376
|
data: [],
|
|
369
377
|
total: 0
|
|
370
378
|
});
|
|
371
|
-
case
|
|
372
|
-
_context2.prev =
|
|
379
|
+
case 21:
|
|
380
|
+
_context2.prev = 21;
|
|
373
381
|
setRetryCount(0);
|
|
374
|
-
return _context2.finish(
|
|
375
|
-
case
|
|
382
|
+
return _context2.finish(21);
|
|
383
|
+
case 24:
|
|
376
384
|
case "end":
|
|
377
385
|
return _context2.stop();
|
|
378
386
|
}
|
|
379
|
-
}, _callee2, null, [[
|
|
387
|
+
}, _callee2, null, [[2, 8, 21, 24]]);
|
|
380
388
|
}));
|
|
381
389
|
return function (_x) {
|
|
382
390
|
return _ref.apply(this, arguments);
|
|
@@ -17,7 +17,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
17
17
|
*/
|
|
18
18
|
var defaultHandleExport = exports.defaultHandleExport = /*#__PURE__*/function () {
|
|
19
19
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(exportApi, params, fileName) {
|
|
20
|
-
var hide,
|
|
20
|
+
var hide, response, url, link, _error$response, errorMessage;
|
|
21
21
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
22
22
|
while (1) switch (_context.prev = _context.next) {
|
|
23
23
|
case 0:
|
|
@@ -26,9 +26,22 @@ var defaultHandleExport = exports.defaultHandleExport = /*#__PURE__*/function ()
|
|
|
26
26
|
_context.next = 4;
|
|
27
27
|
return exportApi(params);
|
|
28
28
|
case 4:
|
|
29
|
-
|
|
29
|
+
response = _context.sent;
|
|
30
|
+
if (response instanceof Blob) {
|
|
31
|
+
_context.next = 8;
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
console.error('导出API返回的不是Blob对象:', response);
|
|
35
|
+
throw new Error('导出数据格式错误,请检查API配置');
|
|
36
|
+
case 8:
|
|
37
|
+
if (!(response.size === 0)) {
|
|
38
|
+
_context.next = 10;
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
throw new Error('导出的文件为空');
|
|
42
|
+
case 10:
|
|
30
43
|
// 创建下载链接
|
|
31
|
-
url = window.URL.createObjectURL(
|
|
44
|
+
url = window.URL.createObjectURL(response);
|
|
32
45
|
link = document.createElement('a');
|
|
33
46
|
link.href = url;
|
|
34
47
|
link.download = fileName;
|
|
@@ -39,24 +52,24 @@ var defaultHandleExport = exports.defaultHandleExport = /*#__PURE__*/function ()
|
|
|
39
52
|
document.body.removeChild(link);
|
|
40
53
|
window.URL.revokeObjectURL(url);
|
|
41
54
|
_antd.message.success('导出成功');
|
|
42
|
-
_context.next =
|
|
55
|
+
_context.next = 27;
|
|
43
56
|
break;
|
|
44
|
-
case
|
|
45
|
-
_context.prev =
|
|
57
|
+
case 21:
|
|
58
|
+
_context.prev = 21;
|
|
46
59
|
_context.t0 = _context["catch"](1);
|
|
47
60
|
console.error('导出失败:', _context.t0);
|
|
48
61
|
errorMessage = ((_error$response = _context.t0.response) === null || _error$response === void 0 || (_error$response = _error$response.data) === null || _error$response === void 0 || (_error$response = _error$response.error) === null || _error$response === void 0 ? void 0 : _error$response.message) || _context.t0.message || '导出失败';
|
|
49
62
|
_antd.message.error("\u5BFC\u51FA\u5931\u8D25\uFF1A".concat(errorMessage));
|
|
50
63
|
throw _context.t0;
|
|
51
|
-
case
|
|
52
|
-
_context.prev =
|
|
64
|
+
case 27:
|
|
65
|
+
_context.prev = 27;
|
|
53
66
|
hide();
|
|
54
|
-
return _context.finish(
|
|
55
|
-
case
|
|
67
|
+
return _context.finish(27);
|
|
68
|
+
case 30:
|
|
56
69
|
case "end":
|
|
57
70
|
return _context.stop();
|
|
58
71
|
}
|
|
59
|
-
}, _callee, null, [[1,
|
|
72
|
+
}, _callee, null, [[1, 21, 27, 30]]);
|
|
60
73
|
}));
|
|
61
74
|
return function defaultHandleExport(_x, _x2, _x3) {
|
|
62
75
|
return _ref.apply(this, arguments);
|
|
@@ -39,14 +39,17 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
39
39
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
40
40
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
41
41
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
42
|
-
// 创建默认的 SchemaField
|
|
42
|
+
// 创建默认的 SchemaField,包含基本组件和装饰器
|
|
43
43
|
var SchemaFieldComponents = (0, _react2.createSchemaField)({
|
|
44
44
|
components: {
|
|
45
45
|
Input: _antdV.Input,
|
|
46
46
|
Select: _antdV.Select,
|
|
47
47
|
DatePicker: _antdV.DatePicker,
|
|
48
48
|
NumberPicker: _antdV.NumberPicker,
|
|
49
|
-
Switch: _antdV.Switch
|
|
49
|
+
Switch: _antdV.Switch,
|
|
50
|
+
FormItem: _antdV.FormItem,
|
|
51
|
+
FormLayout: _antdV.FormLayout,
|
|
52
|
+
FormGrid: _antdV.FormGrid
|
|
50
53
|
}
|
|
51
54
|
});
|
|
52
55
|
|
|
@@ -150,7 +150,12 @@ var withStandardForm = exports.withStandardForm = function withStandardForm(conf
|
|
|
150
150
|
Select: _antdV.Select,
|
|
151
151
|
DatePicker: _antdV.DatePicker,
|
|
152
152
|
NumberPicker: _antdV.NumberPicker,
|
|
153
|
-
Switch: _antdV.Switch
|
|
153
|
+
Switch: _antdV.Switch,
|
|
154
|
+
FormItem: _antdV.FormItem,
|
|
155
|
+
// 字段装饰器,用于渲染 label
|
|
156
|
+
FormLayout: _antdV.FormLayout,
|
|
157
|
+
// 表单布局组件
|
|
158
|
+
FormGrid: _antdV.FormGrid
|
|
154
159
|
}, customComponents);
|
|
155
160
|
return (0, _react2.createSchemaField)({
|
|
156
161
|
components: components
|
|
@@ -115,11 +115,16 @@ var GeneratedListPage = function GeneratedListPage(config) {
|
|
|
115
115
|
clearCache = _useRequestManager.clearCache;
|
|
116
116
|
|
|
117
117
|
// 刷新函数
|
|
118
|
-
var onRefresh = useCallback(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
118
|
+
var onRefresh = useCallback(function () {
|
|
119
|
+
if (externalOnRefresh) {
|
|
120
|
+
externalOnRefresh();
|
|
121
|
+
} else {
|
|
122
|
+
var _gridRef$current;
|
|
123
|
+
// 清除缓存以确保获取最新数据
|
|
124
|
+
clearCache();
|
|
125
|
+
// 立即刷新表格
|
|
126
|
+
(_gridRef$current = gridRef.current) === null || _gridRef$current === void 0 || _gridRef$current.onRefresh();
|
|
127
|
+
}
|
|
123
128
|
}, [externalOnRefresh, clearCache]);
|
|
124
129
|
|
|
125
130
|
// 操作列组件
|
|
@@ -241,8 +246,11 @@ var GeneratedListPage = function GeneratedListPage(config) {
|
|
|
241
246
|
while (1) switch (_context2.prev = _context2.next) {
|
|
242
247
|
case 0:
|
|
243
248
|
setError(null);
|
|
244
|
-
|
|
245
|
-
|
|
249
|
+
|
|
250
|
+
// 每次查询前清除缓存,确保获取最新数据
|
|
251
|
+
clearCache();
|
|
252
|
+
_context2.prev = 2;
|
|
253
|
+
_context2.next = 5;
|
|
246
254
|
return managedRequest(params, /*#__PURE__*/function () {
|
|
247
255
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(requestParams, signal) {
|
|
248
256
|
var treeData, flatData, filteredData, filterText, apiParams, data, items, _treeData, _flatData, _filteredData, _filterText;
|
|
@@ -327,13 +335,13 @@ var GeneratedListPage = function GeneratedListPage(config) {
|
|
|
327
335
|
return _ref2.apply(this, arguments);
|
|
328
336
|
};
|
|
329
337
|
}());
|
|
330
|
-
case
|
|
338
|
+
case 5:
|
|
331
339
|
return _context2.abrupt("return", _context2.sent);
|
|
332
|
-
case
|
|
333
|
-
_context2.prev =
|
|
334
|
-
_context2.t0 = _context2["catch"](
|
|
340
|
+
case 8:
|
|
341
|
+
_context2.prev = 8;
|
|
342
|
+
_context2.t0 = _context2["catch"](2);
|
|
335
343
|
if (!(retryCount < 3 && (_context2.t0.code === 'NETWORK_ERROR' || _context2.t0.code === 'TIMEOUT'))) {
|
|
336
|
-
_context2.next =
|
|
344
|
+
_context2.next = 16;
|
|
337
345
|
break;
|
|
338
346
|
}
|
|
339
347
|
console.warn("\u8BF7\u6C42\u5931\u8D25\uFF0C\u6B63\u5728\u91CD\u8BD5 (".concat(retryCount + 1, "/3):"), _context2.t0);
|
|
@@ -342,13 +350,13 @@ var GeneratedListPage = function GeneratedListPage(config) {
|
|
|
342
350
|
});
|
|
343
351
|
|
|
344
352
|
// 指数退避策略重试
|
|
345
|
-
_context2.next =
|
|
353
|
+
_context2.next = 15;
|
|
346
354
|
return new Promise(function (resolve) {
|
|
347
355
|
return setTimeout(resolve, Math.pow(2, retryCount) * 1000);
|
|
348
356
|
});
|
|
349
|
-
case 14:
|
|
350
|
-
return _context2.abrupt("return", handleRequest(params));
|
|
351
357
|
case 15:
|
|
358
|
+
return _context2.abrupt("return", handleRequest(params));
|
|
359
|
+
case 16:
|
|
352
360
|
errorMessage = "\u83B7\u53D6".concat(title, "\u6570\u636E\u5931\u8D25: ").concat(_context2.t0.message || '未知错误');
|
|
353
361
|
console.error(errorMessage, _context2.t0);
|
|
354
362
|
recordError();
|
|
@@ -358,15 +366,15 @@ var GeneratedListPage = function GeneratedListPage(config) {
|
|
|
358
366
|
data: [],
|
|
359
367
|
total: 0
|
|
360
368
|
});
|
|
361
|
-
case
|
|
362
|
-
_context2.prev =
|
|
369
|
+
case 21:
|
|
370
|
+
_context2.prev = 21;
|
|
363
371
|
setRetryCount(0);
|
|
364
|
-
return _context2.finish(
|
|
365
|
-
case
|
|
372
|
+
return _context2.finish(21);
|
|
373
|
+
case 24:
|
|
366
374
|
case "end":
|
|
367
375
|
return _context2.stop();
|
|
368
376
|
}
|
|
369
|
-
}, _callee2, null, [[
|
|
377
|
+
}, _callee2, null, [[2, 8, 21, 24]]);
|
|
370
378
|
}));
|
|
371
379
|
return function (_x) {
|
|
372
380
|
return _ref.apply(this, arguments);
|
|
@@ -12,7 +12,7 @@ import { message } from 'antd';
|
|
|
12
12
|
*/
|
|
13
13
|
export var defaultHandleExport = /*#__PURE__*/function () {
|
|
14
14
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(exportApi, params, fileName) {
|
|
15
|
-
var hide,
|
|
15
|
+
var hide, response, url, link, _error$response, errorMessage;
|
|
16
16
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
17
17
|
while (1) switch (_context.prev = _context.next) {
|
|
18
18
|
case 0:
|
|
@@ -21,9 +21,22 @@ export var defaultHandleExport = /*#__PURE__*/function () {
|
|
|
21
21
|
_context.next = 4;
|
|
22
22
|
return exportApi(params);
|
|
23
23
|
case 4:
|
|
24
|
-
|
|
24
|
+
response = _context.sent;
|
|
25
|
+
if (response instanceof Blob) {
|
|
26
|
+
_context.next = 8;
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
console.error('导出API返回的不是Blob对象:', response);
|
|
30
|
+
throw new Error('导出数据格式错误,请检查API配置');
|
|
31
|
+
case 8:
|
|
32
|
+
if (!(response.size === 0)) {
|
|
33
|
+
_context.next = 10;
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
throw new Error('导出的文件为空');
|
|
37
|
+
case 10:
|
|
25
38
|
// 创建下载链接
|
|
26
|
-
url = window.URL.createObjectURL(
|
|
39
|
+
url = window.URL.createObjectURL(response);
|
|
27
40
|
link = document.createElement('a');
|
|
28
41
|
link.href = url;
|
|
29
42
|
link.download = fileName;
|
|
@@ -34,24 +47,24 @@ export var defaultHandleExport = /*#__PURE__*/function () {
|
|
|
34
47
|
document.body.removeChild(link);
|
|
35
48
|
window.URL.revokeObjectURL(url);
|
|
36
49
|
message.success('导出成功');
|
|
37
|
-
_context.next =
|
|
50
|
+
_context.next = 27;
|
|
38
51
|
break;
|
|
39
|
-
case
|
|
40
|
-
_context.prev =
|
|
52
|
+
case 21:
|
|
53
|
+
_context.prev = 21;
|
|
41
54
|
_context.t0 = _context["catch"](1);
|
|
42
55
|
console.error('导出失败:', _context.t0);
|
|
43
56
|
errorMessage = ((_error$response = _context.t0.response) === null || _error$response === void 0 || (_error$response = _error$response.data) === null || _error$response === void 0 || (_error$response = _error$response.error) === null || _error$response === void 0 ? void 0 : _error$response.message) || _context.t0.message || '导出失败';
|
|
44
57
|
message.error("\u5BFC\u51FA\u5931\u8D25\uFF1A".concat(errorMessage));
|
|
45
58
|
throw _context.t0;
|
|
46
|
-
case
|
|
47
|
-
_context.prev =
|
|
59
|
+
case 27:
|
|
60
|
+
_context.prev = 27;
|
|
48
61
|
hide();
|
|
49
|
-
return _context.finish(
|
|
50
|
-
case
|
|
62
|
+
return _context.finish(27);
|
|
63
|
+
case 30:
|
|
51
64
|
case "end":
|
|
52
65
|
return _context.stop();
|
|
53
66
|
}
|
|
54
|
-
}, _callee, null, [[1,
|
|
67
|
+
}, _callee, null, [[1, 21, 27, 30]]);
|
|
55
68
|
}));
|
|
56
69
|
return function defaultHandleExport(_x, _x2, _x3) {
|
|
57
70
|
return _ref.apply(this, arguments);
|
|
@@ -25,20 +25,23 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
25
25
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
26
26
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
27
|
import React, { useState, useCallback, useMemo, useRef, useEffect } from 'react';
|
|
28
|
-
import { FormDialog, FormLayout, Input, Select, DatePicker, NumberPicker, Switch } from '@formily/antd-v5';
|
|
28
|
+
import { FormDialog, FormLayout, FormItem, FormGrid, Input, Select, DatePicker, NumberPicker, Switch } from '@formily/antd-v5';
|
|
29
29
|
import { onFormInit, onFormValidateFailed } from '@formily/core';
|
|
30
30
|
import { Button, message, Spin } from 'antd';
|
|
31
31
|
import portalManager from "./PortalManager";
|
|
32
32
|
import { createSchemaField } from '@formily/react';
|
|
33
33
|
|
|
34
|
-
// 创建默认的 SchemaField
|
|
34
|
+
// 创建默认的 SchemaField,包含基本组件和装饰器
|
|
35
35
|
var SchemaFieldComponents = createSchemaField({
|
|
36
36
|
components: {
|
|
37
37
|
Input: Input,
|
|
38
38
|
Select: Select,
|
|
39
39
|
DatePicker: DatePicker,
|
|
40
40
|
NumberPicker: NumberPicker,
|
|
41
|
-
Switch: Switch
|
|
41
|
+
Switch: Switch,
|
|
42
|
+
FormItem: FormItem,
|
|
43
|
+
FormLayout: FormLayout,
|
|
44
|
+
FormGrid: FormGrid
|
|
42
45
|
}
|
|
43
46
|
});
|
|
44
47
|
|
|
@@ -10,7 +10,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
10
10
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
11
11
|
import React, { useMemo } from 'react';
|
|
12
12
|
import { createSchemaField } from '@formily/react';
|
|
13
|
-
import { Input, Select, DatePicker, NumberPicker, Switch } from '@formily/antd-v5';
|
|
13
|
+
import { Input, Select, DatePicker, NumberPicker, Switch, FormItem, FormLayout, FormGrid } from '@formily/antd-v5';
|
|
14
14
|
import StandardFormDialog from "./StandardFormDialog";
|
|
15
15
|
|
|
16
16
|
/**
|
|
@@ -142,7 +142,12 @@ export var withStandardForm = function withStandardForm(config) {
|
|
|
142
142
|
Select: Select,
|
|
143
143
|
DatePicker: DatePicker,
|
|
144
144
|
NumberPicker: NumberPicker,
|
|
145
|
-
Switch: Switch
|
|
145
|
+
Switch: Switch,
|
|
146
|
+
FormItem: FormItem,
|
|
147
|
+
// 字段装饰器,用于渲染 label
|
|
148
|
+
FormLayout: FormLayout,
|
|
149
|
+
// 表单布局组件
|
|
150
|
+
FormGrid: FormGrid
|
|
146
151
|
}, customComponents);
|
|
147
152
|
return createSchemaField({
|
|
148
153
|
components: components
|