488 lines
8.0 KiB
TypeScript
488 lines
8.0 KiB
TypeScript
|
||
import request from './request';
|
||
|
||
export function getDeviceListApi(data) {
|
||
return request({
|
||
url: `/iot/device/userDevice?tenantName=${data.tenantName}&deptId=${data.deptId}`,
|
||
method: 'get',
|
||
});
|
||
}
|
||
|
||
|
||
export function getPlaneDeviceList(params) {
|
||
return request({
|
||
url: '/iot/UAV/getUAVList',
|
||
method: 'get',
|
||
params
|
||
})
|
||
}
|
||
|
||
//modeStatistics{"0":"空闲中","1":"现场调试","2":"远程调试","3":"固件升级中","4":"作业中"}
|
||
|
||
|
||
export function getSiteUAVList(siteId) {
|
||
return request({
|
||
url: '/iot/UAV/getSiteUAVList',
|
||
method: 'get',
|
||
params: { siteId }
|
||
})
|
||
}
|
||
|
||
export function getLiveStream(data) {
|
||
return request({
|
||
url: '/iot/UAV/liveStream',
|
||
method: 'post',
|
||
data
|
||
})
|
||
}
|
||
|
||
export function getControlRight(params) {
|
||
return request({
|
||
url: `/websocket/judgeConnection`,
|
||
method: 'get',
|
||
params
|
||
})
|
||
}
|
||
|
||
// 获取无人机实时状态详情
|
||
export function getUAVState(params) {
|
||
return request({
|
||
url: '/iot/UAV/getUAVState',
|
||
method: 'get',
|
||
params
|
||
})
|
||
}
|
||
|
||
// 远程遥控 判断是否有权限/forward/device/remoteControl platform:web
|
||
export function getJurisdiction(data) {
|
||
return request({
|
||
url: '/forward/device/remoteControl',
|
||
method: 'post',
|
||
data
|
||
})
|
||
}
|
||
|
||
//
|
||
|
||
// 获取所有航线
|
||
|
||
export function getsinglePlan(data) {
|
||
return request({
|
||
url: `/iot/UAV/getFlightTask`,
|
||
method: 'post',
|
||
data
|
||
})
|
||
}
|
||
|
||
// 获取航线轨迹 iot/UAV/getFlightTaskTrack
|
||
|
||
export function getsinglePlanTrack(data) {
|
||
return request({
|
||
url: `/iot/UAV/getFlightTaskTrack?taskId=${data.uuid}`,
|
||
method: 'get',
|
||
})
|
||
}
|
||
|
||
//上传航线
|
||
|
||
export function uploadWayLine(data) {
|
||
return request({
|
||
url: '/iot/UAV/uploadWayline',
|
||
method: 'post',
|
||
data: data, // 上传文件必须用 data,不能用 params
|
||
headers: {
|
||
'Content-Type': 'multipart/form-data' // 上传文件必加!
|
||
}
|
||
})
|
||
}
|
||
|
||
//创建航线任务
|
||
export function createWaylineTask(data) {
|
||
return request({
|
||
url: '/iot/UAV/createFlightTask',
|
||
method: 'post',
|
||
data: data,
|
||
})
|
||
}
|
||
|
||
|
||
|
||
export function updateFlightTaskStatus(taskId, status) {
|
||
return request({
|
||
url: '/iot/UAV/updateFlightTaskStatus',
|
||
method: 'post',
|
||
params: { taskId, status }
|
||
})
|
||
}
|
||
|
||
export function getFlightTaskDetail(taskId) {
|
||
return request({
|
||
url: '/iot/UAV/getFlightTaskDetail',
|
||
method: 'get',
|
||
params: { taskId }
|
||
})
|
||
}
|
||
|
||
/// 航线列表
|
||
export function getWayLine() {
|
||
return request({
|
||
url: '/iot/UAV/getWayline',
|
||
method: 'get',
|
||
})
|
||
}
|
||
//直播流
|
||
|
||
|
||
///iot/UAV/flightTaskCommand
|
||
export function postFlightCommmand(data) {
|
||
return request({
|
||
url: '/iot/UAV/flightTaskCommand',
|
||
method: 'post',
|
||
data
|
||
})
|
||
}
|
||
|
||
//切换相机
|
||
|
||
export function changeCameragateway(data) {
|
||
return request({
|
||
url: '/iot/UAV/changeCamera',
|
||
method: 'post',
|
||
data
|
||
})
|
||
}
|
||
|
||
//切换飞机摄像头/iot/UAV/changeLens
|
||
export function changeCameraPlane(data) {
|
||
return request({
|
||
url: '/iot/UAV/changeLens',
|
||
method: 'post',
|
||
data
|
||
})
|
||
}
|
||
|
||
// 绑定无人机
|
||
export function bindDrone(data) {
|
||
return request({
|
||
url: '/iot/UAV/bind',
|
||
method: 'post',
|
||
data
|
||
})
|
||
}
|
||
|
||
// 解绑无人机
|
||
export function unbindDrone(data) {
|
||
return request({
|
||
url: '/iot/UAV/unbind',
|
||
method: 'post',
|
||
data
|
||
})
|
||
}
|
||
|
||
|
||
// 绑定智能装备
|
||
export function bindSmartDevice(data) {
|
||
return request({
|
||
url: '/iot/device/bind',
|
||
method: 'post',
|
||
data
|
||
})
|
||
}
|
||
|
||
// 解绑智能装备
|
||
export function unbindSmartDevice(data) {
|
||
return request({
|
||
url: '/iot/device/unbind',
|
||
method: 'post',
|
||
data
|
||
})
|
||
}
|
||
|
||
// 批量导入绑定智能装备(上传 Excel)
|
||
// 上传文件必须用 data(FormData)且带 multipart/form-data 头
|
||
export function importBindDevices(data) {
|
||
return request({
|
||
url: '/iot/deviceRunParam/importData',
|
||
method: 'post',
|
||
data,
|
||
headers: {
|
||
'Content-Type': 'multipart/form-data'
|
||
}
|
||
})
|
||
}
|
||
|
||
// 直播心跳
|
||
|
||
export function postLiveHeartbeat(data) {
|
||
return request({
|
||
url: `/iot/UAV/liveHeartbeat?sn=${data.sn}&cameraIndex=${data.cameraIndex}`,
|
||
method: 'post',
|
||
})
|
||
}
|
||
|
||
|
||
//获取场站设备/iot/device/getSiteList
|
||
|
||
export function getSiteDevice(data) {
|
||
return request({
|
||
url: `/iot/device/getSiteList`,
|
||
method: 'get',
|
||
params: data
|
||
})
|
||
}
|
||
|
||
//获取配置i界面机器人设备/iot/device/getDeviceList
|
||
|
||
export function getAllDevice(data) {
|
||
return request({
|
||
url: `/iot/device/getDeviceList`,
|
||
method: 'get',
|
||
params: data
|
||
})
|
||
}
|
||
|
||
|
||
export function getPlaneDeviceListAll() {
|
||
return request({
|
||
url: '/iot/UAV/getProjectDeviceList',
|
||
method: 'get',
|
||
})
|
||
}
|
||
|
||
export function getRobotTaskList(params) {
|
||
return request({
|
||
url: '/iot/deviceTask/getSiteDevicePlan',
|
||
method: 'get',
|
||
params
|
||
})
|
||
}
|
||
|
||
export function getRobotTask(data) {
|
||
return request({
|
||
url: '/iot/deviceTask/deviceTaskPool',
|
||
method: 'post',
|
||
data
|
||
})
|
||
}
|
||
|
||
|
||
|
||
//路径规划列表/iot/workRecord/selectBySiteId
|
||
|
||
export function getRobotRouteList(params) {
|
||
return request({
|
||
url: '/iot/workRecord/selectBySiteId',
|
||
method: 'get',
|
||
params
|
||
})
|
||
}
|
||
//新建任务
|
||
export function saveDeviceTask(data) {
|
||
return request({
|
||
url: `/iot/deviceTask/save`,
|
||
method: 'post',
|
||
data
|
||
})
|
||
}
|
||
|
||
//删除机器人任务/iot/deviceTask/delete
|
||
|
||
export function deleteDeviceTask(data) {
|
||
return request({
|
||
url: `/iot/deviceTask/delete`,
|
||
method: 'get',
|
||
params: data
|
||
})
|
||
}
|
||
|
||
//创建路径规划并且执行
|
||
|
||
export function excuetRoute(data) {
|
||
return request({
|
||
url: `/iot/deviceTask/createDeviceTask`,
|
||
method: 'post',
|
||
data
|
||
|
||
})
|
||
}
|
||
|
||
//取消任务
|
||
|
||
export function cancelRoute(data) {
|
||
return request({
|
||
url: `/iot/deviceTask/cancelTask`,
|
||
method: 'post',
|
||
data
|
||
|
||
})
|
||
}
|
||
|
||
export function pauseRoute(data) {
|
||
return request({
|
||
url: `/iot/deviceTask/pauseTask`,
|
||
method: 'post',
|
||
data
|
||
|
||
})
|
||
}
|
||
|
||
//恢复任务
|
||
|
||
export function recoverRoute(data) {
|
||
return request({
|
||
url: `/iot/deviceTask/recoveryTask`,
|
||
method: 'post',
|
||
data
|
||
|
||
})
|
||
}
|
||
|
||
//当前执行和待执行的任务
|
||
|
||
export function getDeviceTastPool(data) {
|
||
return request({
|
||
url: `/iot/deviceTask/deviceTaskPool`,
|
||
method: 'post',
|
||
data
|
||
|
||
})
|
||
}
|
||
//获取历史任务
|
||
export function getSiteDeviceTaskHistory(data) {
|
||
return request({
|
||
url: `/iot/deviceTask/getSiteDeviceTaskHistory`,
|
||
method: 'post',
|
||
data
|
||
|
||
})
|
||
}
|
||
|
||
//获取统计数据/iot/device/getDeviceIntradayData
|
||
|
||
export function getDeviceStatistics(data) {
|
||
return request({
|
||
url: `/iot/device/getDeviceRunStatistics`,
|
||
method: 'get',
|
||
params: data
|
||
})
|
||
}
|
||
|
||
//getDeviceTotalData
|
||
|
||
|
||
export function getDeviceTotalData(data) {
|
||
return request({
|
||
url: `/iot/device/getDeviceTotalData`,
|
||
method: 'get',
|
||
params: data
|
||
})
|
||
}
|
||
|
||
export function releaseControl(data) {
|
||
return request({
|
||
url: '/forward/device/releaseControl',
|
||
method: 'post',
|
||
data
|
||
})
|
||
}
|
||
|
||
//修改设备别名
|
||
|
||
export function updateDeviceAliasApi(data) {
|
||
return request({
|
||
url: '/forward/device/updateDeviceAlias',
|
||
method: 'post',
|
||
data
|
||
})
|
||
}
|
||
|
||
//获取单个路径规划信息
|
||
|
||
export function getSingleRouteList(params) {
|
||
return request({
|
||
url: '/iot/workRecord/selectById',
|
||
method: 'get',
|
||
params
|
||
})
|
||
}
|
||
|
||
//根据 任务获取规划点位
|
||
export function getRouteByTask(params) {
|
||
return request({
|
||
url: '/iot/workRecord/selectByTaskId',
|
||
method: 'get',
|
||
params
|
||
})
|
||
}
|
||
|
||
//删除预设路径
|
||
|
||
export function deleteRoute(workName) {
|
||
return request({
|
||
url: '/iot/workRecord/deleteByWorkName?workName=' + workName,
|
||
method: 'get',
|
||
})
|
||
}
|
||
|
||
//增加预设路径iot/workRecord/add
|
||
|
||
export function addRoute(data) {
|
||
const config = {
|
||
url: '/iot/workRecord/add', // 修正为正确的添加接口
|
||
method: 'post',
|
||
data,
|
||
timeout: 60000,
|
||
|
||
};
|
||
|
||
|
||
|
||
return request(config);
|
||
}
|
||
|
||
//配置设备参数
|
||
|
||
export function deviceCommmand(data) {
|
||
return request({
|
||
url: '/netty/device/sendCommand',
|
||
method: 'post',
|
||
data
|
||
})
|
||
}
|
||
|
||
///iot/device/paramModifyAuth
|
||
//设备前置授权
|
||
export function getDeviceAuth(data) {
|
||
return request({
|
||
url: '/iot/device/paramModifyAuth',
|
||
method: 'post',
|
||
data
|
||
})
|
||
}
|
||
//查看当前是否有权限修改
|
||
export function hasPermission(params) {
|
||
return request({
|
||
url: '/iot/device/hasPermission',
|
||
method: 'get',
|
||
params
|
||
})
|
||
}
|
||
|
||
///iot/workRecord/getTaskPath?taskId=74 get 获取算法回传的路径
|
||
export function getTaskPath(params) {
|
||
return request({
|
||
url: '/iot/workRecord/getTaskPath',
|
||
method: 'get',
|
||
params
|
||
})
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|