@byteluck-fe/model-driven-engine 2.1.0-sourcemap.13 → 2.1.0-sourcemap.14
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.
|
@@ -737,6 +737,18 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
737
737
|
_proto.updateInstanceProps = function updateInstanceProps(instance, props, value, rowIndex) {
|
|
738
738
|
return this.setInstance(instance, props, value, rowIndex);
|
|
739
739
|
};
|
|
740
|
+
_proto.getAllRules = function getAllRules(controlId) {
|
|
741
|
+
var rules = this.runtime.allRules;
|
|
742
|
+
if (controlId === undefined) {
|
|
743
|
+
return rules;
|
|
744
|
+
} else {
|
|
745
|
+
var _rules_rules_controlId, _rules_antdRules_controlId;
|
|
746
|
+
return {
|
|
747
|
+
rules: (_rules_rules_controlId = rules.rules[controlId]) === null || _rules_rules_controlId === void 0 ? void 0 : _rules_rules_controlId.fields,
|
|
748
|
+
antdRules: (_rules_antdRules_controlId = rules.antdRules[controlId]) === null || _rules_antdRules_controlId === void 0 ? void 0 : _rules_antdRules_controlId.fields
|
|
749
|
+
};
|
|
750
|
+
}
|
|
751
|
+
};
|
|
740
752
|
_proto.getRules = function getRules(controlId) {
|
|
741
753
|
if (controlId === undefined) {
|
|
742
754
|
return this.runtime.rules;
|
|
@@ -146,6 +146,31 @@ export var Runtime = /*#__PURE__*/ function(RegisterControls) {
|
|
|
146
146
|
return this._instanceMap;
|
|
147
147
|
}
|
|
148
148
|
},
|
|
149
|
+
{
|
|
150
|
+
key: "allRules",
|
|
151
|
+
get: function get() {
|
|
152
|
+
var antdRules = {};
|
|
153
|
+
var ruleItems = {};
|
|
154
|
+
loopDataViewControl(this._instance, function(dataView) {
|
|
155
|
+
ruleItems[dataView.id] = dataView.rules[0];
|
|
156
|
+
antdRules[dataView.id] = dataView.rules[0];
|
|
157
|
+
loopFormControl(dataView.children, function(item) {
|
|
158
|
+
// if (
|
|
159
|
+
// item instanceof RuntimeFormControl ||
|
|
160
|
+
// item instanceof RuntimeListControl
|
|
161
|
+
// ) {
|
|
162
|
+
if (item.controlType === CONTROL_BASE_TYPE.FORM || item.controlType === CONTROL_BASE_TYPE.LIST) {
|
|
163
|
+
buildControlRules(ruleItems[dataView.id].fields, item);
|
|
164
|
+
buildControlAntdRules(antdRules[dataView.id].fields, item);
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
return {
|
|
169
|
+
rules: ruleItems,
|
|
170
|
+
antdRules: antdRules
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
},
|
|
149
174
|
{
|
|
150
175
|
key: "rules",
|
|
151
176
|
get: function get() {
|