model-action 1.0.22 → 1.0.24

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.
@@ -11,8 +11,10 @@ export class RoutingAction extends Action {
11
11
  * cameraRoute => 视角跟随样条线
12
12
  */
13
13
  static videoPatrolStart(id, type = "videoPatrol", extendParams = {}) {
14
- const param = Object.assign({ cmd: "routing", action: "start", type,
15
- id }, extendParams);
14
+ const param = Object.assign({ cmd: "routing", action: "start", id }, extendParams);
15
+ if (type) {
16
+ param.type = type;
17
+ }
16
18
  this.sendParam(param, '巡更开始');
17
19
  }
18
20
  /**
@@ -21,8 +23,10 @@ export class RoutingAction extends Action {
21
23
  * @param {*} type (必须)巡检的类型)
22
24
  */
23
25
  static videoPatrolStop(id, type = "videoPatrol", extendParams = {}) {
24
- const param = Object.assign({ cmd: "routing", action: "stop", type,
25
- id }, extendParams);
26
+ const param = Object.assign({ cmd: "routing", action: "stop", id }, extendParams);
27
+ if (type) {
28
+ param.type = type;
29
+ }
26
30
  this.sendParam(param, '巡更结束');
27
31
  }
28
32
  /**
@@ -31,8 +35,10 @@ export class RoutingAction extends Action {
31
35
  * @param {*} type (必须)巡检的类型)
32
36
  */
33
37
  static videoPatrolPause(id, type = "videoPatrol", extendParams = {}) {
34
- const param = Object.assign({ cmd: "routing", action: "pause", type,
35
- id }, extendParams);
38
+ const param = Object.assign({ cmd: "routing", action: "pause", id }, extendParams);
39
+ if (type) {
40
+ param.type = type;
41
+ }
36
42
  this.sendParam(param, '巡更暂停');
37
43
  }
38
44
  /**
@@ -41,8 +47,10 @@ export class RoutingAction extends Action {
41
47
  * @param {*} type (必须)巡检的类型)
42
48
  */
43
49
  static videoPatrolNext(id, type = "videoPatrol", extendParams = {}) {
44
- const param = Object.assign({ cmd: "routing", action: "next", type,
45
- id }, extendParams);
50
+ const param = Object.assign({ cmd: "routing", action: "next", id }, extendParams);
51
+ if (type) {
52
+ param.type = type;
53
+ }
46
54
  this.sendParam(param, '巡更下一步');
47
55
  }
48
56
  /**
@@ -51,8 +59,10 @@ export class RoutingAction extends Action {
51
59
  * @param {*} type (必须)巡检的类型)
52
60
  */
53
61
  static videoPatrolPrev(id, type = "videoPatrol", extendParams = {}) {
54
- const param = Object.assign({ cmd: "routing", action: "last", type,
55
- id }, extendParams);
62
+ const param = Object.assign({ cmd: "routing", action: "last", id }, extendParams);
63
+ if (type) {
64
+ param.type = type;
65
+ }
56
66
  this.sendParam(param, '巡更上一步');
57
67
  }
58
68
  /**
@@ -61,8 +71,10 @@ export class RoutingAction extends Action {
61
71
  * @param {*} type (必须)巡检的类型)
62
72
  */
63
73
  static videoPatrolRestart(id, type = "videoPatrol", extendParams = {}) {
64
- const param = Object.assign({ cmd: "routing", action: "restart", type,
65
- id }, extendParams);
74
+ const param = Object.assign({ cmd: "routing", action: "restart", id }, extendParams);
75
+ if (type) {
76
+ param.type = type;
77
+ }
66
78
  this.sendParam(param, '巡更重新开始,从暂停点开始');
67
79
  }
68
80
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "model-action",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "description": "与三维交互api",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -16,10 +16,12 @@ export class RoutingAction extends Action {
16
16
  const param: any = {
17
17
  cmd: "routing",
18
18
  action: "start",
19
- type,
20
19
  id,
21
20
  ...extendParams,
22
21
  };
22
+ if (type) {
23
+ param.type = type
24
+ }
23
25
  this.sendParam(param, '巡更开始')
24
26
  }
25
27
 
@@ -32,10 +34,12 @@ export class RoutingAction extends Action {
32
34
  const param: any = {
33
35
  cmd: "routing",
34
36
  action: "stop",
35
- type,
36
37
  id,
37
38
  ...extendParams,
38
39
  };
40
+ if (type) {
41
+ param.type = type
42
+ }
39
43
  this.sendParam(param, '巡更结束')
40
44
  }
41
45
 
@@ -47,11 +51,13 @@ export class RoutingAction extends Action {
47
51
  static videoPatrolPause(id: string, type: string = "videoPatrol", extendParams = {}) {
48
52
  const param: any = {
49
53
  cmd: "routing",
50
- action: "pause",
51
- type,
54
+ action: "pause",
52
55
  id,
53
56
  ...extendParams,
54
57
  };
58
+ if (type) {
59
+ param.type = type
60
+ }
55
61
  this.sendParam(param, '巡更暂停')
56
62
  }
57
63
 
@@ -64,10 +70,12 @@ export class RoutingAction extends Action {
64
70
  const param: any = {
65
71
  cmd: "routing",
66
72
  action: "next",
67
- type,
68
73
  id,
69
74
  ...extendParams,
70
75
  };
76
+ if (type) {
77
+ param.type = type
78
+ }
71
79
  this.sendParam(param, '巡更下一步')
72
80
  }
73
81
 
@@ -80,10 +88,12 @@ export class RoutingAction extends Action {
80
88
  const param: any = {
81
89
  cmd: "routing",
82
90
  action: "last",
83
- type,
84
91
  id,
85
92
  ...extendParams,
86
93
  };
94
+ if(type){
95
+ param.type = type
96
+ }
87
97
  this.sendParam(param, '巡更上一步')
88
98
  }
89
99
 
@@ -96,10 +106,12 @@ export class RoutingAction extends Action {
96
106
  const param: any = {
97
107
  cmd: "routing",
98
108
  action: "restart",
99
- type,
100
109
  id,
101
110
  ...extendParams,
102
111
  };
112
+ if (type) {
113
+ param.type = type
114
+ }
103
115
  this.sendParam(param, '巡更重新开始,从暂停点开始')
104
116
  }
105
117
  }