model-action 1.0.20 → 1.0.21
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/package.json +1 -1
- package/src/modules/Action.ts +1 -1
- package/src/modules/Poi.ts +30 -10
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
|
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
|