model-action 1.0.8 → 1.0.10

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.
@@ -2,7 +2,7 @@
2
2
  * POI点方法
3
3
  */
4
4
  import { Action, LocationItem, SendParam } from "./Action";
5
- type PoiActionType = 'show' | 'hide' | 'add' | 'delete' | 'update' | 'getInfo';
5
+ type PoiActionType = 'show' | 'hide' | 'add' | 'delete' | 'update' | 'getInfo' | 'status';
6
6
  type PoiType = {
7
7
  action: PoiActionType;
8
8
  id?: string;
@@ -15,6 +15,7 @@ type PoiType = {
15
15
  linkId?: string;
16
16
  floorNum?: string;
17
17
  lowestFloor?: string;
18
+ state?: 'normal' | 'alarm';
18
19
  } & SendParam;
19
20
  export declare class PoiAction extends Action {
20
21
  /**
@@ -46,6 +47,11 @@ export declare class PoiAction extends Action {
46
47
  * @param {*} place POI所在位置
47
48
  */
48
49
  static poiHide(id: PoiType['id'], type: PoiType['type'], place: PoiType['place']): void;
50
+ /**
51
+ * 把所有的POI恢复到Normal状态
52
+ * @param {*} state normal一般状态 alarm 告警状态
53
+ */
54
+ static poiNormal(state: 'normal' | 'alarm'): void;
49
55
  /**
50
56
  * 获取指定POI
51
57
  * @param {*} type 相机type
@@ -43,7 +43,7 @@ export class PoiAction extends Action {
43
43
  * @param {*} type 相机type
44
44
  * @param {*} place POI所在位置
45
45
  */
46
- static poiShow(id, type = "Camera", place) {
46
+ static poiShow(id, type, place) {
47
47
  const param = {
48
48
  cmd: "POI",
49
49
  action: "show",
@@ -61,7 +61,7 @@ export class PoiAction extends Action {
61
61
  * @param {*} type 相机type
62
62
  * @param {*} place POI所在位置
63
63
  */
64
- static poiHide(id, type = "Camera", place) {
64
+ static poiHide(id, type, place) {
65
65
  const param = {
66
66
  cmd: "POI",
67
67
  action: "hide",
@@ -73,6 +73,18 @@ export class PoiAction extends Action {
73
73
  }
74
74
  this.sendParam(param, '隐藏POI');
75
75
  }
76
+ /**
77
+ * 把所有的POI恢复到Normal状态
78
+ * @param {*} state normal一般状态 alarm 告警状态
79
+ */
80
+ static poiNormal(state) {
81
+ const param = {
82
+ cmd: "POI",
83
+ action: "status",
84
+ state
85
+ };
86
+ this.sendParam(param, `恢复至${state}状态`);
87
+ }
76
88
  /**
77
89
  * 获取指定POI
78
90
  * @param {*} type 相机type
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "model-action",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "与三维交互api",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { Action, LocationItem, RequiredSome, SendParam } from "./Action";
6
6
 
7
- type PoiActionType = 'show' | 'hide' | 'add' | 'delete' | 'update' | 'getInfo'
7
+ type PoiActionType = 'show' | 'hide' | 'add' | 'delete' | 'update' | 'getInfo' | 'status'
8
8
  type PoiType = {
9
9
  action: PoiActionType, //方法
10
10
  id?: string, //POI点UE中的ID
@@ -16,7 +16,8 @@ type PoiType = {
16
16
  description?: string, //POI描述
17
17
  linkId?: string, //POI关联设备ID
18
18
  floorNum?: string, //总楼层
19
- lowestFloor?: string //最低楼层
19
+ lowestFloor?: string, //最低楼层
20
+ state?: 'normal' | 'alarm'
20
21
  } & SendParam
21
22
 
22
23
  export class PoiAction extends Action {
@@ -62,7 +63,7 @@ export class PoiAction extends Action {
62
63
  * @param {*} type 相机type
63
64
  * @param {*} place POI所在位置
64
65
  */
65
- static poiShow(id: PoiType['id'], type: PoiType['type'] = "Camera", place: PoiType['place']) {
66
+ static poiShow(id: PoiType['id'], type: PoiType['type'], place: PoiType['place']) {
66
67
  const param: PoiType = {
67
68
  cmd: "POI",
68
69
  action: "show",
@@ -82,7 +83,7 @@ export class PoiAction extends Action {
82
83
  * @param {*} type 相机type
83
84
  * @param {*} place POI所在位置
84
85
  */
85
- static poiHide(id: PoiType['id'], type: PoiType['type'] = "Camera", place: PoiType['place']) {
86
+ static poiHide(id: PoiType['id'], type: PoiType['type'], place: PoiType['place']) {
86
87
  const param: PoiType = {
87
88
  cmd: "POI",
88
89
  action: "hide",
@@ -96,6 +97,19 @@ export class PoiAction extends Action {
96
97
  this.sendParam(param, '隐藏POI')
97
98
  }
98
99
 
100
+ /**
101
+ * 把所有的POI恢复到Normal状态
102
+ * @param {*} state normal一般状态 alarm 告警状态
103
+ */
104
+ static poiNormal(state: 'normal' | 'alarm') {
105
+ const param: PoiType = {
106
+ cmd: "POI",
107
+ action: "status",
108
+ state
109
+ };
110
+ this.sendParam(param, `恢复至${state}状态`)
111
+ }
112
+
99
113
  /**
100
114
  * 获取指定POI
101
115
  * @param {*} type 相机type