@byteluck-fe/model-driven-engine 2.7.0-alpha.12 → 2.7.0-alpha.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.
@@ -159,6 +159,30 @@ function _objectSpread(target) {
159
159
  }
160
160
  return target;
161
161
  }
162
+ function ownKeys(object, enumerableOnly) {
163
+ var keys = Object.keys(object);
164
+ if (Object.getOwnPropertySymbols) {
165
+ var symbols = Object.getOwnPropertySymbols(object);
166
+ if (enumerableOnly) {
167
+ symbols = symbols.filter(function(sym) {
168
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
169
+ });
170
+ }
171
+ keys.push.apply(keys, symbols);
172
+ }
173
+ return keys;
174
+ }
175
+ function _objectSpreadProps(target, source) {
176
+ source = source != null ? source : {};
177
+ if (Object.getOwnPropertyDescriptors) {
178
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
179
+ } else {
180
+ ownKeys(Object(source)).forEach(function(key) {
181
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
182
+ });
183
+ }
184
+ return target;
185
+ }
162
186
  function _possibleConstructorReturn(self, call) {
163
187
  if (call && (_typeof(call) === "object" || typeof call === "function")) {
164
188
  return call;
@@ -221,44 +245,147 @@ function _createSuper(Derived) {
221
245
  return _possibleConstructorReturn(this, result);
222
246
  };
223
247
  }
224
- import regeneratorRuntime from "regenerator-runtime";
225
- import { isDataBind } from '@byteluck-fe/model-driven-core';
226
- import { CONTROL_BASE_TYPE, CONTROL_TYPE, DEFAULT_LOCALE, error, genNonDuplicateId, isString, JSONCopy, log, RulesMessage, updateValueFromKeys, warn, Watcher } from '@byteluck-fe/model-driven-shared';
227
- import { Runtime } from './Runtime';
228
- import { Store } from './Store';
229
- import { findItem, proxyState } from './proxyState';
230
- import { ActionManager } from './ActionManager';
231
- import { DataManager } from './DataManager';
232
- import { checkerSubtableValue, checkerValue } from './checkerValue';
233
- if (typeof window !== 'undefined') {
248
+ var __generator = this && this.__generator || function(thisArg, body) {
249
+ var f, y, t, g, _ = {
250
+ label: 0,
251
+ sent: function() {
252
+ if (t[0] & 1) throw t[1];
253
+ return t[1];
254
+ },
255
+ trys: [],
256
+ ops: []
257
+ };
258
+ return g = {
259
+ next: verb(0),
260
+ "throw": verb(1),
261
+ "return": verb(2)
262
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
263
+ return this;
264
+ }), g;
265
+ function verb(n) {
266
+ return function(v) {
267
+ return step([
268
+ n,
269
+ v
270
+ ]);
271
+ };
272
+ }
273
+ function step(op) {
274
+ if (f) throw new TypeError("Generator is already executing.");
275
+ while(_)try {
276
+ 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;
277
+ if (y = 0, t) op = [
278
+ op[0] & 2,
279
+ t.value
280
+ ];
281
+ switch(op[0]){
282
+ case 0:
283
+ case 1:
284
+ t = op;
285
+ break;
286
+ case 4:
287
+ _.label++;
288
+ return {
289
+ value: op[1],
290
+ done: false
291
+ };
292
+ case 5:
293
+ _.label++;
294
+ y = op[1];
295
+ op = [
296
+ 0
297
+ ];
298
+ continue;
299
+ case 7:
300
+ op = _.ops.pop();
301
+ _.trys.pop();
302
+ continue;
303
+ default:
304
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
305
+ _ = 0;
306
+ continue;
307
+ }
308
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
309
+ _.label = op[1];
310
+ break;
311
+ }
312
+ if (op[0] === 6 && _.label < t[1]) {
313
+ _.label = t[1];
314
+ t = op;
315
+ break;
316
+ }
317
+ if (t && _.label < t[2]) {
318
+ _.label = t[2];
319
+ _.ops.push(op);
320
+ break;
321
+ }
322
+ if (t[2]) _.ops.pop();
323
+ _.trys.pop();
324
+ continue;
325
+ }
326
+ op = body.call(thisArg, _);
327
+ } catch (e) {
328
+ op = [
329
+ 6,
330
+ e
331
+ ];
332
+ y = 0;
333
+ } finally{
334
+ f = t = 0;
335
+ }
336
+ if (op[0] & 5) throw op[1];
337
+ return {
338
+ value: op[0] ? op[1] : void 0,
339
+ done: true
340
+ };
341
+ }
342
+ };
343
+ import { isDataBind } from "@byteluck-fe/model-driven-core";
344
+ import { CONTROL_BASE_TYPE, CONTROL_TYPE, DEFAULT_LOCALE, error, genNonDuplicateId, isString, JSONCopy, log, RulesMessage, updateValueFromKeys, warn, Watcher } from "@byteluck-fe/model-driven-shared";
345
+ import { Runtime } from "./Runtime";
346
+ import { Store } from "./Store";
347
+ import { findItem, proxyState } from "./proxyState";
348
+ import { ActionManager } from "./ActionManager";
349
+ import { DataManager } from "./DataManager";
350
+ import { checkerSubtableValue, checkerValue } from "./checkerValue";
351
+ if (typeof window !== "undefined") {
234
352
  // @ts-ignore
235
353
  window.engines = {};
236
354
  }
237
355
  // setState的时候,存储options中转变量
238
356
  var eventOptionsTemp = null;
239
357
  // 当前正在注册的插件名称
240
- var applyingPluginName = '';
241
- var Engine = // 整体渲染引擎 并且 提供发布订阅能力
242
- /*#__PURE__*/ function(Watcher1) {
358
+ var applyingPluginName = "";
359
+ // 整体渲染引擎 并且 提供发布订阅能力
360
+ var Engine = /*#__PURE__*/ function(Watcher) {
243
361
  "use strict";
244
- _inherits(Engine, Watcher1);
362
+ _inherits(Engine, Watcher);
245
363
  var _super = _createSuper(Engine);
246
364
  function Engine(props) {
247
365
  _classCallCheck(this, Engine);
248
366
  var _this;
249
367
  _this = _super.call(this);
250
- _this.rawStore = {};
368
+ _defineProperty(_assertThisInitialized(_this), "store", void 0);
369
+ _defineProperty(_assertThisInitialized(_this), "rawStore", {});
370
+ _defineProperty(_assertThisInitialized(_this), "parent", void 0);
371
+ // 提供注册运行态控件以及实例化控件的能力
372
+ _defineProperty(_assertThisInitialized(_this), "runtime", void 0);
251
373
  // 提供子线程处理脚本以及修改数据的能力
252
374
  // public worker: OkWorker
253
- _this.isMounted = false;
254
- _this.id = genNonDuplicateId(8);
255
- _this.__pluginsApplied = false;
256
- _this.actionManager = new ActionManager();
257
- _this._jobTasks = [];
258
- _this.createControlInstance = _this.createInstance;
375
+ _defineProperty(_assertThisInitialized(_this), "isMounted", false);
376
+ _defineProperty(_assertThisInitialized(_this), "id", genNonDuplicateId(8));
377
+ _defineProperty(_assertThisInitialized(_this), "externalParams", void 0);
378
+ // 提供外部注册插件,在不同的hooks触发时执行固定函数的能力
379
+ _defineProperty(_assertThisInitialized(_this), "__plugins", void 0);
380
+ _defineProperty(_assertThisInitialized(_this), "__pluginsApplied", false);
381
+ _defineProperty(_assertThisInitialized(_this), "$options", void 0);
382
+ _defineProperty(_assertThisInitialized(_this), "actionManager", new ActionManager());
383
+ _defineProperty(_assertThisInitialized(_this), "dataManager", void 0);
384
+ _defineProperty(_assertThisInitialized(_this), "_jobTasks", []);
385
+ _defineProperty(_assertThisInitialized(_this), "createControlInstance", _this.createInstance);
259
386
  _this.$options = Object.freeze(props);
260
- var _$options = _this.$options, _autoMount = _$options.autoMount, autoMount = _autoMount === void 0 ? true : _autoMount, schema = _$options.schema, beforeCreateInstance = _$options.beforeCreateInstance, externalParams = _$options.externalParams, _language = _$options.// fieldModel,
261
- language, language = _language === void 0 ? DEFAULT_LOCALE : _language, _debug = _$options.debug, debug = _debug === void 0 ? false : _debug;
387
+ var _this_$options = _this.$options, _this_$options_autoMount = _this_$options.autoMount, autoMount = _this_$options_autoMount === void 0 ? true : _this_$options_autoMount, schema = _this_$options.schema, beforeCreateInstance = _this_$options.beforeCreateInstance, externalParams = _this_$options.externalParams, _this_$options_language = _this_$options.// fieldModel,
388
+ language, language = _this_$options_language === void 0 ? DEFAULT_LOCALE : _this_$options_language, _this_$options_debug = _this_$options.debug, debug = _this_$options_debug === void 0 ? false : _this_$options_debug;
262
389
  RulesMessage.setLocale(language);
263
390
  _this.debug = debug;
264
391
  _this.runtime = new Runtime({
@@ -269,7 +396,7 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
269
396
  _this.store = new Store({
270
397
  instance: _this.runtime.instance
271
398
  });
272
- _this.debugLog('engine is Instantiation complete');
399
+ _this.debugLog("engine is Instantiation complete");
273
400
  // 自动执行挂载完成,也可以手动调用mount方法
274
401
  autoMount && _this.mount();
275
402
  return _this;
@@ -300,8 +427,8 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
300
427
  for(var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++){
301
428
  arg[_key] = arguments[_key];
302
429
  }
303
- var _runtime;
304
- (_runtime = this.runtime).register.apply(_runtime, _toConsumableArray(arg));
430
+ var _this_runtime;
431
+ (_this_runtime = this.runtime).register.apply(_this_runtime, _toConsumableArray(arg));
305
432
  return this;
306
433
  }
307
434
  },
@@ -309,14 +436,14 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
309
436
  key: "mount",
310
437
  value: function mount() {
311
438
  this.debugLog("engine的mount方法开始调用");
312
- var _$options = this.$options, _plugins = _$options.plugins, plugins = _plugins === void 0 ? [] : _plugins;
439
+ var _this_$options = this.$options, _this_$options_plugins = _this_$options.plugins, plugins = _this_$options_plugins === void 0 ? [] : _this_$options_plugins;
313
440
  this._handlerProxyState();
314
441
  this.__plugins = plugins;
315
442
  this.applyPlugins();
316
443
  // 触发所有控件的默认值的change事件
317
444
  this.setStates(this.getState());
318
445
  this.debugLog("engine的mount方法调用结束");
319
- if (this.debug && typeof window !== 'undefined') {
446
+ if (this.debug && typeof window !== "undefined") {
320
447
  // @ts-ignore
321
448
  window.engines[this.id] = this;
322
449
  }
@@ -325,7 +452,7 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
325
452
  {
326
453
  key: "destroy",
327
454
  value: function destroy() {
328
- if (this.debug && typeof window !== 'undefined') {
455
+ if (this.debug && typeof window !== "undefined") {
329
456
  // @ts-ignore
330
457
  delete window.engines[this.id];
331
458
  }
@@ -347,7 +474,6 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
347
474
  }
348
475
  // @ts-ignore
349
476
  if (this.assertInstance(instance, CONTROL_TYPE.SUBTABLE)) {
350
- var ref;
351
477
  if (newValue === null) {
352
478
  return [];
353
479
  }
@@ -362,12 +488,12 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
362
488
  }, {});
363
489
  // @ts-ignore
364
490
  var emptyState = this.getEmptyState(instance.id);
365
- return (ref = newValue) === null || ref === void 0 ? void 0 : ref.map(function(row) {
366
- // @ts-ignore
367
- return checkerSubtableValue(fieldTypeMap, row, emptyState);
491
+ return newValue === null || newValue === void 0 ? void 0 : newValue.map(function(row) {
492
+ return(// @ts-ignore
493
+ checkerSubtableValue(fieldTypeMap, row, emptyState));
368
494
  });
369
495
  }
370
- var keys = key.split('.');
496
+ var keys = key.split(".");
371
497
  var lastKey = keys[keys.length - 1];
372
498
  try {
373
499
  return checkerValue(instance.fieldType, lastKey, newValue, oldValue);
@@ -400,7 +526,7 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
400
526
  var newRows = [];
401
527
  for(var i = 0; i < len; i++){
402
528
  // @ts-ignore
403
- var row = _this.listControlCreateRow(subtable, 'subtable-row');
529
+ var row = _this.listControlCreateRow(subtable, "subtable-row");
404
530
  row && newRows.push(row);
405
531
  }
406
532
  // @ts-ignore
@@ -414,19 +540,19 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
414
540
  if (type && args) {
415
541
  // const subtableOldLength = subtable.children.length
416
542
  switch(type){
417
- case 'push':
418
- case 'unshift':
419
- var _children;
543
+ case "push":
544
+ case "unshift":
545
+ var _subtable_children;
420
546
  var newRowLengths = args.length;
421
547
  createdNewRows = createRows(newRowLengths);
422
548
  createdNewRowsData = args;
423
- (_children = subtable.children)[type].apply(_children, _toConsumableArray(createdNewRows));
549
+ (_subtable_children = subtable.children)[type].apply(_subtable_children, _toConsumableArray(createdNewRows));
424
550
  this.runtime.getFlatInstances();
425
551
  break;
426
- case 'splice':
552
+ case "splice":
427
553
  if (args.length > 2) {
428
554
  var // @ts-ignore
429
- _children1;
555
+ _subtable_children1;
430
556
  var newRowLengths1 = args.length - 2;
431
557
  var newValues = args.slice(2);
432
558
  createdNewRows = createRows(newRowLengths1);
@@ -435,7 +561,7 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
435
561
  var start = args[0];
436
562
  // 替换几个
437
563
  var replace = args[1];
438
- (_children1 = subtable.children)[type].apply(_children1, [
564
+ (_subtable_children1 = subtable.children)[type].apply(_subtable_children1, [
439
565
  start,
440
566
  replace
441
567
  ].concat(_toConsumableArray(createdNewRows)));
@@ -446,29 +572,29 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
446
572
  // })
447
573
  } else {
448
574
  var // @ts-ignore
449
- _children2;
450
- (_children2 = subtable.children)[type].apply(_children2, _toConsumableArray(args));
575
+ _subtable_children2;
576
+ (_subtable_children2 = subtable.children)[type].apply(_subtable_children2, _toConsumableArray(args));
451
577
  this.runtime.getFlatInstances();
452
578
  }
453
579
  break;
454
580
  default:
455
581
  var // @ts-ignore
456
- _children3;
457
- (_children3 = subtable.children)[type].apply(_children3, _toConsumableArray(args));
582
+ _subtable_children3;
583
+ (_subtable_children3 = subtable.children)[type].apply(_subtable_children3, _toConsumableArray(args));
458
584
  this.runtime.getFlatInstances();
459
585
  break;
460
586
  }
461
- if (type === 'splice') {
587
+ if (type === "splice") {
462
588
  deleted = result;
463
589
  } else if ([
464
- 'pop',
465
- 'shift'
590
+ "pop",
591
+ "shift"
466
592
  ].includes(type)) {
467
593
  deleted = [
468
594
  result
469
595
  ];
470
596
  }
471
- this.emit('list-change', {
597
+ this.emit("list-change", {
472
598
  instance: subtable,
473
599
  value: this.getState(subtable.id),
474
600
  options: Object.assign({}, options, {
@@ -495,26 +621,26 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
495
621
  // if (instance instanceof RuntimeListControl) {
496
622
  if (instance.controlType === CONTROL_BASE_TYPE.LIST) {
497
623
  var // @ts-ignore
498
- _children;
624
+ _instance_children;
499
625
  instance.children.length = 0;
500
626
  var newValue = value;
501
627
  // @ts-ignore
502
628
  var newRows = [];
503
629
  for(var i = 0; i < newValue.length; i++){
504
630
  // @ts-ignore
505
- var row = this.listControlCreateRow(instance, 'subtable-row');
631
+ var row = this.listControlCreateRow(instance, "subtable-row");
506
632
  row && newRows.push(row);
507
633
  }
508
- (_children = instance.children).push.apply(_children, _toConsumableArray(newRows));
634
+ (_instance_children = instance.children).push.apply(_instance_children, _toConsumableArray(newRows));
509
635
  this.runtime.getFlatInstances();
510
636
  // 这里已经能拿到控件实例,所以在这里触发setStates,触发每一行每一个控件的change事件
511
637
  // for (let i = 0; i < newValue.length; i++) {
512
638
  // this.setStates(newValue[i], i, options)
513
639
  // }
514
- this.emit('list-change', {
640
+ this.emit("list-change", {
515
641
  instance: instance,
516
642
  value: value,
517
- options: _objectSpread({}, options, {
643
+ options: _objectSpreadProps(_objectSpread({}, options), {
518
644
  // @ts-ignore
519
645
  changed: newRows,
520
646
  data: newValue,
@@ -522,11 +648,11 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
522
648
  })
523
649
  });
524
650
  } else {
525
- this.emit('change', {
651
+ this.emit("change", {
526
652
  instance: instance,
527
653
  value: this.getState(instance.id, index),
528
654
  rowIndex: index,
529
- options: _objectSpread({}, options, {
655
+ options: _objectSpreadProps(_objectSpread({}, options), {
530
656
  oldValue: oldValue
531
657
  })
532
658
  });
@@ -540,13 +666,13 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
540
666
  if (this.__pluginsApplied) return;
541
667
  this.__plugins.forEach(function(plugin) {
542
668
  try {
543
- var _pluginName;
544
- applyingPluginName = (_pluginName = plugin.pluginName) !== null && _pluginName !== void 0 ? _pluginName : plugin.constructor.name;
669
+ var _plugin_pluginName;
670
+ applyingPluginName = (_plugin_pluginName = plugin.pluginName) !== null && _plugin_pluginName !== void 0 ? _plugin_pluginName : plugin.constructor.name;
545
671
  plugin.apply(_this);
546
672
  } catch (e) {
547
673
  error("".concat(applyingPluginName, " Plugin apply Error \n ").concat(e));
548
674
  } finally{
549
- applyingPluginName = '';
675
+ applyingPluginName = "";
550
676
  }
551
677
  });
552
678
  this.__pluginsApplied = true;
@@ -560,12 +686,12 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
560
686
  // if (row instanceof RuntimeLayoutControl) {
561
687
  // @ts-ignore
562
688
  if (row.controlType === CONTROL_BASE_TYPE.LAYOUT) {
563
- var _children;
689
+ var _inst_children;
564
690
  var inst = row;
565
691
  var template = JSONCopy(instance.props.headers);
566
692
  // @ts-ignore
567
693
  var columns = this.createControl(template);
568
- (_children = inst.children).push.apply(_children, _toConsumableArray(columns));
694
+ (_inst_children = inst.children).push.apply(_inst_children, _toConsumableArray(columns));
569
695
  }
570
696
  return row;
571
697
  }
@@ -574,7 +700,7 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
574
700
  key: "listControlAddRow",
575
701
  value: function listControlAddRow(instance) {
576
702
  var // @ts-ignore
577
- rowType = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'subtable-row';
703
+ rowType = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "subtable-row";
578
704
  var row = this.listControlCreateRow(instance, rowType);
579
705
  if (!row) return;
580
706
  instance.children.push(row);
@@ -588,37 +714,40 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
588
714
  var _this1 = this, _superprop_get_emit = function() {
589
715
  return _get(_getPrototypeOf(Engine.prototype), "emit", _this);
590
716
  };
591
- return _asyncToGenerator(regeneratorRuntime.mark(function _callee() {
717
+ return _asyncToGenerator(function() {
592
718
  var needWait, promiseResolver, promise, results;
593
- return regeneratorRuntime.wrap(function _callee$(_ctx) {
594
- while(1)switch(_ctx.prev = _ctx.next){
719
+ return __generator(this, function(_state) {
720
+ switch(_state.label){
595
721
  case 0:
596
- if (!(eventKey === 'engine-mounted')) {
597
- _ctx.next = 11;
598
- break;
599
- }
600
- if (!_this1.isMounted) {
601
- _ctx.next = 4;
602
- break;
722
+ if (!(eventKey === "engine-mounted")) return [
723
+ 3,
724
+ 3
725
+ ];
726
+ if (_this1.isMounted) {
727
+ warn("The engine-mounted life cycle can only be triggered once");
728
+ return [
729
+ 2,
730
+ Promise.resolve([])
731
+ ];
603
732
  }
604
- warn('The engine-mounted life cycle can only be triggered once');
605
- return _ctx.abrupt("return", Promise.resolve([]));
606
- case 4:
607
- if (!_this1._jobTasks.length) {
608
- _ctx.next = 10;
609
- break;
610
- }
611
- console.time('engine-mounted need wait');
733
+ if (!_this1._jobTasks.length) return [
734
+ 3,
735
+ 2
736
+ ];
737
+ console.time("engine-mounted need wait");
612
738
  needWait = _toConsumableArray(_this1._jobTasks);
613
- _ctx.next = 9;
614
- return Promise.all(needWait);
615
- case 9:
616
- console.timeEnd('engine-mounted need wait');
617
- case 10:
739
+ return [
740
+ 4,
741
+ Promise.all(needWait)
742
+ ];
743
+ case 1:
744
+ _state.sent();
745
+ console.timeEnd("engine-mounted need wait");
746
+ _state.label = 2;
747
+ case 2:
618
748
  _this1.isMounted = true;
619
- case 11:
620
- ;
621
- ;
749
+ _state.label = 3;
750
+ case 3:
622
751
  // 如果没有挂载的话,需要记录在挂载之前触发的所有任务
623
752
  if (!_this1.isMounted) {
624
753
  promise = new Promise(function(resolve) {
@@ -626,22 +755,24 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
626
755
  });
627
756
  _this1._jobTasks.push(promise);
628
757
  }
629
- _ctx.next = 16;
630
- return _superprop_get_emit().call(_this1, eventKey, payload);
631
- case 16:
632
- results = _ctx.sent;
758
+ return [
759
+ 4,
760
+ _superprop_get_emit().call(_this1, eventKey, payload)
761
+ ];
762
+ case 4:
763
+ results = _state.sent();
633
764
  if (promiseResolver && promise) {
634
765
  // 每一个任务完成的时候,都把自己从task中去掉
635
766
  promiseResolver();
636
767
  _this1._jobTasks.splice(_this1._jobTasks.indexOf(promise), 1);
637
768
  }
638
- return _ctx.abrupt("return", results);
639
- case 19:
640
- case "end":
641
- return _ctx.stop();
769
+ return [
770
+ 2,
771
+ results
772
+ ];
642
773
  }
643
- }, _callee);
644
- }))();
774
+ });
775
+ })();
645
776
  }
646
777
  },
647
778
  {
@@ -659,8 +790,8 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
659
790
  for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
660
791
  args[_key] = arguments[_key];
661
792
  }
662
- var _runtime;
663
- return (_runtime = this.runtime).createControl.apply(_runtime, _toConsumableArray(args));
793
+ var _this_runtime;
794
+ return (_this_runtime = this.runtime).createControl.apply(_this_runtime, _toConsumableArray(args));
664
795
  }
665
796
  },
666
797
  {
@@ -688,10 +819,10 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
688
819
  if (controlId === undefined) {
689
820
  return rules;
690
821
  } else {
691
- var ref, ref1;
822
+ var _rules_rules_controlId, _rules_antdRules_controlId;
692
823
  return {
693
- rules: (ref = rules.rules[controlId]) === null || ref === void 0 ? void 0 : ref.fields,
694
- antdRules: (ref1 = rules.antdRules[controlId]) === null || ref1 === void 0 ? void 0 : ref1.fields
824
+ rules: (_rules_rules_controlId = rules.rules[controlId]) === null || _rules_rules_controlId === void 0 ? void 0 : _rules_rules_controlId.fields,
825
+ antdRules: (_rules_antdRules_controlId = rules.antdRules[controlId]) === null || _rules_antdRules_controlId === void 0 ? void 0 : _rules_antdRules_controlId.fields
695
826
  };
696
827
  }
697
828
  }
@@ -702,8 +833,8 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
702
833
  if (controlId === undefined) {
703
834
  return this.runtime.rules;
704
835
  } else {
705
- var ref;
706
- return (ref = this.runtime.rules[controlId]) === null || ref === void 0 ? void 0 : ref.fields;
836
+ var _this_runtime_rules_controlId;
837
+ return (_this_runtime_rules_controlId = this.runtime.rules[controlId]) === null || _this_runtime_rules_controlId === void 0 ? void 0 : _this_runtime_rules_controlId.fields;
707
838
  }
708
839
  }
709
840
  },
@@ -713,8 +844,8 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
713
844
  if (controlId === undefined) {
714
845
  return this.runtime.antdRules;
715
846
  } else {
716
- var ref;
717
- return (ref = this.runtime.antdRules[controlId]) === null || ref === void 0 ? void 0 : ref.fields;
847
+ var _this_runtime_antdRules_controlId;
848
+ return (_this_runtime_antdRules_controlId = this.runtime.antdRules[controlId]) === null || _this_runtime_antdRules_controlId === void 0 ? void 0 : _this_runtime_antdRules_controlId.fields;
718
849
  }
719
850
  }
720
851
  },
@@ -751,9 +882,9 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
751
882
  key: "setState",
752
883
  value: function setState(controlId, value, rowIndex, options) {
753
884
  eventOptionsTemp = options;
754
- this.debugLog('[%o]: 触发setState, 修改的值为%o, rowIndex=%o, options=%o', controlId, value, rowIndex, options);
885
+ this.debugLog("[%o]: 触发setState, 修改的值为%o, rowIndex=%o, options=%o", controlId, value, rowIndex, options);
755
886
  this.store.setState(controlId, value, rowIndex);
756
- this.debugLog('[%o]: setState完成, 修改的值为%o, rowIndex=%o', controlId, value, rowIndex);
887
+ this.debugLog("[%o]: setState完成, 修改的值为%o, rowIndex=%o", controlId, value, rowIndex);
757
888
  eventOptionsTemp = null;
758
889
  }
759
890
  },
@@ -766,20 +897,19 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
766
897
  var _this = this;
767
898
  var newStates = states !== null && states !== void 0 ? states : {};
768
899
  Object.keys(newStates).forEach(function(stateId) {
769
- var _this2 = _this;
770
900
  Object.entries(_this.store.controlIdMapping).forEach(function(param) {
771
901
  var _param = _slicedToArray(param, 2), controlId = _param[0], controlIdMapping = _param[1];
772
902
  if (controlIdMapping.dataView === stateId) {
773
903
  // state对象是dataView包裹的
774
904
  var value = newStates[stateId][controlId];
775
905
  if (value !== undefined) {
776
- _this2.setState(controlId, value, rowIndex, options);
906
+ _this.setState(controlId, value, rowIndex, options);
777
907
  }
778
908
  } else {
779
909
  // state对象是单独的,没有被dataView包裹的
780
910
  if (controlId === stateId || controlIdMapping.children && controlIdMapping.children[stateId]) {
781
911
  if (newStates[stateId] !== undefined) {
782
- _this2.setState(stateId, newStates[stateId], rowIndex, options);
912
+ _this.setState(stateId, newStates[stateId], rowIndex, options);
783
913
  }
784
914
  }
785
915
  }
@@ -807,11 +937,11 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
807
937
  if (!dataBindMapping1) {
808
938
  return;
809
939
  }
810
- var dataBind1 = dataBindMapping1.dataBind, controlId1 = dataBindMapping1.controlId;
940
+ var dataBind = dataBindMapping1.dataBind, controlId1 = dataBindMapping1.controlId;
811
941
  var state = this.getState(controlId1, rowIndex);
812
942
  //if (dataBind instanceof ObjectDataBind) {
813
- if (!isDataBind(dataBind1)) {
814
- return Object.entries(dataBind1).reduce(function(result, param) {
943
+ if (!isDataBind(dataBind)) {
944
+ return Object.entries(dataBind).reduce(function(result, param) {
815
945
  var _param = _slicedToArray(param, 2), key = _param[0], dataBind = _param[1];
816
946
  // objectDataBind的元素,跳过下一次赋值
817
947
  if (dataBind.fieldCode === fieldCode) {
@@ -838,18 +968,18 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
838
968
  var data = getFieldData.map(function(item) {
839
969
  var obj = {};
840
970
  for(var key in item){
841
- var ref, ref2, ref3;
842
- var fieldCode = (ref2 = (ref = controlIdMapping[controlId]) === null || ref === void 0 ? void 0 : ref.children[key]) === null || ref2 === void 0 ? void 0 : (ref3 = ref2.dataBind) === null || ref3 === void 0 ? void 0 : ref3.fieldCode;
971
+ var _controlIdMapping_controlId_children_key, _controlIdMapping_controlId, _controlIdMapping_controlId_children_key_dataBind;
972
+ var fieldCode = (_controlIdMapping_controlId_children_key = (_controlIdMapping_controlId = controlIdMapping[controlId]) === null || _controlIdMapping_controlId === void 0 ? void 0 : _controlIdMapping_controlId.children[key]) === null || _controlIdMapping_controlId_children_key === void 0 ? void 0 : (_controlIdMapping_controlId_children_key_dataBind = _controlIdMapping_controlId_children_key.dataBind) === null || _controlIdMapping_controlId_children_key_dataBind === void 0 ? void 0 : _controlIdMapping_controlId_children_key_dataBind.fieldCode;
843
973
  //未绑定字段的控件,直接抛弃
844
- if (fieldCode !== '') {
845
- var ref4;
974
+ if (fieldCode !== "") {
975
+ var _controlIdMapping_controlId1;
846
976
  if (fieldCode) {
847
977
  obj[fieldCode] = item[key];
848
- } else if ((ref4 = controlIdMapping[controlId]) === null || ref4 === void 0 ? void 0 : ref4.children[key]) {
978
+ } else if ((_controlIdMapping_controlId1 = controlIdMapping[controlId]) === null || _controlIdMapping_controlId1 === void 0 ? void 0 : _controlIdMapping_controlId1.children[key]) {
849
979
  // 兼容一个控件需要绑定多个字段的情况
850
980
  for(var keyChi in item[key]){
851
- var ref5, ref6;
852
- obj[(ref6 = (ref5 = controlIdMapping[controlId]) === null || ref5 === void 0 ? void 0 : ref5.children[key]) === null || ref6 === void 0 ? void 0 : ref6.dataBind[keyChi].fieldCode] = item[key][keyChi];
981
+ var _controlIdMapping_controlId_children_key1, _controlIdMapping_controlId2;
982
+ obj[(_controlIdMapping_controlId_children_key1 = (_controlIdMapping_controlId2 = controlIdMapping[controlId]) === null || _controlIdMapping_controlId2 === void 0 ? void 0 : _controlIdMapping_controlId2.children[key]) === null || _controlIdMapping_controlId_children_key1 === void 0 ? void 0 : _controlIdMapping_controlId_children_key1.dataBind[keyChi].fieldCode] = item[key][keyChi];
853
983
  }
854
984
  }
855
985
  }
@@ -858,45 +988,45 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
858
988
  });
859
989
  return data;
860
990
  } else {
861
- var _loop = function(key1) {
862
- var ref15, ref7, ref8, ref9;
863
- if ((ref15 = controlIdMapping[key1]) === null || ref15 === void 0 ? void 0 : (ref7 = ref15.dataBind) === null || ref7 === void 0 ? void 0 : ref7.fieldCode) {
864
- var ref10;
865
- obj1[(ref10 = controlIdMapping[key1]) === null || ref10 === void 0 ? void 0 : ref10.dataBind.fieldCode] = getFieldData[key1];
866
- } else if ((ref8 = controlIdMapping[key1]) === null || ref8 === void 0 ? void 0 : (ref9 = ref8.dataBind) === null || ref9 === void 0 ? void 0 : ref9.dataCode) {
867
- var ref11;
991
+ var _loop = function(key) {
992
+ var _controlIdMapping_key, _controlIdMapping_key_dataBind, _controlIdMapping_key1, _controlIdMapping_key_dataBind1;
993
+ if ((_controlIdMapping_key = controlIdMapping[key]) === null || _controlIdMapping_key === void 0 ? void 0 : (_controlIdMapping_key_dataBind = _controlIdMapping_key.dataBind) === null || _controlIdMapping_key_dataBind === void 0 ? void 0 : _controlIdMapping_key_dataBind.fieldCode) {
994
+ var _controlIdMapping_key2;
995
+ obj[(_controlIdMapping_key2 = controlIdMapping[key]) === null || _controlIdMapping_key2 === void 0 ? void 0 : _controlIdMapping_key2.dataBind.fieldCode] = getFieldData[key];
996
+ } else if ((_controlIdMapping_key1 = controlIdMapping[key]) === null || _controlIdMapping_key1 === void 0 ? void 0 : (_controlIdMapping_key_dataBind1 = _controlIdMapping_key1.dataBind) === null || _controlIdMapping_key_dataBind1 === void 0 ? void 0 : _controlIdMapping_key_dataBind1.dataCode) {
997
+ var _controlIdMapping_key3;
868
998
  // 明细字表只循环一层明细子表未递归
869
- obj1[(ref11 = controlIdMapping[key1]) === null || ref11 === void 0 ? void 0 : ref11.dataBind.dataCode] = getFieldData[key1].map(function(item) {
999
+ obj[(_controlIdMapping_key3 = controlIdMapping[key]) === null || _controlIdMapping_key3 === void 0 ? void 0 : _controlIdMapping_key3.dataBind.dataCode] = getFieldData[key].map(function(item) {
870
1000
  var objChi = {};
871
1001
  for(var keyChi in item){
872
- var ref;
873
- var fieldCode = (ref = controlIdMapping[key1].children[keyChi]) === null || ref === void 0 ? void 0 : ref.dataBind.fieldCode;
1002
+ var _controlIdMapping_key_children_keyChi;
1003
+ var fieldCode = (_controlIdMapping_key_children_keyChi = controlIdMapping[key].children[keyChi]) === null || _controlIdMapping_key_children_keyChi === void 0 ? void 0 : _controlIdMapping_key_children_keyChi.dataBind.fieldCode;
874
1004
  //未绑定字段的控件,直接抛弃
875
- if (fieldCode !== '') {
1005
+ if (fieldCode !== "") {
876
1006
  if (fieldCode) {
877
1007
  objChi[fieldCode] = item[keyChi];
878
1008
  } else {
879
1009
  for(var keyChi1 in item[keyChi]){
880
- var ref14;
881
- objChi[(ref14 = controlIdMapping[key1].children[keyChi]) === null || ref14 === void 0 ? void 0 : ref14.dataBind[keyChi1].fieldCode] = item[keyChi][keyChi1];
1010
+ var _controlIdMapping_key_children_keyChi1;
1011
+ objChi[(_controlIdMapping_key_children_keyChi1 = controlIdMapping[key].children[keyChi]) === null || _controlIdMapping_key_children_keyChi1 === void 0 ? void 0 : _controlIdMapping_key_children_keyChi1.dataBind[keyChi1].fieldCode] = item[keyChi][keyChi1];
882
1012
  }
883
1013
  }
884
1014
  }
885
1015
  }
886
1016
  return objChi;
887
1017
  });
888
- } else if (controlIdMapping[key1]) {
1018
+ } else if (controlIdMapping[key]) {
889
1019
  // 兼容一个控件需要绑定多个字段的情况
890
- for(var keyChi2 in getFieldData[key1]){
891
- var ref12, ref13;
892
- obj1[(ref13 = (ref12 = controlIdMapping[key1]) === null || ref12 === void 0 ? void 0 : ref12.dataBind[keyChi2]) === null || ref13 === void 0 ? void 0 : ref13.fieldCode] = getFieldData[key1][keyChi2];
1020
+ for(var keyChi in getFieldData[key]){
1021
+ var _controlIdMapping_key_dataBind_keyChi, _controlIdMapping_key4;
1022
+ obj[(_controlIdMapping_key_dataBind_keyChi = (_controlIdMapping_key4 = controlIdMapping[key]) === null || _controlIdMapping_key4 === void 0 ? void 0 : _controlIdMapping_key4.dataBind[keyChi]) === null || _controlIdMapping_key_dataBind_keyChi === void 0 ? void 0 : _controlIdMapping_key_dataBind_keyChi.fieldCode] = getFieldData[key][keyChi];
893
1023
  }
894
1024
  }
895
1025
  };
896
1026
  // 主表
897
- var obj1 = {};
898
- for(var key1 in getFieldData)_loop(key1);
899
- return obj1;
1027
+ var obj = {};
1028
+ for(var key in getFieldData)_loop(key);
1029
+ return obj;
900
1030
  }
901
1031
  }
902
1032
  return;
@@ -916,13 +1046,13 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
916
1046
  if (!dataBindMapping) {
917
1047
  return;
918
1048
  }
919
- var dataBind2 = dataBindMapping.dataBind, controlId = dataBindMapping.controlId;
1049
+ var dataBind = dataBindMapping.dataBind, controlId = dataBindMapping.controlId;
920
1050
  // if (dataBind instanceof ObjectDataBind) {
921
- if (!isDataBind(dataBind2)) {
922
- var ref;
923
- var oldState = (ref = JSONCopy(this.getState(controlId, rowIndex))) !== null && ref !== void 0 ? ref : this.getEmptyState(controlId);
1051
+ if (!isDataBind(dataBind)) {
1052
+ var _JSONCopy;
1053
+ var oldState = (_JSONCopy = JSONCopy(this.getState(controlId, rowIndex))) !== null && _JSONCopy !== void 0 ? _JSONCopy : this.getEmptyState(controlId);
924
1054
  // fieldCode不代表是key,所以需要找到对应的key
925
- var newState = Object.entries(dataBind2).reduce(function(result, param) {
1055
+ var newState = Object.entries(dataBind).reduce(function(result, param) {
926
1056
  var _param = _slicedToArray(param, 2), key = _param[0], dataBind = _param[1];
927
1057
  // objectDataBind的元素,跳过下一次赋值
928
1058
  if (dataBind.fieldCode === fieldCode) {
@@ -952,7 +1082,7 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
952
1082
  }
953
1083
  var skipKeys = [];
954
1084
  mapping.fields.forEach(function(item) {
955
- var dataBind3 = item.dataBind, controlId = item.controlId, fieldCode = item.fieldCode;
1085
+ var dataBind = item.dataBind, controlId = item.controlId, fieldCode = item.fieldCode;
956
1086
  if (skipKeys.includes(fieldCode)) {
957
1087
  return;
958
1088
  }
@@ -961,11 +1091,11 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
961
1091
  }
962
1092
  // 对象类型的值
963
1093
  // if (dataBind instanceof ObjectDataBind) {
964
- if (!isDataBind(dataBind3)) {
965
- var ref;
966
- var oldState = (ref = JSONCopy(_this.getState(controlId, rowIndex))) !== null && ref !== void 0 ? ref : _this.getEmptyState(controlId);
1094
+ if (!isDataBind(dataBind)) {
1095
+ var _JSONCopy;
1096
+ var oldState = (_JSONCopy = JSONCopy(_this.getState(controlId, rowIndex))) !== null && _JSONCopy !== void 0 ? _JSONCopy : _this.getEmptyState(controlId);
967
1097
  // fieldCode不代表是key,所以需要找到对应的key
968
- var newState = Object.entries(dataBind3).reduce(function(result, param) {
1098
+ var newState = Object.entries(dataBind).reduce(function(result, param) {
969
1099
  var _param = _slicedToArray(param, 2), key = _param[0], dataBind = _param[1];
970
1100
  // objectDataBind的元素,跳过下一次赋值
971
1101
  skipKeys.push(dataBind.fieldCode);
@@ -995,9 +1125,9 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
995
1125
  return;
996
1126
  }
997
1127
  var skipKeys = [];
998
- var result1 = {};
1128
+ var result = {};
999
1129
  mapping.fields.forEach(function(item) {
1000
- var dataBind4 = item.dataBind, controlId = item.controlId, fieldCode = item.fieldCode;
1130
+ var dataBind = item.dataBind, controlId = item.controlId, fieldCode = item.fieldCode;
1001
1131
  if (skipKeys.includes(fieldCode)) {
1002
1132
  return;
1003
1133
  }
@@ -1006,10 +1136,10 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
1006
1136
  }
1007
1137
  // 对象类型的值
1008
1138
  // if (dataBind instanceof ObjectDataBind) {
1009
- if (!isDataBind(dataBind4)) {
1139
+ if (!isDataBind(dataBind)) {
1010
1140
  var oldState = _this.getEmptyState(controlId);
1011
1141
  // fieldCode不代表是key,所以需要找到对应的key
1012
- result1[item.controlId] = Object.entries(dataBind4).reduce(function(result, param) {
1142
+ result[item.controlId] = Object.entries(dataBind).reduce(function(result, param) {
1013
1143
  var _param = _slicedToArray(param, 2), key = _param[0], dataBind = _param[1];
1014
1144
  // objectDataBind的元素,跳过下一次赋值
1015
1145
  skipKeys.push(dataBind.fieldCode);
@@ -1020,10 +1150,10 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
1020
1150
  return result;
1021
1151
  }, oldState);
1022
1152
  } else {
1023
- result1[controlId] = state[fieldCode];
1153
+ result[controlId] = state[fieldCode];
1024
1154
  }
1025
1155
  });
1026
- return result1;
1156
+ return result;
1027
1157
  }
1028
1158
  },
1029
1159
  {
@@ -1033,14 +1163,13 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
1033
1163
  * @options 传递给关联事件中 EventPayload中的options,一般在plugin中监听使用
1034
1164
  */ key: "setData",
1035
1165
  value: function setData(dataSet, options) {
1036
- var _this6 = this;
1166
+ var _this = this;
1037
1167
  this.debugLog("engine setData方法执行,参数为%o,%o。", dataSet, options);
1038
1168
  var newState = this.store.defaultState;
1039
1169
  Object.keys(dataSet).map(function(dataCode) {
1040
1170
  var entity = dataSet[dataCode];
1041
1171
  if (Array.isArray(entity)) {
1042
- var _this4 = _this6;
1043
- var mapping = _this6.getDataBindMapping(dataCode);
1172
+ var mapping = _this.getDataBindMapping(dataCode);
1044
1173
  if (!mapping) {
1045
1174
  return;
1046
1175
  }
@@ -1048,22 +1177,21 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
1048
1177
  newState[mapping.dataViewId] = {};
1049
1178
  }
1050
1179
  if (!entity.length) {
1051
- var _controlId;
1052
- newState[mapping.dataViewId][mapping.controlId] = (_controlId = newState[mapping.dataViewId][mapping.controlId]) !== null && _controlId !== void 0 ? _controlId : [];
1180
+ var _newState_mapping_dataViewId_mapping_controlId;
1181
+ 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 : [];
1053
1182
  } else {
1054
1183
  newState[mapping.dataViewId][mapping.controlId] = [];
1055
1184
  }
1056
1185
  entity.map(function(row) {
1057
- var _this = _this4;
1058
- var newRow = JSONCopy(_this4.store.emptyState[mapping.dataViewId][mapping.controlId]);
1186
+ var newRow = JSONCopy(_this.store.emptyState[mapping.dataViewId][mapping.controlId]);
1059
1187
  var skipKey = [] //qiyu ObjectDataBind中会提前将相关key拿出来赋值,为了避免重复赋值,设置了此变量
1060
1188
  ;
1061
1189
  Object.keys(row).map(function(fieldCode) {
1062
- var ref, ref18;
1190
+ var _this_store_dataBindMapping_dataCode, _this_store_dataBindMapping_dataCode_fields;
1063
1191
  if (skipKey.includes(fieldCode)) {
1064
1192
  return;
1065
1193
  }
1066
- var fieldMapping = (ref = _this.store.dataBindMapping[dataCode]) === null || ref === void 0 ? void 0 : (ref18 = ref.fields) === null || ref18 === void 0 ? void 0 : ref18.find(function(i) {
1194
+ var fieldMapping = (_this_store_dataBindMapping_dataCode = _this.store.dataBindMapping[dataCode]) === null || _this_store_dataBindMapping_dataCode === void 0 ? void 0 : (_this_store_dataBindMapping_dataCode_fields = _this_store_dataBindMapping_dataCode.fields) === null || _this_store_dataBindMapping_dataCode_fields === void 0 ? void 0 : _this_store_dataBindMapping_dataCode_fields.find(function(i) {
1067
1195
  return i.fieldCode === fieldCode;
1068
1196
  });
1069
1197
  if (fieldMapping) {
@@ -1072,8 +1200,8 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
1072
1200
  newRow[fieldMapping.controlId] = row[fieldCode];
1073
1201
  // } else if (fieldMapping.dataBind instanceof ObjectDataBind) {
1074
1202
  } else if (!isDataBind(fieldMapping.dataBind)) {
1075
- var ref19;
1076
- var objValue = JSONCopy((ref19 = _this.getEmptyState(fieldMapping.controlId)) !== null && ref19 !== void 0 ? ref19 : {});
1203
+ var _this_getEmptyState;
1204
+ var objValue = JSONCopy((_this_getEmptyState = _this.getEmptyState(fieldMapping.controlId)) !== null && _this_getEmptyState !== void 0 ? _this_getEmptyState : {});
1077
1205
  Object.keys(fieldMapping.dataBind).map(function(key) {
1078
1206
  var dataBind = fieldMapping.dataBind[key];
1079
1207
  if (row[dataBind.fieldCode] !== undefined) {
@@ -1088,19 +1216,18 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
1088
1216
  newState[mapping.dataViewId][mapping.controlId].push(newRow);
1089
1217
  });
1090
1218
  } else if (entity) {
1091
- var ref20;
1092
- var skipKey1 = [] //qiyu ObjectDataBind中会提前将相关key拿出来赋值,为了避免重复赋值,设置了此变量
1219
+ var _Object_keys;
1220
+ var skipKey = [] //qiyu ObjectDataBind中会提前将相关key拿出来赋值,为了避免重复赋值,设置了此变量
1093
1221
  ;
1094
- var emptyState = JSONCopy(_this6.store.emptyState);
1095
- if (!((ref20 = Object.keys(entity)) === null || ref20 === void 0 ? void 0 : ref20.length)) {
1222
+ var emptyState = JSONCopy(_this.store.emptyState);
1223
+ if (!((_Object_keys = Object.keys(entity)) === null || _Object_keys === void 0 ? void 0 : _Object_keys.length)) {
1096
1224
  // newState = this.store.defaultState
1097
1225
  } else {
1098
- var _this3 = _this6;
1099
1226
  Object.keys(entity).map(function(fieldCode) {
1100
- if (skipKey1.includes(fieldCode)) {
1227
+ if (skipKey.includes(fieldCode)) {
1101
1228
  return;
1102
1229
  }
1103
- var mapping = _this3.getDataBindMapping(dataCode, fieldCode);
1230
+ var mapping = _this.getDataBindMapping(dataCode, fieldCode);
1104
1231
  if (mapping) {
1105
1232
  if (!newState[mapping.dataViewId[0]]) {
1106
1233
  newState[mapping.dataViewId[0]] = {};
@@ -1110,31 +1237,31 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
1110
1237
  newState[mapping.dataViewId[0]][mapping.controlId] = entity[fieldCode] !== undefined ? entity[fieldCode] : emptyState[mapping.dataViewId[0]][mapping.controlId];
1111
1238
  // } else if (mapping.dataBind instanceof ObjectDataBind) {
1112
1239
  } else if (!isDataBind(mapping.dataBind)) {
1113
- var ref;
1114
- var objValue = (ref = _this3.getEmptyState(mapping.controlId)) !== null && ref !== void 0 ? ref : {};
1240
+ var _this_getEmptyState;
1241
+ var objValue = (_this_getEmptyState = _this.getEmptyState(mapping.controlId)) !== null && _this_getEmptyState !== void 0 ? _this_getEmptyState : {};
1115
1242
  Object.keys(mapping.dataBind).map(function(key) {
1116
1243
  var dataBind = mapping.dataBind[key];
1117
1244
  if (entity[dataBind.fieldCode] !== undefined) {
1118
1245
  objValue[key] = entity[dataBind.fieldCode];
1119
1246
  }
1120
- skipKey1.push(dataBind.fieldCode);
1247
+ skipKey.push(dataBind.fieldCode);
1121
1248
  });
1122
1249
  newState[mapping.dataViewId[0]][mapping.controlId] = objValue;
1123
1250
  }
1124
1251
  }
1125
1252
  });
1126
1253
  }
1127
- var newMapping = _this6.getDataBindMapping(dataCode);
1254
+ var newMapping = _this.getDataBindMapping(dataCode);
1128
1255
  if (newMapping) {
1129
- var ref16;
1130
- var mappingKeys = newMapping === null || newMapping === void 0 ? void 0 : (ref16 = newMapping.fields) === null || ref16 === void 0 ? void 0 : ref16.map(function(item) {
1256
+ var _newMapping_fields;
1257
+ var mappingKeys = newMapping === null || newMapping === void 0 ? void 0 : (_newMapping_fields = newMapping.fields) === null || _newMapping_fields === void 0 ? void 0 : _newMapping_fields.map(function(item) {
1131
1258
  return item === null || item === void 0 ? void 0 : item.controlId;
1132
1259
  });
1133
- var mappingValue = _this6.getEmptyState(newMapping === null || newMapping === void 0 ? void 0 : newMapping.controlId);
1134
- var ref17;
1135
- var mainStateKeys = Object.keys((ref17 = newState === null || newState === void 0 ? void 0 : newState[newMapping === null || newMapping === void 0 ? void 0 : newMapping.controlId]) !== null && ref17 !== void 0 ? ref17 : {});
1260
+ var mappingValue = _this.getEmptyState(newMapping === null || newMapping === void 0 ? void 0 : newMapping.controlId);
1261
+ var _newState_newMapping_controlId;
1262
+ var mainStateKeys = Object.keys((_newState_newMapping_controlId = newState === null || newState === void 0 ? void 0 : newState[newMapping === null || newMapping === void 0 ? void 0 : newMapping.controlId]) !== null && _newState_newMapping_controlId !== void 0 ? _newState_newMapping_controlId : {});
1136
1263
  mappingKeys === null || mappingKeys === void 0 ? void 0 : mappingKeys.forEach(function(key) {
1137
- if (!mainStateKeys.includes(key) && key !== 'uid' && newState[newMapping === null || newMapping === void 0 ? void 0 : newMapping.controlId]) {
1264
+ if (!mainStateKeys.includes(key) && key !== "uid" && newState[newMapping === null || newMapping === void 0 ? void 0 : newMapping.controlId]) {
1138
1265
  if (Object.keys(newState).length) {
1139
1266
  Object.assign(newState[newMapping === null || newMapping === void 0 ? void 0 : newMapping.controlId], _defineProperty({}, key, mappingValue[key]));
1140
1267
  } else {
@@ -1142,7 +1269,7 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
1142
1269
  }
1143
1270
  }
1144
1271
  });
1145
- _this6.debugLog("engine setData方法默认值及表单数据组合完成,参数为%o。", newState);
1272
+ _this.debugLog("engine setData方法默认值及表单数据组合完成,参数为%o。", newState);
1146
1273
  }
1147
1274
  }
1148
1275
  });
@@ -1210,13 +1337,13 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
1210
1337
  }
1211
1338
  }
1212
1339
  } else {
1213
- var ref;
1214
- var controlIdMapping = (ref = this.getControlIdMapping()) !== null && ref !== void 0 ? ref : {};
1215
- var ref21;
1216
- var ref22 = _slicedToArray((ref21 = Object.entries(controlIdMapping).find(function(param) {
1340
+ var _this_getControlIdMapping;
1341
+ var controlIdMapping = (_this_getControlIdMapping = this.getControlIdMapping()) !== null && _this_getControlIdMapping !== void 0 ? _this_getControlIdMapping : {};
1342
+ var _Object_entries_find;
1343
+ var _ref = _slicedToArray((_Object_entries_find = Object.entries(controlIdMapping).find(function(param) {
1217
1344
  var _param = _slicedToArray(param, 2), _ = _param[0], mapping = _param[1];
1218
1345
  return mapping.children && controlId in mapping.children;
1219
- })) !== null && ref21 !== void 0 ? ref21 : [], 1), subtableId = ref22[0];
1346
+ })) !== null && _Object_entries_find !== void 0 ? _Object_entries_find : [], 1), subtableId = _ref[0];
1220
1347
  if (subtableId) {
1221
1348
  var subtable = this.getInstance(subtableId);
1222
1349
  // @ts-ignore
@@ -1243,16 +1370,16 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
1243
1370
  {
1244
1371
  key: "setInstance",
1245
1372
  value: function setInstance(instance, props, value, rowIndex) {
1373
+ var _this = this;
1246
1374
  try {
1247
- if (typeof instance === 'string' && rowIndex === -1) {
1248
- var _this = this;
1375
+ if (typeof instance === "string" && rowIndex === -1) {
1249
1376
  //修改明细表整列属性的逻辑
1250
1377
  var instances = this.getInstances(instance, rowIndex === -1);
1251
1378
  instances.map(function(_instance) {
1252
1379
  if (_instance) {
1253
1380
  _this.debugLog("[%o]: 修改instance: %o的%o属性,修改的值为%o。", _instance.id, _instance, props, value);
1254
1381
  updateValueFromKeys(_instance.props, props, value);
1255
- _this.schemaEvent('schema-change', {
1382
+ _this.schemaEvent("schema-change", {
1256
1383
  instance: _instance,
1257
1384
  props: props,
1258
1385
  value: value,
@@ -1261,19 +1388,19 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
1261
1388
  }
1262
1389
  });
1263
1390
  } else {
1264
- var _instance1;
1265
- if (typeof instance === 'string') {
1266
- _instance1 = this.getInstance(instance, rowIndex);
1391
+ var _instance;
1392
+ if (typeof instance === "string") {
1393
+ _instance = this.getInstance(instance, rowIndex);
1267
1394
  } else {
1268
- _instance1 = instance;
1395
+ _instance = instance;
1269
1396
  }
1270
- if (!_instance1) {
1397
+ if (!_instance) {
1271
1398
  return;
1272
1399
  }
1273
- this.debugLog("[%o]: 修改instance: %o的%o属性,修改的值为%o。", _instance1.id, _instance1, props, value);
1274
- updateValueFromKeys(_instance1.props, props, value);
1275
- this.schemaEvent('schema-change', {
1276
- instance: _instance1,
1400
+ this.debugLog("[%o]: 修改instance: %o的%o属性,修改的值为%o。", _instance.id, _instance, props, value);
1401
+ updateValueFromKeys(_instance.props, props, value);
1402
+ this.schemaEvent("schema-change", {
1403
+ instance: _instance,
1277
1404
  props: props,
1278
1405
  value: value,
1279
1406
  rowIndex: rowIndex
@@ -1443,8 +1570,8 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
1443
1570
  for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
1444
1571
  args[_key] = arguments[_key];
1445
1572
  }
1446
- var _runtime;
1447
- return (_runtime = this.runtime).registerControlConfig.apply(_runtime, _toConsumableArray(args));
1573
+ var _this_runtime;
1574
+ return (_this_runtime = this.runtime).registerControlConfig.apply(_this_runtime, _toConsumableArray(args));
1448
1575
  }
1449
1576
  },
1450
1577
  {
@@ -1456,12 +1583,12 @@ var Engine = // 整体渲染引擎 并且 提供发布订阅能力
1456
1583
  {
1457
1584
  key: "inList",
1458
1585
  value: function inList(controlId) {
1459
- var _controlIdMapping;
1460
- var mapping = (_controlIdMapping = this.store.controlIdMapping) !== null && _controlIdMapping !== void 0 ? _controlIdMapping : {};
1586
+ var _this_store_controlIdMapping;
1587
+ var mapping = (_this_store_controlIdMapping = this.store.controlIdMapping) !== null && _this_store_controlIdMapping !== void 0 ? _this_store_controlIdMapping : {};
1461
1588
  var listKey = undefined;
1462
1589
  Object.keys(mapping).some(function(key) {
1463
- var ref, ref23;
1464
- var matched = (ref = mapping[key]) === null || ref === void 0 ? void 0 : (ref23 = ref.children) === null || ref23 === void 0 ? void 0 : ref23.hasOwnProperty(controlId);
1590
+ var _mapping_key, _mapping_key_children;
1591
+ var matched = (_mapping_key = mapping[key]) === null || _mapping_key === void 0 ? void 0 : (_mapping_key_children = _mapping_key.children) === null || _mapping_key_children === void 0 ? void 0 : _mapping_key_children.hasOwnProperty(controlId);
1465
1592
  if (matched) {
1466
1593
  listKey = key;
1467
1594
  }