@byteluck-fe/model-driven-engine 2.3.7 → 2.3.8
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/esm/common/Engine.js +9 -6
- package/dist/index.umd.js +5 -5
- package/package.json +2 -2
|
@@ -1161,12 +1161,6 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
1161
1161
|
value: function setData(dataSet, options) {
|
|
1162
1162
|
var _this = this;
|
|
1163
1163
|
this.debugLog("engine setData方法执行,参数为%o,%o。", dataSet, options);
|
|
1164
|
-
var isEmpty = function(value) {
|
|
1165
|
-
if (isString(value) || Array.isArray(value)) {
|
|
1166
|
-
return value.length === 0;
|
|
1167
|
-
}
|
|
1168
|
-
return false;
|
|
1169
|
-
};
|
|
1170
1164
|
var newState = {};
|
|
1171
1165
|
Object.keys(dataSet).map(function(dataCode) {
|
|
1172
1166
|
var entity = dataSet[dataCode];
|
|
@@ -1218,8 +1212,17 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
1218
1212
|
;
|
|
1219
1213
|
var emptyState = JSONCopy(_this.store.emptyState);
|
|
1220
1214
|
if (!((_Object_keys = Object.keys(entity)) === null || _Object_keys === void 0 ? void 0 : _Object_keys.length)) {
|
|
1215
|
+
var _this_getDataBindMapping;
|
|
1221
1216
|
//判断entity 为空对象就给表单赋值默认值
|
|
1222
1217
|
newState = JSONCopy(emptyState);
|
|
1218
|
+
var _this_getDataBindMapping_controlId;
|
|
1219
|
+
var dataViewControlId = (_this_getDataBindMapping_controlId = (_this_getDataBindMapping = _this.getDataBindMapping(dataCode)) === null || _this_getDataBindMapping === void 0 ? void 0 : _this_getDataBindMapping.controlId) !== null && _this_getDataBindMapping_controlId !== void 0 ? _this_getDataBindMapping_controlId : "";
|
|
1220
|
+
var state = emptyState[dataViewControlId];
|
|
1221
|
+
Object.keys(state).map(function(key) {
|
|
1222
|
+
if (_this.getControlIdMapping()[key].children !== undefined) {
|
|
1223
|
+
newState[dataViewControlId][key] = [];
|
|
1224
|
+
}
|
|
1225
|
+
});
|
|
1223
1226
|
} else {
|
|
1224
1227
|
Object.keys(entity).map(function(fieldCode) {
|
|
1225
1228
|
if (skipKey.includes(fieldCode)) {
|