nayota-show-sdk 1.2.0 → 1.2.2

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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
  ## 1. SDK简介
5
- nayota开放SDK是为了方便开发者快速接入nayota平台而提供的一套开发工具包。SDK提供了一系列的API接口,开发者可以通过调用这些接口实现与nayota平台的交互。
5
+ Nayota开放SDK是为了方便开发者快速接入Nayota平台而提供的一套开发工具包。SDK提供了一系列的API接口,开发者可以通过调用这些接口实现与Nayota平台的交互。
6
6
 
7
7
  ## 2. SDK npm 安装
8
8
  ```shell
@@ -17,4 +17,10 @@ NayotaSdk.config({
17
17
  authTokenName: 'Admin-Token', // api接口存储的token到cookie的key名称
18
18
  showServer: 'http://localhost:8080/api', // noyota-impossible-pro配置服务地址
19
19
  })
20
+ // 调用你需要的模块名称
21
+ import { alarmRecord } from 'nayota-show-sdk'
22
+ // 引入接口模块的方法
23
+ const { list, updateOne, create, delete } = alarmRecord
24
+ // 正常调用
25
+ list({ page:1, limit:50 })
20
26
  ```
@@ -1,15 +1,19 @@
1
1
  /**
2
- * @file 报警进度接口
2
+ * @file 报警进度api
3
3
  * @module 报警进度接口
4
- * @category 报警模块
4
+ * @category 报警管理
5
+ * @import
6
+ * import { alarmProgress } from 'nayota-show-sdk'
7
+ * const { list, getOne, create, updateOne, deleteOne, deleteMany } = alarmProgress
8
+ * list({ page: 1, limit: 50 })
5
9
  */
6
10
  import { requestShow } from '../utils'
7
11
 
8
12
 
9
13
  /**
10
- * @typedef {Object} alarmProgress - 报警进度
14
+ * @typedef {Object} AlarmProgress - 报警进度
11
15
  * @property {string} alarmRecord - 报警id
12
- * @property {number} processingState - 报警进度的处理状态 [{key: '待处理', value: 1}, {key: '处理中', value: 2}, {key: '已处理', value: 3}, {key: '云呼通知中', value: 4}, {key: '短信通知', value: 5}, {key: '缺岗', value: 6}, {key: '已通知', value: 7}, {key: '真实报警', value: 8}, {key: '测试', value: 9}, {key: '误报', value: 10}, {key: '云呼通知失败', value: 13}, {key: '推送给第三方', value: 14}, {key: '处理完成', value: 15}, {key: '人工处理', value: 16}, {key: '设备自动复位', value: 17}, {key: '短信发送失败', value: 18}, {key: '跟进中', value: 19}]
16
+ * @property {number} processingState - 报警进度的处理状态 [{name: '待处理', value: 1}, {name: '处理中', value: 2}, {name: '已处理', value: 3}, {name: '云呼通知中', value: 4}, {name: '短信通知', value: 5}, {name: '缺岗', value: 6}, {name: '已通知', value: 7}, {name: '真实报警', value: 8}, {name: '测试', value: 9}, {name: '误报', value: 10}, {name: '云呼通知失败', value: 13}, {name: '推送给第三方', value: 14}, {name: '处理完成', value: 15}, {name: '人工处理', value: 16}, {name: '设备自动复位', value: 17}, {name: '短信发送失败', value: 18}, {name: '跟进中', value: 19}]
13
17
  * @property {number} event_time - 报警进度的处理时间 毫秒时间戳。
14
18
  * @property {string} desc - 报警进度的描述。
15
19
  * @example
@@ -32,9 +36,24 @@ import { requestShow } from '../utils'
32
36
  * @param {string} query.label - 模糊查询关键字
33
37
  * @param {string} query.search - 模糊查询内容
34
38
  * @param {string} query.alarmRecord - 关联到AlarmRecord的引用。
39
+ * @example
40
+ * { page: 1, limit: 10, label: 'desc', search: '报警', alarmRecord: '67498c0ea2bd800009fa8906' }
35
41
  * @returns {number} code - 返回码,0表示成功
36
42
  * @returns {number} total - 报警进度总数
37
43
  * @returns {Array} rows - 报警进度数组 见表结构alarmProgress定义
44
+ * @example
45
+ * {
46
+ * "code": 0,
47
+ * "total": 1,
48
+ * "rows": [
49
+ {
50
+ "_id": "67498c0ea2bd800009fa8931",
51
+ "alarmRecord": "67498c0ea2bd800009fa8906",
52
+ "processingState": 1,
53
+ "event_time": 1732873230764,
54
+ "desc": "通用部件-回路043944节点0155-正常"
55
+ }
56
+ ]}
38
57
  */
39
58
  export function list(query) {
40
59
  return requestShow({
@@ -47,8 +66,26 @@ export function list(query) {
47
66
  /**
48
67
  * 新增报警进度记录
49
68
  * @param {object} data - 见表结构alarmProgress定义
69
+ * @example
70
+ * {
71
+ "alarmRecord": "67498c0ea2bd800009fa8906",
72
+ "processingState": 1,
73
+ "event_time": 1732873230764,
74
+ "desc": "通用部件-回路043944节点0155-正常"
75
+ }
50
76
  * @returns {number} code - 返回码,0表示成功
51
77
  * @returns {Object} data - 见表结构alarmProgress定义
78
+ * @example
79
+ * {
80
+ * "code": 0,
81
+ * "data": {
82
+ * "_id": "67498c0ea2bd800009fa8931",
83
+ * "alarmRecord": "67498c0ea2bd800009fa8906",
84
+ * "processingState": 1,
85
+ * "event_time": 1732873230764,
86
+ * "desc": "通用部件-回路043944节点0155-正常"
87
+ * }
88
+ * }
52
89
  */
53
90
  export function create(data) {
54
91
  return requestShow({
@@ -61,10 +98,21 @@ export function create(data) {
61
98
  /**
62
99
  * 获取报警进度详情
63
100
  * @param {string} id - 报警id
64
- * @returns {Object} - 响应对象,其中包含表示操作成功与否的代码。
65
- * @returns {number} code - 返回码,0表示成功。
66
- * @returns {string} _id - 报警进度id
67
- * @returns {Object} 见表结构alarmProgress定义
101
+ * @example
102
+ * 67498c0ea2bd800009fa8931
103
+ * @returns {number} code - 返回码,0表示成功。
104
+ * @returns {Object} data - 见表结构alarmProgress定义
105
+ * @example
106
+ * {
107
+ * "code": 0,
108
+ * "data": {
109
+ * "_id": "67498c0ea2bd800009fa8931",
110
+ * "alarmRecord": "67498c0ea2bd800009fa8906",
111
+ * "processingState": 1,
112
+ * "event_time": 1732873230764,
113
+ * "desc": "通用部件-回路043944节点0155-正常"
114
+ * }
115
+ }
68
116
  */
69
117
  export function getOne(id) {
70
118
  return requestShow({
@@ -77,10 +125,27 @@ export function getOne(id) {
77
125
  /**
78
126
  * 编辑报警进度详情
79
127
  * @param {Object} data 修改数据对象
80
- * @param {string} data._id - 报警进度id
81
- * @param {Object} data.other 见表结构alarmProgress定义
128
+ * @example
129
+ * {
130
+ "_id": "67498c0ea2bd800009fa8931",
131
+ "alarmRecord": "67498c0ea2bd800009fa8906",
132
+ "processingState": 1,
133
+ "event_time": 1732873230764,
134
+ "desc": "通用部件-回路043944节点0155-正常"
135
+ }
82
136
  * @returns {number} code - 返回码,0表示成功。
83
137
  * @returns {Object} data - 报警进度对象 见表结构alarmProgress定义
138
+ * @example
139
+ * {
140
+ * "code": 0,
141
+ * "data": {
142
+ * "_id": "67498c0ea2bd800009fa8931",
143
+ * "alarmRecord": "67498c0ea2bd800009fa8906",
144
+ * "processingState": 1,
145
+ * "event_time": 1732873230764,
146
+ * "desc": "通用部件-回路043944节点0155-正常"
147
+ * }
148
+ * }
84
149
  */
85
150
  export function updateOne(data) {
86
151
  return requestShow({
@@ -93,9 +158,21 @@ export function updateOne(data) {
93
158
  /**
94
159
  * 删除进度
95
160
  * @param {string} id - 报警id
96
- * @returns {Object} - 响应对象,其中包含表示操作成功与否的代码。
161
+ * @example
162
+ * 67498c0ea2bd800009fa8931
97
163
  * @returns {number} code - 返回码,0表示成功。
98
- * @returns {Object} 见表结构alarmProgress定义
164
+ * @returns {Object} data - 见表结构alarmProgress定义
165
+ * @example
166
+ * {
167
+ * "code": 0,
168
+ * "data": {
169
+ * "_id": "67498c0ea2bd800009fa8931",
170
+ * "alarmRecord": "67498c0ea2bd800009fa8906",
171
+ * "processingState": 1,
172
+ * "event_time": 1732873230764,
173
+ * "desc": "通用部件-回路043944节点0155-正常"
174
+ * }
175
+ * }
99
176
  */
100
177
  export function deleteOne(id) {
101
178
  return requestShow({
@@ -107,8 +184,14 @@ export function deleteOne(id) {
107
184
  /**
108
185
  * 批量删除报警进度
109
186
  * @param {Array} ids - 报警进度ids
187
+ * @example
188
+ * ['67498c0ea2bd800009fa8931', '67498c0ea2bd800009fa8932']
110
189
  * @returns {Object} - 响应对象,其中包含表示操作成功与否的代码。
111
190
  * @returns {number} code - 返回码,0表示成功。
191
+ * @example
192
+ * {
193
+ * "code": 0
194
+ * }
112
195
  */
113
196
  export function deleteMany(ids) {
114
197
  return requestShow({
@@ -1,22 +1,28 @@
1
+ import { requestShow } from '../utils'
1
2
  /**
2
3
  * @file 报警记录api
3
4
  * @module 报警记录接口
4
- * @category 报警模块
5
+ * @category 报警管理
6
+ * @categoryOrder 4
7
+ * @import
8
+ * import { alarmRecord } from 'nayota-show-sdk'
9
+ * const { list, getOne, create, updateOne, deleteOne, deleteMany, getAlarmCount, getAlarmTotalCount, getMoreAlarmCount, cloudCall, alarmCloudCall, processingManyAlarm, exportAlarmRecord } = alarmRecord
10
+ * list({ page: 1, limit: 50 })
5
11
  */
6
- import { requestShow } from '../utils'
12
+
7
13
 
8
14
  /**
9
- * @typedef {Object} alarmRecord - 报警记录
15
+ * @typedef {Object} AlarmRecord - 报警记录
10
16
  * @property {string} _id - 报警记录id
11
- * @property {number} mainType - 告警的主要类型 取value值[{key: '设备告警', value: 1}, {key: '异常告警', value: 2}, {key: '设备故障', value: 3}, {key: '离线告警', value: 4}]
17
+ * @property {number} mainType - 告警的主要类型 取value值[{name: '设备告警', value: 1}, {name: '异常告警', value: 2}, {name: '设备故障', value: 3}, {name: '离线告警', value: 4}].
12
18
  * @property {string} subType - 告警的子类型。
13
19
  * @property {string} device - 关联的设备。
14
20
  * @property {number} event_time - 告警发生的时间(毫秒时间戳)。
15
21
  * @property {string} desc - 告警的描述。
16
22
  * @property {number} number - 告警发生的次数。
17
- * @property {number} processingState - 告警的处理状态 取value值[{key: '待处理', value: 1}, {key: '处理中', value: 2}, {key: '已处理', value: 3}]。
18
- * @property {number} processingResult - 处理结果 取value值[{key: '云呼通知失败', value: 9}, {key: '缺岗', value: 10}, {key: '短信发送失败', value: 12}, {key: '已通知', value: 1}, {key: '云呼通知中', value: 11}, {key: '真实告警', value: 2}, {key: '测试', value: 3}, {key: '误报', value: 4}, {key: '处理完成', value: 5}, {key: '人工处理', value: 6}, {key: '设备自动复位', value: 7}, {key: '已推送至第三方', value: 8}]。
19
- * @property {number} noticeWay - 通知方式 取value值[{key: '云呼', value: 1}, {key: '短信', value: 2}, {key: '人工通知', value: 3}]。
23
+ * @property {number} processingState - 告警的处理状态 取value值[{name: '待处理', value: 1}, {name: '处理中', value: 2}, {name: '已处理', value: 3}]。
24
+ * @property {number} processingResult - 处理结果 取value值[{name: '云呼通知失败', value: 9}, {name: '缺岗', value: 10}, {name: '短信发送失败', value: 12}, {name: '已通知', value: 1}, {name: '云呼通知中', value: 11}, {name: '真实告警', value: 2}, {name: '测试', value: 3}, {name: '误报', value: 4}, {name: '处理完成', value: 5}, {name: '人工处理', value: 6}, {name: '设备自动复位', value: 7}, {name: '已推送至第三方', value: 8}]。
25
+ * @property {number} noticeWay - 通知方式 取value值[{name: '云呼', value: 1}, {name: '短信', value: 2}, {name: '人工通知', value: 3}]。
20
26
  * @property {string} fireDesc - 火灾事件的描述。
21
27
  * @property {number} lastSmsTime - 最后发送短信的时间 毫秒时间戳。
22
28
  * @property {number} lastCallTime - 最后发送云呼的时间 毫秒时间戳。
@@ -291,9 +297,17 @@ import { requestShow } from '../utils'
291
297
  * @param {number} query.limit - 每页数量
292
298
  * @param {string} query.label - 模糊查询关键字
293
299
  * @param {string} query.search - 模糊查询内容
300
+ * @example
301
+ * { page: 1, limit: 10, label: 'desc', search: '报警' }
294
302
  * @returns {number} code - 返回码,0表示成功
295
303
  * @returns {number} total - 报警记录总数
296
- * @returns {Array} rows - 报警记录数组 见表结构alarmRecord定义
304
+ * @returns {Array} rows - 报警记录数组 见表结构AlarmRecord定义
305
+ * @example
306
+ * {
307
+ "code": 0,
308
+ "total": 1,
309
+ "rows": [] // 数组对象内容见表结构AlarmRecord定义
310
+ }
297
311
  */
298
312
  export function list(query) {
299
313
  return requestShow({
@@ -306,8 +320,47 @@ export function list(query) {
306
320
  /**
307
321
  * 新增报警记录
308
322
  * @param {Object} data - 包含报警记录的请求体 见表结构alarmRecord定义
323
+ * @example
324
+ * {
325
+ "picUrls": [],
326
+ "alarmTimes": [
327
+ 1732846021953
328
+ ],
329
+ "_id": "674921c6b9c0f70009320efc",
330
+ "mainType": 1,
331
+ "subType": "门禁告警",
332
+ "deviceClass": "667d32ed52d21700095b60c8",
333
+ "device": "6742de025872200009a89da5",
334
+ "event_time": 1732846021953,
335
+ "desc": "电压报警",
336
+ "number": 1,
337
+ "processingState": 1,
338
+ "noticeWay": 1,
339
+ "depart": "667bc7bb92f8ed0009c55baa"
340
+ }
309
341
  * @returns {number} code - 返回码,0表示成功
310
342
  * @returns {string} data - 新增成功的数据 见表结构alarmRecord定义
343
+ * @example
344
+ * {
345
+ "code": 0,
346
+ "data": {
347
+ "_id": "674921c6b9c0f70009320efc",
348
+ "picUrls": [],
349
+ "alarmTimes": [
350
+ 1732846021953
351
+ ],
352
+ "mainType": 1,
353
+ "subType": "门禁告警",
354
+ "deviceClass": "667d32ed52d21700095b60c8",
355
+ "device": "6742de025872200009a89da5",
356
+ "event_time": 1732846021953,
357
+ "desc": "电压报警",
358
+ "number": 1,
359
+ "processingState": 1,
360
+ "noticeWay": 1,
361
+ "depart": "667bc7bb92f8ed0009c55baa"
362
+ }
363
+ }
311
364
  */
312
365
  export function create(data) {
313
366
  return requestShow({
@@ -320,8 +373,30 @@ export function create(data) {
320
373
  /**
321
374
  * 获取报警详情
322
375
  * @param {string} id - 报警id
376
+ * @example
377
+ * 67498c0ea2bd800009fa8931
323
378
  * @returns {number} code - 返回码,0表示成功。
324
379
  * @returns {Object} data - 报警记录对象 见表结构alarmRecord定义
380
+ * @example
381
+ * {
382
+ * "code": 0,
383
+ * "data": {
384
+ * "_id": "67498c0ea2bd800009fa8931",
385
+ * "picUrls": [],
386
+ * "alarmTimes": [
387
+ * 1732846021953
388
+ * ],
389
+ * "mainType": 1,
390
+ * "subType": "门禁告警",
391
+ * "deviceClass": "667d32ed52d21700095b60c8",
392
+ * "device": "6742de025872200009a89da5",
393
+ * "event_time": 1732846021953,
394
+ * "desc": "电压报警",
395
+ * "number": 1,
396
+ * "processingState": 1,
397
+ * "noticeWay": 1,
398
+ * "depart": "667bc7bb92f8ed0009c55baa"
399
+ * }
325
400
  */
326
401
  export function getOne(id) {
327
402
  return requestShow({
@@ -333,8 +408,47 @@ export function getOne(id) {
333
408
  /**
334
409
  * 编辑报警详情
335
410
  * @param {Object} data - 修改数据对象
411
+ * @example
412
+ * {
413
+ "_id": "67498c0ea2bd800009fa8931",
414
+ "picUrls": [],
415
+ "alarmTimes": [
416
+ 1732846021953
417
+ ],
418
+ "mainType": 1,
419
+ "subType": "门禁告警",
420
+ "deviceClass": "667d32ed52d21700095b60c8",
421
+ "device": "6742de025872200009a89da5",
422
+ "event_time": 1732846021953,
423
+ "desc": "电压报警",
424
+ "number": 1,
425
+ "processingState": 1,
426
+ "noticeWay": 1,
427
+ "depart": "667bc7bb92f8ed0009c55baa"
428
+ }
336
429
  * @returns {number} code - 返回码,0表示成功。
337
430
  * @returns {Object} data - 报警记录对象 见表结构alarmRecord定义
431
+ * @example
432
+ * {
433
+ * "code": 0,
434
+ * "data": {
435
+ * "_id": "67498c0ea2bd800009fa8931",
436
+ * "picUrls": [],
437
+ * "alarmTimes": [
438
+ * 1732846021953
439
+ * ],
440
+ * "mainType": 1,
441
+ * "subType": "门禁告警",
442
+ * "deviceClass": "667d32ed52d21700095b60c8",
443
+ * "device": "6742de025872200009a89da5",
444
+ * "event_time": 1732846021953,
445
+ * "desc": "电压报警",
446
+ * "number": 1,
447
+ * "processingState": 1,
448
+ * "noticeWay": 1,
449
+ * "depart": "667bc7bb92f8ed0009c55baa"
450
+ * }
451
+ }
338
452
  */
339
453
  export function updateOne(data) {
340
454
  return requestShow({
@@ -347,8 +461,31 @@ export function updateOne(data) {
347
461
  /**
348
462
  * 删除报警
349
463
  * @param {string} id - 报警id
464
+ * @example
465
+ * 67498c0ea2bd800009fa8931
350
466
  * @returns {number} code - 返回码,0表示成功。
351
467
  * @returns {Object} data - 报警记录对象 见表结构alarmRecord定义
468
+ * @example
469
+ * {
470
+ * "code": 0,
471
+ * "data": {
472
+ * "_id": "67498c0ea2bd800009fa8931",
473
+ * "picUrls": [],
474
+ * "alarmTimes": [
475
+ * 1732846021953
476
+ * ],
477
+ * "mainType": 1,
478
+ * "subType": "门禁告警",
479
+ * "deviceClass": "667d32ed52d21700095b60c8",
480
+ * "device": "6742de025872200009a89da5",
481
+ * "event_time": 1732846021953,
482
+ * "desc": "电压报警",
483
+ * "number": 1,
484
+ * "processingState": 1,
485
+ * "noticeWay": 1,
486
+ * "depart": "667bc7bb92f8ed0009c55baa"
487
+ * }
488
+ * }
352
489
  */
353
490
  export function deleteOne(id) {
354
491
  return requestShow({
@@ -360,7 +497,13 @@ export function deleteOne(id) {
360
497
  /**
361
498
  * 批量删除报警
362
499
  * @param {Array} ids - 报警ids
500
+ * @example
501
+ * ['67498c0ea2bd800009fa8931', '67498c0ea2bd800009fa8932']
363
502
  * @returns {number} code - 返回码,0表示成功。
503
+ * @example
504
+ * {
505
+ * "code": 0
506
+ * }
364
507
  */
365
508
  export function deleteMany(ids) {
366
509
  return requestShow({
@@ -378,6 +521,17 @@ export function deleteMany(ids) {
378
521
  * @param {Date} data.endTime - 用于过滤报警的结束时间 毫秒时间戳(可选)。
379
522
  * @param {Date} data.startMonth - 用于过滤报警的开始月份 毫秒时间戳(可选)。
380
523
  * @param {Date} data.endMonth - 用于过滤报警的结束月份 毫秒时间戳(可选)。
524
+ * @example
525
+ * {
526
+ "mainType": 1,
527
+ "startTime": 1733016332000,
528
+ "endTime": 1735608332000
529
+ }
530
+ {
531
+ "mainType": 1,
532
+ "startMonth": 1733016332000,
533
+ "endMonth": 1735608332000
534
+ }
381
535
  * @returns {number} code - 状态码(0表示成功)
382
536
  * @returns {Object} data - 包含报警计数的结果对象
383
537
  * @returns {number} data.total - 报警的总数
@@ -386,6 +540,17 @@ export function deleteMany(ids) {
386
540
  * @returns {number} data.processed - 已处理的报警数量
387
541
  * @returns {number} data.waitProcess - 等待处理的报警数量
388
542
  * @returns {number} data.processing - 正在处理的报警数量
543
+ * @example
544
+ * {
545
+ "code": 0,
546
+ "data": {
547
+ "total": 0,
548
+ "todayTotal": 0,
549
+ "monthTotal": 0,
550
+ "processed": 0,
551
+ "waitProcess": 0,
552
+ "processing": 0
553
+ }
389
554
  */
390
555
  export function getAlarmCount(data) {
391
556
  return requestShow({
@@ -397,7 +562,6 @@ export function getAlarmCount(data) {
397
562
 
398
563
  /**
399
564
  * 获取报警未处理和处理中的总数
400
- * @param {Object} data - 请求体参数 目前不用传此参数
401
565
  * @returns {Object} - 包含报警总数的对象
402
566
  * @returns {number} code - 返回码,0表示成功
403
567
  * @returns {Object} data - 报警总数对象
@@ -406,54 +570,39 @@ export function getAlarmCount(data) {
406
570
  * @returns {number} data.errorCount - 设备异常总数
407
571
  * @returns {number} data.troubleCount - 设备故障总数
408
572
  * @returns {number} data.offlineCount - 设备离线总数
573
+ * @example
574
+ * {
575
+ "code": 0,
576
+ "data": {
577
+ "total": 0,
578
+ "deviceCount": 0,
579
+ "errorCount": 0,
580
+ "troubleCount": 0,
581
+ "offlineCount": 0
582
+ }
583
+ }
409
584
  */
410
- export function getAlarmTotalCount(data) {
585
+ export function getAlarmTotalCount() {
411
586
  return requestShow({
412
587
  url: '/alarm-records/alarm-total-count',
413
- method: 'post',
414
- data
415
- })
416
- }
417
-
418
- /**
419
- * 人员测试云呼
420
- * @returns {Object} - 包含报警总数的对象
421
- * @returns {number} code - 返回码,0表示成功
422
- * @returns {string} message - 错误描述
423
- */
424
- export function cloudCall() {
425
- return requestShow({
426
- url: '/alarm-records/cloud-call',
427
588
  method: 'post'
428
589
  })
429
590
  }
430
591
 
431
- /**
432
- * 报警云呼 用于报警页面通知人员
433
- * @returns {Object} data - 返回对象
434
- * @returns {number} data.code - 返回码,0表示成功
435
- */
436
- export function alarmCloudCall() {
437
- return requestShow({
438
- url: '/alarm-records/alarm-cloud-call',
439
- method: 'post'
440
- })
441
- }
592
+
442
593
 
443
594
  /**
444
595
  * 批量处理
445
596
  * @param {Object} data 处理参数对象
446
597
  * @param {boolean} data.isAll - 是否全部处理
447
598
  * @param {Object} data.query - 查询参数对象 当isAll为true时,query必传
448
- * @param {number} data.query.mainType - 查询告警的主要类型[{key: '设备告警', value: 1}, {key: '异常告警', value: 2}, {key: '设备故障', value: 3}, {key: '离线告警', value: 4}]
599
+ * @param {number} data.query.mainType - 查询告警的主要类型[{name: '设备告警', value: 1}, {name: '异常告警', value: 2}, {name: '设备故障', value: 3}, {name: '离线告警', value: 4}]
449
600
  * @param {Array} data.query.range - 查询的时间范围[开始毫秒时间戳,结束毫秒时间戳]
450
- * @param {number} data.query.processingState - 查询的告警的处理状态[{key: '待处理', value: 1}, {key: '处理中', value: 2}, {key: '已处理', value: 3}]
601
+ * @param {number} data.query.processingState - 查询的告警的处理状态[{name: '待处理', value: 1}, {name: '处理中', value: 2}, {name: '已处理', value: 3}]
451
602
  * @param {Array} data.alarmRecords - 待处理的报警记录id数组
452
- * @param {number} data.processingResult - 处理结果 [{key: '已通知', value: 1}, {key: '真实告警', value: 2}, {key: '测试', value: 3}, {key: '误报', value: 4}, {key: '处理完成', value: 5}, {key: '人工处理', value: 6}, {key: '设备自动复位', value: 7}, {key: '已推送至第三方', value: 8}, {key: '云呼通知失败', value: 9}, {key: '缺岗', value: 10}, {key: '云呼通知中', value: 11}, {key: '短信发送失败', value: 12}]
603
+ * @param {number} data.processingResult - 处理结果 [{name: '已通知', value: 1}, {name: '真实告警', value: 2}, {name: '测试', value: 3}, {name: '误报', value: 4}, {name: '处理完成', value: 5}, {name: '人工处理', value: 6}, {name: '设备自动复位', value: 7}, {name: '已推送至第三方', value: 8}, {name: '云呼通知失败', value: 9}, {name: '缺岗', value: 10}, {name: '云呼通知中', value: 11}, {name: '短信发送失败', value: 12}]
453
604
  * @param {string} data.fireDesc - 报警描述
454
- * @returns {Object} data - 返回对象
455
- * @returns {number} code - 返回码,0表示成功
456
- * @example <caption>请求范例</caption>
605
+ * @example
457
606
  * 当isAll为true时,传以下参数。代表处理条件内的所有报警记录
458
607
  * {
459
608
  * isAll: true,
@@ -472,6 +621,11 @@ export function alarmCloudCall() {
472
621
  * processingResult: 2,
473
622
  * fireDesc: '报警描述'
474
623
  * }
624
+ * @returns {number} code - 返回码,0表示成功
625
+ * @example
626
+ * {
627
+ * "code": 0
628
+ }
475
629
  */
476
630
  export function processingManyAlarm(data) {
477
631
  return requestShow({
@@ -481,34 +635,28 @@ export function processingManyAlarm(data) {
481
635
  })
482
636
  }
483
637
 
484
- /**
485
- * 微信小程序上传故障记录。
486
- * @param {Object} data - 包含故障记录所需数据的请求体。
487
- * @param {string} data.device - 与故障记录关联的设备的ID。
488
- * @param {string} data.wxUser - 与故障记录关联的用户的ID。
489
- * @param {string} data.subType - 故障记录的子类型。
490
- * @param {string} data.desc - 故障记录的描述。
491
- * @param {string[]} data.picUrls - 与故障记录关联的图片的URL。
492
- * @returns {Object} data - 返回对象
493
- * @returns {number} code - 返回码,0表示成功
494
- */
495
- // export function uploadTroubleAlarm(data) {
496
- // return requestShow({
497
- // url: '/alarm-records/upload-trouble-alarm',
498
- // method: 'post',
499
- // data
500
- // })
501
- // }
638
+
502
639
 
503
640
  /**
504
- * 报警记录导出excel
505
- * @param {Object} data - 包含故障记录所需数据的请求体。
506
- * @param {string} data.startTime - 开始时间戳。
507
- * @param {string} data.endTime - 结束时间戳。
508
- * @returns {number} code - 返回码,0表示成功。
509
- * @returns {string} data - excel文件的下载相对链接。
510
- * @returns {string} message - 描述。
511
- */
641
+ * 报警记录导出excel
642
+ * @param {Object} data - 包含故障记录所需数据的请求体。
643
+ * @param {string} data.startTime - 开始时间戳。
644
+ * @param {string} data.endTime - 结束时间戳。
645
+ * @example
646
+ * {
647
+ "startTime": 1733016332000,
648
+ "endTime": 1735608332000
649
+ }
650
+ * @returns {number} code - 返回码,0表示成功。
651
+ * @returns {string} data - excel文件的下载相对链接。
652
+ * @returns {string} message - 描述。
653
+ * @example
654
+ * {
655
+ "code": 0,
656
+ "data": "/upload/报警记录1734109060666.xlsx",
657
+ "message": "导出成功"
658
+ }
659
+ */
512
660
  export function exportAlarmRecord(data) {
513
661
  return requestShow({
514
662
  url: '/alarm-records/export-alarm-excel',
@@ -523,12 +671,47 @@ export function exportAlarmRecord(data) {
523
671
  * @param {Array} data.timestamps - 时间戳数组
524
672
  * @param {number} data.timestamps[].startTime - 开始时间戳
525
673
  * @param {number} data.timestamps[].endTime - 结束时间戳
674
+ * @example
675
+ * {
676
+ "timestamps": [
677
+ {
678
+ "startTime": 1733016332000,
679
+ "endTime": 1733102732000
680
+ },
681
+ ]
682
+ }
526
683
  * @returns {number} code - 返回码,0表示成功
527
684
  * @returns {Array} data - 报警计数数组
528
- * @returns {string} data[].date - 格式化后的时间字符串
529
- * @returns {Array} data[].counts - 报警类型计数数组
530
- * @returns {string} data[].counts[].type - 报警类型
531
- * @returns {number} data[].counts[].count - 报警计数
685
+ * @returns {string} data.date - 格式化后的时间字符串
686
+ * @returns {Array} data.counts - 报警类型计数数组
687
+ * @returns {string} data.counts.type - 报警类型取value值[{name:"设备告警",value:"device"},{name:"异常告警",value:"error"},{name:"设备故障",value:"trouble"},{name:"离线告警",value:"offline"}]
688
+ * @returns {number} data.counts.count - 报警计数
689
+ * @example
690
+ * {
691
+ "code": 0,
692
+ "data": [
693
+ {
694
+ "date": "2021-01-01 00:00:00", // 按照每个endTime的日期来进行格式化
695
+ "counts": [
696
+ {
697
+ "type": "device",
698
+ "count": 0
699
+ },
700
+ {
701
+ "type": "error",
702
+ "count": 0
703
+ },
704
+ {
705
+ "type": "trouble",
706
+ "count": 0
707
+ },
708
+ {
709
+ "type": "offline",
710
+ "count": 0
711
+ }
712
+ ]
713
+ },
714
+ ]}
532
715
  */
533
716
  export function getMoreAlarmCount(data) {
534
717
  return requestShow({
@@ -548,8 +731,6 @@ export default {
548
731
  getAlarmCount,
549
732
  getAlarmTotalCount,
550
733
  getMoreAlarmCount,
551
- cloudCall,
552
- alarmCloudCall,
553
734
  processingManyAlarm,
554
735
  exportAlarmRecord
555
736
  }
package/api/appRouter.js CHANGED
@@ -22,7 +22,7 @@ import { requestShow } from '../utils'
22
22
  * @property {string} routes.icon - 子菜单的图标
23
23
  * @property {string} routes.name - 子菜单的名称
24
24
  * @property {string} routes.identifier - 子菜单的唯一标识
25
- * @property {string} routes.type - 子菜单的类型,取value值[{key:'分组菜单',value:'group'},{key:'页面菜单',value:'view'}]
25
+ * @property {string} routes.type - 子菜单的类型,取value值[{name:'分组菜单',value:'group'},{name:'页面菜单',value:'view'}]
26
26
  * @example
27
27
  * {
28
28
  "_id": "638ec3f7ed786520c52a44a8",
@@ -3,6 +3,7 @@ import { requestShow } from '../utils'
3
3
  * @file 应用信息api
4
4
  * @module 应用信息接口
5
5
  * @category 系统设置
6
+ * @categoryOrder 1
6
7
  */
7
8
 
8
9
  /**
@@ -11,7 +12,7 @@ import { requestShow } from '../utils'
11
12
  * @property {string} name - 应用信息名称
12
13
  * @property {string} icon - 应用图标
13
14
  * @property {string} color - 图标颜色
14
- * @property {number} type - 应用类型,取value值[{key: '本地应用', value: 0}, {key: '平台应用', value: 1}]
15
+ * @property {number} type - 应用类型,取value值[{name: '本地应用', value: 0}, {name: '平台应用', value: 1}]
15
16
  * @property {string} url - 应用路径
16
17
  * @example
17
18
  * {