nayota-show-sdk 1.2.9 → 1.3.1
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/area.js +2 -0
- package/api/reservation.js +156 -0
- package/api/userDevice.js +10 -1
- package/index.js +3 -1
- package/package.json +1 -1
package/api/area.js
CHANGED
|
@@ -24,6 +24,7 @@ import { requestShow } from '../utils'
|
|
|
24
24
|
* @property {Array} statisticsComponent - 统计组件名称数组
|
|
25
25
|
* @property {Object} statisticsJson - 统计组件自定义json
|
|
26
26
|
* @property {string} areaClass - 区域类型id
|
|
27
|
+
* @property {string} managerName - 管理人姓名
|
|
27
28
|
* @example
|
|
28
29
|
* {
|
|
29
30
|
"_id": "67073bfe463d6e00099becdd",
|
|
@@ -34,6 +35,7 @@ import { requestShow } from '../utils'
|
|
|
34
35
|
"opacity": 1,
|
|
35
36
|
"type": "办公区",
|
|
36
37
|
"areaClass": "67073bfe463d6e00099becdd",
|
|
38
|
+
"managerName": "张三",
|
|
37
39
|
"bounds": [
|
|
38
40
|
[
|
|
39
41
|
116.404,
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { requestShow } from '../utils'
|
|
2
|
+
/**
|
|
3
|
+
* @file 预约记录api
|
|
4
|
+
* @module 预约记录接口
|
|
5
|
+
* @category 区域管理
|
|
6
|
+
* @import
|
|
7
|
+
* import { reservation } from 'nayota-show-sdk'
|
|
8
|
+
* const { list, create, updateOne, deleteOne, deleteMany, getOne, approve } = reservation
|
|
9
|
+
* list({ page: 1, limit: 50 })
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @typedef {Object} Reservation - 预约记录
|
|
15
|
+
* @property {string} _id - 预约记录id
|
|
16
|
+
* @property {string} reserverName - 预约人名称
|
|
17
|
+
* @property {Date} startTime - 开始时间
|
|
18
|
+
* @property {Date} endTime - 结束时间
|
|
19
|
+
* @property {string} area - 空间(关联到Area模型)
|
|
20
|
+
* @property {string} depart - 层级(关联到Depart模型)
|
|
21
|
+
* @property {string} remark - 备注
|
|
22
|
+
* @property {string} approver - 审批人
|
|
23
|
+
* @property {Date} approveTime - 审批时间
|
|
24
|
+
* @property {number} approveStatus - 审批状态(0-待审批,1-已批准,2-已拒绝)
|
|
25
|
+
* @property {string} creator - 创建者
|
|
26
|
+
* @example
|
|
27
|
+
* {
|
|
28
|
+
"_id": "67073bfe463d6e00099becee",
|
|
29
|
+
"reserverName": "张三",
|
|
30
|
+
"startTime": "2025-03-07T08:00:00.000Z",
|
|
31
|
+
"endTime": "2025-03-07T10:00:00.000Z",
|
|
32
|
+
"area": "67073bfe463d6e00099becdd",
|
|
33
|
+
"depart": "667d2ecc52d21700095b58b4",
|
|
34
|
+
"remark": "项目讨论会议",
|
|
35
|
+
"approver": "李四",
|
|
36
|
+
"approveTime": "2025-03-06T10:00:00.000Z",
|
|
37
|
+
"approveStatus": 1,
|
|
38
|
+
"creator": "667d2ecc52d21700095b58b5",
|
|
39
|
+
"createdAt": "2025-03-06T09:00:00.000Z",
|
|
40
|
+
"updatedAt": "2025-03-06T10:00:00.000Z"
|
|
41
|
+
}
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* 获取预约记录列表
|
|
47
|
+
* @param {Object} query - 请求对象
|
|
48
|
+
* @param {number} query.page - 页码
|
|
49
|
+
* @param {number} query.limit - 每页数量
|
|
50
|
+
* @param {string} [query.area] - 按空间筛选
|
|
51
|
+
* @param {string} [query.depart] - 按层级筛选
|
|
52
|
+
* @param {number} [query.approveStatus] - 按审批状态筛选
|
|
53
|
+
* @param {string} [query.startDate] - 开始日期筛选
|
|
54
|
+
* @param {string} [query.endDate] - 结束日期筛选
|
|
55
|
+
* @example
|
|
56
|
+
* {
|
|
57
|
+
* "page": 1,
|
|
58
|
+
* "limit": 10,
|
|
59
|
+
* "area": "67073bfe463d6e00099becdd",
|
|
60
|
+
* "approveStatus": 1
|
|
61
|
+
* }
|
|
62
|
+
* @returns {number} code - 返回码,0表示成功
|
|
63
|
+
* @returns {number} total - 页面总数
|
|
64
|
+
* @returns {Array} rows - 页面数组见表结构reservation定义
|
|
65
|
+
* @example
|
|
66
|
+
*
|
|
67
|
+
* {
|
|
68
|
+
"code": 0,
|
|
69
|
+
"total": 1,
|
|
70
|
+
"rows": [见表结构reservation定义]
|
|
71
|
+
}
|
|
72
|
+
*/
|
|
73
|
+
export function list(query) {
|
|
74
|
+
return requestShow({
|
|
75
|
+
url: '/reservations',
|
|
76
|
+
method: 'get',
|
|
77
|
+
params: query
|
|
78
|
+
})
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* 新增预约记录
|
|
83
|
+
* @param {Object} data - 包含预约记录的请求体 属性见表结构reservation定义。
|
|
84
|
+
* @returns {number} code - 返回码,0表示成功
|
|
85
|
+
* @returns {string} data - 新增成功的数据 见表结构reservation定义
|
|
86
|
+
*/
|
|
87
|
+
export function create(data) {
|
|
88
|
+
return requestShow({
|
|
89
|
+
url: '/reservations',
|
|
90
|
+
method: 'post',
|
|
91
|
+
data
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* 获取预约记录
|
|
97
|
+
* @param {string} id - 预约记录id
|
|
98
|
+
* @returns {number} code - 返回码,0表示成功。
|
|
99
|
+
* @returns {Object} data - 预约记录对象 见表结构reservation定义
|
|
100
|
+
*/
|
|
101
|
+
export function getOne(id) {
|
|
102
|
+
return requestShow({
|
|
103
|
+
url: `/reservations/${id}`,
|
|
104
|
+
method: 'get'
|
|
105
|
+
})
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* 修改预约记录
|
|
110
|
+
* @param {Object} data - 包含预约记录的请求体 属性见表结构reservation定义。
|
|
111
|
+
* @returns {number} code - 返回码,0表示成功
|
|
112
|
+
* @returns {string} data - 修改成功的数据 见表结构reservation定义
|
|
113
|
+
*/
|
|
114
|
+
export function updateOne(data) {
|
|
115
|
+
return requestShow({
|
|
116
|
+
url: `/reservations/${data._id}`,
|
|
117
|
+
method: 'put',
|
|
118
|
+
data
|
|
119
|
+
})
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* 删除预约记录
|
|
124
|
+
* @param {string} id - 删除的预约记录id。
|
|
125
|
+
* @returns {number} code - 返回码,0表示成功
|
|
126
|
+
* @returns {string} data - 删除成功的数据 见表结构reservation定义
|
|
127
|
+
*/
|
|
128
|
+
export function deleteOne(id) {
|
|
129
|
+
return requestShow({
|
|
130
|
+
url: `/reservations/${id}`,
|
|
131
|
+
method: 'delete'
|
|
132
|
+
})
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* 批量删除预约记录
|
|
137
|
+
* @param {Array} ids - 删除的预约记录ids。
|
|
138
|
+
* @returns {number} code - 返回码,0表示成功
|
|
139
|
+
*/
|
|
140
|
+
export function deleteMany(ids) {
|
|
141
|
+
return requestShow({
|
|
142
|
+
url: '/reservations',
|
|
143
|
+
method: 'delete',
|
|
144
|
+
data: ids // delete传递主体要包含在data里
|
|
145
|
+
})
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
export default {
|
|
150
|
+
list,
|
|
151
|
+
create,
|
|
152
|
+
updateOne,
|
|
153
|
+
deleteOne,
|
|
154
|
+
deleteMany,
|
|
155
|
+
getOne
|
|
156
|
+
}
|
package/api/userDevice.js
CHANGED
|
@@ -12,7 +12,9 @@ import { requestShow } from '../utils'
|
|
|
12
12
|
* @property {string} _id - 用户权限配置id.
|
|
13
13
|
* @property {string} user - 用户id.
|
|
14
14
|
* @property {array} devices - 绑定的设备id数组.
|
|
15
|
-
* @property {array} apps - 绑定的看板路由id
|
|
15
|
+
* @property {array} apps - 绑定的看板路由id数组.
|
|
16
|
+
* @property {array} areas - 绑定的区域id数组.
|
|
17
|
+
* @property {array} departs - 绑定的层级数组.
|
|
16
18
|
* @property {array} approutes - 绑定的应用中的页面和路由.
|
|
17
19
|
* @property {string} approutes.application - 所属应用.
|
|
18
20
|
* @property {string} approutes.appRouter - 看板路由id.
|
|
@@ -29,6 +31,13 @@ import { requestShow } from '../utils'
|
|
|
29
31
|
],
|
|
30
32
|
"_id": "674e9c7ded8b5a000786a5ba",
|
|
31
33
|
"user": "66ea75fc81f1de269eec3ee9",
|
|
34
|
+
"areas": [
|
|
35
|
+
"638eb453cff209441968e76e",
|
|
36
|
+
"638eb4a3cff2093a6e68e77a"
|
|
37
|
+
],
|
|
38
|
+
"departs": [
|
|
39
|
+
"638eb453cff209441968e76e",
|
|
40
|
+
]
|
|
32
41
|
"approutes": [
|
|
33
42
|
{
|
|
34
43
|
"children": [],
|
package/index.js
CHANGED
|
@@ -27,6 +27,7 @@ import inspectionTaskSub from './api/inspectionTaskSub'
|
|
|
27
27
|
import product from './api/product'
|
|
28
28
|
import area from './api/area'
|
|
29
29
|
import areaClass from './api/areaClass'
|
|
30
|
+
import reservation from './api/reservation'
|
|
30
31
|
|
|
31
32
|
const api = {
|
|
32
33
|
alarmRecord,
|
|
@@ -54,7 +55,8 @@ const api = {
|
|
|
54
55
|
inspectionTaskSub,
|
|
55
56
|
product,
|
|
56
57
|
area,
|
|
57
|
-
areaClass
|
|
58
|
+
areaClass,
|
|
59
|
+
reservation
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
export default {
|