@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
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { IMDControlState } from './i-md-control.state';
|
|
2
|
+
/**
|
|
3
|
+
* 地图部件状态
|
|
4
|
+
* @author lxm
|
|
5
|
+
* @date 2023-05-22 02:18:43
|
|
6
|
+
* @export
|
|
7
|
+
* @interface IMapState
|
|
8
|
+
* @extends {IMDControlState}
|
|
9
|
+
*/
|
|
10
|
+
export interface IMapState extends IMDControlState {
|
|
11
|
+
items: IMapData[];
|
|
12
|
+
/**
|
|
13
|
+
* 点的数据
|
|
14
|
+
* @author lxm
|
|
15
|
+
* @date 2023-10-31 09:48:54
|
|
16
|
+
* @type {IMapData[]}
|
|
17
|
+
*/
|
|
18
|
+
pointData: IMapData[];
|
|
19
|
+
/**
|
|
20
|
+
* 区域的数据
|
|
21
|
+
* @author lxm
|
|
22
|
+
* @date 2023-10-31 09:49:02
|
|
23
|
+
* @type {IMapData[]}
|
|
24
|
+
*/
|
|
25
|
+
areaData: IMapData[];
|
|
26
|
+
/**
|
|
27
|
+
* 当前区域代码
|
|
28
|
+
* @author lxm
|
|
29
|
+
* @date 2023-10-31 09:03:23
|
|
30
|
+
* @type {string}
|
|
31
|
+
*/
|
|
32
|
+
areaCode: string | number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 地图数据格式
|
|
36
|
+
*
|
|
37
|
+
* @export
|
|
38
|
+
* @class ITreeNodeData
|
|
39
|
+
*/
|
|
40
|
+
export interface IMapData {
|
|
41
|
+
/**
|
|
42
|
+
* 唯一标识
|
|
43
|
+
* @author lxm
|
|
44
|
+
* @date 2023-10-30 06:20:08
|
|
45
|
+
* @type {string}
|
|
46
|
+
*/
|
|
47
|
+
_id: string;
|
|
48
|
+
/**
|
|
49
|
+
* 类型
|
|
50
|
+
* @author lxm
|
|
51
|
+
* @date 2023-10-30 06:20:14
|
|
52
|
+
* @type {('point' | 'area')}
|
|
53
|
+
*/
|
|
54
|
+
_type: 'point' | 'area';
|
|
55
|
+
/**
|
|
56
|
+
* 地图项id
|
|
57
|
+
* @author lxm
|
|
58
|
+
* @date 2023-10-30 06:20:40
|
|
59
|
+
* @type {string}
|
|
60
|
+
*/
|
|
61
|
+
_mapItemId: string;
|
|
62
|
+
/**
|
|
63
|
+
* 经度
|
|
64
|
+
* @author lxm
|
|
65
|
+
* @date 2023-10-30 09:25:34
|
|
66
|
+
* @type {string}
|
|
67
|
+
*/
|
|
68
|
+
_longitude?: string;
|
|
69
|
+
/**
|
|
70
|
+
* 纬度
|
|
71
|
+
* @author lxm
|
|
72
|
+
* @date 2023-10-30 09:25:34
|
|
73
|
+
* @type {string}
|
|
74
|
+
*/
|
|
75
|
+
_latitude?: string;
|
|
76
|
+
/**
|
|
77
|
+
* 区域标识
|
|
78
|
+
* @author lxm
|
|
79
|
+
* @date 2023-10-30 09:26:18
|
|
80
|
+
*/
|
|
81
|
+
_areaCode?: string;
|
|
82
|
+
/**
|
|
83
|
+
* 提示信息
|
|
84
|
+
* @author lxm
|
|
85
|
+
* @date 2023-10-30 09:34:47
|
|
86
|
+
* @type {string}
|
|
87
|
+
*/
|
|
88
|
+
_tooltip?: string;
|
|
89
|
+
/**
|
|
90
|
+
* 统计数据值
|
|
91
|
+
* @author lxm
|
|
92
|
+
* @date 2023-10-31 10:47:50
|
|
93
|
+
* @type {number}
|
|
94
|
+
*/
|
|
95
|
+
_value?: number;
|
|
96
|
+
/**
|
|
97
|
+
* 文本值
|
|
98
|
+
* @author lxm
|
|
99
|
+
* @date 2023-10-31 10:47:50
|
|
100
|
+
* @type {number}
|
|
101
|
+
*/
|
|
102
|
+
_text?: string;
|
|
103
|
+
/**
|
|
104
|
+
* 图标
|
|
105
|
+
* @author lxm
|
|
106
|
+
* @date 2023-10-31 10:47:50
|
|
107
|
+
* @type {number}
|
|
108
|
+
*/
|
|
109
|
+
_symbol?: string;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=i-map.state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i-map.state.d.ts","sourceRoot":"","sources":["../../../../../src/interface/controller/state/control/i-map.state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,WAAW,SAAU,SAAQ,eAAe;IAChD,KAAK,EAAE,QAAQ,EAAE,CAAC;IAElB;;;;;OAKG;IACH,SAAS,EAAE,QAAQ,EAAE,CAAC;IAEtB;;;;;OAKG;IACH,QAAQ,EAAE,QAAQ,EAAE,CAAC;IAErB;;;;;OAKG;IACH,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3B;AAED;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB;;;;;OAKG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;;;;OAKG;IACH,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;IAExB;;;;;OAKG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/interface/controller/state/control/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,YAAY,EACV,eAAe,EACf,kBAAkB,GACnB,MAAM,uBAAuB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/interface/controller/state/control/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,YAAY,EACV,eAAe,EACf,kBAAkB,GACnB,MAAM,uBAAuB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mqtt.service.d.ts","sourceRoot":"","sources":["../../../src/service/mqtt/mqtt.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAClD,OAAO,EAAE,OAAO,EAA4B,MAAM,SAAS,CAAC;AAE5D;;;;;;;GAOG;AACH,qBAAa,WAAW;
|
|
1
|
+
{"version":3,"file":"mqtt.service.d.ts","sourceRoot":"","sources":["../../../src/service/mqtt/mqtt.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAClD,OAAO,EAAE,OAAO,EAA4B,MAAM,SAAS,CAAC;AAE5D;;;;;;;GAOG;AACH,qBAAa,WAAW;IAiDpB,SAAS,CAAC,SAAS,EAAE,MAAM;IAC3B,SAAS,CAAC,KAAK,EAAE,MAAM;IACvB,SAAS,CAAC,KAAK,EAAE,MAAM;IAlDzB;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;QAAE,OAAO,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,IAAI,CAAA;KAAE,CAAC,CACjD;IAEhB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IAEpB;;;;;;;OAOG;IACH,SAAS,CAAC,OAAO,EAAE,cAAc,CAU/B;IAEF;;;;;;;;OAQG;gBAES,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM;IASzB;;;;;;OAMG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IA6B9B;;;;;OAKG;IACH,KAAK,IAAI,IAAI;CAGd"}
|
|
@@ -18,6 +18,8 @@ export class MqttService {
|
|
|
18
18
|
* @param {string} appId
|
|
19
19
|
*/
|
|
20
20
|
constructor(mqttTopic, token, appId) {
|
|
21
|
+
this.mqttTopic = mqttTopic;
|
|
22
|
+
this.token = token;
|
|
21
23
|
this.appId = appId;
|
|
22
24
|
/**
|
|
23
25
|
* 接受消息通知
|
|
@@ -66,6 +68,7 @@ export class MqttService {
|
|
|
66
68
|
const { location } = window;
|
|
67
69
|
this.client = mqtt.connect(`ws://${location.host}${ibiz.env.baseUrl}/${this.appId}${ibiz.env.mqttUrl}`, this.options);
|
|
68
70
|
this.client.on('connect', () => {
|
|
71
|
+
this.client.subscribe(this.mqttTopic);
|
|
69
72
|
ibiz.log.debug('mqtt connect');
|
|
70
73
|
});
|
|
71
74
|
this.client.on('error', error => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/service/vo/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/service/vo/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC"}
|
package/out/service/vo/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/service/vo/map-data/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MapData } from './map-data';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ISysMapItem } from '@ibiz/model-core';
|
|
2
|
+
import { IMapData } from '../../../interface';
|
|
3
|
+
export declare class MapData implements IMapData {
|
|
4
|
+
[key: string | symbol]: any;
|
|
5
|
+
_id: string;
|
|
6
|
+
_type: 'point' | 'area';
|
|
7
|
+
_mapItemId: string;
|
|
8
|
+
_longitude?: string;
|
|
9
|
+
_latitude?: string;
|
|
10
|
+
_areaCode?: string;
|
|
11
|
+
_tooltip?: string;
|
|
12
|
+
_value?: number;
|
|
13
|
+
_text?: string;
|
|
14
|
+
_symbol?: string;
|
|
15
|
+
constructor(deData: IData, mapItem: ISysMapItem);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=map-data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-data.d.ts","sourceRoot":"","sources":["../../../../src/service/vo/map-data/map-data.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAgB9C,qBAAa,OAAQ,YAAW,QAAQ;IAEtC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;IAE5B,GAAG,EAAE,MAAM,CAAC;IAEZ,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;IAExB,UAAU,EAAE,MAAM,CAAC;IAEnB,UAAU,CAAC,EAAE,MAAM,CAAa;IAEhC,SAAS,CAAC,EAAE,MAAM,CAAa;IAE/B,SAAS,CAAC,EAAE,MAAM,CAAa;IAE/B,QAAQ,CAAC,EAAE,MAAM,CAAa;IAE9B,MAAM,CAAC,EAAE,MAAM,CAAa;IAE5B,KAAK,CAAC,EAAE,MAAM,CAAa;IAE3B,OAAO,CAAC,EAAE,MAAM,CAAa;gBAEjB,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW;CAgFhD"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// 更新属性,缺的补充定义
|
|
2
|
+
function updateKeyDefine(target, keys) {
|
|
3
|
+
keys.forEach(key => {
|
|
4
|
+
if (!Object.prototype.hasOwnProperty.call(target, key)) {
|
|
5
|
+
Object.defineProperty(target, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
configurable: true,
|
|
8
|
+
writable: true,
|
|
9
|
+
value: undefined,
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export class MapData {
|
|
15
|
+
constructor(deData, mapItem) {
|
|
16
|
+
this._longitude = undefined;
|
|
17
|
+
this._latitude = undefined;
|
|
18
|
+
this._areaCode = undefined;
|
|
19
|
+
this._tooltip = undefined;
|
|
20
|
+
this._value = undefined;
|
|
21
|
+
this._text = undefined;
|
|
22
|
+
this._symbol = undefined;
|
|
23
|
+
const { id, itemType, longitudeAppDEFieldId, latitudeAppDEFieldId, textAppDEFieldId, dataAppDEFieldId, tipsAppDEFieldId, sysImage, } = mapItem;
|
|
24
|
+
const keyMap = new Map();
|
|
25
|
+
this._id = id + deData.srfkey;
|
|
26
|
+
this._type = itemType;
|
|
27
|
+
this._mapItemId = id;
|
|
28
|
+
if (itemType === 'area') {
|
|
29
|
+
if (longitudeAppDEFieldId) {
|
|
30
|
+
keyMap.set('_areaCode', longitudeAppDEFieldId);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
if (longitudeAppDEFieldId) {
|
|
35
|
+
keyMap.set('_longitude', longitudeAppDEFieldId);
|
|
36
|
+
}
|
|
37
|
+
if (latitudeAppDEFieldId) {
|
|
38
|
+
keyMap.set('_latitude', latitudeAppDEFieldId);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (tipsAppDEFieldId) {
|
|
42
|
+
keyMap.set('_tooltip', tipsAppDEFieldId);
|
|
43
|
+
}
|
|
44
|
+
if (textAppDEFieldId) {
|
|
45
|
+
keyMap.set('_text', textAppDEFieldId);
|
|
46
|
+
}
|
|
47
|
+
if (dataAppDEFieldId) {
|
|
48
|
+
keyMap.set('_value', dataAppDEFieldId);
|
|
49
|
+
}
|
|
50
|
+
if (sysImage) {
|
|
51
|
+
this._symbol = sysImage.rawContent || sysImage.imagePath;
|
|
52
|
+
}
|
|
53
|
+
return new Proxy(this, {
|
|
54
|
+
set(target, p, value) {
|
|
55
|
+
if (Object.prototype.hasOwnProperty.call(deData, p)) {
|
|
56
|
+
deData[p] = value;
|
|
57
|
+
}
|
|
58
|
+
else if (keyMap.has(p)) {
|
|
59
|
+
deData[keyMap.get(p)] = value;
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
target[p] = value;
|
|
63
|
+
}
|
|
64
|
+
return true;
|
|
65
|
+
},
|
|
66
|
+
get(target, p, _receiver) {
|
|
67
|
+
if (target[p] !== undefined) {
|
|
68
|
+
return target[p];
|
|
69
|
+
}
|
|
70
|
+
if (keyMap.has(p)) {
|
|
71
|
+
return deData[keyMap.get(p)];
|
|
72
|
+
}
|
|
73
|
+
if (deData[p] !== undefined) {
|
|
74
|
+
return deData[p];
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
ownKeys(target) {
|
|
78
|
+
// 整合所有并排除重复
|
|
79
|
+
const allKeys = [
|
|
80
|
+
...new Set([...Object.keys(target), ...Object.keys(deData)]),
|
|
81
|
+
];
|
|
82
|
+
updateKeyDefine(target, allKeys);
|
|
83
|
+
return allKeys;
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"script-function.d.ts","sourceRoot":"","sources":["../../../src/utils/script/script-function.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAmB,MAAM,iBAAiB,CAAC;AASvE,qBAAa,cAAc;IACzB,SAAS,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAE7B,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,CAAM;IAEjC,SAAS,CAAC,OAAO,EAAE,mBAAmB,CAAC;gBAGrC,OAAO,EAAE,MAAM,EAAE,EACjB,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,mBAAoC;
|
|
1
|
+
{"version":3,"file":"script-function.d.ts","sourceRoot":"","sources":["../../../src/utils/script/script-function.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAmB,MAAM,iBAAiB,CAAC;AASvE,qBAAa,cAAc;IACzB,SAAS,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAE7B,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,CAAM;IAEjC,SAAS,CAAC,OAAO,EAAE,mBAAmB,CAAC;gBAGrC,OAAO,EAAE,MAAM,EAAE,EACjB,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,mBAAoC;IAgB/C;;;;;;;;OAQG;IACH,SAAS,CAAC,UAAU,CAClB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,mBAAmB,GAC3B,MAAM;IAWT;;;;;;;OAOG;IACH,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,mBAAmB,GAAG,IAAI;IA4B5E;;;;;;;OAOG;IACH,SAAS,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,GAAG,GAAG,EAAE;IAuB7C;;;;;;;OAOG;IACH,SAAS,CAAC,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IA4C9D;;;;;;OAMG;IACH,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO;CAI/B"}
|
|
@@ -16,7 +16,13 @@ export class ScriptFunction {
|
|
|
16
16
|
this.calcArgKeys(argKeys, options);
|
|
17
17
|
const fn = new Function(...this.argKeys, code);
|
|
18
18
|
this.scriptFn = function callBack(...args) {
|
|
19
|
-
|
|
19
|
+
try {
|
|
20
|
+
return fn.apply({}, args);
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
console.log('报错脚本', code);
|
|
24
|
+
throw error;
|
|
25
|
+
}
|
|
20
26
|
};
|
|
21
27
|
}
|
|
22
28
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/runtime",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"description": "控制器包",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "out/index.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@ibiz-template/core": "^0.2.6",
|
|
33
|
-
"@ibiz/model-core": "^0.0.
|
|
33
|
+
"@ibiz/model-core": "^0.0.20",
|
|
34
34
|
"@types/path-browserify": "^1.0.0",
|
|
35
35
|
"@types/qs": "^6.9.8",
|
|
36
36
|
"@types/systemjs": "^6.13.3",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@ibiz-template/core": "^0.1.0",
|
|
50
|
-
"@ibiz/model-core": "^0.0.
|
|
50
|
+
"@ibiz/model-core": "^0.0.20",
|
|
51
51
|
"async-validator": "^4.2.5",
|
|
52
52
|
"dayjs": "^1.11.7",
|
|
53
53
|
"echarts": "^5.4.3",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"qx-util": "^0.4.8",
|
|
60
60
|
"ramda": "^0.29.0"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "98917f0e99351acbe3ca6241011ff1da2794e55a"
|
|
63
63
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable max-classes-per-file */
|
|
2
2
|
import { isElementSame, RuntimeError } from '@ibiz-template/core';
|
|
3
3
|
import { IAppDataEntity, IMDControl } from '@ibiz/model-core';
|
|
4
|
+
import { debounce } from 'lodash-es';
|
|
4
5
|
import {
|
|
5
6
|
IMDControlController,
|
|
6
7
|
IMDControlEvent,
|
|
@@ -89,7 +90,12 @@ export class MDControlController<
|
|
|
89
90
|
this.dataEntity.appDEFields?.forEach(field => {
|
|
90
91
|
this.fieldIdNameMap.set(field.id!, field.name!);
|
|
91
92
|
});
|
|
92
|
-
|
|
93
|
+
|
|
94
|
+
const fn = this.onDataChange.bind(this);
|
|
95
|
+
this.onDataChange = debounce(msg => {
|
|
96
|
+
fn(msg);
|
|
97
|
+
}, 300);
|
|
98
|
+
|
|
93
99
|
ibiz.mc.command.change.on(this.onDataChange);
|
|
94
100
|
|
|
95
101
|
// 设置默认排序
|
|
@@ -428,6 +428,9 @@ export class EditFormController
|
|
|
428
428
|
const { context, params } = this.handlerAbilityParams(args);
|
|
429
429
|
try {
|
|
430
430
|
await this.service.wfStart(context, params, this.data);
|
|
431
|
+
if (this.view.modal.mode === 'ROUTE') {
|
|
432
|
+
ibiz.mc.command.send(this.data.$origin, 'OBJECTUPDATED');
|
|
433
|
+
}
|
|
431
434
|
} catch (error) {
|
|
432
435
|
this.actionNotification('WFSTARTERROR', {
|
|
433
436
|
error: error as Error,
|
|
@@ -457,6 +460,9 @@ export class EditFormController
|
|
|
457
460
|
const { context, params } = this.handlerAbilityParams(args);
|
|
458
461
|
try {
|
|
459
462
|
await this.service.wfSubmit(context, params, this.data);
|
|
463
|
+
if (this.view.modal.mode === 'ROUTE') {
|
|
464
|
+
ibiz.mc.command.send(this.data.$origin, 'OBJECTUPDATED');
|
|
465
|
+
}
|
|
460
466
|
} catch (error) {
|
|
461
467
|
this.actionNotification('WFSUBMITERROR', {
|
|
462
468
|
error: error as Error,
|
|
@@ -525,10 +525,6 @@ export class GridController
|
|
|
525
525
|
rowState.data = res.data;
|
|
526
526
|
rowState.modified = false;
|
|
527
527
|
|
|
528
|
-
this.actionNotification(`${isCreate ? 'CREATE' : 'UPDATE'}SUCCESS`, {
|
|
529
|
-
default: `${res.data.srfmajortext || ''}保存成功`,
|
|
530
|
-
data: res.data,
|
|
531
|
-
});
|
|
532
528
|
this.gridStateNotify(rowState, GridNotifyState.SAVE);
|
|
533
529
|
await this.evt.emit('onSaveSuccess', undefined);
|
|
534
530
|
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { ISysMap } from '@ibiz/model-core';
|
|
2
|
+
import { MapService } from './map.service';
|
|
3
|
+
import {
|
|
4
|
+
IMapController,
|
|
5
|
+
IMapData,
|
|
6
|
+
IMapEvent,
|
|
7
|
+
IMapState,
|
|
8
|
+
MDCtrlLoadParams,
|
|
9
|
+
} from '../../../interface';
|
|
10
|
+
import { MDControlController } from '../../common';
|
|
11
|
+
|
|
12
|
+
export class MapController
|
|
13
|
+
extends MDControlController<ISysMap, IMapState, IMapEvent>
|
|
14
|
+
implements IMapController
|
|
15
|
+
{
|
|
16
|
+
declare service: MapService;
|
|
17
|
+
|
|
18
|
+
protected initState(): void {
|
|
19
|
+
super.initState();
|
|
20
|
+
this.state.size = 1000;
|
|
21
|
+
this.state.pointData = [];
|
|
22
|
+
this.state.areaData = [];
|
|
23
|
+
this.state.areaCode = 320000;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
protected async onCreated(): Promise<void> {
|
|
27
|
+
await super.onCreated();
|
|
28
|
+
this.service = new MapService(this.model);
|
|
29
|
+
await this.service.init(this.context);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 部件加载数据行为
|
|
34
|
+
*
|
|
35
|
+
* @author lxm
|
|
36
|
+
* @date 2022-08-19 14:08:50
|
|
37
|
+
*/
|
|
38
|
+
async load(args: MDCtrlLoadParams = {}): Promise<IData[]> {
|
|
39
|
+
if (this.state.isSimple) {
|
|
40
|
+
return [];
|
|
41
|
+
}
|
|
42
|
+
await this.startLoading();
|
|
43
|
+
try {
|
|
44
|
+
// *初始加载需要重置分页
|
|
45
|
+
const isInitialLoad = args.isInitialLoad === true;
|
|
46
|
+
|
|
47
|
+
// *查询参数处理
|
|
48
|
+
const { context } = this.handlerAbilityParams(args);
|
|
49
|
+
const params = await this.getFetchParams(args?.viewParam);
|
|
50
|
+
context.srfareacode = this.state.areaCode;
|
|
51
|
+
|
|
52
|
+
const res = await this.service.fetchAll(context, params);
|
|
53
|
+
|
|
54
|
+
this.state.items = res.data;
|
|
55
|
+
|
|
56
|
+
await this.afterLoad(args, res.data);
|
|
57
|
+
|
|
58
|
+
this.state.isLoaded = true;
|
|
59
|
+
await this._evt.emit('onLoadSuccess', {
|
|
60
|
+
isInitialLoad,
|
|
61
|
+
});
|
|
62
|
+
} catch (error) {
|
|
63
|
+
await this._evt.emit('onLoadError', undefined);
|
|
64
|
+
this.actionNotification('FETCHERROR', {
|
|
65
|
+
error: error as Error,
|
|
66
|
+
});
|
|
67
|
+
throw error;
|
|
68
|
+
} finally {
|
|
69
|
+
await this.endLoading();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
this.actionNotification('FETCHSUCCESS');
|
|
73
|
+
return this.state.items;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
async afterLoad(args: MDCtrlLoadParams, items: IData[]): Promise<IData[]> {
|
|
77
|
+
const result = (await super.afterLoad(args, items)) as IMapData[];
|
|
78
|
+
|
|
79
|
+
const tempareaData: IMapData[] = [];
|
|
80
|
+
const temppointData: IMapData[] = [];
|
|
81
|
+
result.forEach(item => {
|
|
82
|
+
if (item._type === 'area') {
|
|
83
|
+
tempareaData.push(item);
|
|
84
|
+
} else if (item._type === 'point') {
|
|
85
|
+
temppointData.push(item);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
this.state.pointData = temppointData;
|
|
89
|
+
this.state.areaData = tempareaData;
|
|
90
|
+
|
|
91
|
+
return result;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* 地图变更事件处理
|
|
96
|
+
* @author lxm
|
|
97
|
+
* @date 2023-10-31 05:28:36
|
|
98
|
+
* @param {(string | number)} areaCode
|
|
99
|
+
*/
|
|
100
|
+
onMapChange(areaCode: string | number): void {
|
|
101
|
+
// 修改预置视图参数,然后加载
|
|
102
|
+
this.state.areaCode = areaCode;
|
|
103
|
+
this.load({});
|
|
104
|
+
this.evt.emit('onMapChange', { areaCode });
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* 地图区域点击事件处理
|
|
109
|
+
* @author lxm
|
|
110
|
+
* @date 2023-10-31 05:30:54
|
|
111
|
+
* @param {IMapData} mapData
|
|
112
|
+
*/
|
|
113
|
+
onAreaClick(mapData: IMapData): void {
|
|
114
|
+
this.evt.emit('onAreaClick', { data: [mapData] });
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* 地图散点点击事件处理
|
|
119
|
+
* @author lxm
|
|
120
|
+
* @date 2023-10-31 05:30:58
|
|
121
|
+
* @param {IMapData} mapData
|
|
122
|
+
*/
|
|
123
|
+
onPointClick(mapData: IMapData): void {
|
|
124
|
+
this.evt.emit('onPointClick', { data: [mapData] });
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { HttpResponse, IHttpResponse } from '@ibiz-template/core';
|
|
2
|
+
import { ISysMap } from '@ibiz/model-core';
|
|
3
|
+
import { IMapData } from '../../../interface';
|
|
4
|
+
import { parseUserParams } from '../../../model';
|
|
5
|
+
import { MapData, MDControlService } from '../../../service';
|
|
6
|
+
import { convertNavData, ScriptFactory } from '../../../utils';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 地图部件服务
|
|
10
|
+
* @author lxm
|
|
11
|
+
* @date 2023-05-15 09:53:35
|
|
12
|
+
* @export
|
|
13
|
+
* @class GridService
|
|
14
|
+
* @extends {MDControlService<ISysMap>}
|
|
15
|
+
*/
|
|
16
|
+
export class MapService extends MDControlService<ISysMap> {
|
|
17
|
+
async init(context?: IContext | undefined): Promise<void> {
|
|
18
|
+
await super.init(context);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 加载所有地图项的数据
|
|
23
|
+
* @author lxm
|
|
24
|
+
* @date 2023-10-30 06:27:32
|
|
25
|
+
* @param {IParams} context
|
|
26
|
+
* @param {IParams} [params={}]
|
|
27
|
+
* @return {*} {Promise<IHttpResponse<IMapData[]>>}
|
|
28
|
+
*/
|
|
29
|
+
async fetchAll(
|
|
30
|
+
context: IContext,
|
|
31
|
+
params: IParams = {},
|
|
32
|
+
): Promise<IHttpResponse<IMapData[]>> {
|
|
33
|
+
const allData: IMapData[] = [];
|
|
34
|
+
// 没有面板项返回空数组
|
|
35
|
+
if (this.model.sysMapItems?.length) {
|
|
36
|
+
const app = ibiz.hub.getApp(context.srfappid);
|
|
37
|
+
await Promise.all(
|
|
38
|
+
this.model.sysMapItems.map(async mapItem => {
|
|
39
|
+
const { appDataEntityId, appDEDataSetId, customCond } = mapItem;
|
|
40
|
+
const _context = context.clone();
|
|
41
|
+
const _params = { ...params };
|
|
42
|
+
|
|
43
|
+
if (customCond) {
|
|
44
|
+
const customParams = ScriptFactory.execSingleLine(
|
|
45
|
+
customCond,
|
|
46
|
+
) as IData;
|
|
47
|
+
if (customParams) {
|
|
48
|
+
const { navigateContexts, navigateParams } =
|
|
49
|
+
parseUserParams(customParams);
|
|
50
|
+
if (navigateContexts) {
|
|
51
|
+
Object.assign(
|
|
52
|
+
_context,
|
|
53
|
+
convertNavData(navigateContexts, params, context),
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
if (navigateParams) {
|
|
57
|
+
Object.assign(
|
|
58
|
+
_params,
|
|
59
|
+
convertNavData(navigateContexts, params, context),
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const res = (await app.deService.exec(
|
|
66
|
+
appDataEntityId!,
|
|
67
|
+
appDEDataSetId!,
|
|
68
|
+
_context,
|
|
69
|
+
_params,
|
|
70
|
+
)) as IHttpResponse<IData[]>;
|
|
71
|
+
if (res.data) {
|
|
72
|
+
allData.push(...res.data.map(item => new MapData(item, mapItem)));
|
|
73
|
+
}
|
|
74
|
+
}),
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
return new HttpResponse<IMapData[]>(allData, 200);
|
|
78
|
+
}
|
|
79
|
+
}
|