@byteluck-fe/model-driven-engine 2.5.0-beta.12 → 2.5.0-beta.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.
@@ -1178,7 +1178,12 @@ var Engine = /*#__PURE__*/ function(Watcher) {
1178
1178
  if (!newState[mapping.dataViewId]) {
1179
1179
  newState[mapping.dataViewId] = {};
1180
1180
  }
1181
- newState[mapping.dataViewId][mapping.controlId] = [];
1181
+ if (!entity.length) {
1182
+ var _newState_mapping_dataViewId_mapping_controlId;
1183
+ newState[mapping.dataViewId][mapping.controlId] = (_newState_mapping_dataViewId_mapping_controlId = newState[mapping.dataViewId][mapping.controlId]) !== null && _newState_mapping_dataViewId_mapping_controlId !== void 0 ? _newState_mapping_dataViewId_mapping_controlId : [];
1184
+ } else {
1185
+ newState[mapping.dataViewId][mapping.controlId] = [];
1186
+ }
1182
1187
  entity.map(function(row) {
1183
1188
  var newRow = JSONCopy(_this.store.emptyState[mapping.dataViewId][mapping.controlId]);
1184
1189
  var skipKey = [] //qiyu ObjectDataBind中会提前将相关key拿出来赋值,为了避免重复赋值,设置了此变量
@@ -273,12 +273,12 @@ item) {
273
273
  loopFormSchema(item.props.headers, function(headerItem) {
274
274
  emptyTemplate[headerItem.id] = JSONCopy(headerItem.props.defaultValue);
275
275
  });
276
- var _item_props_defaultRows;
277
- dataViewState[item.id] = new Array((_item_props_defaultRows = item.props.defaultRows) !== null && _item_props_defaultRows !== void 0 ? _item_props_defaultRows : 1).fill(0).map(function() {
276
+ var _item_props_defaultRows, _fill_map;
277
+ dataViewState[item.id] = (_fill_map = new Array((_item_props_defaultRows = item.props.defaultRows) !== null && _item_props_defaultRows !== void 0 ? _item_props_defaultRows : 1).fill(0).map(function() {
278
278
  return _objectSpread({
279
279
  uid: "new:" + buildUUID("uid")
280
280
  }, JSONCopy(emptyTemplate));
281
- });
281
+ })) !== null && _fill_map !== void 0 ? _fill_map : [];
282
282
  emptyDataViewState[item.id] = emptyTemplate;
283
283
  }
284
284
  }