@cpzxrobot/sdk 1.3.40 → 1.3.42
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/car_gateway.ts +7 -9
- package/device_gateway.ts +28 -1
- package/dist/car_gateway.js +5 -6
- package/dist/device_gateway.js +20 -0
- package/package.json +1 -1
package/car_gateway.ts
CHANGED
|
@@ -14,14 +14,6 @@ export class CarGateway extends Object {
|
|
|
14
14
|
.then((res) => res.data);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
async addWeightRecords(factory: Factory, data: any) {
|
|
18
|
-
var axios = await this.context.ready;
|
|
19
|
-
return axios
|
|
20
|
-
.post(`/api/v2/car/${factory.pid}/weightRecords`, data)
|
|
21
|
-
.then((res) => res.data);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
17
|
async detections(factory: Factory, date: Date) {
|
|
26
18
|
var axios = await this.context.ready;
|
|
27
19
|
return axios
|
|
@@ -47,7 +39,7 @@ export class CarGateway extends Object {
|
|
|
47
39
|
var axios = await this.context.ready;
|
|
48
40
|
//filter=未分配的
|
|
49
41
|
return axios
|
|
50
|
-
.get(`/api/v2/car/${factory.id}/order?date=` + date.toISOString()+"&filter=unallocated")
|
|
42
|
+
.get(`/api/v2/car/${factory.id}/order?date=` + date.toISOString() + "&filter=unallocated")
|
|
51
43
|
.then((res) => res.data);
|
|
52
44
|
}
|
|
53
45
|
|
|
@@ -81,8 +73,14 @@ export class CarGateway extends Object {
|
|
|
81
73
|
// "manualCarWeight":20000,
|
|
82
74
|
// "manualCarWeightTime":"2025-05-08 08:20:49"
|
|
83
75
|
// }
|
|
76
|
+
// 增加手动重量记录或者增加称重记录
|
|
84
77
|
async updateRecord(factory: Factory, record: any) {
|
|
85
78
|
var axios = await this.context.ready;
|
|
86
79
|
return axios.post(`/api/v2/car/${factory.pid}/weightRecord`, record);
|
|
87
80
|
}
|
|
81
|
+
|
|
82
|
+
async addRecord(factory: Factory, record: any) {
|
|
83
|
+
var axios = await this.context.ready;
|
|
84
|
+
return axios.post(`/api/v2/car/${factory.pid}/weightRecord`, record);
|
|
85
|
+
}
|
|
88
86
|
}
|
package/device_gateway.ts
CHANGED
|
@@ -137,6 +137,7 @@ export class DeviceGateway extends Object {
|
|
|
137
137
|
return res.data;
|
|
138
138
|
});
|
|
139
139
|
},
|
|
140
|
+
|
|
140
141
|
};
|
|
141
142
|
}
|
|
142
143
|
|
|
@@ -930,7 +931,7 @@ export class DeviceGateway extends Object {
|
|
|
930
931
|
public maintenanceStatus = this.generateFunctionsForDict('maintenance-status');
|
|
931
932
|
|
|
932
933
|
//外委中状态列表
|
|
933
|
-
public maintenanceOutsourceStatus =this.generateFunctionsForDict('maintenance-outsource-status');
|
|
934
|
+
public maintenanceOutsourceStatus = this.generateFunctionsForDict('maintenance-outsource-status');
|
|
934
935
|
|
|
935
936
|
//故障来源
|
|
936
937
|
public troubleDetectSource = this.generateFunctionsForDict('trouble-detect-source');
|
|
@@ -972,4 +973,30 @@ export class DeviceGateway extends Object {
|
|
|
972
973
|
};
|
|
973
974
|
}
|
|
974
975
|
|
|
976
|
+
get disinfect() {
|
|
977
|
+
return {
|
|
978
|
+
openDoor: async (deviceId: number,door: "doora" | "doorb", open: boolean) => {
|
|
979
|
+
var axios = await this.context.ready;
|
|
980
|
+
return axios.post(`/api/v2/device/disinfect/${deviceId}`, { door, open })
|
|
981
|
+
},
|
|
982
|
+
config: async (deviceId: number, config: {
|
|
983
|
+
mode?: number; // 0:没有消毒 1:高温消毒 2:臭氧消毒 3:高温+臭氧
|
|
984
|
+
disinfectTime?: number; // 洗消时间(s)
|
|
985
|
+
targetTemp?: number; // 目标温度
|
|
986
|
+
targetOzone?: number; // 目标臭氧浓度
|
|
987
|
+
}) => {
|
|
988
|
+
let axios = await this.context.ready;
|
|
989
|
+
return axios.post(`/api/v2/device/disinfect/${deviceId}`, config).then((res) => {
|
|
990
|
+
return res.data;
|
|
991
|
+
});
|
|
992
|
+
},
|
|
993
|
+
history: async (deviceId: number, pageNum:number,pageSize:number) => {
|
|
994
|
+
let axios = await this.context.ready;
|
|
995
|
+
return axios.get(`/api/v2/device/disinfect/${deviceId}`, { params: { pageNum, pageSize } }).then((res) => {
|
|
996
|
+
return res.data;
|
|
997
|
+
});
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
|
|
975
1002
|
}
|
package/dist/car_gateway.js
CHANGED
|
@@ -12,12 +12,6 @@ class CarGateway extends Object {
|
|
|
12
12
|
.get(`/api/v2/car/${factory.pid}/weightRecords?date=` + date.toISOString())
|
|
13
13
|
.then((res) => res.data);
|
|
14
14
|
}
|
|
15
|
-
async addWeightRecords(factory, data) {
|
|
16
|
-
var axios = await this.context.ready;
|
|
17
|
-
return axios
|
|
18
|
-
.post(`/api/v2/car/${factory.pid}/weightRecords`, data)
|
|
19
|
-
.then((res) => res.data);
|
|
20
|
-
}
|
|
21
15
|
async detections(factory, date) {
|
|
22
16
|
var axios = await this.context.ready;
|
|
23
17
|
return axios
|
|
@@ -70,9 +64,14 @@ class CarGateway extends Object {
|
|
|
70
64
|
// "manualCarWeight":20000,
|
|
71
65
|
// "manualCarWeightTime":"2025-05-08 08:20:49"
|
|
72
66
|
// }
|
|
67
|
+
// 增加手动重量记录或者增加称重记录
|
|
73
68
|
async updateRecord(factory, record) {
|
|
74
69
|
var axios = await this.context.ready;
|
|
75
70
|
return axios.post(`/api/v2/car/${factory.pid}/weightRecord`, record);
|
|
76
71
|
}
|
|
72
|
+
async addRecord(factory, record) {
|
|
73
|
+
var axios = await this.context.ready;
|
|
74
|
+
return axios.post(`/api/v2/car/${factory.pid}/weightRecord`, record);
|
|
75
|
+
}
|
|
77
76
|
}
|
|
78
77
|
exports.CarGateway = CarGateway;
|
package/dist/device_gateway.js
CHANGED
|
@@ -740,5 +740,25 @@ class DeviceGateway extends Object {
|
|
|
740
740
|
}
|
|
741
741
|
};
|
|
742
742
|
}
|
|
743
|
+
get disinfect() {
|
|
744
|
+
return {
|
|
745
|
+
openDoor: async (deviceId, door, open) => {
|
|
746
|
+
var axios = await this.context.ready;
|
|
747
|
+
return axios.post(`/api/v2/device/disinfect/${deviceId}`, { door, open });
|
|
748
|
+
},
|
|
749
|
+
config: async (deviceId, config) => {
|
|
750
|
+
let axios = await this.context.ready;
|
|
751
|
+
return axios.post(`/api/v2/device/disinfect/${deviceId}`, config).then((res) => {
|
|
752
|
+
return res.data;
|
|
753
|
+
});
|
|
754
|
+
},
|
|
755
|
+
history: async (deviceId, pageNum, pageSize) => {
|
|
756
|
+
let axios = await this.context.ready;
|
|
757
|
+
return axios.get(`/api/v2/device/disinfect/${deviceId}`, { params: { pageNum, pageSize } }).then((res) => {
|
|
758
|
+
return res.data;
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
};
|
|
762
|
+
}
|
|
743
763
|
}
|
|
744
764
|
exports.DeviceGateway = DeviceGateway;
|