model-action 1.0.20 → 1.0.22
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/modules/Action.d.ts +1 -1
- package/dist/modules/Poi.d.ts +10 -0
- package/dist/modules/Poi.js +14 -0
- package/dist/modules/Routing.d.ts +6 -6
- package/dist/modules/Routing.js +18 -42
- package/package.json +1 -1
- package/src/modules/Action.ts +1 -1
- package/src/modules/Poi.ts +30 -10
- package/src/modules/Routing.ts +12 -6
package/dist/modules/Action.d.ts
CHANGED
package/dist/modules/Poi.d.ts
CHANGED
@@ -17,6 +17,10 @@ type PoiType = {
|
|
17
17
|
lowestFloor?: string;
|
18
18
|
state?: 'normal' | 'alarm';
|
19
19
|
} & SendParam;
|
20
|
+
type IdList = Array<{
|
21
|
+
id: string;
|
22
|
+
state: 'normal' | 'alarm';
|
23
|
+
}>;
|
20
24
|
export declare class PoiAction extends Action {
|
21
25
|
/**
|
22
26
|
* 添加poi
|
@@ -62,6 +66,12 @@ export declare class PoiAction extends Action {
|
|
62
66
|
* @param {*} state normal一般状态 alarm 告警状态
|
63
67
|
*/
|
64
68
|
static poiNormal(state: 'normal' | 'alarm'): void;
|
69
|
+
/**
|
70
|
+
* 切换指定ID设备的poi状态
|
71
|
+
* @param {*} ids 设备ID列表
|
72
|
+
* @param {*} isLocation 是否定位到第一个ID对应的设备
|
73
|
+
*/
|
74
|
+
static poiSwitchStatus(ids: IdList, isLocation?: boolean): void;
|
65
75
|
/**
|
66
76
|
* 获取指定POI
|
67
77
|
* @param {*} type 相机type
|
package/dist/modules/Poi.js
CHANGED
@@ -107,6 +107,20 @@ export class PoiAction extends Action {
|
|
107
107
|
};
|
108
108
|
this.sendParam(param, `恢复poi至${state}状态`);
|
109
109
|
}
|
110
|
+
/**
|
111
|
+
* 切换指定ID设备的poi状态
|
112
|
+
* @param {*} ids 设备ID列表
|
113
|
+
* @param {*} isLocation 是否定位到第一个ID对应的设备
|
114
|
+
*/
|
115
|
+
static poiSwitchStatus(ids, isLocation = false) {
|
116
|
+
const param = {
|
117
|
+
cmd: "status",
|
118
|
+
isLocation,
|
119
|
+
type: 'POI',
|
120
|
+
ids
|
121
|
+
};
|
122
|
+
this.sendParam(param, `切换poi至指定状态`);
|
123
|
+
}
|
110
124
|
/**
|
111
125
|
* 获取指定POI
|
112
126
|
* @param {*} type 相机type
|
@@ -10,35 +10,35 @@ export declare class RoutingAction extends Action {
|
|
10
10
|
* videoPatrol => 视频巡更
|
11
11
|
* cameraRoute => 视角跟随样条线
|
12
12
|
*/
|
13
|
-
static videoPatrolStart(id: string, type?: string): void;
|
13
|
+
static videoPatrolStart(id: string, type?: string, extendParams?: {}): void;
|
14
14
|
/**
|
15
15
|
* 巡检结束
|
16
16
|
* @param {*} id (必须)巡检的唯一ID)
|
17
17
|
* @param {*} type (必须)巡检的类型)
|
18
18
|
*/
|
19
|
-
static videoPatrolStop(id: string, type?: string): void;
|
19
|
+
static videoPatrolStop(id: string, type?: string, extendParams?: {}): void;
|
20
20
|
/**
|
21
21
|
* 巡检暂停
|
22
22
|
* @param {*} id (必须)巡检的唯一ID)
|
23
23
|
* @param {*} type (必须)巡检的类型)
|
24
24
|
*/
|
25
|
-
static videoPatrolPause(id: string, type?: string): void;
|
25
|
+
static videoPatrolPause(id: string, type?: string, extendParams?: {}): void;
|
26
26
|
/**
|
27
27
|
* 巡检下一步
|
28
28
|
* @param {*} id (必须)巡检的唯一ID)
|
29
29
|
* @param {*} type (必须)巡检的类型)
|
30
30
|
*/
|
31
|
-
static videoPatrolNext(id: string, type?: string): void;
|
31
|
+
static videoPatrolNext(id: string, type?: string, extendParams?: {}): void;
|
32
32
|
/**
|
33
33
|
* 巡更上一步
|
34
34
|
* @param {*} id (必须)巡检的唯一ID)
|
35
35
|
* @param {*} type (必须)巡检的类型)
|
36
36
|
*/
|
37
|
-
static videoPatrolPrev(id: string, type?: string): void;
|
37
|
+
static videoPatrolPrev(id: string, type?: string, extendParams?: {}): void;
|
38
38
|
/**
|
39
39
|
* 巡更重新开始,从暂停点开始
|
40
40
|
* @param {*} id (必须)巡检的唯一ID)
|
41
41
|
* @param {*} type (必须)巡检的类型)
|
42
42
|
*/
|
43
|
-
static videoPatrolRestart(id: string, type?: string): void;
|
43
|
+
static videoPatrolRestart(id: string, type?: string, extendParams?: {}): void;
|
44
44
|
}
|
package/dist/modules/Routing.js
CHANGED
@@ -10,13 +10,9 @@ export class RoutingAction extends Action {
|
|
10
10
|
* videoPatrol => 视频巡更
|
11
11
|
* cameraRoute => 视角跟随样条线
|
12
12
|
*/
|
13
|
-
static videoPatrolStart(id, type = "videoPatrol") {
|
14
|
-
const param = {
|
15
|
-
|
16
|
-
action: "start",
|
17
|
-
type,
|
18
|
-
id,
|
19
|
-
};
|
13
|
+
static videoPatrolStart(id, type = "videoPatrol", extendParams = {}) {
|
14
|
+
const param = Object.assign({ cmd: "routing", action: "start", type,
|
15
|
+
id }, extendParams);
|
20
16
|
this.sendParam(param, '巡更开始');
|
21
17
|
}
|
22
18
|
/**
|
@@ -24,13 +20,9 @@ export class RoutingAction extends Action {
|
|
24
20
|
* @param {*} id (必须)巡检的唯一ID)
|
25
21
|
* @param {*} type (必须)巡检的类型)
|
26
22
|
*/
|
27
|
-
static videoPatrolStop(id, type = "videoPatrol") {
|
28
|
-
const param = {
|
29
|
-
|
30
|
-
action: "stop",
|
31
|
-
type,
|
32
|
-
id,
|
33
|
-
};
|
23
|
+
static videoPatrolStop(id, type = "videoPatrol", extendParams = {}) {
|
24
|
+
const param = Object.assign({ cmd: "routing", action: "stop", type,
|
25
|
+
id }, extendParams);
|
34
26
|
this.sendParam(param, '巡更结束');
|
35
27
|
}
|
36
28
|
/**
|
@@ -38,13 +30,9 @@ export class RoutingAction extends Action {
|
|
38
30
|
* @param {*} id (必须)巡检的唯一ID)
|
39
31
|
* @param {*} type (必须)巡检的类型)
|
40
32
|
*/
|
41
|
-
static videoPatrolPause(id, type = "videoPatrol") {
|
42
|
-
const param = {
|
43
|
-
|
44
|
-
action: "pause",
|
45
|
-
type,
|
46
|
-
id,
|
47
|
-
};
|
33
|
+
static videoPatrolPause(id, type = "videoPatrol", extendParams = {}) {
|
34
|
+
const param = Object.assign({ cmd: "routing", action: "pause", type,
|
35
|
+
id }, extendParams);
|
48
36
|
this.sendParam(param, '巡更暂停');
|
49
37
|
}
|
50
38
|
/**
|
@@ -52,13 +40,9 @@ export class RoutingAction extends Action {
|
|
52
40
|
* @param {*} id (必须)巡检的唯一ID)
|
53
41
|
* @param {*} type (必须)巡检的类型)
|
54
42
|
*/
|
55
|
-
static videoPatrolNext(id, type = "videoPatrol") {
|
56
|
-
const param = {
|
57
|
-
|
58
|
-
action: "next",
|
59
|
-
type,
|
60
|
-
id,
|
61
|
-
};
|
43
|
+
static videoPatrolNext(id, type = "videoPatrol", extendParams = {}) {
|
44
|
+
const param = Object.assign({ cmd: "routing", action: "next", type,
|
45
|
+
id }, extendParams);
|
62
46
|
this.sendParam(param, '巡更下一步');
|
63
47
|
}
|
64
48
|
/**
|
@@ -66,13 +50,9 @@ export class RoutingAction extends Action {
|
|
66
50
|
* @param {*} id (必须)巡检的唯一ID)
|
67
51
|
* @param {*} type (必须)巡检的类型)
|
68
52
|
*/
|
69
|
-
static videoPatrolPrev(id, type = "videoPatrol") {
|
70
|
-
const param = {
|
71
|
-
|
72
|
-
action: "last",
|
73
|
-
type,
|
74
|
-
id,
|
75
|
-
};
|
53
|
+
static videoPatrolPrev(id, type = "videoPatrol", extendParams = {}) {
|
54
|
+
const param = Object.assign({ cmd: "routing", action: "last", type,
|
55
|
+
id }, extendParams);
|
76
56
|
this.sendParam(param, '巡更上一步');
|
77
57
|
}
|
78
58
|
/**
|
@@ -80,13 +60,9 @@ export class RoutingAction extends Action {
|
|
80
60
|
* @param {*} id (必须)巡检的唯一ID)
|
81
61
|
* @param {*} type (必须)巡检的类型)
|
82
62
|
*/
|
83
|
-
static videoPatrolRestart(id, type = "videoPatrol") {
|
84
|
-
const param = {
|
85
|
-
|
86
|
-
action: "restart",
|
87
|
-
type,
|
88
|
-
id,
|
89
|
-
};
|
63
|
+
static videoPatrolRestart(id, type = "videoPatrol", extendParams = {}) {
|
64
|
+
const param = Object.assign({ cmd: "routing", action: "restart", type,
|
65
|
+
id }, extendParams);
|
90
66
|
this.sendParam(param, '巡更重新开始,从暂停点开始');
|
91
67
|
}
|
92
68
|
}
|
package/package.json
CHANGED
package/src/modules/Action.ts
CHANGED
package/src/modules/Poi.ts
CHANGED
@@ -20,6 +20,11 @@ type PoiType = {
|
|
20
20
|
state?: 'normal' | 'alarm'
|
21
21
|
} & SendParam
|
22
22
|
|
23
|
+
type IdList = Array<{
|
24
|
+
id: string;
|
25
|
+
state: 'normal' | 'alarm'
|
26
|
+
}>
|
27
|
+
|
23
28
|
export class PoiAction extends Action {
|
24
29
|
/**
|
25
30
|
* 添加poi
|
@@ -44,16 +49,16 @@ export class PoiAction extends Action {
|
|
44
49
|
this.sendParam(param, '新增POI')
|
45
50
|
}
|
46
51
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
52
|
+
/**
|
53
|
+
* 更新poi
|
54
|
+
* @param {*} type 相机type
|
55
|
+
* @param {*} location poi点位置
|
56
|
+
* @param {*} text POI标题
|
57
|
+
* @param {*} place POI所在位置
|
58
|
+
* @param {*} description POI描述
|
59
|
+
* @param {*} linkId POI关联的设备ID
|
60
|
+
*/
|
61
|
+
static poiUpdate(type: PoiType['type'] = 'Camera', location: LocationItem, text: PoiType['text'] = '', place: PoiType['place'] = '', description: PoiType['description'] = '', linkId: PoiType['linkId'] = '') {
|
57
62
|
const param: RequiredSome<PoiType, 'action' | 'type' | 'location'> = {
|
58
63
|
cmd: "POI",
|
59
64
|
action: "update",
|
@@ -133,6 +138,21 @@ export class PoiAction extends Action {
|
|
133
138
|
this.sendParam(param, `恢复poi至${state}状态`)
|
134
139
|
}
|
135
140
|
|
141
|
+
/**
|
142
|
+
* 切换指定ID设备的poi状态
|
143
|
+
* @param {*} ids 设备ID列表
|
144
|
+
* @param {*} isLocation 是否定位到第一个ID对应的设备
|
145
|
+
*/
|
146
|
+
static poiSwitchStatus(ids: IdList, isLocation: boolean = false) {
|
147
|
+
const param = {
|
148
|
+
cmd: "status",
|
149
|
+
isLocation,
|
150
|
+
type: 'POI',
|
151
|
+
ids
|
152
|
+
}
|
153
|
+
this.sendParam(param, `切换poi至指定状态`)
|
154
|
+
}
|
155
|
+
|
136
156
|
/**
|
137
157
|
* 获取指定POI
|
138
158
|
* @param {*} type 相机type
|
package/src/modules/Routing.ts
CHANGED
@@ -12,12 +12,13 @@ export class RoutingAction extends Action {
|
|
12
12
|
* videoPatrol => 视频巡更
|
13
13
|
* cameraRoute => 视角跟随样条线
|
14
14
|
*/
|
15
|
-
static videoPatrolStart(id: string, type: string = "videoPatrol") {
|
15
|
+
static videoPatrolStart(id: string, type: string = "videoPatrol", extendParams = {}) {
|
16
16
|
const param: any = {
|
17
17
|
cmd: "routing",
|
18
18
|
action: "start",
|
19
19
|
type,
|
20
20
|
id,
|
21
|
+
...extendParams,
|
21
22
|
};
|
22
23
|
this.sendParam(param, '巡更开始')
|
23
24
|
}
|
@@ -27,12 +28,13 @@ export class RoutingAction extends Action {
|
|
27
28
|
* @param {*} id (必须)巡检的唯一ID)
|
28
29
|
* @param {*} type (必须)巡检的类型)
|
29
30
|
*/
|
30
|
-
static videoPatrolStop(id: string, type: string = "videoPatrol") {
|
31
|
+
static videoPatrolStop(id: string, type: string = "videoPatrol", extendParams = {}) {
|
31
32
|
const param: any = {
|
32
33
|
cmd: "routing",
|
33
34
|
action: "stop",
|
34
35
|
type,
|
35
36
|
id,
|
37
|
+
...extendParams,
|
36
38
|
};
|
37
39
|
this.sendParam(param, '巡更结束')
|
38
40
|
}
|
@@ -42,12 +44,13 @@ export class RoutingAction extends Action {
|
|
42
44
|
* @param {*} id (必须)巡检的唯一ID)
|
43
45
|
* @param {*} type (必须)巡检的类型)
|
44
46
|
*/
|
45
|
-
static videoPatrolPause(id: string, type: string = "videoPatrol") {
|
47
|
+
static videoPatrolPause(id: string, type: string = "videoPatrol", extendParams = {}) {
|
46
48
|
const param: any = {
|
47
49
|
cmd: "routing",
|
48
50
|
action: "pause",
|
49
51
|
type,
|
50
52
|
id,
|
53
|
+
...extendParams,
|
51
54
|
};
|
52
55
|
this.sendParam(param, '巡更暂停')
|
53
56
|
}
|
@@ -57,12 +60,13 @@ export class RoutingAction extends Action {
|
|
57
60
|
* @param {*} id (必须)巡检的唯一ID)
|
58
61
|
* @param {*} type (必须)巡检的类型)
|
59
62
|
*/
|
60
|
-
static videoPatrolNext(id: string, type: string = "videoPatrol") {
|
63
|
+
static videoPatrolNext(id: string, type: string = "videoPatrol", extendParams = {}) {
|
61
64
|
const param: any = {
|
62
65
|
cmd: "routing",
|
63
66
|
action: "next",
|
64
67
|
type,
|
65
68
|
id,
|
69
|
+
...extendParams,
|
66
70
|
};
|
67
71
|
this.sendParam(param, '巡更下一步')
|
68
72
|
}
|
@@ -72,12 +76,13 @@ export class RoutingAction extends Action {
|
|
72
76
|
* @param {*} id (必须)巡检的唯一ID)
|
73
77
|
* @param {*} type (必须)巡检的类型)
|
74
78
|
*/
|
75
|
-
static videoPatrolPrev(id: string, type: string = "videoPatrol") {
|
79
|
+
static videoPatrolPrev(id: string, type: string = "videoPatrol", extendParams = {}) {
|
76
80
|
const param: any = {
|
77
81
|
cmd: "routing",
|
78
82
|
action: "last",
|
79
83
|
type,
|
80
84
|
id,
|
85
|
+
...extendParams,
|
81
86
|
};
|
82
87
|
this.sendParam(param, '巡更上一步')
|
83
88
|
}
|
@@ -87,12 +92,13 @@ export class RoutingAction extends Action {
|
|
87
92
|
* @param {*} id (必须)巡检的唯一ID)
|
88
93
|
* @param {*} type (必须)巡检的类型)
|
89
94
|
*/
|
90
|
-
static videoPatrolRestart(id: string, type: string = "videoPatrol") {
|
95
|
+
static videoPatrolRestart(id: string, type: string = "videoPatrol", extendParams = {}) {
|
91
96
|
const param: any = {
|
92
97
|
cmd: "routing",
|
93
98
|
action: "restart",
|
94
99
|
type,
|
95
100
|
id,
|
101
|
+
...extendParams,
|
96
102
|
};
|
97
103
|
this.sendParam(param, '巡更重新开始,从暂停点开始')
|
98
104
|
}
|