@cpzxrobot/sdk 1.3.74 → 1.3.75

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 CHANGED
@@ -993,14 +993,14 @@ export class DeviceGateway extends Object {
993
993
  */
994
994
  async getAlarmStats(factoryId: number | undefined = undefined): Promise<DeviceAlarmStatsResponse> {
995
995
  const axios = await this.context.ready;
996
-
996
+ var _factoryId = factoryId || 0;
997
997
  if (!factoryId) {
998
- const farm = await this.context.user.getSelectedFarm();
999
- factoryId = farm?.id || 0;
998
+ const farm = await this.context.user.getSelectedFarm();
999
+ _factoryId = farm?.id || 0;
1000
1000
  }
1001
1001
 
1002
1002
  return axios.get(`/api/v2/device/stat/alarms`, {
1003
- params: { factoryId }
1003
+ params: { factoryId: _factoryId }
1004
1004
  }).then((res) => {
1005
1005
  if (res.data.code !== 200) {
1006
1006
  throw new Error(res.data.message || '获取设备告警统计信息失败');
@@ -788,12 +788,13 @@ class DeviceGateway extends Object {
788
788
  getAlarmStats() {
789
789
  return __awaiter(this, arguments, void 0, function* (factoryId = undefined) {
790
790
  const axios = yield this.context.ready;
791
+ var _factoryId = factoryId || 0;
791
792
  if (!factoryId) {
792
793
  const farm = yield this.context.user.getSelectedFarm();
793
- factoryId = (farm === null || farm === void 0 ? void 0 : farm.id) || 0;
794
+ _factoryId = (farm === null || farm === void 0 ? void 0 : farm.id) || 0;
794
795
  }
795
796
  return axios.get(`/api/v2/device/stat/alarms`, {
796
- params: { factoryId }
797
+ params: { factoryId: _factoryId }
797
798
  }).then((res) => {
798
799
  if (res.data.code !== 200) {
799
800
  throw new Error(res.data.message || '获取设备告警统计信息失败');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.3.74",
3
+ "version": "1.3.75",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -1,4 +1,4 @@
1
- import { Cpzxrobot, Production } from ".";
1
+ import { Cpzxrobot, type Production } from ".";
2
2
 
3
3
  // 产量统计网关,管理工厂产量数据
4
4
  export class ProductionGateway extends Object {