@byteluck-fe/model-driven-engine 2.3.1-beta.3 → 2.3.1-beta.6

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.
@@ -1198,24 +1198,42 @@ var Engine = /*#__PURE__*/ function(Watcher) {
1198
1198
  return instances;
1199
1199
  };
1200
1200
  _proto.setInstance = function setInstance(instance, props, value, rowIndex) {
1201
+ var _this = this;
1201
1202
  try {
1202
- var _instance;
1203
- if (typeof instance === "string") {
1204
- _instance = this.getInstance(instance, rowIndex);
1203
+ if (typeof instance === "string" && rowIndex === -1) {
1204
+ //修改明细表整列属性的逻辑
1205
+ var instances = this.getInstances(instance, rowIndex === -1);
1206
+ instances.map(function(_instance) {
1207
+ if (_instance) {
1208
+ _this.debugLog("[%o]: 修改instance: %o的%o属性,修改的值为%o。", _instance.id, _instance, props, value);
1209
+ updateValueFromKeys(_instance.props, props, value);
1210
+ _this.schemaEvent("schema-change", {
1211
+ instance: _instance,
1212
+ props: props,
1213
+ value: value,
1214
+ rowIndex: rowIndex
1215
+ });
1216
+ }
1217
+ });
1205
1218
  } else {
1206
- _instance = instance;
1207
- }
1208
- if (!_instance) {
1209
- return;
1219
+ var _instance;
1220
+ if (typeof instance === "string") {
1221
+ _instance = this.getInstance(instance, rowIndex);
1222
+ } else {
1223
+ _instance = instance;
1224
+ }
1225
+ if (!_instance) {
1226
+ return;
1227
+ }
1228
+ this.debugLog("[%o]: 修改instance: %o的%o属性,修改的值为%o。", _instance.id, _instance, props, value);
1229
+ updateValueFromKeys(_instance.props, props, value);
1230
+ this.schemaEvent("schema-change", {
1231
+ instance: _instance,
1232
+ props: props,
1233
+ value: value,
1234
+ rowIndex: rowIndex
1235
+ });
1210
1236
  }
1211
- this.debugLog("[%o]: 修改instance: %o的%o属性,修改的值为%o。", _instance.id, _instance, props, value);
1212
- updateValueFromKeys(_instance.props, props, value);
1213
- this.schemaEvent("schema-change", {
1214
- instance: _instance,
1215
- props: props,
1216
- value: value,
1217
- rowIndex: rowIndex
1218
- });
1219
1237
  } catch (e) {
1220
1238
  throw e;
1221
1239
  }