@cpzxrobot/sdk 1.0.40 → 1.0.42

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_filter.ts CHANGED
@@ -99,6 +99,9 @@ export abstract class DeviceFilter<T extends { id: number }> {
99
99
  }
100
100
 
101
101
  //获取设备数据,和getData相同作用,为统一接口进行了重命名
102
+ // diffPerDay: 每天差值, 注意这个只是差值,不是开始值和结束值
103
+ // last: 每个周期最新, 如果需要获得每天的最新数据,需要设置start和stop,然后设置period为1d,这样可以获得每天的最后数据
104
+ // 如果需要查询18点到18点的数据,需要设置offset为18h
102
105
  get data() {
103
106
  return this.getData;
104
107
  }
@@ -281,6 +284,7 @@ export abstract class DeviceFilter<T extends { id: number }> {
281
284
  | "latest"
282
285
  | "weekoverweek"
283
286
  | "last"
287
+ | "rangeOfDay"
284
288
  | "rangeToday"
285
289
  | null; //如果data为null,则不获取数据,只获取设备列表,否则获取设备列表和数据
286
290
  status?: string;
@@ -313,6 +317,7 @@ export abstract class DeviceFilter<T extends { id: number }> {
313
317
  unit: options?.unit,
314
318
  data: options?.data,
315
319
  status: options?.status,
320
+ supplier: options?.supplier,
316
321
  },
317
322
  });
318
323
  })
@@ -82,6 +82,9 @@ class DeviceFilter {
82
82
  });
83
83
  }
84
84
  //获取设备数据,和getData相同作用,为统一接口进行了重命名
85
+ // diffPerDay: 每天差值, 注意这个只是差值,不是开始值和结束值
86
+ // last: 每个周期最新, 如果需要获得每天的最新数据,需要设置start和stop,然后设置period为1d,这样可以获得每天的最后数据
87
+ // 如果需要查询18点到18点的数据,需要设置offset为18h
85
88
  get data() {
86
89
  return this.getData;
87
90
  }
@@ -253,6 +256,7 @@ class DeviceFilter {
253
256
  unit: options === null || options === void 0 ? void 0 : options.unit,
254
257
  data: options === null || options === void 0 ? void 0 : options.data,
255
258
  status: options === null || options === void 0 ? void 0 : options.status,
259
+ supplier: options === null || options === void 0 ? void 0 : options.supplier,
256
260
  },
257
261
  });
258
262
  })
package/dist/index.js CHANGED
@@ -249,6 +249,7 @@ class Cpzxrobot {
249
249
  return;
250
250
  }
251
251
  this.token = "Bearer " + res.data.token;
252
+ localStorage.setItem("token", this.token);
252
253
  this.resolveReady(this.axios);
253
254
  });
254
255
  return;
package/index.ts CHANGED
@@ -283,6 +283,7 @@ export class Cpzxrobot {
283
283
  return;
284
284
  }
285
285
  this.token = "Bearer " + res.data.token;
286
+ localStorage.setItem("token", this.token);
286
287
  this.resolveReady(this.axios);
287
288
  });
288
289
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.0.40",
3
+ "version": "1.0.42",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/types.d.ts CHANGED
@@ -151,11 +151,14 @@ export interface DataQueryArgs {
151
151
  type?:
152
152
  | "diffPerDay"
153
153
  | "sumPerDay"
154
+ | "rangeOfDay"
155
+ | "rangeToday"
154
156
  | "latest"
155
157
  | "latestInRangePerDay"
156
158
  | "last"
157
159
  | "difference";
158
160
  period?: "1mo" | "1d" | null;
161
+ offset?: string; // 可以设置统计偏移量,比如设置18h, 则统计从当天晚上6点开始
159
162
  [key: string]: any;
160
163
  }
161
164