@cpzxrobot/sdk 1.0.11 → 1.0.13
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/device_filter.ts +2 -5
- package/dist/camera_gateway.js +24 -24
- package/dist/device_filter.js +2 -9
- package/dist/factory_gateway.js +2 -2
- package/dist/user_gateway.js +2 -1
- package/package.json +1 -1
- package/user_gateway.ts +2 -1
package/device_filter.ts
CHANGED
|
@@ -309,11 +309,8 @@ export abstract class DeviceFilter<T extends { id: number }> {
|
|
|
309
309
|
if (res.data.Error) {
|
|
310
310
|
throw res.data.Error;
|
|
311
311
|
} else {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
this.devices = res.data;
|
|
315
|
-
}
|
|
316
|
-
return res.data;
|
|
312
|
+
return this.wrapList(res.data);
|
|
313
|
+
// return res.data;
|
|
317
314
|
}
|
|
318
315
|
});
|
|
319
316
|
}
|
package/dist/camera_gateway.js
CHANGED
|
@@ -2,29 +2,29 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CameraGateway = void 0;
|
|
4
4
|
class CameraGateway extends Object {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
5
|
+
constructor(context) {
|
|
6
|
+
super();
|
|
7
|
+
this.context = context;
|
|
8
|
+
}
|
|
9
|
+
//搜索摄像头
|
|
10
|
+
async search(data) {
|
|
11
|
+
var axios = await this.context.ready;
|
|
12
|
+
const response = await axios.post("/api/v1/camera/search", {
|
|
13
|
+
unit_id: data.id,
|
|
14
|
+
});
|
|
15
|
+
return response.data;
|
|
16
|
+
}
|
|
17
|
+
//获得摄像头的播放地址
|
|
18
|
+
async getUrl(data) {
|
|
19
|
+
var axios = await this.context.ready;
|
|
20
|
+
const response = await axios.get(`/api/v1/camera/${data.id}/url/wss`);
|
|
21
|
+
return response.data;
|
|
22
|
+
}
|
|
23
|
+
//获取工厂天气
|
|
24
|
+
async weather(id) {
|
|
25
|
+
var axios = await this.context.ready;
|
|
26
|
+
const response = await axios.get(`/api/v1/weather?code=${id}`);
|
|
27
|
+
return response.data;
|
|
28
|
+
}
|
|
29
29
|
}
|
|
30
30
|
exports.CameraGateway = CameraGateway;
|
package/dist/device_filter.js
CHANGED
|
@@ -94,10 +94,6 @@ class DeviceFilter {
|
|
|
94
94
|
sevenDaysAgo.setDate(sevenDaysAgo.getDate() - 7);
|
|
95
95
|
args.start = this.formateDateToYYYYMMDD(sevenDaysAgo);
|
|
96
96
|
}
|
|
97
|
-
if (!args.type) {
|
|
98
|
-
throw new Error("没有提交数据类型,请检查type参数");
|
|
99
|
-
}
|
|
100
|
-
|
|
101
97
|
return this.context.ready
|
|
102
98
|
.then(() => {
|
|
103
99
|
const p1 = this.context.axios.get(`/api/v1/device/${id}/data/${args.type}`, {
|
|
@@ -245,11 +241,8 @@ class DeviceFilter {
|
|
|
245
241
|
throw res.data.Error;
|
|
246
242
|
}
|
|
247
243
|
else {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
this.devices = res.data;
|
|
251
|
-
}
|
|
252
|
-
return res.data;
|
|
244
|
+
return this.wrapList(res.data);
|
|
245
|
+
// return res.data;
|
|
253
246
|
}
|
|
254
247
|
});
|
|
255
248
|
}
|
package/dist/factory_gateway.js
CHANGED
|
@@ -42,8 +42,8 @@ class FactoryGateway extends Object {
|
|
|
42
42
|
return response.data;
|
|
43
43
|
}
|
|
44
44
|
async company(data) {
|
|
45
|
-
await this.context.ready;
|
|
46
|
-
const response = await
|
|
45
|
+
var axios = await this.context.ready;
|
|
46
|
+
const response = await axios.get(`/api/v1/factory/${data.id}/organizaion`, data);
|
|
47
47
|
return response.data;
|
|
48
48
|
}
|
|
49
49
|
}
|
package/dist/user_gateway.js
CHANGED
package/package.json
CHANGED
package/user_gateway.ts
CHANGED
|
@@ -19,7 +19,8 @@ export class UserGateway extends Object {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
//获得当前用户选择的工厂
|
|
22
|
-
public getSelectedFarm(): Promise<Factory> {
|
|
22
|
+
public async getSelectedFarm(): Promise<Factory> {
|
|
23
|
+
await this.context.ready;
|
|
23
24
|
return new Promise<Factory>((resolve, reject) => {
|
|
24
25
|
switch (this.context.mode) {
|
|
25
26
|
case "dev":
|