@cpzxrobot/sdk 1.1.12 → 1.1.14
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 +1 -1
- package/device_gateway.ts +1 -1
- package/dist/device_gateway.js +1 -1
- package/dist/factory_gateway.js +1 -1
- package/dist/unit_gateway.js +33 -0
- package/factory_gateway.ts +1 -1
- package/package.json +1 -1
- package/readme.md +3 -0
- package/unit_gateway.ts +33 -0
package/car_gateway.ts
CHANGED
package/device_gateway.ts
CHANGED
package/dist/device_gateway.js
CHANGED
|
@@ -44,7 +44,7 @@ class DeviceGateway extends Object {
|
|
|
44
44
|
let axios = await this.context.ready;
|
|
45
45
|
return axios.get(`/api/v2/threshold/config`, {
|
|
46
46
|
params: {
|
|
47
|
-
factoryType: factory === null || factory === void 0 ? void 0 : factory.
|
|
47
|
+
factoryType: factory === null || factory === void 0 ? void 0 : factory.id
|
|
48
48
|
},
|
|
49
49
|
});
|
|
50
50
|
},
|
package/dist/factory_gateway.js
CHANGED
|
@@ -42,7 +42,7 @@ class FactoryGateway extends Object {
|
|
|
42
42
|
var axios = await this.context.ready;
|
|
43
43
|
return axios.post("/api/v2/factory/role", data);
|
|
44
44
|
}
|
|
45
|
-
async deleteRole(
|
|
45
|
+
async deleteRole(roleId) {
|
|
46
46
|
var axios = await this.context.ready;
|
|
47
47
|
return axios.post("/api/v2/factory/role/delete?id=" + roleId);
|
|
48
48
|
}
|
package/dist/unit_gateway.js
CHANGED
|
@@ -49,6 +49,39 @@ class UnitGateway extends Object {
|
|
|
49
49
|
},
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
+
get thresholdConfig() {
|
|
53
|
+
return {
|
|
54
|
+
//获取阈值配置
|
|
55
|
+
get: (unit) => {
|
|
56
|
+
return this.context.ready.then((axios) => {
|
|
57
|
+
return axios.get(`/api/v2/unit/${unit.id}/threshold`);
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
//绑定阈值配置
|
|
61
|
+
bind: (unit, thresholdConfig) => {
|
|
62
|
+
return this.context.ready.then((axios) => {
|
|
63
|
+
return axios.post(`/api/v2/unit/threshold`, {
|
|
64
|
+
unitId: unit.id,
|
|
65
|
+
configId: thresholdConfig.id,
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
delete: (bind) => {
|
|
70
|
+
var bindId;
|
|
71
|
+
//if bind is string;
|
|
72
|
+
if (typeof bind === "string") {
|
|
73
|
+
bindId = bind;
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
//if bind is object
|
|
77
|
+
bindId = bind.id;
|
|
78
|
+
}
|
|
79
|
+
return this.context.ready.then((axios) => {
|
|
80
|
+
return axios.post(`/api/v2/unit/threshold/delete?id=` + bindId);
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
}
|
|
52
85
|
v2() {
|
|
53
86
|
return {
|
|
54
87
|
//新增时必传factoryId, 当上层是workshop时,需要传workshopId
|
package/factory_gateway.ts
CHANGED
|
@@ -50,7 +50,7 @@ export class FactoryGateway extends Object {
|
|
|
50
50
|
return axios.post("/api/v2/factory/role", data);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
async deleteRole(
|
|
53
|
+
async deleteRole( roleId: number) {
|
|
54
54
|
var axios = await this.context.ready;
|
|
55
55
|
return axios.post("/api/v2/factory/role/delete?id=" + roleId);
|
|
56
56
|
}
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -133,6 +133,9 @@ baseURL: "/"
|
|
|
133
133
|
| cpzxrobot().unit.v2.delete | 删除单元,v2版本 |
|
|
134
134
|
| cpzxrobot().unit.layout.get | 获取单元的展示布局 |
|
|
135
135
|
| cpzxrobot().unit.layout.post | 设置单元的展示布局 |
|
|
136
|
+
| cpzxrobot().unit.thresholdConfig.get | 获取单元的阈值配置信息 |
|
|
137
|
+
| cpzxrobot().unit.thresholdConfig.bind | 设置单元的阈值配置信息 |
|
|
138
|
+
| cpzxrobot().unit.thresholdConfig.delete | 删除单元的阈值配置信息,传入get获取的条目的具体id或对象本身 |
|
|
136
139
|
| cpzxrobot().user.add | 添加用户 |
|
|
137
140
|
| cpzxrobot().user.update | 更新用户 |
|
|
138
141
|
| cpzxrobot().user.list | 列出用户(传入工厂) |
|
package/unit_gateway.ts
CHANGED
|
@@ -66,6 +66,39 @@ export class UnitGateway extends Object {
|
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
get thresholdConfig() {
|
|
70
|
+
return {
|
|
71
|
+
//获取阈值配置
|
|
72
|
+
get: (unit: Unit) => {
|
|
73
|
+
return this.context.ready.then((axios) => {
|
|
74
|
+
return axios.get(`/api/v2/unit/${unit.id}/threshold`);
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
//绑定阈值配置
|
|
78
|
+
bind: (unit: Unit, thresholdConfig: any) => {
|
|
79
|
+
return this.context.ready.then((axios) => {
|
|
80
|
+
return axios.post(`/api/v2/unit/threshold`, {
|
|
81
|
+
unitId: unit.id,
|
|
82
|
+
configId: thresholdConfig.id,
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
},
|
|
86
|
+
delete: (bind: any) => {
|
|
87
|
+
var bindId: string;
|
|
88
|
+
//if bind is string;
|
|
89
|
+
if (typeof bind === "string") {
|
|
90
|
+
bindId = bind;
|
|
91
|
+
} else {
|
|
92
|
+
//if bind is object
|
|
93
|
+
bindId = bind.id;
|
|
94
|
+
}
|
|
95
|
+
return this.context.ready.then((axios) => {
|
|
96
|
+
return axios.post(`/api/v2/unit/threshold/delete?id=` + bindId);
|
|
97
|
+
});
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
69
102
|
v2() {
|
|
70
103
|
return {
|
|
71
104
|
//新增时必传factoryId, 当上层是workshop时,需要传workshopId
|