@cpzxrobot/sdk 1.0.21 → 1.0.22
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 +8 -2
- package/dist/device_filter.js +7 -2
- package/package.json +1 -1
package/device_filter.ts
CHANGED
|
@@ -98,6 +98,12 @@ export abstract class DeviceFilter<T extends { id: number }> {
|
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
//获取设备数据,和getData相同作用,为统一接口进行了重命名
|
|
102
|
+
get data() {
|
|
103
|
+
return this.getData;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
//deprecated,请使用data进行调用
|
|
101
107
|
getData(
|
|
102
108
|
id: number,
|
|
103
109
|
args: DataQueryArgs = {
|
|
@@ -106,10 +112,10 @@ export abstract class DeviceFilter<T extends { id: number }> {
|
|
|
106
112
|
type: "diffPerDay", // diffPerDay, sumPerDay, latest
|
|
107
113
|
}
|
|
108
114
|
) {
|
|
109
|
-
if (args.stop
|
|
115
|
+
if (!args.stop) {
|
|
110
116
|
args.stop = this.formateDateToYYYYMMDD(new Date());
|
|
111
117
|
}
|
|
112
|
-
if (args.start
|
|
118
|
+
if (!args.start) {
|
|
113
119
|
const sevenDaysAgo = new Date();
|
|
114
120
|
sevenDaysAgo.setDate(sevenDaysAgo.getDate() - 7);
|
|
115
121
|
args.start = this.formateDateToYYYYMMDD(sevenDaysAgo);
|
package/dist/device_filter.js
CHANGED
|
@@ -81,15 +81,20 @@ class DeviceFilter {
|
|
|
81
81
|
});
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
+
//获取设备数据,和getData相同作用,为统一接口进行了重命名
|
|
85
|
+
get data() {
|
|
86
|
+
return this.getData;
|
|
87
|
+
}
|
|
88
|
+
//deprecated,请使用data进行调用
|
|
84
89
|
getData(id, args = {
|
|
85
90
|
start: "",
|
|
86
91
|
stop: "",
|
|
87
92
|
type: "diffPerDay", // diffPerDay, sumPerDay, latest
|
|
88
93
|
}) {
|
|
89
|
-
if (args.stop
|
|
94
|
+
if (!args.stop) {
|
|
90
95
|
args.stop = this.formateDateToYYYYMMDD(new Date());
|
|
91
96
|
}
|
|
92
|
-
if (args.start
|
|
97
|
+
if (!args.start) {
|
|
93
98
|
const sevenDaysAgo = new Date();
|
|
94
99
|
sevenDaysAgo.setDate(sevenDaysAgo.getDate() - 7);
|
|
95
100
|
args.start = this.formateDateToYYYYMMDD(sevenDaysAgo);
|