@cpzxrobot/sdk 1.3.45 → 1.3.47
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 +2 -2
- package/dist/device_gateway.js +2 -2
- package/dist/project_gateway.js +34 -0
- package/dist/user_gateway.js +8 -0
- package/package.json +1 -1
- package/project_gateway.ts +47 -0
- package/user_gateway.ts +10 -2
package/device_gateway.ts
CHANGED
|
@@ -985,9 +985,9 @@ export class DeviceGateway extends Object {
|
|
|
985
985
|
var axios = await this.context.ready;
|
|
986
986
|
return axios.post(`/api/v2/disinfect/${deviceId}`, { door, open })
|
|
987
987
|
},
|
|
988
|
-
|
|
988
|
+
action: async (deviceId: number,action: "start"|"end") => {
|
|
989
989
|
var axios = await this.context.ready;
|
|
990
|
-
return axios.post(`/api/v2/disinfect/${deviceId}`, {
|
|
990
|
+
return axios.post(`/api/v2/disinfect/${deviceId}`, { action })
|
|
991
991
|
},
|
|
992
992
|
config: async (deviceId: number, config: {
|
|
993
993
|
mode?: number; // 0:没有消毒 1:高温消毒 2:臭氧消毒 3:高温+臭氧
|
package/dist/device_gateway.js
CHANGED
|
@@ -753,9 +753,9 @@ class DeviceGateway extends Object {
|
|
|
753
753
|
var axios = await this.context.ready;
|
|
754
754
|
return axios.post(`/api/v2/disinfect/${deviceId}`, { door, open });
|
|
755
755
|
},
|
|
756
|
-
|
|
756
|
+
action: async (deviceId, action) => {
|
|
757
757
|
var axios = await this.context.ready;
|
|
758
|
-
return axios.post(`/api/v2/disinfect/${deviceId}`, {
|
|
758
|
+
return axios.post(`/api/v2/disinfect/${deviceId}`, { action });
|
|
759
759
|
},
|
|
760
760
|
config: async (deviceId, config) => {
|
|
761
761
|
let axios = await this.context.ready;
|
package/dist/project_gateway.js
CHANGED
|
@@ -320,6 +320,40 @@ class ProjectGateway extends Object {
|
|
|
320
320
|
},
|
|
321
321
|
};
|
|
322
322
|
}
|
|
323
|
+
get consignee() {
|
|
324
|
+
return {
|
|
325
|
+
/**
|
|
326
|
+
* 新增收货单位
|
|
327
|
+
* @param args 收货单位参数
|
|
328
|
+
* @returns Promise
|
|
329
|
+
*/
|
|
330
|
+
add: (args) => {
|
|
331
|
+
return this.context.ready.then((axios) => {
|
|
332
|
+
return axios.post(`/api/v2/coremde-sale/project/consignee/add`, args);
|
|
333
|
+
});
|
|
334
|
+
},
|
|
335
|
+
/**
|
|
336
|
+
* 修改收货单位
|
|
337
|
+
* @param args 收货单位参数
|
|
338
|
+
* @returns Promise
|
|
339
|
+
*/
|
|
340
|
+
update: (args) => {
|
|
341
|
+
return this.context.ready.then((axios) => {
|
|
342
|
+
return axios.post(`/api/v2/coremde-sale/project/consignee/update`, args);
|
|
343
|
+
});
|
|
344
|
+
},
|
|
345
|
+
/**
|
|
346
|
+
* 删除收货单位
|
|
347
|
+
* @param id 收货单位ID
|
|
348
|
+
* @returns Promise
|
|
349
|
+
*/
|
|
350
|
+
delete: (id) => {
|
|
351
|
+
return this.context.ready.then((axios) => {
|
|
352
|
+
return axios.get(`/api/v2/coremde-sale/project/consignee/delete?id=${id}`);
|
|
353
|
+
});
|
|
354
|
+
},
|
|
355
|
+
};
|
|
356
|
+
}
|
|
323
357
|
get bom() {
|
|
324
358
|
return {
|
|
325
359
|
/**
|
package/dist/user_gateway.js
CHANGED
|
@@ -328,6 +328,14 @@ class UserGateway extends Object {
|
|
|
328
328
|
return axios.post('/api/v2/coremde-sale/task/create', params);
|
|
329
329
|
});
|
|
330
330
|
},
|
|
331
|
+
flows: async (taskId) => {
|
|
332
|
+
var axios = await this.context.ready;
|
|
333
|
+
return axios.get(`/api/v2/coremde-sale/task/flow/list`, {
|
|
334
|
+
params: {
|
|
335
|
+
id: taskId,
|
|
336
|
+
},
|
|
337
|
+
});
|
|
338
|
+
},
|
|
331
339
|
};
|
|
332
340
|
}
|
|
333
341
|
get position() {
|
package/package.json
CHANGED
package/project_gateway.ts
CHANGED
|
@@ -484,6 +484,53 @@ export class ProjectGateway extends Object {
|
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
486
|
|
|
487
|
+
get consignee() {
|
|
488
|
+
return {
|
|
489
|
+
/**
|
|
490
|
+
* 新增收货单位
|
|
491
|
+
* @param args 收货单位参数
|
|
492
|
+
* @returns Promise
|
|
493
|
+
*/
|
|
494
|
+
add: (args: {
|
|
495
|
+
name: string
|
|
496
|
+
contactPeople: string
|
|
497
|
+
contactPhone: string
|
|
498
|
+
contactAddress: string
|
|
499
|
+
projectId: number
|
|
500
|
+
}) => {
|
|
501
|
+
return this.context.ready.then((axios) => {
|
|
502
|
+
return axios.post(`/api/v2/coremde-sale/project/consignee/add`, args)
|
|
503
|
+
})
|
|
504
|
+
},
|
|
505
|
+
/**
|
|
506
|
+
* 修改收货单位
|
|
507
|
+
* @param args 收货单位参数
|
|
508
|
+
* @returns Promise
|
|
509
|
+
*/
|
|
510
|
+
update: (args: {
|
|
511
|
+
id: number
|
|
512
|
+
name: string
|
|
513
|
+
contactPeople: string
|
|
514
|
+
contactPhone: string
|
|
515
|
+
contactAddress: string
|
|
516
|
+
}) => {
|
|
517
|
+
return this.context.ready.then((axios) => {
|
|
518
|
+
return axios.post(`/api/v2/coremde-sale/project/consignee/update`, args)
|
|
519
|
+
})
|
|
520
|
+
},
|
|
521
|
+
/**
|
|
522
|
+
* 删除收货单位
|
|
523
|
+
* @param id 收货单位ID
|
|
524
|
+
* @returns Promise
|
|
525
|
+
*/
|
|
526
|
+
delete: (id: number) => {
|
|
527
|
+
return this.context.ready.then((axios) => {
|
|
528
|
+
return axios.get(`/api/v2/coremde-sale/project/consignee/delete?id=${id}`)
|
|
529
|
+
})
|
|
530
|
+
},
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
|
|
487
534
|
get bom() {
|
|
488
535
|
return {
|
|
489
536
|
/**
|
package/user_gateway.ts
CHANGED
|
@@ -52,7 +52,7 @@ export class UserGateway extends Object {
|
|
|
52
52
|
})
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
async list(factory: Factory | number| undefined = undefined) {
|
|
55
|
+
async list(factory: Factory | number | undefined = undefined) {
|
|
56
56
|
var factoryId = 0
|
|
57
57
|
if (factory) {
|
|
58
58
|
if (typeof factory === 'number') {
|
|
@@ -60,7 +60,7 @@ export class UserGateway extends Object {
|
|
|
60
60
|
} else {
|
|
61
61
|
factoryId = factory.id as number
|
|
62
62
|
}
|
|
63
|
-
}else{
|
|
63
|
+
} else {
|
|
64
64
|
var selectedFarm = await this.context.user.getSelectedFarm()
|
|
65
65
|
factoryId = selectedFarm.id
|
|
66
66
|
}
|
|
@@ -402,6 +402,14 @@ export class UserGateway extends Object {
|
|
|
402
402
|
return axios.post('/api/v2/coremde-sale/task/create', params)
|
|
403
403
|
})
|
|
404
404
|
},
|
|
405
|
+
flows: async (taskId: number) => {
|
|
406
|
+
var axios = await this.context.ready
|
|
407
|
+
return axios.get(`/api/v2/coremde-sale/task/flow/list`, {
|
|
408
|
+
params: {
|
|
409
|
+
id: taskId,
|
|
410
|
+
},
|
|
411
|
+
})
|
|
412
|
+
},
|
|
405
413
|
}
|
|
406
414
|
}
|
|
407
415
|
|