nayota-show-sdk 1.3.102 → 1.3.103
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/inspectionTask.js +19 -1
- package/api/inspectionTask.test.js +33 -0
- package/package.json +1 -1
package/api/inspectionTask.js
CHANGED
|
@@ -218,6 +218,23 @@ export function delProcedure(id) {
|
|
|
218
218
|
})
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
+
/**
|
|
222
|
+
* 获取消防巡查统计看板聚合数据
|
|
223
|
+
* @param {Object} query - 请求对象
|
|
224
|
+
* @param {'month'|'year'} query.periodType - 统计周期类型
|
|
225
|
+
* @param {string} query.period - periodType=month 时为 YYYY-MM,periodType=year 时为 YYYY
|
|
226
|
+
* @param {'all'|'team'|'single'} [query.assignmentMode] - 派发模式筛选
|
|
227
|
+
* @returns {number} code - 返回码,0表示成功
|
|
228
|
+
* @returns {Object} data - 统计看板聚合数据
|
|
229
|
+
*/
|
|
230
|
+
export function dashboardStatistics(query) {
|
|
231
|
+
return requestShow({
|
|
232
|
+
url: '/inspection-tasks/statistics/dashboard',
|
|
233
|
+
method: 'get',
|
|
234
|
+
params: query
|
|
235
|
+
})
|
|
236
|
+
}
|
|
237
|
+
|
|
221
238
|
export default {
|
|
222
239
|
list,
|
|
223
240
|
create,
|
|
@@ -228,5 +245,6 @@ export default {
|
|
|
228
245
|
createProcedure,
|
|
229
246
|
updateProcedure,
|
|
230
247
|
refreshProcedure,
|
|
231
|
-
delProcedure
|
|
248
|
+
delProcedure,
|
|
249
|
+
dashboardStatistics
|
|
232
250
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
jest.mock('../utils', () => ({
|
|
2
|
+
requestShow: jest.fn()
|
|
3
|
+
}))
|
|
4
|
+
|
|
5
|
+
const { requestShow } = require('../utils')
|
|
6
|
+
const inspectionTask = require('./inspectionTask').default
|
|
7
|
+
const sdk = require('../index').default
|
|
8
|
+
|
|
9
|
+
describe('inspectionTask api', () => {
|
|
10
|
+
afterEach(() => {
|
|
11
|
+
jest.clearAllMocks()
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
test('gets fire patrol dashboard statistics', () => {
|
|
15
|
+
const query = {
|
|
16
|
+
periodType: 'month',
|
|
17
|
+
period: '2026-04',
|
|
18
|
+
assignmentMode: 'all'
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
inspectionTask.dashboardStatistics(query)
|
|
22
|
+
|
|
23
|
+
expect(requestShow).toHaveBeenCalledWith({
|
|
24
|
+
url: '/inspection-tasks/statistics/dashboard',
|
|
25
|
+
method: 'get',
|
|
26
|
+
params: query
|
|
27
|
+
})
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
test('exports module from sdk root', () => {
|
|
31
|
+
expect(sdk.inspectionTask).toBe(inspectionTask)
|
|
32
|
+
})
|
|
33
|
+
})
|