Files
web-Iot/src/api/device.ts

433 lines
7.0 KiB
TypeScript
Raw Normal View History

2026-05-11 10:47:51 +08:00
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) {
2026-05-11 10:47:51 +08:00
return request({
2026-05-25 09:12:16 +08:00
url: '/iot/UAV/getUAVList',
2026-05-11 10:47:51 +08:00
method: 'get',
params
2026-05-11 10:47:51 +08:00
})
}
//modeStatistics{"0":"空闲中","1":"现场调试","2":"远程调试","3":"固件升级中","4":"作业中"}
2026-05-25 15:26:28 +08:00
export function getSiteUAVList(siteId) {
return request({
url: '/iot/UAV/getSiteUAVList',
method: 'get',
params: { siteId }
})
}
2026-05-11 14:59:36 +08:00
export function getLiveStream(data) {
return request({
url: '/iot/UAV/liveStream',
method: 'post',
data
})
}
2026-05-12 10:34:50 +08:00
export function getControlRight(params) {
return request({
url: `/websocket/judgeConnection`,
method: 'get',
params
})
}
2026-05-27 15:08:26 +08:00
// 获取无人机实时状态详情
export function getUAVState(params) {
return request({
url: '/iot/UAV/getUAVState',
method: 'get',
params
})
}
2026-05-12 10:34:50 +08:00
// 远程遥控 判断是否有权限/forward/device/remoteControl platform:web
export function getJurisdiction(data) {
return request({
url: '/forward/device/remoteControl',
method: 'post',
data
})
}
2026-05-15 09:37:22 +08:00
//
2026-05-21 13:32:11 +08:00
// 获取所有航线
export function getsinglePlan(data) {
return request({
2026-05-21 17:04:21 +08:00
url: `/iot/UAV/getFlightTask`,
method: 'post',
data
2026-05-21 13:32:11 +08:00
})
}
// 获取航线轨迹 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
})
}
//切换相机
2026-05-22 15:03:43 +08:00
export function changeCameragateway(data) {
2026-05-21 13:32:11 +08:00
return request({
url: '/iot/UAV/changeCamera',
method: 'post',
data
})
}
2026-05-22 15:03:43 +08:00
//切换飞机摄像头/iot/UAV/changeLens
export function changeCameraPlane(data) {
return request({
url: '/iot/UAV/changeLens',
method: 'post',
data
})
}
2026-05-25 13:06:38 +08:00
// 绑定无人机
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
})
}
2026-05-26 13:44:59 +08:00
// 绑定智能装备
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
})
}
2026-05-25 13:06:38 +08:00
// 直播心跳
2026-05-21 13:32:11 +08:00
export function postLiveHeartbeat(data) {
return request({
url: `/iot/UAV/liveHeartbeat?sn=${data.sn}&cameraIndex=${data.cameraIndex}`,
method: 'post',
})
}
2026-05-12 10:34:50 +08:00
//获取场站设备/iot/device/getSiteList
2026-05-25 15:26:28 +08:00
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
})
}
2026-05-25 15:26:28 +08:00
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({
2026-06-03 14:30:56 +08:00
url: `/iot/deviceTask/getSiteDeviceTaskHistory`,
method: 'post',
data
})
}
2026-06-03 14:16:31 +08:00
//获取统计数据/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
})
}
2026-06-04 15:39:46 +08:00
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
})
}
2026-06-15 17:19:04 +08:00
//根据 任务获取规划点位
export function getRouteByTask(params) {
return request({
url: '/iot/workRecord/selectByTaskId',
method: 'get',
params
})
}
2026-07-07 16:25:38 +08:00
//删除预设路径
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);
}