nayota-show-sdk 1.3.46 → 1.3.47
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/patrolPoints.js +131 -0
- package/index.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { requestShow } from '../utils'
|
|
2
|
+
/**
|
|
3
|
+
* @file 巡查点位api
|
|
4
|
+
* @module 巡查点位接口
|
|
5
|
+
* @category 巡更管理
|
|
6
|
+
* @categoryOrder 7
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {Object} patrolPoint - 巡查点位
|
|
11
|
+
* @property {string} _id - 点位id.
|
|
12
|
+
* @property {string} name - 点位名称.
|
|
13
|
+
* @property {number} x - 坐标x
|
|
14
|
+
* @property {number} y - 坐标y
|
|
15
|
+
* @property {string} resourceType - 资源类型
|
|
16
|
+
* @property {string} resourceAddress - 资源地址
|
|
17
|
+
* @property {string} depart - 层级
|
|
18
|
+
* @property {boolean} isPanorama - 是否全景
|
|
19
|
+
* @property {string} remark - 备注
|
|
20
|
+
* @example
|
|
21
|
+
* [
|
|
22
|
+
* {
|
|
23
|
+
* "_id": "67073bfe463d6e00099becdd",
|
|
24
|
+
* "name": "1号位置",
|
|
25
|
+
* "x": 100,
|
|
26
|
+
* "y": 200,
|
|
27
|
+
* "resourceType": "image",
|
|
28
|
+
* "resourceAddress": "/uploads/1.jpg",
|
|
29
|
+
* "depart": "6678e31ff340dfdecd9e1a28",
|
|
30
|
+
* "isPanorama": false,
|
|
31
|
+
* "remark": "备注信息",
|
|
32
|
+
* "createdAt": "2024-10-10T02:29:18.026Z",
|
|
33
|
+
* "updatedAt": "2024-10-10T02:29:18.026Z",
|
|
34
|
+
* "__v": 0
|
|
35
|
+
* }
|
|
36
|
+
* ]
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* 获取巡查点位列表
|
|
43
|
+
* @param {Object} query - 请求对象
|
|
44
|
+
* @param {number} query.page - 页码
|
|
45
|
+
* @param {number} query.limit - 每页数量
|
|
46
|
+
* @returns {number} code - 返回码,0表示成功
|
|
47
|
+
* @returns {number} total - 页面总数
|
|
48
|
+
* @returns {Array} rows - 页面数组见表结构patrolPoint定义
|
|
49
|
+
*/
|
|
50
|
+
export function list(query) {
|
|
51
|
+
return requestShow({
|
|
52
|
+
url: '/patrol-points',
|
|
53
|
+
method: 'get',
|
|
54
|
+
params: query
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* 新增巡查点位
|
|
60
|
+
* @param {Object} data - 包含巡查点位的请求体 属性见表结构patrolPoint定义。
|
|
61
|
+
* @returns {number} code - 返回码,0表示成功
|
|
62
|
+
* @returns {string} data - 新增成功的数据 见表结构patrolPoint定义
|
|
63
|
+
*/
|
|
64
|
+
export function create(data) {
|
|
65
|
+
return requestShow({
|
|
66
|
+
url: '/patrol-points',
|
|
67
|
+
method: 'post',
|
|
68
|
+
data
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* 获取巡查点位
|
|
74
|
+
* @param {string} id - 巡查点位id
|
|
75
|
+
* @returns {number} code - 返回码,0表示成功。
|
|
76
|
+
* @returns {Object} data - 巡查点位对象 见表结构patrolPoint定义
|
|
77
|
+
*/
|
|
78
|
+
export function getOne(id) {
|
|
79
|
+
return requestShow({
|
|
80
|
+
url: `/patrol-points/${id}`,
|
|
81
|
+
method: 'get'
|
|
82
|
+
})
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* 修改巡查点位
|
|
87
|
+
* @param {Object} data - 包含巡查点位的请求体 属性见表结构patrolPoint定义。
|
|
88
|
+
* @returns {number} code - 返回码,0表示成功
|
|
89
|
+
* @returns {string} data - 修改成功的数据 见表结构patrolPoint定义
|
|
90
|
+
*/
|
|
91
|
+
export function updateOne(data) {
|
|
92
|
+
return requestShow({
|
|
93
|
+
url: `/patrol-points/${data._id}`,
|
|
94
|
+
method: 'put',
|
|
95
|
+
data
|
|
96
|
+
})
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* 删除巡查点位
|
|
100
|
+
* @param {string} id - 删除的巡查点位id。
|
|
101
|
+
* @returns {number} code - 返回码,0表示成功
|
|
102
|
+
* @returns {string} data - 删除成功的数据 见表结构patrolPoint定义
|
|
103
|
+
*/
|
|
104
|
+
export function deleteOne(id) {
|
|
105
|
+
return requestShow({
|
|
106
|
+
url: `/patrol-points/${id}`,
|
|
107
|
+
method: 'delete'
|
|
108
|
+
})
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* 批量删除巡查点位
|
|
113
|
+
* @param {Array} ids - 删除的巡查点位ids。
|
|
114
|
+
* @returns {number} code - 返回码,0表示成功
|
|
115
|
+
*/
|
|
116
|
+
export function deleteMany(ids) {
|
|
117
|
+
return requestShow({
|
|
118
|
+
url: '/patrol-points',
|
|
119
|
+
method: 'delete',
|
|
120
|
+
data: ids // delete传递主体要包含在data里
|
|
121
|
+
})
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export default {
|
|
125
|
+
list,
|
|
126
|
+
create,
|
|
127
|
+
updateOne,
|
|
128
|
+
deleteOne,
|
|
129
|
+
deleteMany,
|
|
130
|
+
getOne
|
|
131
|
+
}
|
package/index.js
CHANGED
|
@@ -22,6 +22,7 @@ import userDevice from "./api/userDevice";
|
|
|
22
22
|
import video from "./api/video";
|
|
23
23
|
import line from "./api/line";
|
|
24
24
|
import inspectionPoints from "./api/inspectionPoints";
|
|
25
|
+
import patrolPoints from "./api/patrolPoints";
|
|
25
26
|
import inspectionTask from "./api/inspectionTask";
|
|
26
27
|
import inspectionTaskSub from "./api/inspectionTaskSub";
|
|
27
28
|
import product from "./api/product";
|
|
@@ -57,6 +58,7 @@ const api = {
|
|
|
57
58
|
video,
|
|
58
59
|
line,
|
|
59
60
|
inspectionPoints,
|
|
61
|
+
patrolPoints,
|
|
60
62
|
inspectionTask,
|
|
61
63
|
inspectionTaskSub,
|
|
62
64
|
product,
|