@byteluck-fe/model-driven-engine 2.3.13-beta.1 → 2.3.13-beta.3
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.
|
@@ -1165,11 +1165,20 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
1165
1165
|
Object.keys(dataSet).map(function(dataCode) {
|
|
1166
1166
|
var entity = dataSet[dataCode];
|
|
1167
1167
|
if (Array.isArray(entity)) {
|
|
1168
|
+
var mapping = _this.getDataBindMapping(dataCode);
|
|
1169
|
+
if (!mapping) {
|
|
1170
|
+
return;
|
|
1171
|
+
}
|
|
1172
|
+
if (!newState[mapping.dataViewId]) {
|
|
1173
|
+
newState[mapping.dataViewId] = {};
|
|
1174
|
+
}
|
|
1175
|
+
if (!entity.length) {
|
|
1176
|
+
var _newState_mapping_dataViewId_mapping_controlId;
|
|
1177
|
+
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 : [];
|
|
1178
|
+
} else {
|
|
1179
|
+
newState[mapping.dataViewId][mapping.controlId] = [];
|
|
1180
|
+
}
|
|
1168
1181
|
entity.map(function(row) {
|
|
1169
|
-
var mapping = _this.getDataBindMapping(dataCode);
|
|
1170
|
-
if (!mapping) {
|
|
1171
|
-
return;
|
|
1172
|
-
}
|
|
1173
1182
|
var newRow = JSONCopy(_this.store.emptyState[mapping.dataViewId][mapping.controlId]);
|
|
1174
1183
|
var skipKey = [] //qiyu ObjectDataBind中会提前将相关key拿出来赋值,为了避免重复赋值,设置了此变量
|
|
1175
1184
|
;
|
|
@@ -142,14 +142,14 @@ function ArrayHandler(target, propertyKey, value, thisKey, callback) {
|
|
|
142
142
|
var oldValue = target[propertyKey];
|
|
143
143
|
var concatKey = thisKey === "" ? propertyKey : thisKey + "." + propertyKey;
|
|
144
144
|
var _reProxyState;
|
|
145
|
-
newValue = (_reProxyState = reProxyState(
|
|
145
|
+
newValue = (_reProxyState = reProxyState(newValue)) !== null && _reProxyState !== void 0 ? _reProxyState : newValue;
|
|
146
146
|
// 先设置值,然后再进行触发回调,确保回调内拿到的是最新的值
|
|
147
147
|
var setResult;
|
|
148
148
|
// TODO 数组拦截操作需要重构,优化现有逻辑
|
|
149
149
|
// TODO 直接操作下标改动明细表时,没有对行数据进行checker
|
|
150
150
|
if (Array.isArray(target)) {
|
|
151
151
|
// 操作数组的时候,不需要使用拼接的thisKey,先判断执行的是否是违规操作,违规操作的话会报错,不允许继续执行,正常操作的话,返回一个回调函数,用于在值修改完之后触发
|
|
152
|
-
var nextHandler = ArrayHandler(target, propertyKey,
|
|
152
|
+
var nextHandler = ArrayHandler(target, propertyKey, newValue, thisKey, callback);
|
|
153
153
|
setResult = Reflect.set(target, propertyKey, newValue, receiver);
|
|
154
154
|
if (nextHandler) {
|
|
155
155
|
nextHandler();
|
|
@@ -171,7 +171,7 @@ function ArrayHandler(target, propertyKey, value, thisKey, callback) {
|
|
|
171
171
|
return true;
|
|
172
172
|
}
|
|
173
173
|
setResult = Reflect.set(target, propertyKey, newValue, receiver);
|
|
174
|
-
callback.call(null, target, concatKey,
|
|
174
|
+
callback.call(null, target, concatKey, newValue, oldValue);
|
|
175
175
|
}
|
|
176
176
|
return setResult;
|
|
177
177
|
}
|