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
|
})
|
}
|