@cpzxrobot/sdk 1.3.100 → 1.3.101
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 +1 -8
- package/dist/device_gateway.js +1 -8
- package/package.json +1 -1
package/device_gateway.ts
CHANGED
|
@@ -310,14 +310,7 @@ export class DeviceGateway extends Object {
|
|
|
310
310
|
throw new Error('规则ID不能为空');
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
-
|
|
314
|
-
const requestData: ActiveAlarmRuleRequest = {
|
|
315
|
-
id: request.id,
|
|
316
|
-
factoryIds: request.factoryIds || [],
|
|
317
|
-
allActive: (request.factoryIds?.length || 0) > 0 ? false : request.allActive !== undefined ? request.allActive : true
|
|
318
|
-
};
|
|
319
|
-
|
|
320
|
-
return axios.post(`/api/v2/device/stat/alarms/rule/activate`, requestData).then((res) => {
|
|
313
|
+
return axios.post(`/api/v2/device/stat/alarms/rule/activate`, request).then((res) => {
|
|
321
314
|
if (res.data.code !== 200) {
|
|
322
315
|
throw new Error(res.data.message || '激活报警规则失败');
|
|
323
316
|
}
|
package/dist/device_gateway.js
CHANGED
|
@@ -231,19 +231,12 @@ class DeviceGateway extends Object {
|
|
|
231
231
|
* @returns Promise 包含激活结果
|
|
232
232
|
*/
|
|
233
233
|
activeAlarmRule: (request) => __awaiter(this, void 0, void 0, function* () {
|
|
234
|
-
var _a;
|
|
235
234
|
const axios = yield this.context.ready;
|
|
236
235
|
// 参数验证
|
|
237
236
|
if (!request.id) {
|
|
238
237
|
throw new Error('规则ID不能为空');
|
|
239
238
|
}
|
|
240
|
-
|
|
241
|
-
const requestData = {
|
|
242
|
-
id: request.id,
|
|
243
|
-
factoryIds: request.factoryIds || [],
|
|
244
|
-
allActive: (((_a = request.factoryIds) === null || _a === void 0 ? void 0 : _a.length) || 0) > 0 ? false : request.allActive !== undefined ? request.allActive : true
|
|
245
|
-
};
|
|
246
|
-
return axios.post(`/api/v2/device/stat/alarms/rule/activate`, requestData).then((res) => {
|
|
239
|
+
return axios.post(`/api/v2/device/stat/alarms/rule/activate`, request).then((res) => {
|
|
247
240
|
if (res.data.code !== 200) {
|
|
248
241
|
throw new Error(res.data.message || '激活报警规则失败');
|
|
249
242
|
}
|