Files
web-Iot/src/api/device.ts
2026-05-25 15:26:28 +08:00

180 lines
3.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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() {
return request({
url: '/iot/UAV/getUAVList',
method: 'get',
})
}
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
})
}
// 远程遥控 判断是否有权限/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 postLiveHeartbeat(data) {
return request({
url: `/iot/UAV/liveHeartbeat?sn=${data.sn}&cameraIndex=${data.cameraIndex}`,
method: 'post',
})
}