ronds-metadata 1.1.87 → 1.1.88

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/es/api/index.d.ts CHANGED
@@ -15,5 +15,5 @@ export default class Api implements IAPI {
15
15
  /** 添加元数据 */
16
16
  SaveMetadata(data: any, metadataTag: string): Promise<any>;
17
17
  GetMetadataObjList(data: any): Promise<any>;
18
- GetEnumDataByUrl(url: string): Promise<any>;
18
+ GetEnumDataByUrl(url: string, method: 'get' | 'post', body?: any): Promise<any>;
19
19
  }
package/es/api/index.js CHANGED
@@ -6,7 +6,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
6
6
  /*
7
7
  * @Author:wangxian
8
8
  * @Date: 2021-09-18 14:15:04
9
- * @LastEditTime: 2022-12-07 15:45:18
9
+ * @LastEditTime: 2023-02-09 19:16:42
10
10
  */
11
11
  import { guid, md5 } from '../utils';
12
12
  import { addInterceptor, HttpHelper } from '../framework/http';
@@ -200,20 +200,34 @@ var Api = /*#__PURE__*/function () {
200
200
  }, {
201
201
  key: "GetEnumDataByUrl",
202
202
  value: function () {
203
- var _GetEnumDataByUrl = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(url) {
204
- var res;
203
+ var _GetEnumDataByUrl = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(url, method, body) {
204
+ var res, _res;
205
+
205
206
  return _regeneratorRuntime.wrap(function _callee5$(_context5) {
206
207
  while (1) {
207
208
  switch (_context5.prev = _context5.next) {
208
209
  case 0:
209
- _context5.next = 2;
210
+ if (!(method === 'get')) {
211
+ _context5.next = 7;
212
+ break;
213
+ }
214
+
215
+ _context5.next = 3;
210
216
  return http.get(encodeURI(url));
211
217
 
212
- case 2:
218
+ case 3:
213
219
  res = _context5.sent;
214
220
  return _context5.abrupt("return", res.successed ? res.data : []);
215
221
 
216
- case 4:
222
+ case 7:
223
+ _context5.next = 9;
224
+ return http.post(encodeURI(url), body);
225
+
226
+ case 9:
227
+ _res = _context5.sent;
228
+ return _context5.abrupt("return", _res.successed ? _res.data : []);
229
+
230
+ case 11:
217
231
  case "end":
218
232
  return _context5.stop();
219
233
  }
@@ -221,7 +235,7 @@ var Api = /*#__PURE__*/function () {
221
235
  }, _callee5);
222
236
  }));
223
237
 
224
- function GetEnumDataByUrl(_x6) {
238
+ function GetEnumDataByUrl(_x6, _x7, _x8) {
225
239
  return _GetEnumDataByUrl.apply(this, arguments);
226
240
  }
227
241
 
@@ -39,6 +39,11 @@ var CanvasCore = function CanvasCore(props) {
39
39
  formSetting = _React$useState6[0],
40
40
  setFormSetting = _React$useState6[1];
41
41
 
42
+ var _React$useState7 = React.useState(),
43
+ _React$useState8 = _slicedToArray(_React$useState7, 2),
44
+ allSetting = _React$useState8[0],
45
+ setAllSetting = _React$useState8[1];
46
+
42
47
  React.useEffect(function () {
43
48
  onChange && onChange(listRef.current);
44
49
  }, [list]);
@@ -60,7 +65,7 @@ var CanvasCore = function CanvasCore(props) {
60
65
  listRef.current = _list;
61
66
  }, []);
62
67
  var processFgStreamData = React.useCallback(function (p) {
63
- var _p$payload;
68
+ var _p$payload, _p$payload3;
64
69
 
65
70
  switch (p === null || p === void 0 ? void 0 : p.type) {
66
71
  case streamEventType.onClearCanvas:
@@ -97,6 +102,7 @@ var CanvasCore = function CanvasCore(props) {
97
102
  setFormSetting(_objectSpread({}, p === null || p === void 0 ? void 0 : (_p$payload2 = p.payload) === null || _p$payload2 === void 0 ? void 0 : _p$payload2.formSetting));
98
103
  }
99
104
 
105
+ setAllSetting(_objectSpread({}, p === null || p === void 0 ? void 0 : (_p$payload3 = p.payload) === null || _p$payload3 === void 0 ? void 0 : _p$payload3.allSetting));
100
106
  break;
101
107
  }
102
108
  }, []);
@@ -121,6 +127,16 @@ var CanvasCore = function CanvasCore(props) {
121
127
  });
122
128
  };
123
129
 
130
+ var processColSpan = function processColSpan(compColSpan, formColSpan) {
131
+ var _formColSpan = formColSpan !== null && formColSpan !== void 0 ? formColSpan : 24;
132
+
133
+ if (compColSpan) {
134
+ return compColSpan * _formColSpan <= 24 ? compColSpan * _formColSpan : 24;
135
+ }
136
+
137
+ return _formColSpan;
138
+ };
139
+
124
140
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
125
141
  className: "canvas-wrapper",
126
142
  ref: dropRef,
@@ -147,10 +163,10 @@ var CanvasCore = function CanvasCore(props) {
147
163
  }, /*#__PURE__*/React.createElement(_Row, {
148
164
  gutter: 8
149
165
  }, list.map(function (it) {
150
- var _formSetting$colSpan;
166
+ var _allSetting$it$id;
151
167
 
152
168
  return /*#__PURE__*/React.createElement(_Col, {
153
- span: (_formSetting$colSpan = formSetting === null || formSetting === void 0 ? void 0 : formSetting.colSpan) !== null && _formSetting$colSpan !== void 0 ? _formSetting$colSpan : 24,
169
+ span: processColSpan(allSetting && ((_allSetting$it$id = allSetting[it.id]) === null || _allSetting$it$id === void 0 ? void 0 : _allSetting$it$id.colSpan), formSetting === null || formSetting === void 0 ? void 0 : formSetting.colSpan),
154
170
  style: {
155
171
  width: '100%'
156
172
  }
@@ -148,6 +148,206 @@ export declare const dateSchema: {
148
148
  }[];
149
149
  }[];
150
150
  }[];
151
+ export declare const numberSchema: {
152
+ id: string;
153
+ type: string;
154
+ properties: ({
155
+ id: string;
156
+ type: string;
157
+ fields: {
158
+ id: string;
159
+ type: string;
160
+ refId: string;
161
+ value: {
162
+ label: string;
163
+ };
164
+ }[];
165
+ } | {
166
+ id: string;
167
+ type: string;
168
+ fields: {
169
+ id: string;
170
+ type: string;
171
+ refId: string;
172
+ value: {
173
+ common: {
174
+ label: string;
175
+ };
176
+ 'common-en-US': {};
177
+ };
178
+ }[];
179
+ })[];
180
+ types: {
181
+ id: string;
182
+ type: string;
183
+ properties: {
184
+ id: string;
185
+ type: string;
186
+ fields: {
187
+ id: string;
188
+ type: string;
189
+ refId: string;
190
+ value: {
191
+ text: {};
192
+ common: {
193
+ label: string;
194
+ };
195
+ 'common-en-US': {};
196
+ };
197
+ }[];
198
+ }[];
199
+ }[];
200
+ }[];
201
+ export declare const switchSchema: {
202
+ id: string;
203
+ type: string;
204
+ properties: ({
205
+ id: string;
206
+ type: string;
207
+ fields: {
208
+ id: string;
209
+ type: string;
210
+ refId: string;
211
+ value: {
212
+ label: string;
213
+ };
214
+ }[];
215
+ } | {
216
+ id: string;
217
+ type: string;
218
+ fields: {
219
+ id: string;
220
+ type: string;
221
+ refId: string;
222
+ value: {
223
+ common: {
224
+ label: string;
225
+ };
226
+ 'common-en-US': {};
227
+ };
228
+ }[];
229
+ })[];
230
+ types: {
231
+ id: string;
232
+ type: string;
233
+ properties: {
234
+ id: string;
235
+ type: string;
236
+ fields: {
237
+ id: string;
238
+ type: string;
239
+ refId: string;
240
+ value: {
241
+ text: {};
242
+ common: {
243
+ label: string;
244
+ };
245
+ 'common-en-US': {};
246
+ };
247
+ }[];
248
+ }[];
249
+ }[];
250
+ }[];
251
+ export declare const selectSchema: {
252
+ id: string;
253
+ type: string;
254
+ properties: ({
255
+ id: string;
256
+ type: string;
257
+ fields: {
258
+ id: string;
259
+ type: string;
260
+ refId: string;
261
+ value: {
262
+ label: string;
263
+ };
264
+ }[];
265
+ } | {
266
+ id: string;
267
+ type: string;
268
+ fields: {
269
+ id: string;
270
+ type: string;
271
+ refId: string;
272
+ value: {
273
+ common: {
274
+ label: string;
275
+ };
276
+ 'common-en-US': {};
277
+ };
278
+ }[];
279
+ })[];
280
+ types: {
281
+ id: string;
282
+ type: string;
283
+ properties: {
284
+ id: string;
285
+ type: string;
286
+ fields: {
287
+ id: string;
288
+ type: string;
289
+ refId: string;
290
+ value: {
291
+ text: {};
292
+ common: {
293
+ label: string;
294
+ };
295
+ 'common-en-US': {};
296
+ };
297
+ }[];
298
+ }[];
299
+ }[];
300
+ }[];
301
+ export declare const mutiSelectSchema: {
302
+ id: string;
303
+ type: string;
304
+ properties: ({
305
+ id: string;
306
+ type: string;
307
+ fields: {
308
+ id: string;
309
+ type: string;
310
+ refId: string;
311
+ value: {
312
+ label: string;
313
+ };
314
+ }[];
315
+ } | {
316
+ id: string;
317
+ type: string;
318
+ fields: {
319
+ id: string;
320
+ type: string;
321
+ refId: string;
322
+ value: {
323
+ common: {
324
+ label: string;
325
+ };
326
+ 'common-en-US': {};
327
+ };
328
+ }[];
329
+ })[];
330
+ types: {
331
+ id: string;
332
+ type: string;
333
+ properties: {
334
+ id: string;
335
+ type: string;
336
+ fields: {
337
+ id: string;
338
+ type: string;
339
+ refId: string;
340
+ value: {
341
+ text: {};
342
+ common: {
343
+ label: string;
344
+ };
345
+ 'common-en-US': {};
346
+ };
347
+ }[];
348
+ }[];
349
+ }[];
350
+ }[];
151
351
  export declare const settingSchema: {
152
352
  input: {
153
353
  id: string;
@@ -199,7 +399,207 @@ export declare const settingSchema: {
199
399
  }[];
200
400
  }[];
201
401
  }[];
202
- textarea: {
402
+ textarea: {
403
+ id: string;
404
+ type: string;
405
+ properties: ({
406
+ id: string;
407
+ type: string;
408
+ fields: {
409
+ id: string;
410
+ type: string;
411
+ refId: string;
412
+ value: {
413
+ label: string;
414
+ };
415
+ }[];
416
+ } | {
417
+ id: string;
418
+ type: string;
419
+ fields: {
420
+ id: string;
421
+ type: string;
422
+ refId: string;
423
+ value: {
424
+ common: {
425
+ label: string;
426
+ };
427
+ 'common-en-US': {};
428
+ };
429
+ }[];
430
+ })[];
431
+ types: {
432
+ id: string;
433
+ type: string;
434
+ properties: {
435
+ id: string;
436
+ type: string;
437
+ fields: {
438
+ id: string;
439
+ type: string;
440
+ refId: string;
441
+ value: {
442
+ text: {};
443
+ common: {
444
+ label: string;
445
+ };
446
+ 'common-en-US': {};
447
+ };
448
+ }[];
449
+ }[];
450
+ }[];
451
+ }[];
452
+ date: {
453
+ id: string;
454
+ type: string;
455
+ properties: ({
456
+ id: string;
457
+ type: string;
458
+ fields: {
459
+ id: string;
460
+ type: string;
461
+ refId: string;
462
+ value: {
463
+ label: string;
464
+ };
465
+ }[];
466
+ } | {
467
+ id: string;
468
+ type: string;
469
+ fields: {
470
+ id: string;
471
+ type: string;
472
+ refId: string;
473
+ value: {
474
+ common: {
475
+ label: string;
476
+ };
477
+ 'common-en-US': {};
478
+ };
479
+ }[];
480
+ })[];
481
+ types: {
482
+ id: string;
483
+ type: string;
484
+ properties: {
485
+ id: string;
486
+ type: string;
487
+ fields: {
488
+ id: string;
489
+ type: string;
490
+ refId: string;
491
+ value: {
492
+ text: {};
493
+ common: {
494
+ label: string;
495
+ };
496
+ 'common-en-US': {};
497
+ };
498
+ }[];
499
+ }[];
500
+ }[];
501
+ }[];
502
+ numebr: {
503
+ id: string;
504
+ type: string;
505
+ properties: ({
506
+ id: string;
507
+ type: string;
508
+ fields: {
509
+ id: string;
510
+ type: string;
511
+ refId: string;
512
+ value: {
513
+ label: string;
514
+ };
515
+ }[];
516
+ } | {
517
+ id: string;
518
+ type: string;
519
+ fields: {
520
+ id: string;
521
+ type: string;
522
+ refId: string;
523
+ value: {
524
+ common: {
525
+ label: string;
526
+ };
527
+ 'common-en-US': {};
528
+ };
529
+ }[];
530
+ })[];
531
+ types: {
532
+ id: string;
533
+ type: string;
534
+ properties: {
535
+ id: string;
536
+ type: string;
537
+ fields: {
538
+ id: string;
539
+ type: string;
540
+ refId: string;
541
+ value: {
542
+ text: {};
543
+ common: {
544
+ label: string;
545
+ };
546
+ 'common-en-US': {};
547
+ };
548
+ }[];
549
+ }[];
550
+ }[];
551
+ }[];
552
+ switch: {
553
+ id: string;
554
+ type: string;
555
+ properties: ({
556
+ id: string;
557
+ type: string;
558
+ fields: {
559
+ id: string;
560
+ type: string;
561
+ refId: string;
562
+ value: {
563
+ label: string;
564
+ };
565
+ }[];
566
+ } | {
567
+ id: string;
568
+ type: string;
569
+ fields: {
570
+ id: string;
571
+ type: string;
572
+ refId: string;
573
+ value: {
574
+ common: {
575
+ label: string;
576
+ };
577
+ 'common-en-US': {};
578
+ };
579
+ }[];
580
+ })[];
581
+ types: {
582
+ id: string;
583
+ type: string;
584
+ properties: {
585
+ id: string;
586
+ type: string;
587
+ fields: {
588
+ id: string;
589
+ type: string;
590
+ refId: string;
591
+ value: {
592
+ text: {};
593
+ common: {
594
+ label: string;
595
+ };
596
+ 'common-en-US': {};
597
+ };
598
+ }[];
599
+ }[];
600
+ }[];
601
+ }[];
602
+ select: {
203
603
  id: string;
204
604
  type: string;
205
605
  properties: ({
@@ -249,7 +649,7 @@ export declare const settingSchema: {
249
649
  }[];
250
650
  }[];
251
651
  }[];
252
- dateSchema: {
652
+ mutiSelect: {
253
653
  id: string;
254
654
  type: string;
255
655
  properties: ({
@@ -465,6 +865,221 @@ export declare const dateParam: {
465
865
  type: string;
466
866
  };
467
867
  };
868
+ export declare const numberParam: {
869
+ type: string;
870
+ schema: {
871
+ id: string;
872
+ type: string;
873
+ properties: ({
874
+ id: string;
875
+ type: string;
876
+ fields: {
877
+ id: string;
878
+ type: string;
879
+ refId: string;
880
+ value: {
881
+ label: string;
882
+ };
883
+ }[];
884
+ } | {
885
+ id: string;
886
+ type: string;
887
+ fields: {
888
+ id: string;
889
+ type: string;
890
+ refId: string;
891
+ value: {
892
+ common: {
893
+ label: string;
894
+ };
895
+ 'common-en-US': {};
896
+ };
897
+ }[];
898
+ })[];
899
+ types: {
900
+ id: string;
901
+ type: string;
902
+ properties: {
903
+ id: string;
904
+ type: string;
905
+ fields: {
906
+ id: string;
907
+ type: string;
908
+ refId: string;
909
+ value: {
910
+ text: {};
911
+ common: {
912
+ label: string;
913
+ };
914
+ 'common-en-US': {};
915
+ };
916
+ }[];
917
+ }[];
918
+ }[];
919
+ }[];
920
+ };
921
+ export declare const switchParam: {
922
+ type: string;
923
+ schema: {
924
+ id: string;
925
+ type: string;
926
+ properties: ({
927
+ id: string;
928
+ type: string;
929
+ fields: {
930
+ id: string;
931
+ type: string;
932
+ refId: string;
933
+ value: {
934
+ label: string;
935
+ };
936
+ }[];
937
+ } | {
938
+ id: string;
939
+ type: string;
940
+ fields: {
941
+ id: string;
942
+ type: string;
943
+ refId: string;
944
+ value: {
945
+ common: {
946
+ label: string;
947
+ };
948
+ 'common-en-US': {};
949
+ };
950
+ }[];
951
+ })[];
952
+ types: {
953
+ id: string;
954
+ type: string;
955
+ properties: {
956
+ id: string;
957
+ type: string;
958
+ fields: {
959
+ id: string;
960
+ type: string;
961
+ refId: string;
962
+ value: {
963
+ text: {};
964
+ common: {
965
+ label: string;
966
+ };
967
+ 'common-en-US': {};
968
+ };
969
+ }[];
970
+ }[];
971
+ }[];
972
+ }[];
973
+ };
974
+ export declare const selectParam: {
975
+ type: string;
976
+ schema: {
977
+ id: string;
978
+ type: string;
979
+ properties: ({
980
+ id: string;
981
+ type: string;
982
+ fields: {
983
+ id: string;
984
+ type: string;
985
+ refId: string;
986
+ value: {
987
+ label: string;
988
+ };
989
+ }[];
990
+ } | {
991
+ id: string;
992
+ type: string;
993
+ fields: {
994
+ id: string;
995
+ type: string;
996
+ refId: string;
997
+ value: {
998
+ common: {
999
+ label: string;
1000
+ };
1001
+ 'common-en-US': {};
1002
+ };
1003
+ }[];
1004
+ })[];
1005
+ types: {
1006
+ id: string;
1007
+ type: string;
1008
+ properties: {
1009
+ id: string;
1010
+ type: string;
1011
+ fields: {
1012
+ id: string;
1013
+ type: string;
1014
+ refId: string;
1015
+ value: {
1016
+ text: {};
1017
+ common: {
1018
+ label: string;
1019
+ };
1020
+ 'common-en-US': {};
1021
+ };
1022
+ }[];
1023
+ }[];
1024
+ }[];
1025
+ }[];
1026
+ };
1027
+ export declare const mutiSelectParam: {
1028
+ type: string;
1029
+ schema: {
1030
+ id: string;
1031
+ type: string;
1032
+ properties: ({
1033
+ id: string;
1034
+ type: string;
1035
+ fields: {
1036
+ id: string;
1037
+ type: string;
1038
+ refId: string;
1039
+ value: {
1040
+ label: string;
1041
+ };
1042
+ }[];
1043
+ } | {
1044
+ id: string;
1045
+ type: string;
1046
+ fields: {
1047
+ id: string;
1048
+ type: string;
1049
+ refId: string;
1050
+ value: {
1051
+ common: {
1052
+ label: string;
1053
+ };
1054
+ 'common-en-US': {};
1055
+ };
1056
+ }[];
1057
+ })[];
1058
+ types: {
1059
+ id: string;
1060
+ type: string;
1061
+ properties: {
1062
+ id: string;
1063
+ type: string;
1064
+ fields: {
1065
+ id: string;
1066
+ type: string;
1067
+ refId: string;
1068
+ value: {
1069
+ text: {};
1070
+ common: {
1071
+ label: string;
1072
+ };
1073
+ 'common-en-US': {};
1074
+ };
1075
+ }[];
1076
+ }[];
1077
+ }[];
1078
+ }[];
1079
+ rule: {
1080
+ isMutiple: boolean;
1081
+ };
1082
+ };
468
1083
  export declare const basicComps: {
469
1084
  id: string;
470
1085
  name: string;
@@ -1,31 +1,59 @@
1
1
  /*
2
2
  * @Author: wangxian
3
3
  * @Date: 2023-02-06 08:24:17
4
- * @LastEditTime: 2023-02-09 14:09:26
4
+ * @LastEditTime: 2023-02-09 19:32:19
5
5
  */
6
6
  import { RefRule, Rule } from './ruleConfig';
7
7
  export var inputSchema = [{
8
8
  id: 'inputSchema',
9
9
  type: 'object',
10
- properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.defaultValue, Rule.common.help, Rule.common.tooltip, Rule.common.placeholder, Rule.common.require, Rule.common.disabled, Rule.common.hidden, RefRule.common.depend.props, RefRule.common.rules.props],
11
- types: [RefRule.common.depend.types]
10
+ properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan, Rule.common.defaultValue, Rule.common.help, Rule.common.tooltip, Rule.common.placeholder, Rule.common.require, Rule.common.disabled, Rule.common.hidden, RefRule.common.depend.props, RefRule.common.rules.props],
11
+ types: [RefRule.common.depend.types, RefRule.common.rules.types]
12
12
  }];
13
13
  export var textareaSchema = [{
14
14
  id: 'textareaSchema',
15
15
  type: 'object',
16
- properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.defaultValue, Rule.common.help, Rule.common.tooltip, Rule.common.placeholder, Rule.common.require, Rule.common.disabled, Rule.common.hidden, RefRule.common.depend.props, RefRule.common.rules.props],
17
- types: [RefRule.common.depend.types]
16
+ properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan, Rule.common.defaultValue, Rule.common.help, Rule.common.tooltip, Rule.common.placeholder, Rule.common.require, Rule.common.disabled, Rule.common.hidden, RefRule.common.depend.props, RefRule.common.rules.props],
17
+ types: [RefRule.common.depend.types, RefRule.common.rules.types]
18
18
  }];
19
19
  export var dateSchema = [{
20
- id: 'textareaSchema',
20
+ id: 'dateSchema',
21
21
  type: 'object',
22
- properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.defaultValue, Rule.common.help, Rule.common.tooltip, Rule.common.placeholder, Rule.common.require, Rule.common.disabled, Rule.common.hidden, RefRule.common.depend.props, RefRule.common.rules.props, RefRule.text.props],
23
- types: [RefRule.common.depend.types, RefRule.text.types]
22
+ properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan, Rule.common.defaultValue, Rule.common.help, Rule.common.tooltip, Rule.common.placeholder, Rule.common.require, Rule.common.disabled, Rule.common.hidden, RefRule.common.depend.props, RefRule.common.rules.props, RefRule.text.props],
23
+ types: [RefRule.common.depend.types, RefRule.text.types, RefRule.common.rules.types]
24
+ }];
25
+ export var numberSchema = [{
26
+ id: 'numberSchema',
27
+ type: 'object',
28
+ properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan, Rule.common.defaultValue, Rule.common.help, Rule.common.tooltip, Rule.common.placeholder, Rule.common.require, Rule.common.disabled, Rule.common.hidden, RefRule.common.depend.props, RefRule.common.rules.props],
29
+ types: [RefRule.common.depend.types, RefRule.common.rules.types]
30
+ }];
31
+ export var switchSchema = [{
32
+ id: 'switchSchema',
33
+ type: 'object',
34
+ properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan, Rule.common.defaultValue, Rule.common.help, Rule.common.tooltip, Rule.common.require, Rule.common.disabled, Rule.common.hidden, RefRule.common.depend.props],
35
+ types: [RefRule.common.depend.types]
36
+ }];
37
+ export var selectSchema = [{
38
+ id: 'switchSchema',
39
+ type: 'object',
40
+ properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan, Rule.common.defaultValue, Rule.common.help, Rule.common.tooltip, Rule.common.require, Rule.common.disabled, Rule.common.hidden, RefRule.common.depend.props],
41
+ types: [RefRule.common.depend.types]
42
+ }];
43
+ export var mutiSelectSchema = [{
44
+ id: 'switchSchema',
45
+ type: 'object',
46
+ properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan, Rule.common.defaultValue, Rule.common.help, Rule.common.tooltip, Rule.common.require, Rule.common.disabled, Rule.common.hidden, RefRule.common.depend.props],
47
+ types: [RefRule.common.depend.types]
24
48
  }];
25
49
  export var settingSchema = {
26
50
  input: inputSchema,
27
51
  textarea: textareaSchema,
28
- dateSchema: dateSchema
52
+ date: dateSchema,
53
+ numebr: numberSchema,
54
+ switch: switchSchema,
55
+ select: selectSchema,
56
+ mutiSelect: mutiSelectSchema
29
57
  };
30
58
  export var inputParam = {
31
59
  type: 'text',
@@ -40,10 +68,29 @@ export var textareaParam = {
40
68
  };
41
69
  export var dateParam = {
42
70
  type: 'text',
43
- schema: settingSchema.dateSchema,
71
+ schema: settingSchema.date,
44
72
  rule: {
45
73
  type: 'datePicker'
46
74
  }
75
+ };
76
+ export var numberParam = {
77
+ type: 'number',
78
+ schema: settingSchema.numebr
79
+ };
80
+ export var switchParam = {
81
+ type: 'bool',
82
+ schema: settingSchema.switch
83
+ };
84
+ export var selectParam = {
85
+ type: 'enum',
86
+ schema: settingSchema.select
87
+ };
88
+ export var mutiSelectParam = {
89
+ type: 'enum',
90
+ schema: settingSchema.mutiSelect,
91
+ rule: {
92
+ isMutiple: true
93
+ }
47
94
  }; // 基础组件列表渲染
48
95
 
49
96
  export var basicComps = [{
@@ -65,22 +112,22 @@ export var basicComps = [{
65
112
  id: 'number',
66
113
  name: '数字输入框',
67
114
  type: 'number',
68
- param: inputParam
115
+ param: numberParam
69
116
  }, {
70
117
  id: 'switch',
71
118
  name: '开关',
72
119
  type: 'switch',
73
- param: inputParam
120
+ param: switchParam
74
121
  }, {
75
122
  id: 'select',
76
123
  name: '下拉单选',
77
124
  type: 'select',
78
- param: inputParam
125
+ param: selectParam
79
126
  }, {
80
127
  id: 'mutiSelect',
81
128
  name: '下拉多选',
82
129
  type: 'mutiSelect',
83
- param: inputParam
130
+ param: mutiSelectParam
84
131
  }]; // 布局组件列表渲染
85
132
 
86
133
  export var layoutComps = [{
@@ -38,6 +38,25 @@ export declare const Rule: {
38
38
  };
39
39
  }[];
40
40
  };
41
+ colSpan: {
42
+ id: string;
43
+ type: string;
44
+ fields: {
45
+ id: string;
46
+ refId: string;
47
+ type: string;
48
+ value: {
49
+ 'common-en-US': {
50
+ depend: {};
51
+ };
52
+ common: {
53
+ label: string;
54
+ tooltip: string;
55
+ help: string;
56
+ };
57
+ };
58
+ }[];
59
+ };
41
60
  defaultValue: {
42
61
  id: string;
43
62
  type: string;
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * @Author: wangxian
3
3
  * @Date: 2023-02-08 10:36:25
4
- * @LastEditTime: 2023-02-09 14:08:23
4
+ * @LastEditTime: 2023-02-09 15:36:22
5
5
  */
6
6
  import { DEFAULT_DATE_FORMAT } from '../../../comps/MetadataForm/DataCell/Input';
7
7
  export var Rule = {
@@ -44,6 +44,25 @@ export var Rule = {
44
44
  }
45
45
  }]
46
46
  },
47
+ colSpan: {
48
+ id: 'colSpan',
49
+ type: 'number',
50
+ fields: [{
51
+ id: 'Rule.Form',
52
+ refId: 'com.ronds.schema.default.Rule.Form',
53
+ type: 'ref',
54
+ value: {
55
+ 'common-en-US': {
56
+ depend: {}
57
+ },
58
+ common: {
59
+ label: '组件布局',
60
+ tooltip: '默认按照整体布局配置排布',
61
+ help: '这里填写表单整体布局的倍数,最大一行'
62
+ }
63
+ }
64
+ }]
65
+ },
47
66
  defaultValue: {
48
67
  id: 'defaultValue',
49
68
  type: 'text',
@@ -20,13 +20,14 @@ import _Cascader from "antd/es/cascader";
20
20
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
21
21
  import _regeneratorRuntime from "@babel/runtime/regenerator";
22
22
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
23
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
23
24
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
24
25
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
25
26
 
26
27
  /*
27
28
  * @Author:wangxian
28
29
  * @Date: 2021-09-18 14:15:04
29
- * @LastEditTime: 2023-02-09 14:24:16
30
+ * @LastEditTime: 2023-02-10 08:23:34
30
31
  */
31
32
  import React from 'react';
32
33
  import { MetadataFormContext, MetadataRefContext } from '../interface';
@@ -83,12 +84,32 @@ function Index(props) {
83
84
  var _watch = extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$http = extraInfo.http) === null || _extraInfo$http === void 0 ? void 0 : _extraInfo$http.watch;
84
85
 
85
86
  if (_watch && (p === null || p === void 0 ? void 0 : p.type) === 'onSelectChange') {
86
- var _value = p === null || p === void 0 ? void 0 : p.payload[_watch];
87
+ var _watchArr = _watch.split(',');
88
+
89
+ if (_watchArr.length === 1) {
90
+ var _value = p === null || p === void 0 ? void 0 : p.payload[_watchArr[0]];
91
+
92
+ if (_value) {
93
+ setWatchValue(_value);
94
+ watchValueRef.current = _value;
95
+ formContext.form.setFieldsValue(_defineProperty({}, id, undefined));
96
+ }
97
+ } else {
98
+ for (var i = 0; i < _watchArr.length; i++) {
99
+ var w = _watchArr[i];
100
+
101
+ var _value2 = p === null || p === void 0 ? void 0 : p.payload[w];
102
+
103
+ if (_value2) {
104
+ var _wRef = watchValueRef.current || {};
105
+
106
+ _wRef[w] = _value2;
107
+ watchValueRef.current = _wRef;
108
+ }
109
+ }
87
110
 
88
- if (_value) {
89
- setWatchValue(_value);
90
- watchValueRef.current = _value;
91
111
  formContext.form.setFieldsValue(_defineProperty({}, id, undefined));
112
+ setWatchValue(_objectSpread({}, watchValueRef.current));
92
113
  }
93
114
  }
94
115
  }, [formContext.stream$, extraInfo]);
@@ -105,11 +126,13 @@ function Index(props) {
105
126
  _url = page ? http.url.replace('{page}', page) : _url;
106
127
 
107
128
  if (watchValueRef.current) {
108
- _url = _url.replace('{watch}', watchValueRef.current);
129
+ if (typeof watchValueRef.current === 'string') {
130
+ _url = _url.replace('{watch}', watchValueRef.current);
131
+ }
109
132
  }
110
133
 
111
134
  _context.next = 6;
112
- return server.GetEnumDataByUrl(_url);
135
+ return server.GetEnumDataByUrl(_url, http.method, (http === null || http === void 0 ? void 0 : http.body) && JSON.parse(http === null || http === void 0 ? void 0 : http.body) ? _objectSpread(_objectSpread({}, JSON.parse(http === null || http === void 0 ? void 0 : http.body)), watchValueRef.current || {}) : watchValueRef.current);
113
136
 
114
137
  case 6:
115
138
  res = _context.sent;
@@ -9,7 +9,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
9
9
  /*
10
10
  * @Author: wangxian
11
11
  * @Date: 2021-09-18 14:15:04
12
- * @LastEditTime: 2023-02-03 08:40:14
12
+ * @LastEditTime: 2023-02-09 15:53:44
13
13
  */
14
14
  import React from 'react';
15
15
  import Input from './DataCell/Input';
@@ -78,8 +78,17 @@ export function renderForm(schemaRef, options) {
78
78
  var _form = [];
79
79
 
80
80
  for (var i = 0; i < _properties.length; i++) {
81
+ var _properties$i, _properties$i2, _properties$i2$fields, _properties$i2$fields2;
82
+
83
+ var _colSpan = colSpan;
84
+ var compColSpan = ((_properties$i = _properties[i]) === null || _properties$i === void 0 ? void 0 : _properties$i.fields) && ((_properties$i2 = _properties[i]) === null || _properties$i2 === void 0 ? void 0 : (_properties$i2$fields = _properties$i2.fields[0]) === null || _properties$i2$fields === void 0 ? void 0 : (_properties$i2$fields2 = _properties$i2$fields.value) === null || _properties$i2$fields2 === void 0 ? void 0 : _properties$i2$fields2.colSpan);
85
+
86
+ if (compColSpan) {
87
+ _colSpan = compColSpan * colSpan <= 24 ? compColSpan * colSpan : 24;
88
+ }
89
+
81
90
  _form.push( /*#__PURE__*/React.createElement(_Col, {
82
- span: colSpan
91
+ span: _colSpan
83
92
  }, getDataCell(_properties[i], options)));
84
93
  }
85
94
 
@@ -16,5 +16,5 @@ export declare class MetadataService {
16
16
  /** 获取元数据的值 */
17
17
  GetMetadataObjList(data: any): Promise<any[]>;
18
18
  /** 通过扩展规则获取枚举类型的值 */
19
- GetEnumDataByUrl(url: string): Promise<any>;
19
+ GetEnumDataByUrl(url: string, method?: 'get' | 'post', body?: any): Promise<any>;
20
20
  }
@@ -6,7 +6,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
6
6
  /*
7
7
  * @Author: wangxian
8
8
  * @Date: 2021-09-18 14:15:04
9
- * @LastEditTime: 2022-05-21 08:35:21
9
+ * @LastEditTime: 2023-02-09 18:36:47
10
10
  */
11
11
  import Api from '../../api';
12
12
  var globalAPI = new Api();
@@ -138,13 +138,18 @@ export var MetadataService = /*#__PURE__*/function () {
138
138
  key: "GetEnumDataByUrl",
139
139
  value: function () {
140
140
  var _GetEnumDataByUrl = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(url) {
141
+ var method,
142
+ body,
143
+ _args5 = arguments;
141
144
  return _regeneratorRuntime.wrap(function _callee5$(_context5) {
142
145
  while (1) {
143
146
  switch (_context5.prev = _context5.next) {
144
147
  case 0:
145
- return _context5.abrupt("return", this.api.GetEnumDataByUrl(url));
148
+ method = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : 'get';
149
+ body = _args5.length > 2 ? _args5[2] : undefined;
150
+ return _context5.abrupt("return", this.api.GetEnumDataByUrl(url, method, body));
146
151
 
147
- case 1:
152
+ case 3:
148
153
  case "end":
149
154
  return _context5.stop();
150
155
  }
@@ -1,98 +1,98 @@
1
- /*
2
- * @Author: wangxian
3
- * @Date: 2021-09-18 14:15:04
4
- * @LastEditTime: 2022-08-11 18:26:11
5
- */
6
- export type IMetaType = 'object' | 'ref' | 'bool' | 'number' | 'text' | 'enum' | 'array' | string;
7
-
8
- export type IMetaData = {
9
- /**
10
- * 类名称/属性名称
11
- */
12
- id: string;
13
- /**
14
- * 类型
15
- */
16
- type: IMetaType;
17
- /**
18
- * 属性
19
- */
20
- properties?: IMetaProperties[];
21
-
22
- /**
23
- * 引用id
24
- */
25
- refId?: string;
26
- /**
27
- * 静态的变量
28
- */
29
- fields?: IMetaFileds[];
30
- /**
31
- * 内部类
32
- */
33
- types?: IMetaData[];
34
- };
35
-
36
- export type IMetaProperties = {
37
- /**
38
- * 类规则名称
39
- */
40
- id: string;
41
-
42
- /**
43
- * 类型
44
- */
45
- type: IMetaType;
46
-
47
- /**
48
- * 引用id
49
- */
50
- refId?: string;
51
- /**
52
- * 静态的变量
53
- */
54
- fields?: IMetaFileds[];
55
- /**
56
- * 枚举值
57
- */
58
- enum?: { value: string }[];
59
- /**
60
- * 数组类型
61
- */
62
- items?: { type: IMetaType; refId?: string };
63
- };
64
-
65
- export type IMetaFileds = {
66
- /**
67
- * 规则名称
68
- */
69
- id: string;
70
-
71
- /**
72
- * 类型
73
- */
74
- type: IMetaType;
75
-
76
- /**
77
- * 引用id
78
- */
79
- refId?: string;
80
-
81
- /**
82
- * 规则值
83
- */
84
- value: any;
85
- };
86
-
87
- export interface IAPI {
88
- // 获取元数据列表
89
- GetMetadataList(keyWords?: string[]): Promise<{ id: string; name: string; schema: string }[]>;
90
- // 通过元数据Id获取元数据详情
91
- GetMetadataDetailById(metadataId: string): Promise<any>;
92
- // 新增元数据
93
- SaveMetadata(data: any, metadataTag: string): Promise<any>;
94
- // 获取元数据的值
95
- GetMetadataObjList(data: any): Promise<any[]>;
96
- /** 通过扩展规则获取枚举类型的值 */
97
- GetEnumDataByUrl(url: string): Promise<any>;
98
- }
1
+ /*
2
+ * @Author: wangxian
3
+ * @Date: 2021-09-18 14:15:04
4
+ * @LastEditTime: 2023-02-09 18:37:15
5
+ */
6
+ export type IMetaType = 'object' | 'ref' | 'bool' | 'number' | 'text' | 'enum' | 'array' | string;
7
+
8
+ export type IMetaData = {
9
+ /**
10
+ * 类名称/属性名称
11
+ */
12
+ id: string;
13
+ /**
14
+ * 类型
15
+ */
16
+ type: IMetaType;
17
+ /**
18
+ * 属性
19
+ */
20
+ properties?: IMetaProperties[];
21
+
22
+ /**
23
+ * 引用id
24
+ */
25
+ refId?: string;
26
+ /**
27
+ * 静态的变量
28
+ */
29
+ fields?: IMetaFileds[];
30
+ /**
31
+ * 内部类
32
+ */
33
+ types?: IMetaData[];
34
+ };
35
+
36
+ export type IMetaProperties = {
37
+ /**
38
+ * 类规则名称
39
+ */
40
+ id: string;
41
+
42
+ /**
43
+ * 类型
44
+ */
45
+ type: IMetaType;
46
+
47
+ /**
48
+ * 引用id
49
+ */
50
+ refId?: string;
51
+ /**
52
+ * 静态的变量
53
+ */
54
+ fields?: IMetaFileds[];
55
+ /**
56
+ * 枚举值
57
+ */
58
+ enum?: { value: string }[];
59
+ /**
60
+ * 数组类型
61
+ */
62
+ items?: { type: IMetaType; refId?: string };
63
+ };
64
+
65
+ export type IMetaFileds = {
66
+ /**
67
+ * 规则名称
68
+ */
69
+ id: string;
70
+
71
+ /**
72
+ * 类型
73
+ */
74
+ type: IMetaType;
75
+
76
+ /**
77
+ * 引用id
78
+ */
79
+ refId?: string;
80
+
81
+ /**
82
+ * 规则值
83
+ */
84
+ value: any;
85
+ };
86
+
87
+ export interface IAPI {
88
+ // 获取元数据列表
89
+ GetMetadataList(keyWords?: string[]): Promise<{ id: string; name: string; schema: string }[]>;
90
+ // 通过元数据Id获取元数据详情
91
+ GetMetadataDetailById(metadataId: string): Promise<any>;
92
+ // 新增元数据
93
+ SaveMetadata(data: any, metadataTag: string): Promise<any>;
94
+ // 获取元数据的值
95
+ GetMetadataObjList(data: any): Promise<any[]>;
96
+ /** 通过扩展规则获取枚举类型的值 */
97
+ GetEnumDataByUrl(url: string, method: 'get' | 'post', body: any): Promise<any>;
98
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "public": true,
3
3
  "name": "ronds-metadata",
4
- "version": "1.1.87",
4
+ "version": "1.1.88",
5
5
  "scripts": {
6
6
  "start": "dumi dev",
7
7
  "docs:build": "dumi build",