liuxiaolong
2019-05-06 3e0536f508aad49f743e7bfabca34e3980a1b6e2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
import {
  httpGET,
  httpPOST
} from './common/httpFetch'
/* 检索管理 */
/**
 * @description 获取所有设备树( 不分集群和非集群)
 * @param { string } condition 检索关键字
 */
export const getAreaDeviceList = body => {
  return httpGET('data/api-d/device/findByArea', {
    body
  })
}
/**
 * @description 删除设备
 * @param { string } id
 */
export const delDevice = body => {
  return httpPOST('data/api-d/device/deleteDevice', {
    body,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}
/**
 * @description 通过id查找设备
 * @param { string } id
 */
export const getDeviceById = body => {
  return httpPOST('data/api-d/device/getDeviceById', {
    body,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}
/**
 * @description 保存设备
 * @param { string } id 编辑使用(设备id)
 * @param { string } orgId 节点id
 * @param { string } type 设备类型
 * @param { string } name 设备名称
 * @param { string } brand 摄像机品牌
 * @param { string } address 位置
 * @param { string } latitude 维度
 * @param { string } longitude 经度
 * @param { string } ip ip
 * @param { string } port 端口
 * @param { string } username 用户名
 * @param { string } password 密码
 * @param { string } code 编码 (临时注释,暂时不传)
 * 预留字段
 * @param { string } remarks 备注
 * @param { string } revJson 预留字段
 */
export const saveDevice = body => {
  return httpPOST('data/api-d/device/saveDevice', {
    body
  })
}
 
/**
 * @description 获取平台设备列表
 * @param { string } start 开始条
 * @param { string } length 长度
 * @param { string } orgId  组织机构id
 * @param { string } condition 设备名称/设备id/设备位置 非必传
 */
export const getLocalDeviceList = body => {
  return httpGET('data/api-d/device/findPlatDeviceList', {
    body
  })
}
/**
 * @description 获取设备品牌
 */
export const getDeviceBrand = body => {
  return httpGET('data/api-d/device/getDeviceBrand', {
    body
  })
}
/**
 * @description 获取设备类型
 */
export const getDeviceType = body => {
  return httpPOST('data/api-d/device/getDeviceType', {
    body,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}
/**
 * @description 获取设备组织机构
 * @param { string } name 检索参数 非必传
 */
export const getDeviceOrgType = body => {
  return httpPOST('data/api-d/device/getDeviceOrgType', {
    body,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}
/* ********************************************************** */
/* 集群管理 */
/**
 * @description 查询集群和节点信息
 * @param { string } id 点击节点id
 * @param { string } type 点击节点类型(1:集群,2:节点,3:设备)
 * @param { string } condition 检索参数 非必传
 */
export const getColonyList = body => {
  return httpGET('data/api-d/cluster/findClusterList', {
    body
  })
}
/**
 * @description 退出集群
 * @param { string } id 点击节点id
 * @param { string } cookie 密码
 */
export const delColony = body => {
  return httpGET('data/api-d/cluster/delete', {
    body
  })
}
/**
 * @description 查询集群和节点信息
 */
export const getAllColonyNode = body => {
  return httpPOST('data/api-d/cluster/getClusterDeviceTree', {
    body,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}
/**
 * @description 通过集群内节点ip查找集群信息
 * @param { string } nodeIp 节点ip地址
 */
export const getNodeByIp = body => {
  return httpPOST('data/api-d/cluster/findClusterInfoByNodeIp', {
    body,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}
/**
 * @description 保存集群和节点信息
 * @param { string } address  ip
 * @param { string } cookie  密码
 */
export const saveCluster = body => {
  return httpPOST('data/api-d/cluster/save', {
    body,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}
/**
 * @description 通过集群ids查询集群及节点信息
 * @param { string } ids
 */
export const getNodeByClusterIds = body => {
  return httpPOST('data/api-d/cluster/findClusterNodesByClusterIds', {
    body,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}
/**
 * @description 根据节点Id, 查询节点详细信息及归属的集群
 * @param { string } nodeIds 节点Ids,多个用逗号分隔
 */
export const getNodeByNodeId = body => {
  return httpPOST('data/api-d/cluster/findNodeById', {
    body,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}
/**
 * @description 获取集群节点及同步库信息
 */
export const getAllCluDataBaseList = body => {
  return httpPOST('data/api-d/cluster/getAllCluDataBaseList', {
    body,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}
/**
 * @description 获取所有集群设备级别信息, 实时查询
 */
export const getAllCluListData = body => {
  return httpPOST('data/api-d/cluster/getAllCluListData', {
    body,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}
/**
 * @description 获取集群设备树(带全选)
 */
export const getClusterTreeData = body => {
  return httpPOST('data/api-d/cluster/getClusterTreeData', {
    body,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}
/**
 * @description 获取所有设备信息
 */
export const findAllDevices = body => {
  return httpGET('data//api-d/device/findAllDevices', {
    body
  })
}
/**
 * @description 更新设备经纬度
 * @param {String}  id  设备id
 * @param {String}  type  设备类型
 * @param {String}  longitude 经度
 * @param {String}  latitude 纬度
 */
export const updatePosById = body => {
  return httpGET('data/api-d/device/updatePosById', {
    body,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}
/**
 * @description 获取设备状态字典
 */
export const getStatus = body => {
  return httpGET('data/api-d/device/getStatus', {
    body,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}
/**
 * @description 更新节点公网ip和端口
 * @param {String}  id  设备id
 * @param {String}  publicIp  公网ip
 * @param {String}  publicPort 公网端口
 */
export const setPublicUrl = body => {
  return httpGET('data/api-d/device/updatePublicIpPort', {
    body
  })
}