@byteluck-fe/model-driven-engine 2.7.0-alpha.31b → 2.7.0-alpha.35
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/README.md +30 -30
- package/dist/esm/common/ActionManager.js +177 -60
- package/dist/esm/common/DataManager.js +134 -25
- package/dist/esm/common/Engine.js +480 -406
- package/dist/esm/common/OkWorker.js +31 -17
- package/dist/esm/common/Plugin.js +2 -2
- package/dist/esm/common/Runtime.js +80 -104
- package/dist/esm/common/Store.js +63 -62
- package/dist/esm/common/checkerValue.js +108 -108
- package/dist/esm/common/index.js +2 -2
- package/dist/esm/common/proxyState.js +76 -76
- package/dist/esm/index.js +3 -3
- package/dist/esm/plugins/CalcPlugin.js +128 -120
- package/dist/esm/plugins/ControlsEventPlugin.js +196 -73
- package/dist/esm/plugins/ES6ModulePlugin.js +54 -66
- package/dist/esm/plugins/LifecycleEventPlugin.js +198 -79
- package/dist/esm/plugins/StylePlugin.js +26 -11
- package/dist/esm/plugins/index.js +5 -5
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/utils/runtimeUtils.js +5 -7
- package/dist/index.umd.js +8 -8
- package/dist/types/common/ActionManager.d.ts +14 -14
- package/dist/types/common/DataManager.d.ts +10 -10
- package/dist/types/common/Engine.d.ts +184 -181
- package/dist/types/common/OkWorker.d.ts +13 -13
- package/dist/types/common/Plugin.d.ts +6 -6
- package/dist/types/common/Runtime.d.ts +25 -26
- package/dist/types/common/Store.d.ts +50 -50
- package/dist/types/common/checkerValue.d.ts +3 -3
- package/dist/types/common/index.d.ts +2 -2
- package/dist/types/common/proxyState.d.ts +30 -30
- package/dist/types/index.d.ts +3 -3
- package/dist/types/plugins/CalcPlugin.d.ts +121 -121
- package/dist/types/plugins/ControlsEventPlugin.d.ts +15 -15
- package/dist/types/plugins/ES6ModulePlugin.d.ts +26 -27
- package/dist/types/plugins/LifecycleEventPlugin.d.ts +14 -14
- package/dist/types/plugins/StylePlugin.d.ts +12 -12
- package/dist/types/plugins/index.d.ts +5 -5
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/runtimeUtils.d.ts +5 -5
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _class_call_check(instance, Constructor) {
|
|
2
2
|
if (!(instance instanceof Constructor)) {
|
|
3
3
|
throw new TypeError("Cannot call a class as a function");
|
|
4
4
|
}
|
|
@@ -12,24 +12,38 @@ function _defineProperties(target, props) {
|
|
|
12
12
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
16
16
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
17
17
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
18
18
|
return Constructor;
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
function _define_property(obj, key, value) {
|
|
21
|
+
if (key in obj) {
|
|
22
|
+
Object.defineProperty(obj, key, {
|
|
23
|
+
value: value,
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true
|
|
27
|
+
});
|
|
28
|
+
} else {
|
|
29
|
+
obj[key] = value;
|
|
30
|
+
}
|
|
31
|
+
return obj;
|
|
32
|
+
}
|
|
33
|
+
import { log } from "@byteluck-fe/model-driven-shared";
|
|
21
34
|
var OkWorker = /*#__PURE__*/ function() {
|
|
22
35
|
"use strict";
|
|
23
36
|
function OkWorker() {
|
|
24
|
-
|
|
37
|
+
_class_call_check(this, OkWorker);
|
|
38
|
+
_define_property(this, "worker", void 0);
|
|
25
39
|
}
|
|
26
|
-
|
|
40
|
+
_create_class(OkWorker, [
|
|
27
41
|
{
|
|
28
42
|
key: "run",
|
|
29
43
|
value: function run(initState) {
|
|
30
44
|
this.worker = OkWorker.createWorker();
|
|
31
45
|
this.postMessage({
|
|
32
|
-
action:
|
|
46
|
+
action: "init",
|
|
33
47
|
payload: initState
|
|
34
48
|
});
|
|
35
49
|
}
|
|
@@ -37,15 +51,15 @@ var OkWorker = /*#__PURE__*/ function() {
|
|
|
37
51
|
{
|
|
38
52
|
key: "destroy",
|
|
39
53
|
value: function destroy() {
|
|
40
|
-
var
|
|
41
|
-
(
|
|
54
|
+
var _this_worker;
|
|
55
|
+
(_this_worker = this.worker) === null || _this_worker === void 0 ? void 0 : _this_worker.terminate();
|
|
42
56
|
}
|
|
43
57
|
},
|
|
44
58
|
{
|
|
45
59
|
key: "postMessage",
|
|
46
60
|
value: function postMessage(message) {
|
|
47
|
-
var
|
|
48
|
-
(
|
|
61
|
+
var _this_worker;
|
|
62
|
+
(_this_worker = this.worker) === null || _this_worker === void 0 ? void 0 : _this_worker.postMessage(message);
|
|
49
63
|
}
|
|
50
64
|
}
|
|
51
65
|
], [
|
|
@@ -71,7 +85,7 @@ var OkWorker = /*#__PURE__*/ function() {
|
|
|
71
85
|
set: function set(target, key, value) {
|
|
72
86
|
if (parentKey) {
|
|
73
87
|
_self.postMessage({
|
|
74
|
-
action:
|
|
88
|
+
action: "update",
|
|
75
89
|
key: "".concat(parentKey, ".").concat(key)
|
|
76
90
|
});
|
|
77
91
|
}
|
|
@@ -79,7 +93,7 @@ var OkWorker = /*#__PURE__*/ function() {
|
|
|
79
93
|
}
|
|
80
94
|
};
|
|
81
95
|
};
|
|
82
|
-
log(
|
|
96
|
+
log("\uD83D\uDE80 worker running");
|
|
83
97
|
var _self = self;
|
|
84
98
|
// function createProxy(
|
|
85
99
|
// obj: Record<string, unknown> | Array<Record<string, unknown>>,
|
|
@@ -92,8 +106,8 @@ var OkWorker = /*#__PURE__*/ function() {
|
|
|
92
106
|
// }
|
|
93
107
|
// return new Proxy(obj, createHandler(parentKey))
|
|
94
108
|
// }
|
|
95
|
-
_self.addEventListener(
|
|
96
|
-
var
|
|
109
|
+
_self.addEventListener("message", function(event) {
|
|
110
|
+
var _event_data = event.data, action = _event_data.action, payload = _event_data.payload, fn = _event_data.fn;
|
|
97
111
|
log(action, payload);
|
|
98
112
|
// 通过proxy进行代理,每次修改的时候,自动向外抛出postMessage
|
|
99
113
|
// data.key1 = 1
|
|
@@ -104,10 +118,10 @@ var OkWorker = /*#__PURE__*/ function() {
|
|
|
104
118
|
//
|
|
105
119
|
// const result = fn(data, schema)
|
|
106
120
|
_self.postMessage({
|
|
107
|
-
action:
|
|
121
|
+
action: "delete",
|
|
108
122
|
payload: {
|
|
109
|
-
key:
|
|
110
|
-
value:
|
|
123
|
+
key: "key3[0].key1",
|
|
124
|
+
value: "index"
|
|
111
125
|
}
|
|
112
126
|
});
|
|
113
127
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _class_call_check(instance, Constructor) {
|
|
2
2
|
if (!(instance instanceof Constructor)) {
|
|
3
3
|
throw new TypeError("Cannot call a class as a function");
|
|
4
4
|
}
|
|
5
5
|
}
|
|
6
6
|
var Plugin = function Plugin() {
|
|
7
7
|
"use strict";
|
|
8
|
-
|
|
8
|
+
_class_call_check(this, Plugin);
|
|
9
9
|
};
|
|
10
10
|
export { Plugin };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _assert_this_initialized(self) {
|
|
2
2
|
if (self === void 0) {
|
|
3
3
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
4
4
|
}
|
|
5
5
|
return self;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function _class_call_check(instance, Constructor) {
|
|
8
8
|
if (!(instance instanceof Constructor)) {
|
|
9
9
|
throw new TypeError("Cannot call a class as a function");
|
|
10
10
|
}
|
|
@@ -18,16 +18,29 @@ function _defineProperties(target, props) {
|
|
|
18
18
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
22
22
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
23
23
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
24
24
|
return Constructor;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
26
|
+
function _define_property(obj, key, value) {
|
|
27
|
+
if (key in obj) {
|
|
28
|
+
Object.defineProperty(obj, key, {
|
|
29
|
+
value: value,
|
|
30
|
+
enumerable: true,
|
|
31
|
+
configurable: true,
|
|
32
|
+
writable: true
|
|
33
|
+
});
|
|
34
|
+
} else {
|
|
35
|
+
obj[key] = value;
|
|
36
|
+
}
|
|
37
|
+
return obj;
|
|
38
|
+
}
|
|
39
|
+
function _get_prototype_of(o) {
|
|
40
|
+
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
28
41
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
29
42
|
};
|
|
30
|
-
return
|
|
43
|
+
return _get_prototype_of(o);
|
|
31
44
|
}
|
|
32
45
|
function _inherits(subClass, superClass) {
|
|
33
46
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -40,26 +53,26 @@ function _inherits(subClass, superClass) {
|
|
|
40
53
|
configurable: true
|
|
41
54
|
}
|
|
42
55
|
});
|
|
43
|
-
if (superClass)
|
|
56
|
+
if (superClass) _set_prototype_of(subClass, superClass);
|
|
44
57
|
}
|
|
45
|
-
function
|
|
46
|
-
if (call && (
|
|
58
|
+
function _possible_constructor_return(self, call) {
|
|
59
|
+
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
47
60
|
return call;
|
|
48
61
|
}
|
|
49
|
-
return
|
|
62
|
+
return _assert_this_initialized(self);
|
|
50
63
|
}
|
|
51
|
-
function
|
|
52
|
-
|
|
64
|
+
function _set_prototype_of(o, p) {
|
|
65
|
+
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
53
66
|
o.__proto__ = p;
|
|
54
67
|
return o;
|
|
55
68
|
};
|
|
56
|
-
return
|
|
69
|
+
return _set_prototype_of(o, p);
|
|
57
70
|
}
|
|
58
|
-
|
|
71
|
+
function _type_of(obj) {
|
|
59
72
|
"@swc/helpers - typeof";
|
|
60
73
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
61
|
-
}
|
|
62
|
-
function
|
|
74
|
+
}
|
|
75
|
+
function _is_native_reflect_construct() {
|
|
63
76
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
64
77
|
if (Reflect.construct.sham) return false;
|
|
65
78
|
if (typeof Proxy === "function") return true;
|
|
@@ -70,71 +83,59 @@ function _isNativeReflectConstruct() {
|
|
|
70
83
|
return false;
|
|
71
84
|
}
|
|
72
85
|
}
|
|
73
|
-
function
|
|
74
|
-
var hasNativeReflectConstruct =
|
|
86
|
+
function _create_super(Derived) {
|
|
87
|
+
var hasNativeReflectConstruct = _is_native_reflect_construct();
|
|
75
88
|
return function _createSuperInternal() {
|
|
76
|
-
var Super =
|
|
89
|
+
var Super = _get_prototype_of(Derived), result;
|
|
77
90
|
if (hasNativeReflectConstruct) {
|
|
78
|
-
var NewTarget =
|
|
91
|
+
var NewTarget = _get_prototype_of(this).constructor;
|
|
79
92
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
80
93
|
} else {
|
|
81
94
|
result = Super.apply(this, arguments);
|
|
82
95
|
}
|
|
83
|
-
return
|
|
96
|
+
return _possible_constructor_return(this, result);
|
|
84
97
|
};
|
|
85
98
|
}
|
|
86
|
-
import { RegisterControls } from
|
|
87
|
-
import { CONTROL_BASE_TYPE, CONTROL_TYPE,
|
|
88
|
-
import { hasChildrenControl, loopDataViewControl, loopFormControl } from
|
|
89
|
-
export var Runtime = /*#__PURE__*/ function(
|
|
99
|
+
import { RegisterControls } from "@byteluck-fe/model-driven-core";
|
|
100
|
+
import { CONTROL_BASE_TYPE, CONTROL_TYPE, loopFormSchema } from "@byteluck-fe/model-driven-shared";
|
|
101
|
+
import { hasChildrenControl, loopDataViewControl, loopFormControl } from "../utils/runtimeUtils";
|
|
102
|
+
export var Runtime = /*#__PURE__*/ function(RegisterControls) {
|
|
90
103
|
"use strict";
|
|
91
|
-
_inherits(Runtime,
|
|
92
|
-
var _super =
|
|
104
|
+
_inherits(Runtime, RegisterControls);
|
|
105
|
+
var _super = _create_super(Runtime);
|
|
93
106
|
function Runtime(props) {
|
|
94
|
-
|
|
107
|
+
_class_call_check(this, Runtime);
|
|
95
108
|
var _this;
|
|
96
|
-
_this = _super.call(this,
|
|
97
|
-
_this
|
|
98
|
-
_this
|
|
99
|
-
_this
|
|
109
|
+
_this = _super.call(this, "Runtime");
|
|
110
|
+
_define_property(_assert_this_initialized(_this), "_schema", void 0);
|
|
111
|
+
_define_property(_assert_this_initialized(_this), "_instance", void 0);
|
|
112
|
+
_define_property(_assert_this_initialized(_this), "_flatInstances", []);
|
|
113
|
+
_define_property(_assert_this_initialized(_this), "_instanceMap", {});
|
|
100
114
|
var schema = props.schema;
|
|
101
115
|
_this._schema = schema;
|
|
102
116
|
_this._instance = _this.createControl(schema, props.beforeCreateInstance);
|
|
103
117
|
_this.getFlatInstances();
|
|
104
118
|
return _this;
|
|
105
119
|
}
|
|
106
|
-
|
|
120
|
+
_create_class(Runtime, [
|
|
107
121
|
{
|
|
108
122
|
key: "getFlatInstances",
|
|
109
123
|
value: function getFlatInstances() {
|
|
110
124
|
var instances = [];
|
|
111
125
|
var instanceMap = {};
|
|
112
|
-
|
|
113
|
-
loop(this._instance, '', function(item, parentId) {
|
|
126
|
+
loop(this._instance, function(item) {
|
|
114
127
|
// 3.4.1 避免将subtable-row 放到 _flatInstances 中
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
// return
|
|
118
|
-
// }
|
|
119
|
-
if (parentId) {
|
|
120
|
-
// @ts-ignore
|
|
121
|
-
controlParentIdMap[item.id] = parentId;
|
|
128
|
+
if (item.type === "subtable-row" || item.type === "subtable-column") {
|
|
129
|
+
return;
|
|
122
130
|
}
|
|
131
|
+
instances.push(item);
|
|
123
132
|
if (!instanceMap[item.id]) {
|
|
124
133
|
instanceMap[item.id] = [];
|
|
125
134
|
}
|
|
126
|
-
//不知为何subtable-column会多存一次
|
|
127
|
-
if (item.type === 'subtable-column') {
|
|
128
|
-
if (instanceMap[item.id].length > 0) {
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
instances.push(item);
|
|
133
135
|
instanceMap[item.id].push(item);
|
|
134
136
|
});
|
|
135
137
|
this._flatInstances = instances;
|
|
136
138
|
this._instanceMap = instanceMap;
|
|
137
|
-
this._controlParentIdMap = controlParentIdMap;
|
|
138
139
|
return this._flatInstances;
|
|
139
140
|
}
|
|
140
141
|
},
|
|
@@ -168,9 +169,8 @@ export var Runtime = /*#__PURE__*/ function(RegisterControls1) {
|
|
|
168
169
|
var antdRules = {};
|
|
169
170
|
var ruleItems = {};
|
|
170
171
|
loopDataViewControl(this._instance, function(dataView) {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
antdRules[dataView.id] = JSONCopy(result[0]);
|
|
172
|
+
ruleItems[dataView.id] = dataView.rules[0];
|
|
173
|
+
antdRules[dataView.id] = dataView.rules[0];
|
|
174
174
|
loopFormControl(dataView.children, function(item) {
|
|
175
175
|
// if (
|
|
176
176
|
// item instanceof RuntimeFormControl ||
|
|
@@ -193,9 +193,7 @@ export var Runtime = /*#__PURE__*/ function(RegisterControls1) {
|
|
|
193
193
|
get: function get() {
|
|
194
194
|
var ruleItems = {};
|
|
195
195
|
loopDataViewControl(this._instance, function(dataView) {
|
|
196
|
-
|
|
197
|
-
// ruleItems[dataView.id] = dataView.rules[0]
|
|
198
|
-
ruleItems[dataView.id] = result[0];
|
|
196
|
+
ruleItems[dataView.id] = dataView.rules[0];
|
|
199
197
|
loopFormControl(dataView.children, function(item) {
|
|
200
198
|
// if (
|
|
201
199
|
// item instanceof RuntimeFormControl ||
|
|
@@ -214,9 +212,7 @@ export var Runtime = /*#__PURE__*/ function(RegisterControls1) {
|
|
|
214
212
|
get: function get() {
|
|
215
213
|
var antdRules = {};
|
|
216
214
|
loopDataViewControl(this._instance, function(dataView) {
|
|
217
|
-
|
|
218
|
-
// antdRules[dataView.id] = dataView.rules[0]
|
|
219
|
-
antdRules[dataView.id] = result[0];
|
|
215
|
+
antdRules[dataView.id] = dataView.rules[0];
|
|
220
216
|
loopFormControl(dataView.children, function(item) {
|
|
221
217
|
// if (
|
|
222
218
|
// item instanceof RuntimeFormControl ||
|
|
@@ -233,38 +229,30 @@ export var Runtime = /*#__PURE__*/ function(RegisterControls1) {
|
|
|
233
229
|
]);
|
|
234
230
|
return Runtime;
|
|
235
231
|
}(RegisterControls);
|
|
236
|
-
function loop(control,
|
|
237
|
-
|
|
238
|
-
control
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
232
|
+
function loop(control, callback) {
|
|
233
|
+
if (Array.isArray(control)) {
|
|
234
|
+
control.map(function(item) {
|
|
235
|
+
callback(item);
|
|
236
|
+
if (hasChildrenControl(item)) {
|
|
237
|
+
var ctl = item;
|
|
238
|
+
if (!ctl.children) {
|
|
239
|
+
ctl.children = [];
|
|
240
|
+
}
|
|
241
|
+
// @ts-ignore
|
|
242
|
+
loop(ctl.children, callback);
|
|
246
243
|
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
loop(item.props.headers, item.id, callback);
|
|
252
|
-
}
|
|
253
|
-
if (hasHeaderOrFooterControl(item, 'footers')) {
|
|
254
|
-
loop(item.props.footers, item.id, callback);
|
|
255
|
-
}
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
function hasHeaderOrFooterControl(control, checkType) {
|
|
259
|
-
return checkType in control.props && isArray(control.props[checkType]);
|
|
244
|
+
});
|
|
245
|
+
} else {
|
|
246
|
+
callback(control);
|
|
247
|
+
}
|
|
260
248
|
}
|
|
261
|
-
/**
|
|
262
|
-
* 控件是否在视图中隐藏,遍历查找所有parent
|
|
249
|
+
/**
|
|
250
|
+
* 控件是否在视图中隐藏,遍历查找所有parent
|
|
263
251
|
* */ function getControlIsHide(control) {
|
|
264
252
|
if (control.props.isHide) {
|
|
265
253
|
return true;
|
|
266
254
|
}
|
|
267
|
-
if (control.parent === null
|
|
255
|
+
if (control.parent === null) {
|
|
268
256
|
return false;
|
|
269
257
|
}
|
|
270
258
|
return getControlIsHide(control.parent);
|
|
@@ -274,16 +262,13 @@ item) {
|
|
|
274
262
|
if (getControlIsHide(item)) {
|
|
275
263
|
return;
|
|
276
264
|
}
|
|
277
|
-
var result = Runtime.staticGetRules(item.type, item.props);
|
|
278
265
|
// if (item instanceof RuntimeFormControl) {
|
|
279
266
|
if (item.controlType === CONTROL_BASE_TYPE.FORM) {
|
|
280
|
-
|
|
281
|
-
data[item.id] = result;
|
|
267
|
+
data[item.id] = item.rules;
|
|
282
268
|
} else if (item.type === CONTROL_TYPE.SUBTABLE) {
|
|
283
|
-
|
|
284
|
-
data[item.id] = result;
|
|
269
|
+
data[item.id] = item.rules;
|
|
285
270
|
var itemRules = {
|
|
286
|
-
type:
|
|
271
|
+
type: "array",
|
|
287
272
|
fields: {}
|
|
288
273
|
};
|
|
289
274
|
item.children.forEach(function(row, index) {
|
|
@@ -291,18 +276,13 @@ item) {
|
|
|
291
276
|
if (itemRules.fields) {
|
|
292
277
|
if (!itemRules.fields[index]) {
|
|
293
278
|
itemRules.fields[index] = {
|
|
294
|
-
type:
|
|
279
|
+
type: "object",
|
|
295
280
|
required: true,
|
|
296
281
|
fields: {}
|
|
297
282
|
};
|
|
298
283
|
}
|
|
299
|
-
// // @ts-ignore
|
|
300
|
-
// itemRules.fields[index].fields[formControl.id] = (
|
|
301
|
-
// formControl as RuntimeFormControl
|
|
302
|
-
// ).rules
|
|
303
|
-
var childResult = Runtime.staticGetRules(formControl.type, formControl.props);
|
|
304
284
|
// @ts-ignore
|
|
305
|
-
itemRules.fields[index].fields[formControl.id] =
|
|
285
|
+
itemRules.fields[index].fields[formControl.id] = formControl.rules;
|
|
306
286
|
}
|
|
307
287
|
});
|
|
308
288
|
});
|
|
@@ -314,19 +294,15 @@ item) {
|
|
|
314
294
|
if (getControlIsHide(item)) {
|
|
315
295
|
return;
|
|
316
296
|
}
|
|
317
|
-
var result = Runtime.staticGetRules(item.type, item.props);
|
|
318
297
|
// if (item instanceof RuntimeFormControl) {
|
|
319
298
|
if (item.controlType === CONTROL_BASE_TYPE.FORM) {
|
|
320
|
-
|
|
321
|
-
antdRules[item.id] = result;
|
|
299
|
+
antdRules[item.id] = item.rules;
|
|
322
300
|
} else if (item.type === CONTROL_TYPE.SUBTABLE && item.children.length) {
|
|
323
301
|
antdRules[item.id] = [];
|
|
324
302
|
item.children.forEach(function(row) {
|
|
325
303
|
var rules = {};
|
|
326
304
|
loopFormSchema(row.children, function(formControl) {
|
|
327
|
-
|
|
328
|
-
var childResult = Runtime.staticGetRules(formControl.type, formControl.props);
|
|
329
|
-
rules[formControl.id] = childResult;
|
|
305
|
+
rules[formControl.id] = formControl.rules;
|
|
330
306
|
});
|
|
331
307
|
antdRules[item.id].push(rules);
|
|
332
308
|
});
|