@byteluck-fe/model-driven-engine 1.7.14 → 1.7.18

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.
@@ -1176,23 +1176,40 @@ var Engine = /*#__PURE__*/ function(Watcher) {
1176
1176
  return instances;
1177
1177
  };
1178
1178
  _proto.setInstance = function setInstance(instance, props, value, rowIndex) {
1179
+ var _this = this;
1179
1180
  try {
1180
- var _instance;
1181
- if (typeof instance === "string") {
1182
- _instance = this.getInstance(instance, rowIndex);
1181
+ if (typeof instance === "string" && rowIndex === -1) {
1182
+ //修改明细表整列属性的逻辑
1183
+ var instances = this.getInstances(instance, rowIndex === -1);
1184
+ instances.map(function(_instance) {
1185
+ if (_instance) {
1186
+ _this.debugLog("[%o]: 修改instance: %o的%o属性,修改的值为%o。", _instance.id, _instance, props, value);
1187
+ updateValueFromKeys(_instance.props, props, value);
1188
+ _this.schemaEvent("schema-change", {
1189
+ instance: _instance,
1190
+ props: props,
1191
+ value: value
1192
+ });
1193
+ }
1194
+ });
1183
1195
  } else {
1184
- _instance = instance;
1185
- }
1186
- if (!_instance) {
1187
- return;
1196
+ var _instance;
1197
+ if (typeof instance === "string") {
1198
+ _instance = this.getInstance(instance, rowIndex);
1199
+ } else {
1200
+ _instance = instance;
1201
+ }
1202
+ if (!_instance) {
1203
+ return;
1204
+ }
1205
+ this.debugLog("[%o]: 修改instance: %o的%o属性,修改的值为%o。", _instance.id, _instance, props, value);
1206
+ updateValueFromKeys(_instance.props, props, value);
1207
+ this.schemaEvent("schema-change", {
1208
+ instance: _instance,
1209
+ props: props,
1210
+ value: value
1211
+ });
1188
1212
  }
1189
- this.debugLog("[%o]: 修改instance: %o的%o属性,修改的值为%o。", _instance.id, _instance, props, value);
1190
- updateValueFromKeys(_instance.props, props, value);
1191
- this.schemaEvent("schema-change", {
1192
- instance: _instance,
1193
- props: props,
1194
- value: value
1195
- });
1196
1213
  } catch (e) {
1197
1214
  throw e;
1198
1215
  }
@@ -52,9 +52,10 @@ function _unsupportedIterableToArray(o, minLen) {
52
52
  import { error } from "@byteluck-fe/model-driven-shared";
53
53
  export var ES6ModulePlugin = /*#__PURE__*/ function() {
54
54
  "use strict";
55
- function ES6ModulePlugin(config) {
55
+ function ES6ModulePlugin(config, env) {
56
56
  _classCallCheck(this, ES6ModulePlugin);
57
57
  this.config = config;
58
+ this.env = env;
58
59
  }
59
60
  var _proto = ES6ModulePlugin.prototype;
60
61
  _proto.apply = function apply(engine) {
@@ -63,7 +64,7 @@ export var ES6ModulePlugin = /*#__PURE__*/ function() {
63
64
  if (!action) {
64
65
  return;
65
66
  }
66
- var res = parseModule(action, engine);
67
+ var res = parseModule(action, engine, this.env);
67
68
  if (!res) {
68
69
  return;
69
70
  }
@@ -93,7 +94,7 @@ export var ES6ModulePlugin = /*#__PURE__*/ function() {
93
94
  };
94
95
  return ES6ModulePlugin;
95
96
  }();
96
- export function parseModule(action, engine) {
97
+ export function parseModule(action, engine, env) {
97
98
  if (!action.module || !action.module.compiled) {
98
99
  return;
99
100
  }
@@ -101,7 +102,8 @@ export function parseModule(action, engine) {
101
102
  var module = {
102
103
  exports: {
103
104
  ctx: engine,
104
- utils: engine.getAction().actionUtils
105
+ utils: engine.getAction().actionUtils,
106
+ env: env
105
107
  }
106
108
  };
107
109
  try {