@byteluck-fe/model-driven-engine 2.8.2-beta.12 → 2.8.2-beta.14

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/README.md CHANGED
@@ -1,30 +1,30 @@
1
- # Engine
2
- 运行态引擎
3
-
4
- ```
5
- │ index.ts // 入口文件
6
-
7
- ├─common // 引擎相关
8
- │ ActionManager.ts // utils操作管理
9
- │ checkerValue.ts // 表单值校验器
10
- │ DataManager.ts // 数据源容器
11
- │ Engine.ts // 引擎
12
- │ index.ts // 入口
13
- │ OkWorker.ts // 无用
14
- │ Plugin.ts // 插件
15
- │ proxyState.ts // 劫持引擎表单数据
16
- │ Runtime.ts // 控件注册和创建
17
- │ Store.ts // 数据管理
18
-
19
- ├─plugins
20
- │ CalcPlugin.ts // 计算公式插件
21
- │ ControlsEventPlugin.ts // 控件二开事件插件
22
- │ ES6ModulePlugin.ts //
23
- │ index.ts
24
- │ LifecycleEventPlugin.ts // 页面生命周期事件
25
- │ StylePlugin.ts // css二开
26
-
27
- └─utils
28
- index.ts
29
- runtimeUtils.ts // 工具函数
30
- ```
1
+ # Engine
2
+ 运行态引擎
3
+
4
+ ```
5
+ │ index.ts // 入口文件
6
+
7
+ ├─common // 引擎相关
8
+ │ ActionManager.ts // utils操作管理
9
+ │ checkerValue.ts // 表单值校验器
10
+ │ DataManager.ts // 数据源容器
11
+ │ Engine.ts // 引擎
12
+ │ index.ts // 入口
13
+ │ OkWorker.ts // 无用
14
+ │ Plugin.ts // 插件
15
+ │ proxyState.ts // 劫持引擎表单数据
16
+ │ Runtime.ts // 控件注册和创建
17
+ │ Store.ts // 数据管理
18
+
19
+ ├─plugins
20
+ │ CalcPlugin.ts // 计算公式插件
21
+ │ ControlsEventPlugin.ts // 控件二开事件插件
22
+ │ ES6ModulePlugin.ts //
23
+ │ index.ts
24
+ │ LifecycleEventPlugin.ts // 页面生命周期事件
25
+ │ StylePlugin.ts // css二开
26
+
27
+ └─utils
28
+ index.ts
29
+ runtimeUtils.ts // 工具函数
30
+ ```
@@ -186,11 +186,11 @@ export var ActionManager = /*#__PURE__*/ function() {
186
186
  _class_call_check(this, ActionManager);
187
187
  _define_property(this, "actionMap", new Map());
188
188
  _define_property(this, "buildinActions", {});
189
- /**
190
- * 执行action的时候,作为第二个参数传递给方法,可以通过外部挂载
189
+ /**
190
+ * 执行action的时候,作为第二个参数传递给方法,可以通过外部挂载
191
191
  */ _define_property(this, "actionUtils", {});
192
- /**
193
- * 用于存储es module解析出来的源码,CustomVueControlPlugin
192
+ /**
193
+ * 用于存储es module解析出来的源码,CustomVueControlPlugin
194
194
  */ _define_property(this, "sources", {});
195
195
  }
196
196
  _create_class(ActionManager, [
@@ -952,9 +952,9 @@ var Engine = /*#__PURE__*/ function(Watcher) {
952
952
  }
953
953
  },
954
954
  {
955
- /**
956
- * 设置payload的options,提供在不是使用标准api修改state的时候可以传递options,会在本次任务执行完成之后清空
957
- * @param options 需要携带的options
955
+ /**
956
+ * 设置payload的options,提供在不是使用标准api修改state的时候可以传递options,会在本次任务执行完成之后清空
957
+ * @param options 需要携带的options
958
958
  * */ key: "setPayloadOptions",
959
959
  value: function setPayloadOptions(options) {
960
960
  eventOptionsTemp = options;
@@ -971,9 +971,9 @@ var Engine = /*#__PURE__*/ function(Watcher) {
971
971
  }
972
972
  },
973
973
  {
974
- /**
975
- * 向Store设置一组值,明细表必须全量赋值,并触发事件(触发事件是根据组件在页面中的顺序逐个触发)
976
- * @param states
974
+ /**
975
+ * 向Store设置一组值,明细表必须全量赋值,并触发事件(触发事件是根据组件在页面中的顺序逐个触发)
976
+ * @param states
977
977
  */ key: "setStates",
978
978
  value: function setStates(states, rowIndex, options) {
979
979
  var _this = this;
@@ -1000,11 +1000,11 @@ var Engine = /*#__PURE__*/ function(Watcher) {
1000
1000
  }
1001
1001
  },
1002
1002
  {
1003
- /**
1004
- * 通过dataCode和fieldCode来获取控件的值
1005
- * @param dataCode 模型编码 - 如果是主表的话就是主表的模型编码,明细子表的话就是子表的模型编码
1006
- * @param fieldCode 字段编码 - 控件绑定的数据项的编码
1007
- * @param rowIndex 行下标 - 如果是明细子表中的控件需要提供
1003
+ /**
1004
+ * 通过dataCode和fieldCode来获取控件的值
1005
+ * @param dataCode 模型编码 - 如果是主表的话就是主表的模型编码,明细子表的话就是子表的模型编码
1006
+ * @param fieldCode 字段编码 - 控件绑定的数据项的编码
1007
+ * @param rowIndex 行下标 - 如果是明细子表中的控件需要提供
1008
1008
  * */ key: "getField",
1009
1009
  value: function getField(dataCode, fieldCode, rowIndex) {
1010
1010
  if (!fieldCode) {
@@ -1115,13 +1115,13 @@ var Engine = /*#__PURE__*/ function(Watcher) {
1115
1115
  }
1116
1116
  },
1117
1117
  {
1118
- /**
1119
- * 通过dataCode和fieldCode来设置控件的值
1120
- * @param dataCode 模型编码 - 如果是主表的话就是主表的模型编码,明细子表的话就是子表的模型编码
1121
- * @param fieldCode 字段编码 - 控件绑定的数据项的编码
1122
- * @param value 修改的值
1123
- * @param rowIndex 行下标 - 如果是明细子表中的控件需要提供
1124
- * @param options 触发事件携带的参数
1118
+ /**
1119
+ * 通过dataCode和fieldCode来设置控件的值
1120
+ * @param dataCode 模型编码 - 如果是主表的话就是主表的模型编码,明细子表的话就是子表的模型编码
1121
+ * @param fieldCode 字段编码 - 控件绑定的数据项的编码
1122
+ * @param value 修改的值
1123
+ * @param rowIndex 行下标 - 如果是明细子表中的控件需要提供
1124
+ * @param options 触发事件携带的参数
1125
1125
  * */ key: "setField",
1126
1126
  value: function setField(dataCode, fieldCode, value, rowIndex, options) {
1127
1127
  var dataBindMapping = this.getDataBindMapping(dataCode, fieldCode);
@@ -1149,12 +1149,12 @@ var Engine = /*#__PURE__*/ function(Watcher) {
1149
1149
  }
1150
1150
  },
1151
1151
  {
1152
- /**
1153
- * 通过dataCode和 state来给一组控件赋值,并触发事件携带options
1154
- * @param dataCode 需要赋值的目标模型
1155
- * @param state 赋值对象,以fieldCode为key组成的对象
1156
- * @param rowIndex 行下标,给明细子表赋值时指定赋值某行
1157
- * @param options 触发事件携带的参数
1152
+ /**
1153
+ * 通过dataCode和 state来给一组控件赋值,并触发事件携带options
1154
+ * @param dataCode 需要赋值的目标模型
1155
+ * @param state 赋值对象,以fieldCode为key组成的对象
1156
+ * @param rowIndex 行下标,给明细子表赋值时指定赋值某行
1157
+ * @param options 触发事件携带的参数
1158
1158
  * */ key: "setFields",
1159
1159
  value: function setFields(dataCode, state, rowIndex, options) {
1160
1160
  var _this = this;
@@ -1195,10 +1195,10 @@ var Engine = /*#__PURE__*/ function(Watcher) {
1195
1195
  }
1196
1196
  },
1197
1197
  {
1198
- /**
1199
- * 通过dataCode来将state转化为标准的state结构
1200
- * @param dataCode 需要转换的目标模型code
1201
- * @param state 值对象,以fieldCode为key组成的对象
1198
+ /**
1199
+ * 通过dataCode来将state转化为标准的state结构
1200
+ * @param dataCode 需要转换的目标模型code
1201
+ * @param state 值对象,以fieldCode为key组成的对象
1202
1202
  * */ key: "buildFields",
1203
1203
  value: function buildFields(dataCode, state) {
1204
1204
  var _this = this;
@@ -1239,10 +1239,10 @@ var Engine = /*#__PURE__*/ function(Watcher) {
1239
1239
  }
1240
1240
  },
1241
1241
  {
1242
- /**
1243
- * 向Store设置一组值,并触发事件携带options
1244
- * @param dataSet
1245
- * @options 传递给关联事件中 EventPayload中的options,一般在plugin中监听使用
1242
+ /**
1243
+ * 向Store设置一组值,并触发事件携带options
1244
+ * @param dataSet
1245
+ * @options 传递给关联事件中 EventPayload中的options,一般在plugin中监听使用
1246
1246
  */ key: "setData",
1247
1247
  value: function setData(dataSet, options) {
1248
1248
  var _this = this;
@@ -1379,19 +1379,19 @@ var Engine = /*#__PURE__*/ function(Watcher) {
1379
1379
  }
1380
1380
  },
1381
1381
  {
1382
- /**
1383
- * 获取控件的dataBind
1384
- * @param controlId
1382
+ /**
1383
+ * 获取控件的dataBind
1384
+ * @param controlId
1385
1385
  * */ key: "getDataBind",
1386
1386
  value: function getDataBind(controlId) {
1387
1387
  return this.store.getDataBind(controlId);
1388
1388
  }
1389
1389
  },
1390
1390
  {
1391
- /**
1392
- * 获取组件实例,传入rowIndex代表获取明细表内的控件实例,rowIndex传入-1代表获取表头内的实例
1393
- * @param controlId
1394
- * @param rowIndex
1391
+ /**
1392
+ * 获取组件实例,传入rowIndex代表获取明细表内的控件实例,rowIndex传入-1代表获取表头内的实例
1393
+ * @param controlId
1394
+ * @param rowIndex
1395
1395
  */ key: "getInstance",
1396
1396
  value: function getInstance(controlId, rowIndex) {
1397
1397
  var instances = this.getInstances(controlId, rowIndex === -1);
@@ -1410,10 +1410,10 @@ var Engine = /*#__PURE__*/ function(Watcher) {
1410
1410
  }
1411
1411
  },
1412
1412
  {
1413
- /**
1414
- * 获取组件实例,明细表中的组件将会得到数组, 第二个参数为(false/不传入)则获取到的是明细表内不包含表头内实例的所有控件实例,传入true则获取到包含表头内实例的所有控件实例,表头内实例永远在下标0的位置
1415
- * @param controlId
1416
- * @param header 明细表内是否获取表头的控件
1413
+ /**
1414
+ * 获取组件实例,明细表中的组件将会得到数组, 第二个参数为(false/不传入)则获取到的是明细表内不包含表头内实例的所有控件实例,传入true则获取到包含表头内实例的所有控件实例,表头内实例永远在下标0的位置
1415
+ * @param controlId
1416
+ * @param header 明细表内是否获取表头的控件
1417
1417
  */ // getInstances(
1418
1418
  // controlId?: string,
1419
1419
  // header: boolean = false
@@ -1585,27 +1585,27 @@ var Engine = /*#__PURE__*/ function(Watcher) {
1585
1585
  },
1586
1586
  {
1587
1587
  key: "assertInstance",
1588
- value: /**
1589
- * 判断控件的类型,返回当前控件的正确类型
1588
+ value: /**
1589
+ * 判断控件的类型,返回当前控件的正确类型
1590
1590
  * */ function assertInstance(instance, types) {
1591
1591
  return isString(types) ? instance.type === types : types.includes(instance.type);
1592
1592
  }
1593
1593
  },
1594
1594
  {
1595
1595
  key: "assertInstanceIsCustomControl",
1596
- value: /**
1597
- * 判断控件或控件类型是一个自定义控件
1596
+ value: /**
1597
+ * 判断控件或控件类型是一个自定义控件
1598
1598
  * */ function assertInstanceIsCustomControl(instance) {
1599
1599
  return !isBuiltInControls(isString(instance) ? instance : instance.type);
1600
1600
  }
1601
1601
  },
1602
1602
  {
1603
1603
  key: "getInstanceRowIndex",
1604
- value: /**
1605
- * 获取控件在明细子表中的行下标,
1606
- * 如果控件在表头内,则返回-1
1607
- * 如果控件在表内,则返回行下标
1608
- * 如果控件不在明细表内,则返回undefined
1604
+ value: /**
1605
+ * 获取控件在明细子表中的行下标,
1606
+ * 如果控件在表头内,则返回-1
1607
+ * 如果控件在表内,则返回行下标
1608
+ * 如果控件不在明细表内,则返回undefined
1609
1609
  * */ // public getInstanceRowIndex(
1610
1610
  // instance: ControlRuntimeInstance<ControlsKeys> | RuntimeControl
1611
1611
  // ) {
@@ -285,8 +285,8 @@ function loop(control, parentId, callback) {
285
285
  function hasHeaderOrFooterControl(control, checkType) {
286
286
  return checkType in control.props && isArray(control.props[checkType]);
287
287
  }
288
- /**
289
- * 控件是否在视图中隐藏,遍历查找所有parent
288
+ /**
289
+ * 控件是否在视图中隐藏,遍历查找所有parent
290
290
  * */ function getControlIsHide(control) {
291
291
  if (control.props.isHide) {
292
292
  return true;
@@ -69,10 +69,10 @@ var Store = /*#__PURE__*/ function() {
69
69
  }
70
70
  _create_class(Store, [
71
71
  {
72
- /**
73
- * 使用该方法仅改变数据,不会表单触发事件。明细表可全量赋值也可根据rowIndex进行单独设置
74
- * @param controlId 组件ID
75
- * @param value
72
+ /**
73
+ * 使用该方法仅改变数据,不会表单触发事件。明细表可全量赋值也可根据rowIndex进行单独设置
74
+ * @param controlId 组件ID
75
+ * @param value
76
76
  */ key: "setState",
77
77
  value: function setState(controlId, value, rowIndex) {
78
78
  var _this = this;
@@ -105,11 +105,11 @@ function ArrayHandler(target, propertyKey, value, thisKey, callback) {
105
105
  }
106
106
  }
107
107
  }
108
- /**
109
- * 返回proxy操作对象
110
- * @param thisKey 当前对象在上级中的key
111
- * @param callback 需要在修改的时候,触发的回调函数
112
- * @param beforeSetCallback 需要在修改之前触发的回调函数,可以进行校验和对值的修改等等,最终的返回值不为undefined就会使用
108
+ /**
109
+ * 返回proxy操作对象
110
+ * @param thisKey 当前对象在上级中的key
111
+ * @param callback 需要在修改的时候,触发的回调函数
112
+ * @param beforeSetCallback 需要在修改之前触发的回调函数,可以进行校验和对值的修改等等,最终的返回值不为undefined就会使用
113
113
  * */ function handler(thisKey, callback, beforeSetCallback) {
114
114
  return {
115
115
  __engineProxy__: true,
@@ -183,12 +183,12 @@ function ArrayHandler(target, propertyKey, value, thisKey, callback) {
183
183
  }
184
184
  };
185
185
  }
186
- /**
187
- * 代理state数据
188
- * @param state 数据对象
189
- * @param callback 触发set时候的回调函数
190
- * @param beforeSetCallback
191
- * @param prevKey 递归对象的key
186
+ /**
187
+ * 代理state数据
188
+ * @param state 数据对象
189
+ * @param callback 触发set时候的回调函数
190
+ * @param beforeSetCallback
191
+ * @param prevKey 递归对象的key
192
192
  * */ export function proxyState(state, callback, beforeSetCallback) {
193
193
  var prevKey = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : '';
194
194
  // 冻结的对象不需要再执行proxy,否则会报错
@@ -216,10 +216,10 @@ function flatInstanceForChildren(controls) {
216
216
  });
217
217
  return result;
218
218
  }
219
- /**
220
- * 在flatInstance中通过key查找出对应的instance
221
- * @param flatInstance 拍平的instance数组
222
- * @param key 操作的数据在state的key - 可以是深层次的 subtable.0.input等
219
+ /**
220
+ * 在flatInstance中通过key查找出对应的instance
221
+ * @param flatInstance 拍平的instance数组
222
+ * @param key 操作的数据在state的key - 可以是深层次的 subtable.0.input等
223
223
  * */ export function findItem(flatInstance, key, instanceMap) {
224
224
  if (key === '') return undefined;
225
225
  var keys = key.split('.');
@@ -276,9 +276,9 @@ function getArrayNewArgs(type, args, value) {
276
276
  return args.slice(0, 2).concat(value);
277
277
  }
278
278
  }
279
- /**
280
- * TODO 数组劫持操作需要模仿vue3进行重构,不再直接劫持原生property
281
- * 劫持数组api,达到操作数组api的时候,可以同步操作instance
279
+ /**
280
+ * TODO 数组劫持操作需要模仿vue3进行重构,不再直接劫持原生property
281
+ * 劫持数组api,达到操作数组api的时候,可以同步操作instance
282
282
  * */ function hijackArrayProperty() {
283
283
  proxyArrayApi.forEach(function(key) {
284
284
  var oldApiHandler = Array.prototype[key];
@@ -61,31 +61,31 @@ 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 = /*#__PURE__*/ function(DisplayType) {
65
- /**
66
- * 完全等于
64
+ var DisplayType;
65
+ (function(DisplayType) {
66
+ /**
67
+ * 完全等于
67
68
  */ DisplayType["EQ"] = "EQ";
68
- /**
69
- * 包含
69
+ /**
70
+ * 包含
70
71
  * */ DisplayType["IN"] = "IN";
71
- return DisplayType;
72
- }(DisplayType || {});
72
+ })(DisplayType || (DisplayType = {}));
73
73
  export var CalcPlugin = /*#__PURE__*/ function() {
74
74
  "use strict";
75
75
  function CalcPlugin(options) {
76
76
  _class_call_check(this, CalcPlugin);
77
77
  _define_property(this, "engine", void 0);
78
78
  _define_property(this, "options", void 0);
79
- /**
80
- * 所有的计算公式控件
79
+ /**
80
+ * 所有的计算公式控件
81
81
  * */ // @ts-ignore
82
82
  _define_property(this, "calcControls", []);
83
- /**
84
- * key=控件id value=控件修改后需要触发重新计算的计算公式控件组成的数组
85
- * 存储为一个Map,用于在控件change的时候,重新计算依赖的calc
83
+ /**
84
+ * key=控件id value=控件修改后需要触发重新计算的计算公式控件组成的数组
85
+ * 存储为一个Map,用于在控件change的时候,重新计算依赖的calc
86
86
  * */ _define_property(this, "dependenciesTriggerMap", new Map());
87
- /**
88
- * 隐藏以后需要被计算的控件
87
+ /**
88
+ * 隐藏以后需要被计算的控件
89
89
  * */ _define_property(this, "hideNotRememberControlIds", []);
90
90
  _define_property(this, "dontHasPermissionControlIds", []);
91
91
  _define_property(this, "cacheComputedResult", {});
@@ -96,8 +96,8 @@ export var CalcPlugin = /*#__PURE__*/ function() {
96
96
  _create_class(CalcPlugin, [
97
97
  {
98
98
  key: "getNeedHideRememberControlIds",
99
- value: /**
100
- * @description 获取显隐控制的需要被记住值的控件id
99
+ value: /**
100
+ * @description 获取显隐控制的需要被记住值的控件id
101
101
  * */ function getNeedHideRememberControlIds() {
102
102
  var _this_options;
103
103
  if (!((_this_options = this.options) === null || _this_options === void 0 ? void 0 : _this_options.displayBoList)) {
@@ -114,8 +114,8 @@ export var CalcPlugin = /*#__PURE__*/ function() {
114
114
  },
115
115
  {
116
116
  key: "getDontHasPermissionControlIds",
117
- value: /**
118
- * @description 获取权限控制的隐藏的字段,不需要参与计算
117
+ value: /**
118
+ * @description 获取权限控制的隐藏的字段,不需要参与计算
119
119
  * */ function getDontHasPermissionControlIds() {
120
120
  var _this_options;
121
121
  if (!((_this_options = this.options) === null || _this_options === void 0 ? void 0 : _this_options.behavior)) {
@@ -131,9 +131,9 @@ export var CalcPlugin = /*#__PURE__*/ function() {
131
131
  },
132
132
  {
133
133
  key: "controlNeedComputedValue",
134
- value: /**
135
- * @description 判断控件是否需要被计算
136
- * @param control 控件
134
+ value: /**
135
+ * @description 判断控件是否需要被计算
136
+ * @param control 控件
137
137
  * */ function controlNeedComputedValue(control) {
138
138
  if (!control) {
139
139
  return false;
@@ -153,9 +153,9 @@ export var CalcPlugin = /*#__PURE__*/ function() {
153
153
  },
154
154
  {
155
155
  key: "getControlIsHide",
156
- value: /**
157
- * @description 获取控件是否被隐藏
158
- * @param control 控件
156
+ value: /**
157
+ * @description 获取控件是否被隐藏
158
+ * @param control 控件
159
159
  * */ function getControlIsHide(control) {
160
160
  if (control.props.isHide) {
161
161
  return true;
@@ -184,8 +184,8 @@ export var CalcPlugin = /*#__PURE__*/ function() {
184
184
  },
185
185
  {
186
186
  key: "resetDependencies",
187
- value: /**
188
- * @description 重置依赖,获取所有的计算公式控件,并根据计算公式获取控件依赖关系
187
+ value: /**
188
+ * @description 重置依赖,获取所有的计算公式控件,并根据计算公式获取控件依赖关系
189
189
  * */ function resetDependencies() {
190
190
  this.calcControls = [];
191
191
  this.dependenciesTriggerMap.clear();
@@ -195,8 +195,8 @@ export var CalcPlugin = /*#__PURE__*/ function() {
195
195
  },
196
196
  {
197
197
  key: "allCalcControlComputed",
198
- value: /**
199
- * @description 执行所有计算公式控件的计算
198
+ value: /**
199
+ * @description 执行所有计算公式控件的计算
200
200
  * */ function allCalcControlComputed() {
201
201
  var _this = this;
202
202
  this.calcControls.forEach(function(item) {
@@ -210,8 +210,8 @@ export var CalcPlugin = /*#__PURE__*/ function() {
210
210
  },
211
211
  {
212
212
  key: "getAllCalcControl",
213
- value: /**
214
- * @description 获取所有的计算公式控件
213
+ value: /**
214
+ * @description 获取所有的计算公式控件
215
215
  * */ function getAllCalcControl() {
216
216
  this.calcControls = this.engine.runtime.flatInstances.filter(// @ts-ignore
217
217
  function(item) {
@@ -221,8 +221,8 @@ export var CalcPlugin = /*#__PURE__*/ function() {
221
221
  },
222
222
  {
223
223
  key: "getCalcDependencies",
224
- value: /**
225
- * @description 获取计算公式控件依赖,组成 依赖=>[计算公式] 的Map结构
224
+ value: /**
225
+ * @description 获取计算公式控件依赖,组成 依赖=>[计算公式] 的Map结构
226
226
  * */ function getCalcDependencies() {
227
227
  var _this = this;
228
228
  this.calcControls.forEach(function(item) {
@@ -274,8 +274,8 @@ export var CalcPlugin = /*#__PURE__*/ function() {
274
274
  },
275
275
  {
276
276
  key: "watchSchemaHideChange",
277
- value: /**
278
- * @description 监听控件的显隐事件,把显隐会影响的控件触发一遍计算
277
+ value: /**
278
+ * @description 监听控件的显隐事件,把显隐会影响的控件触发一遍计算
279
279
  * */ function watchSchemaHideChange() {
280
280
  var _this = this;
281
281
  this.engine.on('schema-change', function(payload) {
@@ -291,8 +291,8 @@ export var CalcPlugin = /*#__PURE__*/ function() {
291
291
  },
292
292
  {
293
293
  key: "watchSubtableChange",
294
- value: /**
295
- * @description 监听明细子表的change事件,把明细表会影响的控件触发一遍计算
294
+ value: /**
295
+ * @description 监听明细子表的change事件,把明细表会影响的控件触发一遍计算
296
296
  * */ function watchSubtableChange() {
297
297
  var _this = this;
298
298
  this.engine.on('list-change', function(payload) {
@@ -319,8 +319,8 @@ export var CalcPlugin = /*#__PURE__*/ function() {
319
319
  },
320
320
  {
321
321
  key: "watchControlChange",
322
- value: /**
323
- * @description 监听控件的change事件,当控件change的时候,取到控件会影响的计算公式,然后执行对应的计算
322
+ value: /**
323
+ * @description 监听控件的change事件,当控件change的时候,取到控件会影响的计算公式,然后执行对应的计算
324
324
  * */ function watchControlChange() {
325
325
  var _this = this;
326
326
  this.engine.on('change', function(payload) {
@@ -355,8 +355,8 @@ export var CalcPlugin = /*#__PURE__*/ function() {
355
355
  },
356
356
  {
357
357
  key: "controlInSubtable",
358
- value: /**
359
- * @description 控件在明细子表内
358
+ value: /**
359
+ * @description 控件在明细子表内
360
360
  * */ function controlInSubtable(control) {
361
361
  var _control_parent;
362
362
  return ((_control_parent = control.parent) === null || _control_parent === void 0 ? void 0 : _control_parent.type) === CONTROL_TYPE.SUBTABLE_COLUMN;
@@ -364,8 +364,8 @@ export var CalcPlugin = /*#__PURE__*/ function() {
364
364
  },
365
365
  {
366
366
  key: "computedCalcValue",
367
- value: /**
368
- * @description 执行计算公式的计算
367
+ value: /**
368
+ * @description 执行计算公式的计算
369
369
  * */ // @ts-ignore
370
370
  function computedCalcValue(control) {
371
371
  var _this = this;
@@ -455,8 +455,8 @@ export var CalcPlugin = /*#__PURE__*/ function() {
455
455
  },
456
456
  {
457
457
  key: "getNumberValue",
458
- value: /**
459
- * @description 获取数字值,因为计算公式可以依赖计算公式和金额,所以需要从value中取到对应的值
458
+ value: /**
459
+ * @description 获取数字值,因为计算公式可以依赖计算公式和金额,所以需要从value中取到对应的值
460
460
  * */ function getNumberValue(value) {
461
461
  if ((typeof value === "undefined" ? "undefined" : _type_of(value)) === 'object' && value) {
462
462
  if ('result' in value) {
@@ -473,8 +473,8 @@ export var CalcPlugin = /*#__PURE__*/ function() {
473
473
  },
474
474
  {
475
475
  key: "getAggregateTypeValue",
476
- value: /**
477
- * 计算明细子表最大值最小值平均值总和
476
+ value: /**
477
+ * 计算明细子表最大值最小值平均值总和
478
478
  * */ function getAggregateTypeValue(values, type) {
479
479
  if (!type || !values || !values.length) return 0;
480
480
  switch(type){
@@ -53,12 +53,19 @@ export var StylePlugin = /*#__PURE__*/ function() {
53
53
  var _this_config_source;
54
54
  var compiledStyle = (_this_config_source = (_this_config = this.config) === null || _this_config === void 0 ? void 0 : _this_config.source) !== null && _this_config_source !== void 0 ? _this_config_source : '';
55
55
  var style = document.createElement('style');
56
- style.className = 'edit-css-' + engine.id;
56
+ style.className = 'edit-css';
57
+ style.type = 'text/css';
58
+ style.innerHTML = compiledStyle;
57
59
  var dom = document.querySelector('head');
58
- dom === null || dom === void 0 ? void 0 : dom.appendChild(style);
59
- var cssStyleText;
60
- cssStyleText = ".render-engine-".concat(engine.id, "{ ").concat(compiledStyle, " }");
61
- style.appendChild(document.createTextNode(cssStyleText));
60
+ dom.appendChild(style);
61
+ // const compiledStyle = this.config?.source ?? ''
62
+ // let style: HTMLStyleElement = document.createElement('style')
63
+ // style.className = 'edit-css-' + engine.id
64
+ // let dom = document.querySelector('head')
65
+ // dom?.appendChild(style)
66
+ // let cssStyleText
67
+ // cssStyleText = `.render-engine-${engine.id}{ ${compiledStyle} }`
68
+ // style.appendChild(document.createTextNode(cssStyleText))
62
69
  }
63
70
  }
64
71
  ]);