@nocobase/client 0.7.0-alpha.82 → 0.7.0-alpha.83

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.
Files changed (65) hide show
  1. package/es/block-provider/hooks/index.d.ts +3 -0
  2. package/es/block-provider/hooks/index.js +233 -168
  3. package/es/collection-manager/Configuration/AddFieldAction.js +27 -9
  4. package/es/collection-manager/Configuration/EditFieldAction.js +25 -8
  5. package/es/locale/en_US.d.ts +10 -0
  6. package/es/locale/en_US.js +11 -1
  7. package/es/locale/index.d.ts +44 -0
  8. package/es/locale/zh_CN.d.ts +34 -0
  9. package/es/locale/zh_CN.js +35 -1
  10. package/es/schema-component/antd/action/Action.Designer.js +33 -13
  11. package/es/schema-component/antd/action/utils.d.ts +2 -0
  12. package/es/schema-component/antd/action/utils.js +60 -0
  13. package/es/schema-component/antd/date-picker/util.d.ts +2 -1
  14. package/es/schema-component/antd/date-picker/util.js +4 -2
  15. package/es/schema-initializer/buttons/FormActionInitializers.d.ts +84 -0
  16. package/es/schema-initializer/buttons/FormActionInitializers.js +63 -0
  17. package/es/schema-initializer/buttons/ReadPrettyFormActionInitializers.d.ts +26 -0
  18. package/es/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +21 -0
  19. package/es/schema-initializer/buttons/TableActionColumnInitializers.js +21 -0
  20. package/es/schema-settings/SchemaSettings.js +48 -16
  21. package/es/workflow/triggers/collection.js +1 -0
  22. package/es/workflow/triggers/index.js +2 -0
  23. package/es/workflow/triggers/schedule.d.ts +25 -0
  24. package/es/workflow/triggers/schedule.js +531 -0
  25. package/lib/block-provider/hooks/index.d.ts +3 -0
  26. package/lib/block-provider/hooks/index.js +238 -169
  27. package/lib/collection-manager/Configuration/AddFieldAction.js +27 -9
  28. package/lib/collection-manager/Configuration/EditFieldAction.js +25 -8
  29. package/lib/locale/en_US.d.ts +10 -0
  30. package/lib/locale/en_US.js +11 -1
  31. package/lib/locale/index.d.ts +44 -0
  32. package/lib/locale/zh_CN.d.ts +34 -0
  33. package/lib/locale/zh_CN.js +35 -1
  34. package/lib/schema-component/antd/action/Action.Designer.js +34 -13
  35. package/lib/schema-component/antd/action/utils.d.ts +2 -0
  36. package/lib/schema-component/antd/action/utils.js +67 -0
  37. package/lib/schema-component/antd/date-picker/util.d.ts +2 -1
  38. package/lib/schema-component/antd/date-picker/util.js +6 -1
  39. package/lib/schema-initializer/buttons/FormActionInitializers.d.ts +84 -0
  40. package/lib/schema-initializer/buttons/FormActionInitializers.js +63 -0
  41. package/lib/schema-initializer/buttons/ReadPrettyFormActionInitializers.d.ts +26 -0
  42. package/lib/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +21 -0
  43. package/lib/schema-initializer/buttons/TableActionColumnInitializers.js +21 -0
  44. package/lib/schema-settings/SchemaSettings.js +49 -16
  45. package/lib/workflow/triggers/collection.js +1 -0
  46. package/lib/workflow/triggers/index.js +3 -0
  47. package/lib/workflow/triggers/schedule.d.ts +25 -0
  48. package/lib/workflow/triggers/schedule.js +554 -0
  49. package/package.json +4 -4
  50. package/src/block-provider/hooks/index.ts +106 -69
  51. package/src/collection-manager/Configuration/AddFieldAction.tsx +18 -0
  52. package/src/collection-manager/Configuration/EditFieldAction.tsx +19 -0
  53. package/src/locale/en_US.ts +11 -1
  54. package/src/locale/zh_CN.ts +39 -1
  55. package/src/schema-component/antd/action/Action.Designer.tsx +33 -1
  56. package/src/schema-component/antd/action/utils.ts +68 -0
  57. package/src/schema-component/antd/date-picker/util.ts +4 -3
  58. package/src/schema-initializer/SchemaInitializer.tsx +2 -2
  59. package/src/schema-initializer/buttons/FormActionInitializers.tsx +66 -0
  60. package/src/schema-initializer/buttons/ReadPrettyFormActionInitializers.tsx +22 -0
  61. package/src/schema-initializer/buttons/TableActionColumnInitializers.tsx +22 -0
  62. package/src/schema-settings/SchemaSettings.tsx +40 -29
  63. package/src/workflow/triggers/collection.tsx +1 -1
  64. package/src/workflow/triggers/index.tsx +2 -0
  65. package/src/workflow/triggers/schedule.tsx +422 -0
@@ -7,6 +7,9 @@ export declare const useCreateActionProps: () => {
7
7
  export declare const useCustomizeUpdateActionProps: () => {
8
8
  onClick(): Promise<void>;
9
9
  };
10
+ export declare const useCustomizeRequestActionProps: () => {
11
+ onClick(): Promise<void>;
12
+ };
10
13
  export declare const useUpdateActionProps: () => {
11
14
  onClick(): Promise<void>;
12
15
  };
@@ -14,6 +14,7 @@ import { useField, useFieldSchema, useForm } from '@formily/react';
14
14
  import { message, Modal } from 'antd';
15
15
  import { useTranslation } from 'react-i18next';
16
16
  import { useHistory } from 'react-router-dom';
17
+ import { useAPIClient } from '../../api-client';
17
18
  import { useCollection } from '../../collection-manager';
18
19
  import { useRecord } from '../../record-provider';
19
20
  import { useActionContext, useCompile } from '../../schema-component';
@@ -74,6 +75,61 @@ var filterValue = function filterValue(value) {
74
75
  return obj;
75
76
  };
76
77
 
78
+ function getFormValues(filterByTk, field, form, fieldNames, getField, resource) {
79
+ var values = {};
80
+
81
+ for (var key in form.values) {
82
+ if (fieldNames.includes(key)) {
83
+ var collectionField = getField(key);
84
+
85
+ if (filterByTk) {
86
+ if (collectionField.interface === 'subTable') {
87
+ values[key] = form.values[key];
88
+ continue;
89
+ }
90
+
91
+ if (field.added && !field.added.has(key)) {
92
+ continue;
93
+ }
94
+ }
95
+
96
+ var items = form.values[key];
97
+
98
+ if (collectionField.interface === 'linkTo') {
99
+ (function () {
100
+ var targetKey = collectionField.targetKey || 'id';
101
+
102
+ if (resource instanceof TableFieldResource) {
103
+ if (Array.isArray(items)) {
104
+ values[key] = filterValue(items);
105
+ } else if (items && _typeof(items) === 'object') {
106
+ values[key] = filterValue(items);
107
+ } else {
108
+ values[key] = items;
109
+ }
110
+ } else {
111
+ if (Array.isArray(items)) {
112
+ values[key] = items.map(function (item) {
113
+ return item[targetKey];
114
+ });
115
+ } else if (items && _typeof(items) === 'object') {
116
+ values[key] = items[targetKey];
117
+ } else {
118
+ values[key] = items;
119
+ }
120
+ }
121
+ })();
122
+ } else {
123
+ values[key] = form.values[key];
124
+ }
125
+ } else {
126
+ values[key] = form.values[key];
127
+ }
128
+ }
129
+
130
+ return values;
131
+ }
132
+
77
133
  export var useCreateActionProps = function useCreateActionProps() {
78
134
  var form = useForm();
79
135
 
@@ -99,12 +155,13 @@ export var useCreateActionProps = function useCreateActionProps() {
99
155
  getField = _useCollection.getField;
100
156
 
101
157
  var compile = useCompile();
158
+ var filterByTk = useFilterByTk();
102
159
  return {
103
160
  onClick: function onClick() {
104
161
  return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
105
162
  var _actionSchema$xActio, _parent$service, _parent$service$refre;
106
163
 
107
- var fieldNames, _ref, assignedValues, onSuccess, overwriteValues, skipValidator, values, key, items, collectionField;
164
+ var fieldNames, _ref, assignedValues, onSuccess, overwriteValues, skipValidator, values;
108
165
 
109
166
  return regeneratorRuntime.wrap(function _callee2$(_context2) {
110
167
  while (1) {
@@ -124,65 +181,27 @@ export var useCreateActionProps = function useCreateActionProps() {
124
181
  return form.submit();
125
182
 
126
183
  case 5:
127
- values = {};
128
-
129
- for (key in form.values) {
130
- if (fieldNames.includes(key)) {
131
- items = form.values[key];
132
- collectionField = getField(key);
133
-
134
- if (collectionField.interface === 'linkTo') {
135
- (function () {
136
- var targetKey = collectionField.targetKey || 'id';
137
-
138
- if (resource instanceof TableFieldResource) {
139
- if (Array.isArray(items)) {
140
- values[key] = filterValue(items);
141
- } else if (items && _typeof(items) === 'object') {
142
- values[key] = filterValue(items);
143
- } else {
144
- values[key] = items;
145
- }
146
- } else {
147
- if (Array.isArray(items)) {
148
- values[key] = items.map(function (item) {
149
- return item[targetKey];
150
- });
151
- } else if (items && _typeof(items) === 'object') {
152
- values[key] = items[targetKey];
153
- } else {
154
- values[key] = items;
155
- }
156
- }
157
- })();
158
- } else {
159
- values[key] = form.values[key];
160
- }
161
- } else {
162
- values[key] = form.values[key];
163
- }
164
- }
165
-
184
+ values = getFormValues(filterByTk, field, form, fieldNames, getField, resource);
166
185
  actionField.data = field.data || {};
167
186
  actionField.data.loading = true;
168
- _context2.next = 11;
187
+ _context2.next = 10;
169
188
  return resource.create({
170
189
  values: _objectSpread(_objectSpread(_objectSpread({}, values), overwriteValues), assignedValues)
171
190
  });
172
191
 
173
- case 11:
192
+ case 10:
174
193
  actionField.data.loading = false;
175
194
  __parent === null || __parent === void 0 ? void 0 : (_parent$service = __parent.service) === null || _parent$service === void 0 ? void 0 : (_parent$service$refre = _parent$service.refresh) === null || _parent$service$refre === void 0 ? void 0 : _parent$service$refre.call(_parent$service);
176
195
  setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
177
196
 
178
197
  if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage) {
179
- _context2.next = 16;
198
+ _context2.next = 15;
180
199
  break;
181
200
  }
182
201
 
183
202
  return _context2.abrupt("return");
184
203
 
185
- case 16:
204
+ case 15:
186
205
  if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
187
206
  Modal.success({
188
207
  title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
@@ -223,7 +242,7 @@ export var useCreateActionProps = function useCreateActionProps() {
223
242
  message.success(compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage));
224
243
  }
225
244
 
226
- case 17:
245
+ case 16:
227
246
  case "end":
228
247
  return _context2.stop();
229
248
  }
@@ -335,137 +354,183 @@ export var useCustomizeUpdateActionProps = function useCustomizeUpdateActionProp
335
354
  }
336
355
  };
337
356
  };
338
- export var useUpdateActionProps = function useUpdateActionProps() {
339
- var form = useForm();
357
+ export var useCustomizeRequestActionProps = function useCustomizeRequestActionProps() {
358
+ var apiClient = useAPIClient();
359
+ var history = useHistory();
340
360
  var filterByTk = useFilterByTk();
341
-
342
- var _useBlockRequestConte3 = useBlockRequestContext(),
343
- field = _useBlockRequestConte3.field,
344
- resource = _useBlockRequestConte3.resource,
345
- __parent = _useBlockRequestConte3.__parent;
346
-
347
- var _useActionContext2 = useActionContext(),
348
- setVisible = _useActionContext2.setVisible;
349
-
350
361
  var actionSchema = useFieldSchema();
351
- var history = useHistory();
362
+ var compile = useCompile();
363
+ var form = useForm();
352
364
 
353
365
  var _useCollection2 = useCollection(),
354
366
  fields = _useCollection2.fields,
355
367
  getField = _useCollection2.getField;
356
368
 
357
- var compile = useCompile();
358
- var actionField = useField();
369
+ var _useBlockRequestConte3 = useBlockRequestContext(),
370
+ field = _useBlockRequestConte3.field,
371
+ resource = _useBlockRequestConte3.resource;
372
+
359
373
  return {
360
374
  onClick: function onClick() {
361
375
  return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {
362
- var _actionSchema$xActio3, _parent$service3, _parent$service3$refr;
376
+ var _actionSchema$xActio3;
363
377
 
364
- var _ref3, assignedValues, onSuccess, overwriteValues, skipValidator, fieldNames, values, key, collectionField, items, _parent$__parent, _parent$__parent$serv, _parent$__parent$serv2;
378
+ var _ref3, skipValidator, onSuccess, requestSettings, headers, params, data, methods, fieldNames, values;
365
379
 
366
380
  return regeneratorRuntime.wrap(function _callee6$(_context6) {
367
381
  while (1) {
368
382
  switch (_context6.prev = _context6.next) {
369
383
  case 0:
370
- _ref3 = (_actionSchema$xActio3 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio3 !== void 0 ? _actionSchema$xActio3 : {}, assignedValues = _ref3.assignedValues, onSuccess = _ref3.onSuccess, overwriteValues = _ref3.overwriteValues, skipValidator = _ref3.skipValidator;
384
+ _ref3 = (_actionSchema$xActio3 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio3 !== void 0 ? _actionSchema$xActio3 : {}, skipValidator = _ref3.skipValidator, onSuccess = _ref3.onSuccess, requestSettings = _ref3.requestSettings;
371
385
 
372
- if (skipValidator) {
373
- _context6.next = 4;
386
+ if (requestSettings['url']) {
387
+ _context6.next = 3;
374
388
  break;
375
389
  }
376
390
 
377
- _context6.next = 4;
378
- return form.submit();
379
-
380
- case 4:
381
- fieldNames = fields.map(function (field) {
382
- return field.name;
383
- });
384
- values = {};
385
- _context6.t0 = regeneratorRuntime.keys(form.values);
391
+ return _context6.abrupt("return");
386
392
 
387
- case 7:
388
- if ((_context6.t1 = _context6.t0()).done) {
389
- _context6.next = 23;
393
+ case 3:
394
+ if (!(skipValidator === false)) {
395
+ _context6.next = 6;
390
396
  break;
391
397
  }
392
398
 
393
- key = _context6.t1.value;
399
+ _context6.next = 6;
400
+ return form.submit();
394
401
 
395
- if (!fieldNames.includes(key)) {
396
- _context6.next = 20;
397
- break;
402
+ case 6:
403
+ headers = requestSettings['headers'] ? JSON.parse(requestSettings['headers']) : {};
404
+ params = requestSettings['params'] ? JSON.parse(requestSettings['params']) : {};
405
+ data = requestSettings['data'] ? JSON.parse(requestSettings['data']) : {};
406
+ methods = ['POST', 'PUT', 'PATCH'];
407
+
408
+ if (actionSchema['x-action'] === 'customize:form:request' && methods.includes(requestSettings['method'])) {
409
+ fieldNames = fields.map(function (field) {
410
+ return field.name;
411
+ });
412
+ values = getFormValues(filterByTk, field, form, fieldNames, getField, resource);
413
+ Object.assign(data, values);
398
414
  }
399
415
 
400
- collectionField = getField(key);
416
+ _context6.next = 13;
417
+ return apiClient.request(_objectSpread(_objectSpread({}, requestSettings), {}, {
418
+ headers: headers,
419
+ params: params,
420
+ data: data
421
+ }));
401
422
 
402
- if (!(collectionField.interface === 'subTable')) {
403
- _context6.next = 14;
423
+ case 13:
424
+ if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage) {
425
+ _context6.next = 15;
404
426
  break;
405
427
  }
406
428
 
407
- values[key] = form.values[key];
408
- return _context6.abrupt("continue", 7);
429
+ return _context6.abrupt("return");
409
430
 
410
- case 14:
411
- if (!(field.added && !field.added.has(key))) {
412
- _context6.next = 16;
413
- break;
414
- }
431
+ case 15:
432
+ if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
433
+ Modal.success({
434
+ title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
435
+ onOk: function () {
436
+ var _onOk3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
437
+ return regeneratorRuntime.wrap(function _callee5$(_context5) {
438
+ while (1) {
439
+ switch (_context5.prev = _context5.next) {
440
+ case 0:
441
+ if ((onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirecting) && (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirectTo)) {
442
+ if (isURL(onSuccess.redirectTo)) {
443
+ window.location.href = onSuccess.redirectTo;
444
+ } else {
445
+ history.push(onSuccess.redirectTo);
446
+ }
447
+ }
415
448
 
416
- return _context6.abrupt("continue", 7);
449
+ case 1:
450
+ case "end":
451
+ return _context5.stop();
452
+ }
453
+ }
454
+ }, _callee5);
455
+ }));
417
456
 
418
- case 16:
419
- items = form.values[key];
420
-
421
- if (collectionField.interface === 'linkTo') {
422
- (function () {
423
- var targetKey = collectionField.targetKey || 'id';
424
-
425
- if (resource instanceof TableFieldResource) {
426
- if (Array.isArray(items)) {
427
- values[key] = filterValue(items);
428
- } else if (items && _typeof(items) === 'object') {
429
- values[key] = filterValue(items);
430
- } else {
431
- values[key] = items;
432
- }
433
- } else {
434
- if (Array.isArray(items)) {
435
- values[key] = items.map(function (item) {
436
- return item[targetKey];
437
- });
438
- } else if (items && _typeof(items) === 'object') {
439
- values[key] = items[targetKey];
440
- } else {
441
- values[key] = items;
457
+ function onOk() {
458
+ return _onOk3.apply(this, arguments);
442
459
  }
443
- }
444
- })();
460
+
461
+ return onOk;
462
+ }()
463
+ });
445
464
  } else {
446
- values[key] = form.values[key];
465
+ message.success(compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage));
447
466
  }
448
467
 
449
- _context6.next = 21;
450
- break;
468
+ case 16:
469
+ case "end":
470
+ return _context6.stop();
471
+ }
472
+ }
473
+ }, _callee6);
474
+ }))();
475
+ }
476
+ };
477
+ };
478
+ export var useUpdateActionProps = function useUpdateActionProps() {
479
+ var form = useForm();
480
+ var filterByTk = useFilterByTk();
481
+
482
+ var _useBlockRequestConte4 = useBlockRequestContext(),
483
+ field = _useBlockRequestConte4.field,
484
+ resource = _useBlockRequestConte4.resource,
485
+ __parent = _useBlockRequestConte4.__parent;
486
+
487
+ var _useActionContext2 = useActionContext(),
488
+ setVisible = _useActionContext2.setVisible;
489
+
490
+ var actionSchema = useFieldSchema();
491
+ var history = useHistory();
492
+
493
+ var _useCollection3 = useCollection(),
494
+ fields = _useCollection3.fields,
495
+ getField = _useCollection3.getField;
496
+
497
+ var compile = useCompile();
498
+ var actionField = useField();
499
+ return {
500
+ onClick: function onClick() {
501
+ return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8() {
502
+ var _actionSchema$xActio4, _parent$service3, _parent$service3$refr;
503
+
504
+ var _ref4, assignedValues, onSuccess, overwriteValues, skipValidator, fieldNames, values, _parent$__parent, _parent$__parent$serv, _parent$__parent$serv2;
451
505
 
452
- case 20:
453
- values[key] = form.values[key];
506
+ return regeneratorRuntime.wrap(function _callee8$(_context8) {
507
+ while (1) {
508
+ switch (_context8.prev = _context8.next) {
509
+ case 0:
510
+ _ref4 = (_actionSchema$xActio4 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio4 !== void 0 ? _actionSchema$xActio4 : {}, assignedValues = _ref4.assignedValues, onSuccess = _ref4.onSuccess, overwriteValues = _ref4.overwriteValues, skipValidator = _ref4.skipValidator;
511
+
512
+ if (skipValidator) {
513
+ _context8.next = 4;
514
+ break;
515
+ }
454
516
 
455
- case 21:
456
- _context6.next = 7;
457
- break;
517
+ _context8.next = 4;
518
+ return form.submit();
458
519
 
459
- case 23:
520
+ case 4:
521
+ fieldNames = fields.map(function (field) {
522
+ return field.name;
523
+ });
524
+ values = getFormValues(filterByTk, field, form, fieldNames, getField, resource);
460
525
  actionField.data = field.data || {};
461
526
  actionField.data.loading = true;
462
- _context6.next = 27;
527
+ _context8.next = 10;
463
528
  return resource.update({
464
529
  filterByTk: filterByTk,
465
530
  values: _objectSpread(_objectSpread(_objectSpread({}, values), overwriteValues), assignedValues)
466
531
  });
467
532
 
468
- case 27:
533
+ case 10:
469
534
  actionField.data.loading = false;
470
535
  __parent === null || __parent === void 0 ? void 0 : (_parent$service3 = __parent.service) === null || _parent$service3 === void 0 ? void 0 : (_parent$service3$refr = _parent$service3.refresh) === null || _parent$service3$refr === void 0 ? void 0 : _parent$service3$refr.call(_parent$service3);
471
536
 
@@ -476,23 +541,23 @@ export var useUpdateActionProps = function useUpdateActionProps() {
476
541
  setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
477
542
 
478
543
  if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage) {
479
- _context6.next = 33;
544
+ _context8.next = 16;
480
545
  break;
481
546
  }
482
547
 
483
- return _context6.abrupt("return");
548
+ return _context8.abrupt("return");
484
549
 
485
- case 33:
550
+ case 16:
486
551
  if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
487
552
  Modal.success({
488
553
  title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
489
554
  onOk: function () {
490
- var _onOk3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
491
- return regeneratorRuntime.wrap(function _callee5$(_context5) {
555
+ var _onOk4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7() {
556
+ return regeneratorRuntime.wrap(function _callee7$(_context7) {
492
557
  while (1) {
493
- switch (_context5.prev = _context5.next) {
558
+ switch (_context7.prev = _context7.next) {
494
559
  case 0:
495
- _context5.next = 2;
560
+ _context7.next = 2;
496
561
  return form.reset();
497
562
 
498
563
  case 2:
@@ -506,14 +571,14 @@ export var useUpdateActionProps = function useUpdateActionProps() {
506
571
 
507
572
  case 3:
508
573
  case "end":
509
- return _context5.stop();
574
+ return _context7.stop();
510
575
  }
511
576
  }
512
- }, _callee5);
577
+ }, _callee7);
513
578
  }));
514
579
 
515
580
  function onOk() {
516
- return _onOk3.apply(this, arguments);
581
+ return _onOk4.apply(this, arguments);
517
582
  }
518
583
 
519
584
  return onOk;
@@ -523,12 +588,12 @@ export var useUpdateActionProps = function useUpdateActionProps() {
523
588
  message.success(compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage));
524
589
  }
525
590
 
526
- case 34:
591
+ case 17:
527
592
  case "end":
528
- return _context6.stop();
593
+ return _context8.stop();
529
594
  }
530
595
  }
531
- }, _callee6);
596
+ }, _callee8);
532
597
  }))();
533
598
  }
534
599
  };
@@ -536,20 +601,20 @@ export var useUpdateActionProps = function useUpdateActionProps() {
536
601
  export var useDestroyActionProps = function useDestroyActionProps() {
537
602
  var filterByTk = useFilterByTk();
538
603
 
539
- var _useBlockRequestConte4 = useBlockRequestContext(),
540
- resource = _useBlockRequestConte4.resource,
541
- service = _useBlockRequestConte4.service;
604
+ var _useBlockRequestConte5 = useBlockRequestContext(),
605
+ resource = _useBlockRequestConte5.resource,
606
+ service = _useBlockRequestConte5.service;
542
607
 
543
608
  return {
544
609
  onClick: function onClick() {
545
- return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7() {
610
+ return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9() {
546
611
  var _service$refresh2;
547
612
 
548
- return regeneratorRuntime.wrap(function _callee7$(_context7) {
613
+ return regeneratorRuntime.wrap(function _callee9$(_context9) {
549
614
  while (1) {
550
- switch (_context7.prev = _context7.next) {
615
+ switch (_context9.prev = _context9.next) {
551
616
  case 0:
552
- _context7.next = 2;
617
+ _context9.next = 2;
553
618
  return resource.destroy({
554
619
  filterByTk: filterByTk
555
620
  });
@@ -559,40 +624,40 @@ export var useDestroyActionProps = function useDestroyActionProps() {
559
624
 
560
625
  case 3:
561
626
  case "end":
562
- return _context7.stop();
627
+ return _context9.stop();
563
628
  }
564
629
  }
565
- }, _callee7);
630
+ }, _callee9);
566
631
  }))();
567
632
  }
568
633
  };
569
634
  };
570
635
  export var useBulkDestroyActionProps = function useBulkDestroyActionProps() {
571
- var _useBlockRequestConte5 = useBlockRequestContext(),
572
- field = _useBlockRequestConte5.field;
573
-
574
636
  var _useBlockRequestConte6 = useBlockRequestContext(),
575
- resource = _useBlockRequestConte6.resource,
576
- service = _useBlockRequestConte6.service;
637
+ field = _useBlockRequestConte6.field;
638
+
639
+ var _useBlockRequestConte7 = useBlockRequestContext(),
640
+ resource = _useBlockRequestConte7.resource,
641
+ service = _useBlockRequestConte7.service;
577
642
 
578
643
  return {
579
644
  onClick: function onClick() {
580
- return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8() {
645
+ return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10() {
581
646
  var _field$data, _field$data$selectedR, _field$data2, _service$refresh3;
582
647
 
583
- return regeneratorRuntime.wrap(function _callee8$(_context8) {
648
+ return regeneratorRuntime.wrap(function _callee10$(_context10) {
584
649
  while (1) {
585
- switch (_context8.prev = _context8.next) {
650
+ switch (_context10.prev = _context10.next) {
586
651
  case 0:
587
652
  if (field === null || field === void 0 ? void 0 : (_field$data = field.data) === null || _field$data === void 0 ? void 0 : (_field$data$selectedR = _field$data.selectedRowKeys) === null || _field$data$selectedR === void 0 ? void 0 : _field$data$selectedR.length) {
588
- _context8.next = 2;
653
+ _context10.next = 2;
589
654
  break;
590
655
  }
591
656
 
592
- return _context8.abrupt("return");
657
+ return _context10.abrupt("return");
593
658
 
594
659
  case 2:
595
- _context8.next = 4;
660
+ _context10.next = 4;
596
661
  return resource.destroy({
597
662
  filterByTk: (_field$data2 = field.data) === null || _field$data2 === void 0 ? void 0 : _field$data2.selectedRowKeys
598
663
  });
@@ -603,10 +668,10 @@ export var useBulkDestroyActionProps = function useBulkDestroyActionProps() {
603
668
 
604
669
  case 6:
605
670
  case "end":
606
- return _context8.stop();
671
+ return _context10.stop();
607
672
  }
608
673
  }
609
- }, _callee8);
674
+ }, _callee10);
610
675
  }))();
611
676
  }
612
677
  };
@@ -623,13 +688,13 @@ export var useDetailsPaginationProps = function useDetailsPaginationProps() {
623
688
  total: count,
624
689
  pageSize: 1,
625
690
  onChange: function onChange(page) {
626
- return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9() {
691
+ return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11() {
627
692
  var _ctx$service3, _ctx$service3$params;
628
693
 
629
694
  var params;
630
- return regeneratorRuntime.wrap(function _callee9$(_context9) {
695
+ return regeneratorRuntime.wrap(function _callee11$(_context11) {
631
696
  while (1) {
632
- switch (_context9.prev = _context9.next) {
697
+ switch (_context11.prev = _context11.next) {
633
698
  case 0:
634
699
  params = (_ctx$service3 = ctx.service) === null || _ctx$service3 === void 0 ? void 0 : (_ctx$service3$params = _ctx$service3.params) === null || _ctx$service3$params === void 0 ? void 0 : _ctx$service3$params[0];
635
700
  ctx.service.run(_objectSpread(_objectSpread({}, params), {}, {
@@ -638,10 +703,10 @@ export var useDetailsPaginationProps = function useDetailsPaginationProps() {
638
703
 
639
704
  case 2:
640
705
  case "end":
641
- return _context9.stop();
706
+ return _context11.stop();
642
707
  }
643
708
  }
644
- }, _callee9);
709
+ }, _callee11);
645
710
  }))();
646
711
  },
647
712
  style: {