@ibiz-template/runtime 0.2.7 → 0.2.8
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/index.esm.js +294 -23
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/out/controller/common/control/md-control.controller.d.ts.map +1 -1
- package/out/controller/common/control/md-control.controller.js +5 -1
- package/out/controller/control/form/edit-form/edit-form.controller.d.ts.map +1 -1
- package/out/controller/control/form/edit-form/edit-form.controller.js +6 -0
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +0 -4
- package/out/controller/control/index.d.ts +1 -0
- package/out/controller/control/index.d.ts.map +1 -1
- package/out/controller/control/index.js +1 -0
- package/out/controller/control/map/index.d.ts +3 -0
- package/out/controller/control/map/index.d.ts.map +1 -0
- package/out/controller/control/map/index.js +2 -0
- package/out/controller/control/map/map.controller.d.ts +39 -0
- package/out/controller/control/map/map.controller.d.ts.map +1 -0
- package/out/controller/control/map/map.controller.js +101 -0
- package/out/controller/control/map/map.service.d.ts +25 -0
- package/out/controller/control/map/map.service.d.ts.map +1 -0
- package/out/controller/control/map/map.service.js +55 -0
- package/out/controller/control/panel/panel/panel-item.controller.d.ts +3 -3
- package/out/controller/control/panel/panel/panel-item.controller.d.ts.map +1 -1
- package/out/controller/control/panel/panel/panel-item.controller.js +22 -16
- package/out/interface/controller/controller/control/i-map.controller.d.ts +15 -0
- package/out/interface/controller/controller/control/i-map.controller.d.ts.map +1 -0
- package/out/interface/controller/controller/control/i-map.controller.js +1 -0
- package/out/interface/controller/controller/control/index.d.ts +1 -0
- package/out/interface/controller/controller/control/index.d.ts.map +1 -1
- package/out/interface/controller/controller/control/index.js +1 -0
- package/out/interface/controller/event/control/i-map.event.d.ts +54 -0
- package/out/interface/controller/event/control/i-map.event.d.ts.map +1 -0
- package/out/interface/controller/event/control/i-map.event.js +1 -0
- package/out/interface/controller/event/control/index.d.ts +1 -0
- package/out/interface/controller/event/control/index.d.ts.map +1 -1
- package/out/interface/controller/event/control/index.js +1 -0
- package/out/interface/controller/state/control/i-map.state.d.ts +111 -0
- package/out/interface/controller/state/control/i-map.state.d.ts.map +1 -0
- package/out/interface/controller/state/control/i-map.state.js +1 -0
- package/out/interface/controller/state/control/index.d.ts +1 -0
- package/out/interface/controller/state/control/index.d.ts.map +1 -1
- package/out/interface/controller/state/control/index.js +1 -0
- package/out/service/mqtt/mqtt.service.d.ts +2 -0
- package/out/service/mqtt/mqtt.service.d.ts.map +1 -1
- package/out/service/mqtt/mqtt.service.js +3 -0
- package/out/service/vo/index.d.ts +1 -0
- package/out/service/vo/index.d.ts.map +1 -1
- package/out/service/vo/index.js +1 -0
- package/out/service/vo/map-data/index.d.ts +2 -0
- package/out/service/vo/map-data/index.d.ts.map +1 -0
- package/out/service/vo/map-data/index.js +1 -0
- package/out/service/vo/map-data/map-data.d.ts +17 -0
- package/out/service/vo/map-data/map-data.d.ts.map +1 -0
- package/out/service/vo/map-data/map-data.js +87 -0
- package/out/utils/script/script-function.d.ts.map +1 -1
- package/out/utils/script/script-function.js +7 -1
- package/package.json +4 -4
- package/src/controller/common/control/md-control.controller.ts +7 -1
- package/src/controller/control/form/edit-form/edit-form.controller.ts +6 -0
- package/src/controller/control/grid/grid/grid.controller.ts +0 -4
- package/src/controller/control/index.ts +1 -0
- package/src/controller/control/map/index.ts +2 -0
- package/src/controller/control/map/map.controller.ts +126 -0
- package/src/controller/control/map/map.service.ts +79 -0
- package/src/controller/control/panel/panel/panel-item.controller.ts +27 -17
- package/src/interface/controller/controller/control/i-map.controller.ts +15 -0
- package/src/interface/controller/controller/control/index.ts +1 -0
- package/src/interface/controller/event/control/i-map.event.ts +48 -0
- package/src/interface/controller/event/control/index.ts +1 -0
- package/src/interface/controller/state/control/i-map.state.ts +124 -0
- package/src/interface/controller/state/control/index.ts +1 -0
- package/src/service/mqtt/mqtt.service.ts +3 -2
- package/src/service/vo/index.ts +1 -0
- package/src/service/vo/map-data/index.ts +1 -0
- package/src/service/vo/map-data/map-data.ts +123 -0
- package/src/utils/script/script-function.ts +6 -1
|
@@ -172,10 +172,10 @@ export class PanelItemController<T extends IPanelItem = IPanelItem>
|
|
|
172
172
|
* @param {IData} data
|
|
173
173
|
*/
|
|
174
174
|
calcItemDisabled(data: IData): void {
|
|
175
|
-
let
|
|
175
|
+
let { disabled } = this.dynaLogicResult;
|
|
176
176
|
|
|
177
177
|
// 上层计算为启用时计算预定义项启用逻辑
|
|
178
|
-
if (
|
|
178
|
+
if (disabled !== true && this.panel.scheduler) {
|
|
179
179
|
const itemEnable = this.panel.scheduler.triggerItemEnable(
|
|
180
180
|
this.model.id!,
|
|
181
181
|
{
|
|
@@ -183,12 +183,14 @@ export class PanelItemController<T extends IPanelItem = IPanelItem>
|
|
|
183
183
|
},
|
|
184
184
|
);
|
|
185
185
|
if (itemEnable !== undefined) {
|
|
186
|
-
|
|
186
|
+
disabled = !itemEnable;
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
//
|
|
191
|
-
|
|
190
|
+
// 有值的时候才会去修改state
|
|
191
|
+
if (disabled !== undefined) {
|
|
192
|
+
this.state.disabled = disabled;
|
|
193
|
+
}
|
|
192
194
|
}
|
|
193
195
|
|
|
194
196
|
/**
|
|
@@ -201,7 +203,7 @@ export class PanelItemController<T extends IPanelItem = IPanelItem>
|
|
|
201
203
|
let { visible } = this.dynaLogicResult;
|
|
202
204
|
|
|
203
205
|
// 上层计算为显示时计算预定义项显示逻辑
|
|
204
|
-
if (visible && this.panel.scheduler) {
|
|
206
|
+
if (visible !== false && this.panel.scheduler) {
|
|
205
207
|
const itemVIsible = this.panel.scheduler.triggerItemVisible(
|
|
206
208
|
this.model.id!,
|
|
207
209
|
{
|
|
@@ -213,8 +215,10 @@ export class PanelItemController<T extends IPanelItem = IPanelItem>
|
|
|
213
215
|
}
|
|
214
216
|
}
|
|
215
217
|
|
|
216
|
-
//
|
|
217
|
-
|
|
218
|
+
// 有值的时候才会去修改state
|
|
219
|
+
if (visible !== undefined) {
|
|
220
|
+
this.state.visible = visible;
|
|
221
|
+
}
|
|
218
222
|
}
|
|
219
223
|
|
|
220
224
|
/**
|
|
@@ -224,10 +228,10 @@ export class PanelItemController<T extends IPanelItem = IPanelItem>
|
|
|
224
228
|
* @param {IData} data
|
|
225
229
|
*/
|
|
226
230
|
calcItemRequired(data: IData): void {
|
|
227
|
-
let
|
|
231
|
+
let { required } = this.dynaLogicResult;
|
|
228
232
|
|
|
229
233
|
// 上层计算为启用时计算预定义项启用逻辑
|
|
230
|
-
if (
|
|
234
|
+
if (required !== true && this.panel.scheduler) {
|
|
231
235
|
const itemAllowEmpty = this.panel.scheduler.triggerItemBlank(
|
|
232
236
|
this.model.id!,
|
|
233
237
|
{
|
|
@@ -235,12 +239,14 @@ export class PanelItemController<T extends IPanelItem = IPanelItem>
|
|
|
235
239
|
},
|
|
236
240
|
);
|
|
237
241
|
if (itemAllowEmpty !== undefined) {
|
|
238
|
-
|
|
242
|
+
required = !itemAllowEmpty;
|
|
239
243
|
}
|
|
240
244
|
}
|
|
241
245
|
|
|
242
|
-
//
|
|
243
|
-
|
|
246
|
+
// 有值的时候才会去修改state
|
|
247
|
+
if (required !== undefined) {
|
|
248
|
+
this.state.required = required;
|
|
249
|
+
}
|
|
244
250
|
}
|
|
245
251
|
|
|
246
252
|
/**
|
|
@@ -249,10 +255,14 @@ export class PanelItemController<T extends IPanelItem = IPanelItem>
|
|
|
249
255
|
* @date 2023-09-21 03:36:37
|
|
250
256
|
* @protected
|
|
251
257
|
*/
|
|
252
|
-
protected dynaLogicResult
|
|
253
|
-
visible
|
|
254
|
-
disabled
|
|
255
|
-
required
|
|
258
|
+
protected dynaLogicResult: {
|
|
259
|
+
visible?: boolean;
|
|
260
|
+
disabled?: boolean;
|
|
261
|
+
required?: boolean;
|
|
262
|
+
} = {
|
|
263
|
+
visible: undefined,
|
|
264
|
+
disabled: undefined,
|
|
265
|
+
required: undefined,
|
|
256
266
|
};
|
|
257
267
|
|
|
258
268
|
/**
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ISysMap } from '@ibiz/model-core';
|
|
2
|
+
import { IMapEvent } from '../../event';
|
|
3
|
+
import { IMapState } from '../../state';
|
|
4
|
+
import { IMDControlController } from './i-md-control.controller';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 地图控制器
|
|
8
|
+
* @author lxm
|
|
9
|
+
* @date 2023-05-04 01:47:16
|
|
10
|
+
* @export
|
|
11
|
+
* @interface IChartController
|
|
12
|
+
* @extends {IMDControlController}
|
|
13
|
+
*/
|
|
14
|
+
export interface IMapController
|
|
15
|
+
extends IMDControlController<ISysMap, IMapState, IMapEvent> {}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { EventBase } from '../argument';
|
|
2
|
+
import { IMDControlEvent } from './i-md-control.event';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 地图部件事件
|
|
6
|
+
*
|
|
7
|
+
* @author lxm
|
|
8
|
+
* @date 2022-08-30 16:08:43
|
|
9
|
+
* @export
|
|
10
|
+
* @interface IMDControlEvent
|
|
11
|
+
*/
|
|
12
|
+
export interface IMapEvent extends IMDControlEvent {
|
|
13
|
+
/**
|
|
14
|
+
* 地图变更事件(下探,返回)
|
|
15
|
+
* @author lxm
|
|
16
|
+
* @date 2023-03-26 06:15:06
|
|
17
|
+
* @param {emitArgs} undefined
|
|
18
|
+
* @return {*} {Promise<void>}
|
|
19
|
+
*/
|
|
20
|
+
onMapChange: {
|
|
21
|
+
event: EventBase & { areaCode: string | number };
|
|
22
|
+
emitArgs: { areaCode: string | number };
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 地图区域点击事件
|
|
27
|
+
* @author lxm
|
|
28
|
+
* @date 2023-03-26 06:15:06
|
|
29
|
+
* @param {emitArgs} undefined
|
|
30
|
+
* @return {*} {Promise<void>}
|
|
31
|
+
*/
|
|
32
|
+
onAreaClick: {
|
|
33
|
+
event: EventBase;
|
|
34
|
+
emitArgs: { data: IData[] };
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 地图散点点击事件
|
|
39
|
+
* @author lxm
|
|
40
|
+
* @date 2023-03-26 06:15:06
|
|
41
|
+
* @param {emitArgs} undefined
|
|
42
|
+
* @return {*} {Promise<void>}
|
|
43
|
+
*/
|
|
44
|
+
onPointClick: {
|
|
45
|
+
event: EventBase;
|
|
46
|
+
emitArgs: { data: IData[] };
|
|
47
|
+
};
|
|
48
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { IMDControlState } from './i-md-control.state';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 地图部件状态
|
|
5
|
+
* @author lxm
|
|
6
|
+
* @date 2023-05-22 02:18:43
|
|
7
|
+
* @export
|
|
8
|
+
* @interface IMapState
|
|
9
|
+
* @extends {IMDControlState}
|
|
10
|
+
*/
|
|
11
|
+
export interface IMapState extends IMDControlState {
|
|
12
|
+
items: IMapData[];
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 点的数据
|
|
16
|
+
* @author lxm
|
|
17
|
+
* @date 2023-10-31 09:48:54
|
|
18
|
+
* @type {IMapData[]}
|
|
19
|
+
*/
|
|
20
|
+
pointData: IMapData[];
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 区域的数据
|
|
24
|
+
* @author lxm
|
|
25
|
+
* @date 2023-10-31 09:49:02
|
|
26
|
+
* @type {IMapData[]}
|
|
27
|
+
*/
|
|
28
|
+
areaData: IMapData[];
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 当前区域代码
|
|
32
|
+
* @author lxm
|
|
33
|
+
* @date 2023-10-31 09:03:23
|
|
34
|
+
* @type {string}
|
|
35
|
+
*/
|
|
36
|
+
areaCode: string | number;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* 地图数据格式
|
|
41
|
+
*
|
|
42
|
+
* @export
|
|
43
|
+
* @class ITreeNodeData
|
|
44
|
+
*/
|
|
45
|
+
export interface IMapData {
|
|
46
|
+
/**
|
|
47
|
+
* 唯一标识
|
|
48
|
+
* @author lxm
|
|
49
|
+
* @date 2023-10-30 06:20:08
|
|
50
|
+
* @type {string}
|
|
51
|
+
*/
|
|
52
|
+
_id: string;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* 类型
|
|
56
|
+
* @author lxm
|
|
57
|
+
* @date 2023-10-30 06:20:14
|
|
58
|
+
* @type {('point' | 'area')}
|
|
59
|
+
*/
|
|
60
|
+
_type: 'point' | 'area';
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* 地图项id
|
|
64
|
+
* @author lxm
|
|
65
|
+
* @date 2023-10-30 06:20:40
|
|
66
|
+
* @type {string}
|
|
67
|
+
*/
|
|
68
|
+
_mapItemId: string;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* 经度
|
|
72
|
+
* @author lxm
|
|
73
|
+
* @date 2023-10-30 09:25:34
|
|
74
|
+
* @type {string}
|
|
75
|
+
*/
|
|
76
|
+
_longitude?: string;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* 纬度
|
|
80
|
+
* @author lxm
|
|
81
|
+
* @date 2023-10-30 09:25:34
|
|
82
|
+
* @type {string}
|
|
83
|
+
*/
|
|
84
|
+
_latitude?: string;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* 区域标识
|
|
88
|
+
* @author lxm
|
|
89
|
+
* @date 2023-10-30 09:26:18
|
|
90
|
+
*/
|
|
91
|
+
_areaCode?: string;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* 提示信息
|
|
95
|
+
* @author lxm
|
|
96
|
+
* @date 2023-10-30 09:34:47
|
|
97
|
+
* @type {string}
|
|
98
|
+
*/
|
|
99
|
+
_tooltip?: string;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* 统计数据值
|
|
103
|
+
* @author lxm
|
|
104
|
+
* @date 2023-10-31 10:47:50
|
|
105
|
+
* @type {number}
|
|
106
|
+
*/
|
|
107
|
+
_value?: number;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* 文本值
|
|
111
|
+
* @author lxm
|
|
112
|
+
* @date 2023-10-31 10:47:50
|
|
113
|
+
* @type {number}
|
|
114
|
+
*/
|
|
115
|
+
_text?: string;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* 图标
|
|
119
|
+
* @author lxm
|
|
120
|
+
* @date 2023-10-31 10:47:50
|
|
121
|
+
* @type {number}
|
|
122
|
+
*/
|
|
123
|
+
_symbol?: string;
|
|
124
|
+
}
|
|
@@ -59,8 +59,8 @@ export class MqttService {
|
|
|
59
59
|
* @param {string} appId
|
|
60
60
|
*/
|
|
61
61
|
constructor(
|
|
62
|
-
mqttTopic: string,
|
|
63
|
-
token: string,
|
|
62
|
+
protected mqttTopic: string,
|
|
63
|
+
protected token: string,
|
|
64
64
|
protected appId: string,
|
|
65
65
|
) {
|
|
66
66
|
if (isNilOrEmpty(mqttTopic) || isNilOrEmpty(token)) {
|
|
@@ -88,6 +88,7 @@ export class MqttService {
|
|
|
88
88
|
this.options,
|
|
89
89
|
) as MqttClient;
|
|
90
90
|
this.client.on('connect', () => {
|
|
91
|
+
this.client!.subscribe(this.mqttTopic);
|
|
91
92
|
ibiz.log.debug('mqtt connect');
|
|
92
93
|
});
|
|
93
94
|
this.client.on('error', error => {
|
package/src/service/vo/index.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MapData } from './map-data';
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/* eslint-disable no-constructor-return */
|
|
2
|
+
import { ISysMapItem } from '@ibiz/model-core';
|
|
3
|
+
import { IMapData } from '../../../interface';
|
|
4
|
+
|
|
5
|
+
// 更新属性,缺的补充定义
|
|
6
|
+
function updateKeyDefine(target: IParams, keys: string[]): void {
|
|
7
|
+
keys.forEach(key => {
|
|
8
|
+
if (!Object.prototype.hasOwnProperty.call(target, key)) {
|
|
9
|
+
Object.defineProperty(target, key, {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
configurable: true,
|
|
12
|
+
writable: true,
|
|
13
|
+
value: undefined,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export class MapData implements IMapData {
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
|
+
[key: string | symbol]: any;
|
|
22
|
+
|
|
23
|
+
_id: string;
|
|
24
|
+
|
|
25
|
+
_type: 'point' | 'area';
|
|
26
|
+
|
|
27
|
+
_mapItemId: string;
|
|
28
|
+
|
|
29
|
+
_longitude?: string = undefined;
|
|
30
|
+
|
|
31
|
+
_latitude?: string = undefined;
|
|
32
|
+
|
|
33
|
+
_areaCode?: string = undefined;
|
|
34
|
+
|
|
35
|
+
_tooltip?: string = undefined;
|
|
36
|
+
|
|
37
|
+
_value?: number = undefined;
|
|
38
|
+
|
|
39
|
+
_text?: string = undefined;
|
|
40
|
+
|
|
41
|
+
_symbol?: string = undefined;
|
|
42
|
+
|
|
43
|
+
constructor(deData: IData, mapItem: ISysMapItem) {
|
|
44
|
+
const {
|
|
45
|
+
id,
|
|
46
|
+
itemType,
|
|
47
|
+
longitudeAppDEFieldId,
|
|
48
|
+
latitudeAppDEFieldId,
|
|
49
|
+
textAppDEFieldId,
|
|
50
|
+
dataAppDEFieldId,
|
|
51
|
+
tipsAppDEFieldId,
|
|
52
|
+
sysImage,
|
|
53
|
+
} = mapItem;
|
|
54
|
+
|
|
55
|
+
const keyMap = new Map<string | symbol, string | symbol>();
|
|
56
|
+
|
|
57
|
+
this._id = id + deData.srfkey;
|
|
58
|
+
|
|
59
|
+
this._type = itemType! as 'point';
|
|
60
|
+
|
|
61
|
+
this._mapItemId = id!;
|
|
62
|
+
|
|
63
|
+
if (itemType === 'area') {
|
|
64
|
+
if (longitudeAppDEFieldId) {
|
|
65
|
+
keyMap.set('_areaCode', longitudeAppDEFieldId);
|
|
66
|
+
}
|
|
67
|
+
} else {
|
|
68
|
+
if (longitudeAppDEFieldId) {
|
|
69
|
+
keyMap.set('_longitude', longitudeAppDEFieldId);
|
|
70
|
+
}
|
|
71
|
+
if (latitudeAppDEFieldId) {
|
|
72
|
+
keyMap.set('_latitude', latitudeAppDEFieldId);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (tipsAppDEFieldId) {
|
|
76
|
+
keyMap.set('_tooltip', tipsAppDEFieldId);
|
|
77
|
+
}
|
|
78
|
+
if (textAppDEFieldId) {
|
|
79
|
+
keyMap.set('_text', textAppDEFieldId);
|
|
80
|
+
}
|
|
81
|
+
if (dataAppDEFieldId) {
|
|
82
|
+
keyMap.set('_value', dataAppDEFieldId);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (sysImage) {
|
|
86
|
+
this._symbol = sysImage.rawContent || sysImage.imagePath;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return new Proxy<MapData>(this, {
|
|
90
|
+
set(target, p, value): boolean {
|
|
91
|
+
if (Object.prototype.hasOwnProperty.call(deData, p)) {
|
|
92
|
+
deData[p] = value;
|
|
93
|
+
} else if (keyMap.has(p)) {
|
|
94
|
+
deData[keyMap.get(p)!] = value;
|
|
95
|
+
} else {
|
|
96
|
+
target[p] = value;
|
|
97
|
+
}
|
|
98
|
+
return true;
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
get(target, p, _receiver): unknown {
|
|
102
|
+
if (target[p] !== undefined) {
|
|
103
|
+
return target[p];
|
|
104
|
+
}
|
|
105
|
+
if (keyMap.has(p)) {
|
|
106
|
+
return deData[keyMap.get(p)!];
|
|
107
|
+
}
|
|
108
|
+
if (deData[p] !== undefined) {
|
|
109
|
+
return deData[p];
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
ownKeys(target): ArrayLike<string | symbol> {
|
|
114
|
+
// 整合所有并排除重复
|
|
115
|
+
const allKeys = [
|
|
116
|
+
...new Set([...Object.keys(target), ...Object.keys(deData)]),
|
|
117
|
+
];
|
|
118
|
+
updateKeyDefine(target, allKeys);
|
|
119
|
+
return allKeys;
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -28,7 +28,12 @@ export class ScriptFunction {
|
|
|
28
28
|
this.calcArgKeys(argKeys, options);
|
|
29
29
|
const fn = new Function(...this.argKeys, code);
|
|
30
30
|
this.scriptFn = function callBack(...args: unknown[]): unknown {
|
|
31
|
-
|
|
31
|
+
try {
|
|
32
|
+
return fn.apply({}, args);
|
|
33
|
+
} catch (error) {
|
|
34
|
+
console.log('报错脚本', code);
|
|
35
|
+
throw error;
|
|
36
|
+
}
|
|
32
37
|
};
|
|
33
38
|
}
|
|
34
39
|
|