nayota-show-sdk 1.3.26 → 1.3.28
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/devices.js +1 -0
- package/api/energyCalculation.js +144 -0
- package/index.js +44 -42
- package/package.json +1 -1
package/api/devices.js
CHANGED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { requestShow } from "../utils";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file 能耗计算关联表api
|
|
5
|
+
* @module 能耗计算关联表接口
|
|
6
|
+
* @category 能耗管理
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {Object} energyCalculation - 能耗计算关联
|
|
11
|
+
* @property {string} _id - 关联记录id
|
|
12
|
+
* @property {string} deviceId - 设备ID,关联到设备表
|
|
13
|
+
* @property {string} electricityMeterId - 关联的电表ID,关联到电表设备
|
|
14
|
+
* @property {string} electricityCalculationNodeId - 电表计算节点id
|
|
15
|
+
* @property {string} flowCalculationNodeId - 流量表计算节点id
|
|
16
|
+
* @property {string} flowMeterId - 关联的流量表ID,关联到流量表设备
|
|
17
|
+
* @property {boolean} isActive - 是否启用
|
|
18
|
+
* @property {string} description - 关联描述
|
|
19
|
+
* @property {string} creator - 创建者
|
|
20
|
+
* @property {Date} createdAt - 创建时间
|
|
21
|
+
* @property {Date} updatedAt - 更新时间
|
|
22
|
+
* @example
|
|
23
|
+
* {
|
|
24
|
+
* "_id": "667d2efa52d21700095b58d5",
|
|
25
|
+
* "deviceId": "667d2ee28aaf514ab9bcbca5",
|
|
26
|
+
* "electricityMeterId": "667d2ee28aaf514ab9bcbca6",
|
|
27
|
+
* "electricityCalculationNodeId": "667d2ee28aaf514ab9bcbca7",
|
|
28
|
+
* "flowCalculationNodeId": "667d2ee28aaf514ab9bcbca8",
|
|
29
|
+
* "flowMeterId": "667d2ee28aaf514ab9bcbca9",
|
|
30
|
+
* "isActive": true,
|
|
31
|
+
* "description": "设备与电表、流量表的关联配置",
|
|
32
|
+
* "creator": "6678e31ff340dfdecd9e1a28",
|
|
33
|
+
* "createdAt": "2024-01-15T10:30:00.000Z",
|
|
34
|
+
* "updatedAt": "2024-01-15T10:30:00.000Z"
|
|
35
|
+
* }
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* 创建能耗计算关联
|
|
40
|
+
* @param {Object} data - 能耗计算关联数据
|
|
41
|
+
* @param {string} data.deviceId - 设备ID
|
|
42
|
+
* @param {string} [data.electricityMeterId] - 电表ID
|
|
43
|
+
* @param {string} [data.electricityCalculationNodeId] - 电表计算节点ID
|
|
44
|
+
* @param {string} [data.flowCalculationNodeId] - 流量表计算节点ID
|
|
45
|
+
* @param {string} [data.flowMeterId] - 流量表ID
|
|
46
|
+
* @param {boolean} [data.isActive=true] - 是否启用
|
|
47
|
+
* @param {string} [data.description] - 关联描述
|
|
48
|
+
* @returns {Promise<Object>} 创建的能耗计算关联记录
|
|
49
|
+
*/
|
|
50
|
+
export function create(data) {
|
|
51
|
+
return requestShow({
|
|
52
|
+
url: "/energy-calculations",
|
|
53
|
+
method: "post",
|
|
54
|
+
data,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* 获取能耗计算关联列表
|
|
60
|
+
* @param {Object} [params] - 查询参数
|
|
61
|
+
* @param {number} [params.page=1] - 页码
|
|
62
|
+
* @param {number} [params.limit=50] - 每页数量
|
|
63
|
+
* @param {string} [params.deviceId] - 设备ID筛选
|
|
64
|
+
* @param {string} [params.electricityMeterId] - 电表ID筛选
|
|
65
|
+
* @param {string} [params.flowMeterId] - 流量表ID筛选
|
|
66
|
+
* @param {boolean} [params.isActive] - 是否启用筛选
|
|
67
|
+
* @param {string} [params.sortBy] - 排序字段
|
|
68
|
+
* @param {string} [params.sortOrder='desc'] - 排序方向,asc或desc
|
|
69
|
+
* @returns {Promise<Object>} 能耗计算关联列表
|
|
70
|
+
*/
|
|
71
|
+
export function list(params) {
|
|
72
|
+
return requestShow({
|
|
73
|
+
url: "/energy-calculations",
|
|
74
|
+
method: "get",
|
|
75
|
+
params,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* 根据ID获取能耗计算关联详情
|
|
81
|
+
* @param {string} id - 能耗计算关联ID
|
|
82
|
+
* @returns {Promise<Object>} 能耗计算关联详情
|
|
83
|
+
*/
|
|
84
|
+
export function getOne(id) {
|
|
85
|
+
return requestShow({
|
|
86
|
+
url: `/energy-calculations/${id}`,
|
|
87
|
+
method: "get",
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* 更新能耗计算关联
|
|
93
|
+
* @param {Object} data - 更新的数据
|
|
94
|
+
* @param {string} data._id - 能耗计算关联ID
|
|
95
|
+
* @param {string} [data.deviceId] - 设备ID
|
|
96
|
+
* @param {string} [data.electricityMeterId] - 电表ID
|
|
97
|
+
* @param {string} [data.electricityCalculationNodeId] - 电表计算节点ID
|
|
98
|
+
* @param {string} [data.flowCalculationNodeId] - 流量表计算节点ID
|
|
99
|
+
* @param {string} [data.flowMeterId] - 流量表ID
|
|
100
|
+
* @param {boolean} [data.isActive] - 是否启用
|
|
101
|
+
* @param {string} [data.description] - 关联描述
|
|
102
|
+
* @returns {Promise<Object>} 更新后的能耗计算关联记录
|
|
103
|
+
*/
|
|
104
|
+
export function updateOne(data) {
|
|
105
|
+
return requestShow({
|
|
106
|
+
url: `/energy-calculations/${data._id}`,
|
|
107
|
+
method: "put",
|
|
108
|
+
data,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* 删除能耗计算关联
|
|
114
|
+
* @param {string} id - 能耗计算关联ID
|
|
115
|
+
* @returns {Promise<Object>} 删除结果
|
|
116
|
+
*/
|
|
117
|
+
export function deleteOne(id) {
|
|
118
|
+
return requestShow({
|
|
119
|
+
url: `/energy-calculations/${id}`,
|
|
120
|
+
method: "delete",
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* 批量删除能耗计算关联
|
|
126
|
+
* @param {Array<string>} ids - 能耗计算关联ID数组
|
|
127
|
+
* @returns {Promise<Object>} 批量删除结果
|
|
128
|
+
*/
|
|
129
|
+
export function deleteMany(ids) {
|
|
130
|
+
return requestShow({
|
|
131
|
+
url: "/energy-calculations",
|
|
132
|
+
method: "delete",
|
|
133
|
+
data: { ids },
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export default {
|
|
138
|
+
create,
|
|
139
|
+
list,
|
|
140
|
+
getOne,
|
|
141
|
+
updateOne,
|
|
142
|
+
deleteOne,
|
|
143
|
+
deleteMany,
|
|
144
|
+
};
|
package/index.js
CHANGED
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
import config from
|
|
2
|
-
import { init } from
|
|
3
|
-
import emitter from
|
|
4
|
-
import alarmRecord from
|
|
5
|
-
import alarmProgress from
|
|
6
|
-
import systeminfo from
|
|
7
|
-
import router from
|
|
8
|
-
import departs from
|
|
9
|
-
import bmsRole from
|
|
10
|
-
import bmsRouter from
|
|
11
|
-
import devices from
|
|
12
|
-
import deviceClass from
|
|
13
|
-
import tag from
|
|
14
|
-
import svglib from
|
|
15
|
-
import relationPlatform from
|
|
16
|
-
import components from
|
|
17
|
-
import application from
|
|
18
|
-
import upload from
|
|
19
|
-
import appRouter from
|
|
20
|
-
import view from
|
|
21
|
-
import userDevice from
|
|
22
|
-
import video from
|
|
23
|
-
import line from
|
|
24
|
-
import inspectionPoints from
|
|
25
|
-
import inspectionTask from
|
|
26
|
-
import inspectionTaskSub from
|
|
27
|
-
import product from
|
|
28
|
-
import area from
|
|
29
|
-
import areaClass from
|
|
30
|
-
import reservation from
|
|
31
|
-
import datavDatas from
|
|
32
|
-
import datavForms from
|
|
33
|
-
import sensor from
|
|
34
|
-
import scadaProject from
|
|
1
|
+
import config from "./config/urlcfg";
|
|
2
|
+
import { init } from "./utils";
|
|
3
|
+
import emitter from "./utils/EventEmitter";
|
|
4
|
+
import alarmRecord from "./api/alarmRecord";
|
|
5
|
+
import alarmProgress from "./api/alarmProgress";
|
|
6
|
+
import systeminfo from "./api/systeminfo";
|
|
7
|
+
import router from "./api/router";
|
|
8
|
+
import departs from "./api/departs";
|
|
9
|
+
import bmsRole from "./api/bmsRole";
|
|
10
|
+
import bmsRouter from "./api/bmsRouter";
|
|
11
|
+
import devices from "./api/devices";
|
|
12
|
+
import deviceClass from "./api/deviceClass";
|
|
13
|
+
import tag from "./api/tag";
|
|
14
|
+
import svglib from "./api/svglib";
|
|
15
|
+
import relationPlatform from "./api/relationPlatform";
|
|
16
|
+
import components from "./api/components";
|
|
17
|
+
import application from "./api/application";
|
|
18
|
+
import upload from "./api/upload";
|
|
19
|
+
import appRouter from "./api/appRouter";
|
|
20
|
+
import view from "./api/view";
|
|
21
|
+
import userDevice from "./api/userDevice";
|
|
22
|
+
import video from "./api/video";
|
|
23
|
+
import line from "./api/line";
|
|
24
|
+
import inspectionPoints from "./api/inspectionPoints";
|
|
25
|
+
import inspectionTask from "./api/inspectionTask";
|
|
26
|
+
import inspectionTaskSub from "./api/inspectionTaskSub";
|
|
27
|
+
import product from "./api/product";
|
|
28
|
+
import area from "./api/area";
|
|
29
|
+
import areaClass from "./api/areaClass";
|
|
30
|
+
import reservation from "./api/reservation";
|
|
31
|
+
import datavDatas from "./api/datavDatas";
|
|
32
|
+
import datavForms from "./api/datavForms";
|
|
33
|
+
import sensor from "./api/sensor";
|
|
34
|
+
import scadaProject from "./api/scadaProject";
|
|
35
|
+
import energyCalculation from "./api/energyCalculation";
|
|
35
36
|
const api = {
|
|
36
37
|
alarmRecord,
|
|
37
38
|
alarmProgress,
|
|
@@ -63,16 +64,17 @@ const api = {
|
|
|
63
64
|
datavForms,
|
|
64
65
|
reservation,
|
|
65
66
|
sensor,
|
|
66
|
-
scadaProject
|
|
67
|
-
|
|
67
|
+
scadaProject,
|
|
68
|
+
energyCalculation,
|
|
69
|
+
};
|
|
68
70
|
|
|
69
71
|
export default {
|
|
70
|
-
config: options => {
|
|
71
|
-
Object.assign(config, options)
|
|
72
|
-
init()
|
|
72
|
+
config: (options) => {
|
|
73
|
+
Object.assign(config, options);
|
|
74
|
+
init();
|
|
73
75
|
},
|
|
74
76
|
on: (...args) => {
|
|
75
|
-
emitter.on(...args)
|
|
77
|
+
emitter.on(...args);
|
|
76
78
|
},
|
|
77
|
-
...api
|
|
78
|
-
}
|
|
79
|
+
...api,
|
|
80
|
+
};
|