@cpzxrobot/sdk 1.1.13 → 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/dist/device_gateway.js +1 -1
- package/dist/unit_gateway.js +15 -1
- package/package.json +1 -1
- package/readme.md +2 -1
- package/unit_gateway.ts +15 -2
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/unit_gateway.js
CHANGED
|
@@ -61,11 +61,25 @@ class UnitGateway extends Object {
|
|
|
61
61
|
bind: (unit, thresholdConfig) => {
|
|
62
62
|
return this.context.ready.then((axios) => {
|
|
63
63
|
return axios.post(`/api/v2/unit/threshold`, {
|
|
64
|
-
|
|
64
|
+
unitId: unit.id,
|
|
65
65
|
configId: thresholdConfig.id,
|
|
66
66
|
});
|
|
67
67
|
});
|
|
68
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
|
+
},
|
|
69
83
|
};
|
|
70
84
|
}
|
|
71
85
|
v2() {
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -134,7 +134,8 @@ baseURL: "/"
|
|
|
134
134
|
| cpzxrobot().unit.layout.get | 获取单元的展示布局 |
|
|
135
135
|
| cpzxrobot().unit.layout.post | 设置单元的展示布局 |
|
|
136
136
|
| cpzxrobot().unit.thresholdConfig.get | 获取单元的阈值配置信息 |
|
|
137
|
-
| cpzxrobot().unit.thresholdConfig.
|
|
137
|
+
| cpzxrobot().unit.thresholdConfig.bind | 设置单元的阈值配置信息 |
|
|
138
|
+
| cpzxrobot().unit.thresholdConfig.delete | 删除单元的阈值配置信息,传入get获取的条目的具体id或对象本身 |
|
|
138
139
|
| cpzxrobot().user.add | 添加用户 |
|
|
139
140
|
| cpzxrobot().user.update | 更新用户 |
|
|
140
141
|
| cpzxrobot().user.list | 列出用户(传入工厂) |
|
package/unit_gateway.ts
CHANGED
|
@@ -78,10 +78,23 @@ export class UnitGateway extends Object {
|
|
|
78
78
|
bind: (unit: Unit, thresholdConfig: any) => {
|
|
79
79
|
return this.context.ready.then((axios) => {
|
|
80
80
|
return axios.post(`/api/v2/unit/threshold`, {
|
|
81
|
-
|
|
81
|
+
unitId: unit.id,
|
|
82
82
|
configId: thresholdConfig.id,
|
|
83
83
|
});
|
|
84
|
-
});
|
|
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
|
+
});
|
|
85
98
|
},
|
|
86
99
|
};
|
|
87
100
|
}
|