@byteluck-fe/model-driven-engine 1.7.6-bete.11 → 1.7.6-bete.13
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.
|
@@ -436,10 +436,11 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
436
436
|
_proto._proxyStateBeforeSetCallback = function _proxyStateBeforeSetCallback(state, key, newValue, oldValue) {
|
|
437
437
|
var _this = this;
|
|
438
438
|
var cc = console;
|
|
439
|
-
|
|
440
|
-
cc.
|
|
439
|
+
var now = Date.now();
|
|
440
|
+
cc.log("㊗️_proxyStateBeforeSetCallback findItem " + key, newValue, oldValue);
|
|
441
|
+
cc.time("㊗️_proxyStateBeforeSetCallback findItem " + key + " " + now);
|
|
441
442
|
var instance = findItem(this.runtime.flatInstances, key);
|
|
442
|
-
cc.
|
|
443
|
+
cc.timeEnd("㊗️_proxyStateBeforeSetCallback findItem " + key + " " + now);
|
|
443
444
|
// 找不到控件说明不是改动控件上的字段,直接通过
|
|
444
445
|
if (!instance) {
|
|
445
446
|
return newValue;
|
|
@@ -483,7 +484,7 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
483
484
|
var cc = console;
|
|
484
485
|
cc.time("㊗️ _handlerArrayUpdate findItem" + key);
|
|
485
486
|
var subtable = findItem(this.runtime.flatInstances, key);
|
|
486
|
-
cc.
|
|
487
|
+
cc.timeEnd("㊗️ _handlerArrayUpdate findItem" + key);
|
|
487
488
|
if (!_instanceof(subtable, RuntimeListControl)) return;
|
|
488
489
|
// 新增多行方法
|
|
489
490
|
var createRows = function(len) {
|
|
@@ -574,10 +575,11 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
574
575
|
};
|
|
575
576
|
_proto._handlerObjectUpdate = function _handlerObjectUpdate(state, key, value, oldValue) {
|
|
576
577
|
var cc = console;
|
|
577
|
-
|
|
578
|
-
cc.
|
|
578
|
+
var now = Date.now();
|
|
579
|
+
cc.log("㊗️_handlerObjectUpdate findItem " + key, value, oldValue);
|
|
580
|
+
cc.time("㊗️_handlerObjectUpdate findItem " + key + " " + now);
|
|
579
581
|
var instance = findItem(this.runtime.flatInstances, key);
|
|
580
|
-
cc.
|
|
582
|
+
cc.timeEnd("㊗️_handlerObjectUpdate findItem " + key + " " + now);
|
|
581
583
|
if (!instance) {
|
|
582
584
|
return;
|
|
583
585
|
}
|
|
@@ -1148,6 +1150,10 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
1148
1150
|
if (controlId === undefined) {
|
|
1149
1151
|
return this.runtime.flatInstances;
|
|
1150
1152
|
}
|
|
1153
|
+
var cc = console;
|
|
1154
|
+
var now = Date.now();
|
|
1155
|
+
var timeLabel = "⚠️ getInstances " + controlId + " " + header + now;
|
|
1156
|
+
cc.time(timeLabel);
|
|
1151
1157
|
var instances = this.runtime.flatInstances.filter(// @ts-ignore
|
|
1152
1158
|
function(item) {
|
|
1153
1159
|
return item.id === controlId;
|
|
@@ -1188,6 +1194,7 @@ var Engine = /*#__PURE__*/ function(Watcher) {
|
|
|
1188
1194
|
}
|
|
1189
1195
|
}
|
|
1190
1196
|
}
|
|
1197
|
+
cc.timeEnd(timeLabel);
|
|
1191
1198
|
return instances;
|
|
1192
1199
|
};
|
|
1193
1200
|
_proto.setInstance = function setInstance(instance, props, value, rowIndex) {
|
|
@@ -283,6 +283,10 @@ export var CalcPlugin = /*#__PURE__*/ function() {
|
|
|
283
283
|
if (!scriptEcho || scriptEcho.length === 0) {
|
|
284
284
|
return;
|
|
285
285
|
}
|
|
286
|
+
var cc = console;
|
|
287
|
+
var now = Date.now();
|
|
288
|
+
var timeLabel = "\uD83D\uDC36 computedCalcValue " + control.id + " " + now;
|
|
289
|
+
cc.time(timeLabel);
|
|
286
290
|
// @ts-ignore
|
|
287
291
|
var scriptText = scriptEcho.reduce(function(result, current) {
|
|
288
292
|
if (current.type === CALC_TOKEN_TYPE.Operator || current.type === CALC_TOKEN_TYPE.Number) {
|
|
@@ -343,6 +347,8 @@ export var CalcPlugin = /*#__PURE__*/ function() {
|
|
|
343
347
|
rowIndex = this.engine.getInstanceRowIndex(control);
|
|
344
348
|
// 控件在明细表内,但是没有行下标,说明控件被已经删除了,所以直接return
|
|
345
349
|
if (rowIndex === undefined) {
|
|
350
|
+
cc.log(timeLabel, "------> 控件在明细表内,但是没有行下标,说明控件被已经删除了,所以直接return");
|
|
351
|
+
cc.timeEnd(timeLabel);
|
|
346
352
|
return;
|
|
347
353
|
}
|
|
348
354
|
}
|
|
@@ -350,6 +356,8 @@ export var CalcPlugin = /*#__PURE__*/ function() {
|
|
|
350
356
|
var result = !value || value === Infinity || value === -Infinity ? 0 : control.props.precision === "" ? value : Number(value.toFixed(control.props.precision));
|
|
351
357
|
// 如果值没变的话,不触发修改
|
|
352
358
|
if (result === (oldValue === null || oldValue === void 0 ? void 0 : oldValue.result)) {
|
|
359
|
+
cc.log(timeLabel, "------> 如果值没变的话,不触发修改");
|
|
360
|
+
cc.timeEnd(timeLabel);
|
|
353
361
|
return;
|
|
354
362
|
}
|
|
355
363
|
var _oldValue_unit;
|
|
@@ -357,6 +365,7 @@ export var CalcPlugin = /*#__PURE__*/ function() {
|
|
|
357
365
|
result: result,
|
|
358
366
|
unit: (_oldValue_unit = oldValue === null || oldValue === void 0 ? void 0 : oldValue.unit) !== null && _oldValue_unit !== void 0 ? _oldValue_unit : ""
|
|
359
367
|
}, rowIndex);
|
|
368
|
+
cc.timeEnd(timeLabel);
|
|
360
369
|
};
|
|
361
370
|
/**
|
|
362
371
|
* @description 获取数字值,因为计算公式可以依赖计算公式和金额,所以需要从value中取到对应的值
|