@byteluck-fe/model-driven-engine 6.2.0-2-beta.2 → 6.2.0-beta.10

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.
@@ -326,7 +326,7 @@ function _ts_generator(thisArg, body) {
326
326
  }
327
327
  import { getLocaleText } from '@byteluck-fe/locale-message';
328
328
  import { isDataBind } from '@byteluck-fe/model-driven-core';
329
- import { CONTROL_BASE_TYPE, CONTROL_TYPE, DEFAULT_LOCALE, error, genNonDuplicateId, isString, JSONCopy, log, updateValueFromKeys, warn, Watcher, isBuiltInControls } from '@byteluck-fe/model-driven-shared';
329
+ import { CONTROL_BASE_TYPE, CONTROL_TYPE, DEFAULT_LOCALE, error, genNonDuplicateId, isString, JSONCopy, log, updateValueFromKeys, warn, Watcher, deepFreeze, isBuiltInControls } from '@byteluck-fe/model-driven-shared';
330
330
  import { Runtime } from './Runtime';
331
331
  import { Store } from './Store';
332
332
  import { findItem, proxyState } from './proxyState';
@@ -1571,6 +1571,32 @@ var Engine = /*#__PURE__*/ function(Watcher) {
1571
1571
  return this.store.controlIdMapping;
1572
1572
  }
1573
1573
  },
1574
+ {
1575
+ /**
1576
+ * 根据字段获取组件实例,传入rowIndex代表获取明细表内的控件实例,rowIndex传入-1代表获取表头内的实例
1577
+ * @param dataCode 模型code
1578
+ * @param fieldCode 字段code
1579
+ */ key: "getFieldInstance",
1580
+ value: function getFieldInstance(dataCode, fieldCode, rowIndex) {
1581
+ var dataBindMapping = this.getDataBindMapping(dataCode, fieldCode);
1582
+ if (dataBindMapping) {
1583
+ var _instance = this.getInstance(dataBindMapping.controlId, rowIndex);
1584
+ return _instance;
1585
+ }
1586
+ }
1587
+ },
1588
+ {
1589
+ key: "setFieldInstance",
1590
+ value: function setFieldInstance(dataCode, fieldCode, props, value, rowIndex) {
1591
+ var dataBindMapping = this.getDataBindMapping(dataCode, fieldCode);
1592
+ if (dataBindMapping) {
1593
+ var _instance = this.getInstance(dataBindMapping.controlId, rowIndex);
1594
+ this.debugLog("调用了setFieldInstance[%o]: 修改instance: %o的%o属性,修改的值为%o。", _instance.id, _instance, props, value);
1595
+ this.setInstance(_instance.id, props, value, rowIndex);
1596
+ return deepFreeze(_instance);
1597
+ }
1598
+ }
1599
+ },
1574
1600
  {
1575
1601
  key: "getDataBindMapping",
1576
1602
  value: function getDataBindMapping(dataCode, fieldCode) {