nayota-show-sdk 1.3.32 → 1.3.34
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/api/energyCalculation.js +33 -48
- package/api/energyConsumption.js +32 -32
- package/package.json +1 -1
package/api/energyCalculation.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { requestShow } from
|
|
1
|
+
import { requestShow } from '../utils'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @file 能耗计算关联表api
|
|
@@ -10,29 +10,24 @@ import { requestShow } from "../utils";
|
|
|
10
10
|
* @typedef {Object} energyCalculation - 能耗计算关联
|
|
11
11
|
* @property {string} _id - 关联记录id
|
|
12
12
|
* @property {string} deviceId - 设备ID,关联到设备表
|
|
13
|
-
* @property {string}
|
|
14
|
-
* @property {string}
|
|
15
|
-
* @property {string} flowCalculationNodeId - 流量表计算节点id
|
|
16
|
-
* @property {string} flowMeterId - 关联的流量表ID,关联到流量表设备
|
|
13
|
+
* @property {Array<string>} electricityMeterIds - 关联的多电表ID,关联到电表设备
|
|
14
|
+
* @property {Array<string>} flowMeterIds - 关联的多流量表ID,关联到流量表设备
|
|
17
15
|
* @property {boolean} isActive - 是否启用
|
|
18
16
|
* @property {string} description - 关联描述
|
|
19
|
-
* @property {number} power - 功率
|
|
20
17
|
* @property {string} creator - 创建者
|
|
21
18
|
* @property {Date} createdAt - 创建时间
|
|
22
19
|
* @property {Date} updatedAt - 更新时间
|
|
23
20
|
* @example
|
|
24
21
|
* {
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* "createdAt": "2024-01-15T10:30:00.000Z",
|
|
35
|
-
* "updatedAt": "2024-01-15T10:30:00.000Z"
|
|
22
|
+
* '_id': '667d2efa52d21700095b58d5',
|
|
23
|
+
* 'deviceId': '667d2ee28aaf514ab9bcbca5',
|
|
24
|
+
* 'electricityMeterIds': ['667d2ee28aaf514ab9bcbca6'],
|
|
25
|
+
* 'flowMeterIds': ['667d2ee28aaf514ab9bcbca9'],
|
|
26
|
+
* 'isActive': true,
|
|
27
|
+
* 'description': '设备与电表、流量表的关联配置',
|
|
28
|
+
* 'creator': '6678e31ff340dfdecd9e1a28',
|
|
29
|
+
* 'createdAt': '2024-01-15T10:30:00.000Z',
|
|
30
|
+
* 'updatedAt': '2024-01-15T10:30:00.000Z'
|
|
36
31
|
* }
|
|
37
32
|
*/
|
|
38
33
|
|
|
@@ -40,20 +35,15 @@ import { requestShow } from "../utils";
|
|
|
40
35
|
* 创建能耗计算关联
|
|
41
36
|
* @param {Object} data - 能耗计算关联数据
|
|
42
37
|
* @param {string} data.deviceId - 设备ID
|
|
43
|
-
* @param {string} [data.electricityMeterId] - 电表ID
|
|
44
|
-
* @param {string} [data.electricityCalculationNodeId] - 电表计算节点ID
|
|
45
|
-
* @param {string} [data.flowCalculationNodeId] - 流量表计算节点ID
|
|
46
|
-
* @param {string} [data.flowMeterId] - 流量表ID
|
|
47
|
-
* @param {boolean} [data.isActive=true] - 是否启用
|
|
48
38
|
* @param {string} [data.description] - 关联描述
|
|
49
39
|
* @returns {Promise<Object>} 创建的能耗计算关联记录
|
|
50
40
|
*/
|
|
51
41
|
export function create(data) {
|
|
52
42
|
return requestShow({
|
|
53
|
-
url:
|
|
54
|
-
method:
|
|
55
|
-
data
|
|
56
|
-
})
|
|
43
|
+
url: '/energy-calculations',
|
|
44
|
+
method: 'post',
|
|
45
|
+
data
|
|
46
|
+
})
|
|
57
47
|
}
|
|
58
48
|
|
|
59
49
|
/**
|
|
@@ -62,19 +52,14 @@ export function create(data) {
|
|
|
62
52
|
* @param {number} [params.page=1] - 页码
|
|
63
53
|
* @param {number} [params.limit=50] - 每页数量
|
|
64
54
|
* @param {string} [params.deviceId] - 设备ID筛选
|
|
65
|
-
* @param {string} [params.electricityMeterId] - 电表ID筛选
|
|
66
|
-
* @param {string} [params.flowMeterId] - 流量表ID筛选
|
|
67
|
-
* @param {boolean} [params.isActive] - 是否启用筛选
|
|
68
|
-
* @param {string} [params.sortBy] - 排序字段
|
|
69
|
-
* @param {string} [params.sortOrder='desc'] - 排序方向,asc或desc
|
|
70
55
|
* @returns {Promise<Object>} 能耗计算关联列表
|
|
71
56
|
*/
|
|
72
57
|
export function list(params) {
|
|
73
58
|
return requestShow({
|
|
74
|
-
url:
|
|
75
|
-
method:
|
|
76
|
-
params
|
|
77
|
-
})
|
|
59
|
+
url: '/energy-calculations',
|
|
60
|
+
method: 'get',
|
|
61
|
+
params
|
|
62
|
+
})
|
|
78
63
|
}
|
|
79
64
|
|
|
80
65
|
/**
|
|
@@ -85,8 +70,8 @@ export function list(params) {
|
|
|
85
70
|
export function getOne(id) {
|
|
86
71
|
return requestShow({
|
|
87
72
|
url: `/energy-calculations/${id}`,
|
|
88
|
-
method:
|
|
89
|
-
})
|
|
73
|
+
method: 'get'
|
|
74
|
+
})
|
|
90
75
|
}
|
|
91
76
|
|
|
92
77
|
/**
|
|
@@ -103,9 +88,9 @@ export function getOne(id) {
|
|
|
103
88
|
export function updateOne(data) {
|
|
104
89
|
return requestShow({
|
|
105
90
|
url: `/energy-calculations/${data._id}`,
|
|
106
|
-
method:
|
|
107
|
-
data
|
|
108
|
-
})
|
|
91
|
+
method: 'put',
|
|
92
|
+
data
|
|
93
|
+
})
|
|
109
94
|
}
|
|
110
95
|
|
|
111
96
|
/**
|
|
@@ -116,8 +101,8 @@ export function updateOne(data) {
|
|
|
116
101
|
export function deleteOne(id) {
|
|
117
102
|
return requestShow({
|
|
118
103
|
url: `/energy-calculations/${id}`,
|
|
119
|
-
method:
|
|
120
|
-
})
|
|
104
|
+
method: 'delete'
|
|
105
|
+
})
|
|
121
106
|
}
|
|
122
107
|
|
|
123
108
|
/**
|
|
@@ -127,10 +112,10 @@ export function deleteOne(id) {
|
|
|
127
112
|
*/
|
|
128
113
|
export function deleteMany(ids) {
|
|
129
114
|
return requestShow({
|
|
130
|
-
url:
|
|
131
|
-
method:
|
|
132
|
-
data: ids
|
|
133
|
-
})
|
|
115
|
+
url: '/energy-calculations',
|
|
116
|
+
method: 'delete',
|
|
117
|
+
data: ids
|
|
118
|
+
})
|
|
134
119
|
}
|
|
135
120
|
|
|
136
121
|
export default {
|
|
@@ -139,5 +124,5 @@ export default {
|
|
|
139
124
|
getOne,
|
|
140
125
|
updateOne,
|
|
141
126
|
deleteOne,
|
|
142
|
-
deleteMany
|
|
143
|
-
}
|
|
127
|
+
deleteMany
|
|
128
|
+
}
|
package/api/energyConsumption.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { requestShow } from
|
|
1
|
+
import { requestShow } from '../utils'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @file 能源消耗表api
|
|
@@ -20,16 +20,16 @@ import { requestShow } from "../utils";
|
|
|
20
20
|
* @property {Date} updatedAt - 更新时间
|
|
21
21
|
* @example
|
|
22
22
|
* {
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
23
|
+
* '_id': '667d2efa52d21700095b58d5',
|
|
24
|
+
* 'deviceId': '667d2ee28aaf514ab9bcbca5',
|
|
25
|
+
* 'electricityConsumption': 150.5,
|
|
26
|
+
* 'heatConsumption': 80.2,
|
|
27
|
+
* 'coolingConsumption': 120.8,
|
|
28
|
+
* 'runningDuration': 24.5,
|
|
29
|
+
* 'recordDate': '2024-01-15T00:00:00.000Z',
|
|
30
|
+
* 'creator': '6678e31ff340dfdecd9e1a28',
|
|
31
|
+
* 'createdAt': '2024-01-15T10:30:00.000Z',
|
|
32
|
+
* 'updatedAt': '2024-01-15T10:30:00.000Z'
|
|
33
33
|
* }
|
|
34
34
|
*/
|
|
35
35
|
|
|
@@ -46,10 +46,10 @@ import { requestShow } from "../utils";
|
|
|
46
46
|
*/
|
|
47
47
|
export function create(data) {
|
|
48
48
|
return requestShow({
|
|
49
|
-
url:
|
|
50
|
-
method:
|
|
51
|
-
data
|
|
52
|
-
})
|
|
49
|
+
url: '/energy-consumptions',
|
|
50
|
+
method: 'post',
|
|
51
|
+
data
|
|
52
|
+
})
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
/**
|
|
@@ -72,10 +72,10 @@ export function create(data) {
|
|
|
72
72
|
*/
|
|
73
73
|
export function list(params) {
|
|
74
74
|
return requestShow({
|
|
75
|
-
url:
|
|
76
|
-
method:
|
|
77
|
-
params
|
|
78
|
-
})
|
|
75
|
+
url: '/energy-consumptions',
|
|
76
|
+
method: 'get',
|
|
77
|
+
params
|
|
78
|
+
})
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
/**
|
|
@@ -86,8 +86,8 @@ export function list(params) {
|
|
|
86
86
|
export function getOne(id) {
|
|
87
87
|
return requestShow({
|
|
88
88
|
url: `/energy-consumptions/${id}`,
|
|
89
|
-
method:
|
|
90
|
-
})
|
|
89
|
+
method: 'get'
|
|
90
|
+
})
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
/**
|
|
@@ -105,9 +105,9 @@ export function getOne(id) {
|
|
|
105
105
|
export function updateOne(data) {
|
|
106
106
|
return requestShow({
|
|
107
107
|
url: `/energy-consumptions/${data._id}`,
|
|
108
|
-
method:
|
|
109
|
-
data
|
|
110
|
-
})
|
|
108
|
+
method: 'put',
|
|
109
|
+
data
|
|
110
|
+
})
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
/**
|
|
@@ -118,8 +118,8 @@ export function updateOne(data) {
|
|
|
118
118
|
export function deleteOne(id) {
|
|
119
119
|
return requestShow({
|
|
120
120
|
url: `/energy-consumptions/${id}`,
|
|
121
|
-
method:
|
|
122
|
-
})
|
|
121
|
+
method: 'delete'
|
|
122
|
+
})
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
/**
|
|
@@ -129,10 +129,10 @@ export function deleteOne(id) {
|
|
|
129
129
|
*/
|
|
130
130
|
export function deleteMany(ids) {
|
|
131
131
|
return requestShow({
|
|
132
|
-
url:
|
|
133
|
-
method:
|
|
134
|
-
data: ids
|
|
135
|
-
})
|
|
132
|
+
url: '/energy-consumptions',
|
|
133
|
+
method: 'delete',
|
|
134
|
+
data: ids
|
|
135
|
+
})
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
export default {
|
|
@@ -141,5 +141,5 @@ export default {
|
|
|
141
141
|
getOne,
|
|
142
142
|
updateOne,
|
|
143
143
|
deleteOne,
|
|
144
|
-
deleteMany
|
|
145
|
-
}
|
|
144
|
+
deleteMany
|
|
145
|
+
}
|