@cpzxrobot/sdk 1.3.47 → 1.3.48
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_gateway.ts +25 -16
- package/dist/device_gateway.js +13 -5
- package/dist/project_gateway.js +10 -0
- package/package.json +1 -1
- package/project_gateway.ts +15 -1
- package/user_gateway.ts +0 -2
package/device_gateway.ts
CHANGED
|
@@ -211,17 +211,17 @@ export class DeviceGateway extends Object {
|
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
async watch(
|
|
214
|
-
ids: number|number[],
|
|
214
|
+
ids: number | number[],
|
|
215
215
|
fn: any,
|
|
216
216
|
) {
|
|
217
217
|
var axios = await this.context.ready;
|
|
218
218
|
var idQuery = "";
|
|
219
219
|
if (Array.isArray(ids)) {
|
|
220
220
|
idQuery = ids.map(x => `ids=${x}`).join("&");
|
|
221
|
-
}else{
|
|
221
|
+
} else {
|
|
222
222
|
idQuery = `ids=${ids}`;
|
|
223
223
|
}
|
|
224
|
-
return axios.getAsSse(`/api/v1/device/watch
|
|
224
|
+
return axios.getAsSse(`/api/v1/device/watch?` + idQuery, fn)
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
private getFilter<T extends { id: number }>(
|
|
@@ -981,26 +981,35 @@ export class DeviceGateway extends Object {
|
|
|
981
981
|
|
|
982
982
|
get disinfect() {
|
|
983
983
|
return {
|
|
984
|
-
openDoor: async (deviceId: number,door: "doora" | "doorb", open: boolean) => {
|
|
984
|
+
openDoor: async (deviceId: number, door: "doora" | "doorb", open: boolean) => {
|
|
985
985
|
var axios = await this.context.ready;
|
|
986
986
|
return axios.post(`/api/v2/disinfect/${deviceId}`, { door, open })
|
|
987
987
|
},
|
|
988
|
-
action: async (deviceId: number,action: "start"|"end") => {
|
|
988
|
+
action: async (deviceId: number, action: "start" | "end") => {
|
|
989
989
|
var axios = await this.context.ready;
|
|
990
990
|
return axios.post(`/api/v2/disinfect/${deviceId}`, { action })
|
|
991
991
|
},
|
|
992
|
-
config:
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
992
|
+
config: {
|
|
993
|
+
set: async (deviceId: number, config: {
|
|
994
|
+
mode?: number; // 0:没有消毒 1:高温消毒 2:臭氧消毒 3:高温+臭氧
|
|
995
|
+
disinfectTime?: number; // 洗消时间(s)
|
|
996
|
+
targetTemp?: number; // 目标温度
|
|
997
|
+
targetOzone?: number; // 目标臭氧浓度
|
|
998
|
+
soaktime?: number; // 浸泡时间(s)
|
|
999
|
+
}) => {
|
|
1000
|
+
let axios = await this.context.ready;
|
|
1001
|
+
return axios.post(`/api/v2/disinfect/${deviceId}/params`, config).then((res) => {
|
|
1002
|
+
return res.data;
|
|
1003
|
+
});
|
|
1004
|
+
},
|
|
1005
|
+
get: async (deviceId: number) => {
|
|
1006
|
+
let axios = await this.context.ready;
|
|
1007
|
+
return axios.get(`/api/v2/disinfect/${deviceId}/params`).then((res) => {
|
|
1008
|
+
return res.data;
|
|
1009
|
+
});
|
|
1010
|
+
}
|
|
1002
1011
|
},
|
|
1003
|
-
history: async (deviceId: number, pageNum:number,pageSize:number) => {
|
|
1012
|
+
history: async (deviceId: number, pageNum: number, pageSize: number) => {
|
|
1004
1013
|
let axios = await this.context.ready;
|
|
1005
1014
|
return axios.get(`/api/v2/disinfect/${deviceId}`, { params: { pageNum, pageSize } }).then((res) => {
|
|
1006
1015
|
return res.data;
|
package/dist/device_gateway.js
CHANGED
|
@@ -757,11 +757,19 @@ class DeviceGateway extends Object {
|
|
|
757
757
|
var axios = await this.context.ready;
|
|
758
758
|
return axios.post(`/api/v2/disinfect/${deviceId}`, { action });
|
|
759
759
|
},
|
|
760
|
-
config:
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
return res
|
|
764
|
-
|
|
760
|
+
config: {
|
|
761
|
+
set: async (deviceId, config) => {
|
|
762
|
+
let axios = await this.context.ready;
|
|
763
|
+
return axios.post(`/api/v2/disinfect/${deviceId}/params`, config).then((res) => {
|
|
764
|
+
return res.data;
|
|
765
|
+
});
|
|
766
|
+
},
|
|
767
|
+
get: async (deviceId) => {
|
|
768
|
+
let axios = await this.context.ready;
|
|
769
|
+
return axios.get(`/api/v2/disinfect/${deviceId}/params`).then((res) => {
|
|
770
|
+
return res.data;
|
|
771
|
+
});
|
|
772
|
+
}
|
|
765
773
|
},
|
|
766
774
|
history: async (deviceId, pageNum, pageSize) => {
|
|
767
775
|
let axios = await this.context.ready;
|
package/dist/project_gateway.js
CHANGED
|
@@ -352,6 +352,16 @@ class ProjectGateway extends Object {
|
|
|
352
352
|
return axios.get(`/api/v2/coremde-sale/project/consignee/delete?id=${id}`);
|
|
353
353
|
});
|
|
354
354
|
},
|
|
355
|
+
/**
|
|
356
|
+
* 获取收货单位列表
|
|
357
|
+
* @param args 分页参数和项目ID
|
|
358
|
+
* @returns Promise
|
|
359
|
+
*/
|
|
360
|
+
list: (args) => {
|
|
361
|
+
return this.context.ready.then((axios) => {
|
|
362
|
+
return axios.post(`/api/v2/coremde-sale/project/consignee/list`, args);
|
|
363
|
+
});
|
|
364
|
+
},
|
|
355
365
|
};
|
|
356
366
|
}
|
|
357
367
|
get bom() {
|
package/package.json
CHANGED
package/project_gateway.ts
CHANGED
|
@@ -528,6 +528,20 @@ export class ProjectGateway extends Object {
|
|
|
528
528
|
return axios.get(`/api/v2/coremde-sale/project/consignee/delete?id=${id}`)
|
|
529
529
|
})
|
|
530
530
|
},
|
|
531
|
+
/**
|
|
532
|
+
* 获取收货单位列表
|
|
533
|
+
* @param args 分页参数和项目ID
|
|
534
|
+
* @returns Promise
|
|
535
|
+
*/
|
|
536
|
+
list: (args: {
|
|
537
|
+
pageNo: number
|
|
538
|
+
pageSize: number
|
|
539
|
+
projectId: number
|
|
540
|
+
}) => {
|
|
541
|
+
return this.context.ready.then((axios) => {
|
|
542
|
+
return axios.post(`/api/v2/coremde-sale/project/consignee/list`, args)
|
|
543
|
+
})
|
|
544
|
+
},
|
|
531
545
|
}
|
|
532
546
|
}
|
|
533
547
|
|
|
@@ -758,7 +772,7 @@ export class ProjectGateway extends Object {
|
|
|
758
772
|
get principal() {
|
|
759
773
|
return {
|
|
760
774
|
// 分配负责人
|
|
761
|
-
assign: (args: {id: number, principalId: number, principalName: string}) => {
|
|
775
|
+
assign: (args: { id: number, principalId: number, principalName: string }) => {
|
|
762
776
|
return this.context.ready.then((axios) => {
|
|
763
777
|
return axios.post(
|
|
764
778
|
`/api/v2/coremde-sale/project/principal/assign`,
|