@byteluck-fe/model-driven-engine 4.34.0-lx2 → 4.36.0-lx1
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/ActionManager.js +6 -11
- package/dist/esm/common/DataManager.js +7 -12
- package/dist/esm/common/Engine.js +12 -16
- package/dist/esm/common/Store.js +1 -2
- package/dist/esm/plugins/CalcPlugin.js +3 -3
- package/dist/esm/plugins/ControlsEventPlugin.js +19 -29
- package/dist/esm/plugins/LifecycleEventPlugin.js +18 -29
- package/dist/index.umd.js +8 -8
- package/package.json +3 -3
|
@@ -85,7 +85,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
85
85
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
86
86
|
}
|
|
87
87
|
function _ts_generator(thisArg, body) {
|
|
88
|
-
var f, y, t,
|
|
88
|
+
var f, y, t, _ = {
|
|
89
89
|
label: 0,
|
|
90
90
|
sent: function() {
|
|
91
91
|
if (t[0] & 1) throw t[1];
|
|
@@ -93,12 +93,8 @@ function _ts_generator(thisArg, body) {
|
|
|
93
93
|
},
|
|
94
94
|
trys: [],
|
|
95
95
|
ops: []
|
|
96
|
-
};
|
|
97
|
-
return g = {
|
|
98
|
-
next: verb(0),
|
|
99
|
-
"throw": verb(1),
|
|
100
|
-
"return": verb(2)
|
|
101
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
96
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
97
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
102
98
|
return this;
|
|
103
99
|
}), g;
|
|
104
100
|
function verb(n) {
|
|
@@ -111,7 +107,7 @@ function _ts_generator(thisArg, body) {
|
|
|
111
107
|
}
|
|
112
108
|
function step(op) {
|
|
113
109
|
if (f) throw new TypeError("Generator is already executing.");
|
|
114
|
-
while(_)try {
|
|
110
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
115
111
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
116
112
|
if (y = 0, t) op = [
|
|
117
113
|
op[0] & 2,
|
|
@@ -200,13 +196,12 @@ export var ActionManager = /*#__PURE__*/ function() {
|
|
|
200
196
|
for(var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
|
|
201
197
|
args[_key - 2] = arguments[_key];
|
|
202
198
|
}
|
|
203
|
-
var _this = this;
|
|
204
199
|
return _async_to_generator(function() {
|
|
205
200
|
var action, _action_func, result, e;
|
|
206
201
|
return _ts_generator(this, function(_state) {
|
|
207
202
|
switch(_state.label){
|
|
208
203
|
case 0:
|
|
209
|
-
action =
|
|
204
|
+
action = this.actionMap.get(name);
|
|
210
205
|
if (!action) {
|
|
211
206
|
return [
|
|
212
207
|
2
|
|
@@ -248,7 +243,7 @@ export var ActionManager = /*#__PURE__*/ function() {
|
|
|
248
243
|
];
|
|
249
244
|
}
|
|
250
245
|
});
|
|
251
|
-
})();
|
|
246
|
+
}).call(this);
|
|
252
247
|
}
|
|
253
248
|
},
|
|
254
249
|
{
|
|
@@ -60,7 +60,7 @@ function _define_property(obj, key, value) {
|
|
|
60
60
|
return obj;
|
|
61
61
|
}
|
|
62
62
|
function _ts_generator(thisArg, body) {
|
|
63
|
-
var f, y, t,
|
|
63
|
+
var f, y, t, _ = {
|
|
64
64
|
label: 0,
|
|
65
65
|
sent: function() {
|
|
66
66
|
if (t[0] & 1) throw t[1];
|
|
@@ -68,12 +68,8 @@ function _ts_generator(thisArg, body) {
|
|
|
68
68
|
},
|
|
69
69
|
trys: [],
|
|
70
70
|
ops: []
|
|
71
|
-
};
|
|
72
|
-
return g = {
|
|
73
|
-
next: verb(0),
|
|
74
|
-
"throw": verb(1),
|
|
75
|
-
"return": verb(2)
|
|
76
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
71
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
72
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
77
73
|
return this;
|
|
78
74
|
}), g;
|
|
79
75
|
function verb(n) {
|
|
@@ -86,7 +82,7 @@ function _ts_generator(thisArg, body) {
|
|
|
86
82
|
}
|
|
87
83
|
function step(op) {
|
|
88
84
|
if (f) throw new TypeError("Generator is already executing.");
|
|
89
|
-
while(_)try {
|
|
85
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
90
86
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
91
87
|
if (y = 0, t) op = [
|
|
92
88
|
op[0] & 2,
|
|
@@ -186,10 +182,9 @@ export var DataManager = /*#__PURE__*/ function() {
|
|
|
186
182
|
{
|
|
187
183
|
key: "getRemoteData",
|
|
188
184
|
value: function getRemoteData(payload) {
|
|
189
|
-
var _this = this;
|
|
190
185
|
return _async_to_generator(function() {
|
|
191
186
|
return _ts_generator(this, function(_state) {
|
|
192
|
-
if (
|
|
187
|
+
if (this.executer === undefined) {
|
|
193
188
|
logerror('未初始化executer');
|
|
194
189
|
return [
|
|
195
190
|
2,
|
|
@@ -198,14 +193,14 @@ export var DataManager = /*#__PURE__*/ function() {
|
|
|
198
193
|
} else {
|
|
199
194
|
return [
|
|
200
195
|
2,
|
|
201
|
-
|
|
196
|
+
this.executer(payload)
|
|
202
197
|
];
|
|
203
198
|
}
|
|
204
199
|
return [
|
|
205
200
|
2
|
|
206
201
|
];
|
|
207
202
|
});
|
|
208
|
-
})();
|
|
203
|
+
}).call(this);
|
|
209
204
|
}
|
|
210
205
|
}
|
|
211
206
|
]);
|
|
@@ -234,7 +234,7 @@ function _is_native_reflect_construct() {
|
|
|
234
234
|
})();
|
|
235
235
|
}
|
|
236
236
|
function _ts_generator(thisArg, body) {
|
|
237
|
-
var f, y, t,
|
|
237
|
+
var f, y, t, _ = {
|
|
238
238
|
label: 0,
|
|
239
239
|
sent: function() {
|
|
240
240
|
if (t[0] & 1) throw t[1];
|
|
@@ -242,12 +242,8 @@ function _ts_generator(thisArg, body) {
|
|
|
242
242
|
},
|
|
243
243
|
trys: [],
|
|
244
244
|
ops: []
|
|
245
|
-
};
|
|
246
|
-
return g = {
|
|
247
|
-
next: verb(0),
|
|
248
|
-
"throw": verb(1),
|
|
249
|
-
"return": verb(2)
|
|
250
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
245
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
246
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
251
247
|
return this;
|
|
252
248
|
}), g;
|
|
253
249
|
function verb(n) {
|
|
@@ -260,7 +256,7 @@ function _ts_generator(thisArg, body) {
|
|
|
260
256
|
}
|
|
261
257
|
function step(op) {
|
|
262
258
|
if (f) throw new TypeError("Generator is already executing.");
|
|
263
|
-
while(_)try {
|
|
259
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
264
260
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
265
261
|
if (y = 0, t) op = [
|
|
266
262
|
op[0] & 2,
|
|
@@ -781,19 +777,19 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
781
777
|
3,
|
|
782
778
|
3
|
|
783
779
|
];
|
|
784
|
-
if (
|
|
780
|
+
if (this.isMounted) {
|
|
785
781
|
warn('The engine-mounted life cycle can only be triggered once');
|
|
786
782
|
return [
|
|
787
783
|
2,
|
|
788
784
|
Promise.resolve([])
|
|
789
785
|
];
|
|
790
786
|
}
|
|
791
|
-
if (!
|
|
787
|
+
if (!this._jobTasks.length) return [
|
|
792
788
|
3,
|
|
793
789
|
2
|
|
794
790
|
];
|
|
795
791
|
console.time('engine-mounted need wait');
|
|
796
|
-
needWait = _to_consumable_array(
|
|
792
|
+
needWait = _to_consumable_array(this._jobTasks);
|
|
797
793
|
return [
|
|
798
794
|
4,
|
|
799
795
|
Promise.all(needWait)
|
|
@@ -803,15 +799,15 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
803
799
|
console.timeEnd('engine-mounted need wait');
|
|
804
800
|
_state.label = 2;
|
|
805
801
|
case 2:
|
|
806
|
-
|
|
802
|
+
this.isMounted = true;
|
|
807
803
|
_state.label = 3;
|
|
808
804
|
case 3:
|
|
809
805
|
// 如果没有挂载的话,需要记录在挂载之前触发的所有任务
|
|
810
|
-
if (!
|
|
806
|
+
if (!this.isMounted) {
|
|
811
807
|
promise = new Promise(function(resolve) {
|
|
812
808
|
promiseResolver = resolve;
|
|
813
809
|
});
|
|
814
|
-
|
|
810
|
+
this._jobTasks.push(promise);
|
|
815
811
|
}
|
|
816
812
|
return [
|
|
817
813
|
4,
|
|
@@ -822,7 +818,7 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
822
818
|
if (promiseResolver && promise) {
|
|
823
819
|
// 每一个任务完成的时候,都把自己从task中去掉
|
|
824
820
|
promiseResolver();
|
|
825
|
-
|
|
821
|
+
this._jobTasks.splice(this._jobTasks.indexOf(promise), 1);
|
|
826
822
|
}
|
|
827
823
|
return [
|
|
828
824
|
2,
|
|
@@ -830,7 +826,7 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
830
826
|
];
|
|
831
827
|
}
|
|
832
828
|
});
|
|
833
|
-
})();
|
|
829
|
+
}).call(this);
|
|
834
830
|
}
|
|
835
831
|
},
|
|
836
832
|
{
|
package/dist/esm/common/Store.js
CHANGED
|
@@ -54,8 +54,7 @@ var Store = /*#__PURE__*/ function() {
|
|
|
54
54
|
_class_call_check(this, Store);
|
|
55
55
|
_define_property(this, "emptyState", void 0);
|
|
56
56
|
_define_property(this, "state", void 0);
|
|
57
|
-
_define_property(this, "dataBindMapping", void 0 // 主要提供给二开使用
|
|
58
|
-
);
|
|
57
|
+
_define_property(this, "dataBindMapping", void 0); // 主要提供给二开使用
|
|
59
58
|
_define_property(this, "controlIdMapping", void 0);
|
|
60
59
|
_define_property(this, "subtableHeadersControlIdMapping", void 0);
|
|
61
60
|
_define_property(this, "defaultState", void 0);
|
|
@@ -61,15 +61,15 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
61
61
|
}
|
|
62
62
|
import { CONTROL_TYPE, CALC_TOKEN_TYPE, CALC_AGGREGATE_TYPE } from '@byteluck-fe/model-driven-shared';
|
|
63
63
|
import { format } from 'mathjs';
|
|
64
|
-
var DisplayType
|
|
65
|
-
(function(DisplayType) {
|
|
64
|
+
var DisplayType = /*#__PURE__*/ function(DisplayType) {
|
|
66
65
|
/**
|
|
67
66
|
* 完全等于
|
|
68
67
|
*/ DisplayType["EQ"] = "EQ";
|
|
69
68
|
/**
|
|
70
69
|
* 包含
|
|
71
70
|
* */ DisplayType["IN"] = "IN";
|
|
72
|
-
|
|
71
|
+
return DisplayType;
|
|
72
|
+
}(DisplayType || {});
|
|
73
73
|
export var CalcPlugin = /*#__PURE__*/ function() {
|
|
74
74
|
"use strict";
|
|
75
75
|
function CalcPlugin(options) {
|
|
@@ -60,7 +60,7 @@ function _define_property(obj, key, value) {
|
|
|
60
60
|
return obj;
|
|
61
61
|
}
|
|
62
62
|
function _ts_generator(thisArg, body) {
|
|
63
|
-
var f, y, t,
|
|
63
|
+
var f, y, t, _ = {
|
|
64
64
|
label: 0,
|
|
65
65
|
sent: function() {
|
|
66
66
|
if (t[0] & 1) throw t[1];
|
|
@@ -68,12 +68,8 @@ function _ts_generator(thisArg, body) {
|
|
|
68
68
|
},
|
|
69
69
|
trys: [],
|
|
70
70
|
ops: []
|
|
71
|
-
};
|
|
72
|
-
return g = {
|
|
73
|
-
next: verb(0),
|
|
74
|
-
"throw": verb(1),
|
|
75
|
-
"return": verb(2)
|
|
76
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
71
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
72
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
77
73
|
return this;
|
|
78
74
|
}), g;
|
|
79
75
|
function verb(n) {
|
|
@@ -86,7 +82,7 @@ function _ts_generator(thisArg, body) {
|
|
|
86
82
|
}
|
|
87
83
|
function step(op) {
|
|
88
84
|
if (f) throw new TypeError("Generator is already executing.");
|
|
89
|
-
while(_)try {
|
|
85
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
90
86
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
91
87
|
if (y = 0, t) op = [
|
|
92
88
|
op[0] & 2,
|
|
@@ -207,13 +203,13 @@ export var ControlsEventPlugin = /*#__PURE__*/ function() {
|
|
|
207
203
|
key: "engineAddEventListener",
|
|
208
204
|
value: function engineAddEventListener(eventKey, controlEventKey) {
|
|
209
205
|
var _this = this;
|
|
210
|
-
this.engine.on(eventKey,
|
|
211
|
-
|
|
206
|
+
this.engine.on(eventKey, function(payload) {
|
|
207
|
+
return _async_to_generator(function() {
|
|
212
208
|
return _ts_generator(this, function(_state) {
|
|
213
209
|
switch(_state.label){
|
|
214
210
|
case 0:
|
|
215
211
|
// 初始化state的时候不触发change事件,必须在engine mounted以后才触发
|
|
216
|
-
if ((eventKey === 'change' || eventKey === 'list-change') && !
|
|
212
|
+
if ((eventKey === 'change' || eventKey === 'list-change') && !this.engine.isMounted) {
|
|
217
213
|
return [
|
|
218
214
|
2
|
|
219
215
|
];
|
|
@@ -224,7 +220,7 @@ export var ControlsEventPlugin = /*#__PURE__*/ function() {
|
|
|
224
220
|
];
|
|
225
221
|
return [
|
|
226
222
|
4,
|
|
227
|
-
|
|
223
|
+
this.callControlEvent(controlEventKey, payload)
|
|
228
224
|
];
|
|
229
225
|
case 1:
|
|
230
226
|
return [
|
|
@@ -237,23 +233,20 @@ export var ControlsEventPlugin = /*#__PURE__*/ function() {
|
|
|
237
233
|
];
|
|
238
234
|
}
|
|
239
235
|
});
|
|
240
|
-
});
|
|
241
|
-
|
|
242
|
-
return _ref.apply(this, arguments);
|
|
243
|
-
};
|
|
244
|
-
}());
|
|
236
|
+
}).call(_this);
|
|
237
|
+
});
|
|
245
238
|
}
|
|
246
239
|
},
|
|
247
240
|
{
|
|
248
241
|
key: "callControlEvent",
|
|
249
242
|
value: function callControlEvent(name, payload) {
|
|
250
|
-
var _this = this;
|
|
251
243
|
return _async_to_generator(function() {
|
|
252
|
-
var events, result;
|
|
244
|
+
var _this, events, result;
|
|
253
245
|
return _ts_generator(this, function(_state) {
|
|
254
246
|
switch(_state.label){
|
|
255
247
|
case 0:
|
|
256
|
-
|
|
248
|
+
_this = this;
|
|
249
|
+
events = this.config[payload.instance.id];
|
|
257
250
|
if (!events || !Array.isArray(events[name])) {
|
|
258
251
|
return [
|
|
259
252
|
2,
|
|
@@ -262,15 +255,15 @@ export var ControlsEventPlugin = /*#__PURE__*/ function() {
|
|
|
262
255
|
}
|
|
263
256
|
return [
|
|
264
257
|
4,
|
|
265
|
-
Promise.all(events[name].map(
|
|
266
|
-
|
|
258
|
+
Promise.all(events[name].map(function(eventName) {
|
|
259
|
+
return _async_to_generator(function() {
|
|
267
260
|
var execResult;
|
|
268
261
|
return _ts_generator(this, function(_state) {
|
|
269
262
|
switch(_state.label){
|
|
270
263
|
case 0:
|
|
271
264
|
return [
|
|
272
265
|
4,
|
|
273
|
-
|
|
266
|
+
this.engine.getAction().execAction(eventName, //qiyu 注释掉的两个参数变为全局参数
|
|
274
267
|
// this.engine,
|
|
275
268
|
// this.engine.getAction().actionUtils, //以前是params,空的
|
|
276
269
|
payload)
|
|
@@ -283,11 +276,8 @@ export var ControlsEventPlugin = /*#__PURE__*/ function() {
|
|
|
283
276
|
];
|
|
284
277
|
}
|
|
285
278
|
});
|
|
286
|
-
});
|
|
287
|
-
|
|
288
|
-
return _ref.apply(this, arguments);
|
|
289
|
-
};
|
|
290
|
-
}()))
|
|
279
|
+
}).call(_this);
|
|
280
|
+
}))
|
|
291
281
|
];
|
|
292
282
|
case 1:
|
|
293
283
|
result = _state.sent();
|
|
@@ -307,7 +297,7 @@ export var ControlsEventPlugin = /*#__PURE__*/ function() {
|
|
|
307
297
|
];
|
|
308
298
|
}
|
|
309
299
|
});
|
|
310
|
-
})();
|
|
300
|
+
}).call(this);
|
|
311
301
|
}
|
|
312
302
|
}
|
|
313
303
|
]);
|
|
@@ -106,7 +106,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
106
106
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
107
107
|
}
|
|
108
108
|
function _ts_generator(thisArg, body) {
|
|
109
|
-
var f, y, t,
|
|
109
|
+
var f, y, t, _ = {
|
|
110
110
|
label: 0,
|
|
111
111
|
sent: function() {
|
|
112
112
|
if (t[0] & 1) throw t[1];
|
|
@@ -114,12 +114,8 @@ function _ts_generator(thisArg, body) {
|
|
|
114
114
|
},
|
|
115
115
|
trys: [],
|
|
116
116
|
ops: []
|
|
117
|
-
};
|
|
118
|
-
return g = {
|
|
119
|
-
next: verb(0),
|
|
120
|
-
"throw": verb(1),
|
|
121
|
-
"return": verb(2)
|
|
122
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
117
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
118
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
123
119
|
return this;
|
|
124
120
|
}), g;
|
|
125
121
|
function verb(n) {
|
|
@@ -132,7 +128,7 @@ function _ts_generator(thisArg, body) {
|
|
|
132
128
|
}
|
|
133
129
|
function step(op) {
|
|
134
130
|
if (f) throw new TypeError("Generator is already executing.");
|
|
135
|
-
while(_)try {
|
|
131
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
136
132
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
137
133
|
if (y = 0, t) op = [
|
|
138
134
|
op[0] & 2,
|
|
@@ -223,16 +219,15 @@ export var LifecycleEventPlugin = /*#__PURE__*/ function() {
|
|
|
223
219
|
this.engine = engine;
|
|
224
220
|
Object.entries(LifecycleEventKeyMap).forEach(function(param) {
|
|
225
221
|
var _param = _sliced_to_array(param, 2), engineKey = _param[0], lifecycleKey = _param[1];
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
var _ref = _async_to_generator(function(payload) {
|
|
222
|
+
engine.on(engineKey, function(payload) {
|
|
223
|
+
return _async_to_generator(function() {
|
|
229
224
|
var result;
|
|
230
225
|
return _ts_generator(this, function(_state) {
|
|
231
226
|
switch(_state.label){
|
|
232
227
|
case 0:
|
|
233
228
|
return [
|
|
234
229
|
4,
|
|
235
|
-
|
|
230
|
+
this.callLifecycleEvent(lifecycleKey, payload)
|
|
236
231
|
];
|
|
237
232
|
case 1:
|
|
238
233
|
result = _state.sent();
|
|
@@ -252,24 +247,21 @@ export var LifecycleEventPlugin = /*#__PURE__*/ function() {
|
|
|
252
247
|
];
|
|
253
248
|
}
|
|
254
249
|
});
|
|
255
|
-
});
|
|
256
|
-
|
|
257
|
-
return _ref.apply(this, arguments);
|
|
258
|
-
};
|
|
259
|
-
}());
|
|
250
|
+
}).call(_this);
|
|
251
|
+
});
|
|
260
252
|
});
|
|
261
253
|
}
|
|
262
254
|
},
|
|
263
255
|
{
|
|
264
256
|
key: "callLifecycleEvent",
|
|
265
257
|
value: function callLifecycleEvent(name, payload) {
|
|
266
|
-
var _this = this;
|
|
267
258
|
return _async_to_generator(function() {
|
|
268
|
-
var events, result;
|
|
259
|
+
var _this, events, result;
|
|
269
260
|
return _ts_generator(this, function(_state) {
|
|
270
261
|
switch(_state.label){
|
|
271
262
|
case 0:
|
|
272
|
-
|
|
263
|
+
_this = this;
|
|
264
|
+
events = this.config;
|
|
273
265
|
if (!events || !Array.isArray(events[name])) {
|
|
274
266
|
return [
|
|
275
267
|
2,
|
|
@@ -278,15 +270,15 @@ export var LifecycleEventPlugin = /*#__PURE__*/ function() {
|
|
|
278
270
|
}
|
|
279
271
|
return [
|
|
280
272
|
4,
|
|
281
|
-
Promise.all(events[name].map(
|
|
282
|
-
|
|
273
|
+
Promise.all(events[name].map(function(eventName) {
|
|
274
|
+
return _async_to_generator(function() {
|
|
283
275
|
var execResult;
|
|
284
276
|
return _ts_generator(this, function(_state) {
|
|
285
277
|
switch(_state.label){
|
|
286
278
|
case 0:
|
|
287
279
|
return [
|
|
288
280
|
4,
|
|
289
|
-
|
|
281
|
+
this.engine.getAction().execAction(eventName, //qiyu 注释掉的两个参数变为全局参数
|
|
290
282
|
// this.engine,
|
|
291
283
|
// this.engine.getAction().actionUtils, //以前是params,空的
|
|
292
284
|
payload)
|
|
@@ -299,11 +291,8 @@ export var LifecycleEventPlugin = /*#__PURE__*/ function() {
|
|
|
299
291
|
];
|
|
300
292
|
}
|
|
301
293
|
});
|
|
302
|
-
});
|
|
303
|
-
|
|
304
|
-
return _ref.apply(this, arguments);
|
|
305
|
-
};
|
|
306
|
-
}()))
|
|
294
|
+
}).call(_this);
|
|
295
|
+
}))
|
|
307
296
|
];
|
|
308
297
|
case 1:
|
|
309
298
|
result = _state.sent();
|
|
@@ -313,7 +302,7 @@ export var LifecycleEventPlugin = /*#__PURE__*/ function() {
|
|
|
313
302
|
];
|
|
314
303
|
}
|
|
315
304
|
});
|
|
316
|
-
})();
|
|
305
|
+
}).call(this);
|
|
317
306
|
}
|
|
318
307
|
}
|
|
319
308
|
]);
|