优化了一点 样式和设备控制
This commit is contained in:
375
src/api/api.ts
375
src/api/api.ts
@@ -1,342 +1,331 @@
|
||||
import api from './request';
|
||||
|
||||
|
||||
export function getDeviceListApi(data){
|
||||
return api({
|
||||
url: `/iot/device/userDevice?tenantName=${data.tenantName}&deptId=${data.deptId}`,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
export function getUserList(params) {
|
||||
return api({
|
||||
url: '/system/user/list',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
return api({
|
||||
url: '/system/user/list',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 作业列表
|
||||
|
||||
// 作业列表
|
||||
export function getWorkList(data) {
|
||||
return api({
|
||||
url: `/iot/workRecord/selectByUserId?userId=${data.userId}`,
|
||||
method: 'get',
|
||||
})
|
||||
return api({
|
||||
url: `/iot/workRecord/selectByUserId?userId=${data.userId}`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
// /iot/deviceTask/save 新建路线
|
||||
export function saveDeviceTask(data) {
|
||||
return api({
|
||||
url: `/iot/deviceTask/save`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
export function saveDeviceTask(data) {
|
||||
return api({
|
||||
url: `/iot/deviceTask/save`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 获取任务列表
|
||||
export function getDeviceTask(data) {
|
||||
return api({
|
||||
url: `/iot/deviceTask/getDevicePlan`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
export function getDeviceTask(data) {
|
||||
return api({
|
||||
url: `/iot/deviceTask/getDevicePlan`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 获取任务分布/iot/deviceTask/devicePlanStatistics
|
||||
|
||||
export function getTaskDistribution(params) {
|
||||
return api({
|
||||
url: `/iot/deviceTask/devicePlanStatistics`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
export function getTaskDistribution(params) {
|
||||
return api({
|
||||
url: `/iot/deviceTask/devicePlanStatistics`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
//选择某一个数据https://serviceri.satabot.com/iot/workRecord/selectByWorkName?workName=${workName}&_t=${Date.now()}
|
||||
export function getSingleWork(data) {
|
||||
return api({
|
||||
url: `/iot/workRecord/selectByWorkName?workName=${data.workName}`,
|
||||
method: 'get',
|
||||
})
|
||||
export function getSingleWork(data) {
|
||||
return api({
|
||||
url: `/iot/workRecord/selectByWorkName?workName=${data.workName}`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
// 执行结果/iot/deviceTask/devicePlanTaskStatistics
|
||||
export function getDevicePlanTaskStatistics(params) {
|
||||
return api({
|
||||
url: `/iot/deviceTask/devicePlanTaskStatistics`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
export function getDevicePlanTaskStatistics(params) {
|
||||
return api({
|
||||
url: `/iot/deviceTask/devicePlanTaskStatistics`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 获取当前的设备运行路线/iot/deviceTask/concurrentDeviceRoute
|
||||
export function getConcurrentDeviceRoute (params) {
|
||||
return api({
|
||||
url: `/iot/deviceTask/concurrentDeviceRoute`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
export function getConcurrentDeviceRoute(params) {
|
||||
return api({
|
||||
url: `/iot/deviceTask/concurrentDeviceRoute`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
// 获取作业数据/iot/deviceTask/workStatistics
|
||||
export function getWorkStatistics(params) {
|
||||
return api({
|
||||
url: `/iot/deviceTask/workStatistics`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
export function getWorkStatistics(params) {
|
||||
return api({
|
||||
url: `/iot/deviceTask/workStatistics`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 判断是否能控制
|
||||
export function getControlRight(params) {
|
||||
const dataStr = localStorage.getItem('userInfo');
|
||||
let parse = JSON.parse(dataStr);
|
||||
var token=parse?.token;
|
||||
return api({
|
||||
url: `/websocket/judgeConnection`,
|
||||
method: 'get',
|
||||
headers: {
|
||||
Authorization: token // token 正常带上
|
||||
},
|
||||
params
|
||||
})
|
||||
const dataStr = localStorage.getItem('userInfo');
|
||||
let parse = JSON.parse(dataStr);
|
||||
var token = parse?.token;
|
||||
return api({
|
||||
url: `/websocket/judgeConnection`,
|
||||
method: 'get',
|
||||
headers: {
|
||||
Authorization: token // token 正常带上
|
||||
},
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 登录
|
||||
export function loginApi(data) {
|
||||
return api({
|
||||
url: '/login',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
return api({
|
||||
url: '/login',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 可视化面板获取无人机信息
|
||||
|
||||
export function getPlaneDeviceList() {
|
||||
return api({
|
||||
url: '/iot/UAV/getProjectDeviceList',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 获取所有航线
|
||||
|
||||
export function getsinglePlan(data) {
|
||||
return api({
|
||||
url: `/iot/UAV/getFlightTask?sn=${data.gateway_sn}`,
|
||||
method: 'get',
|
||||
})
|
||||
return api({
|
||||
url: `/iot/UAV/getFlightTask?sn=${data.gateway_sn}`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
// 获取航线轨迹 iot/UAV/getFlightTaskTrack
|
||||
|
||||
export function getsinglePlanTrack(data) {
|
||||
return api({
|
||||
url: `/iot/UAV/getFlightTaskTrack?taskId=${data.uuid}`,
|
||||
method: 'get',
|
||||
})
|
||||
return api({
|
||||
url: `/iot/UAV/getFlightTaskTrack?taskId=${data.uuid}`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
//上传航线
|
||||
|
||||
export function uploadWayLine(data) {
|
||||
return api({
|
||||
url: '/iot/UAV/uploadWayline',
|
||||
method: 'post',
|
||||
data: data, // 上传文件必须用 data,不能用 params
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data' // 上传文件必加!
|
||||
}
|
||||
})
|
||||
return api({
|
||||
url: '/iot/UAV/uploadWayline',
|
||||
method: 'post',
|
||||
data: data, // 上传文件必须用 data,不能用 params
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data' // 上传文件必加!
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//创建航线任务
|
||||
export function createWaylineTask(data) {
|
||||
return api({
|
||||
url: '/iot/UAV/createFlightTask',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
return api({
|
||||
url: '/iot/UAV/createFlightTask',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
export function updateFlightTaskStatus(taskId, status) {
|
||||
return api({
|
||||
url: '/iot/UAV/updateFlightTaskStatus',
|
||||
method: 'post',
|
||||
params: { taskId, status }
|
||||
})
|
||||
return api({
|
||||
url: '/iot/UAV/updateFlightTaskStatus',
|
||||
method: 'post',
|
||||
params: { taskId, status }
|
||||
})
|
||||
}
|
||||
|
||||
export function getFlightTaskDetail(taskId) {
|
||||
return api({
|
||||
url: '/iot/UAV/getFlightTaskDetail',
|
||||
method: 'get',
|
||||
params: { taskId }
|
||||
})
|
||||
return api({
|
||||
url: '/iot/UAV/getFlightTaskDetail',
|
||||
method: 'get',
|
||||
params: { taskId }
|
||||
})
|
||||
}
|
||||
|
||||
/// 航线列表
|
||||
export function getWayLine() {
|
||||
return api({
|
||||
url: '/iot/UAV/getWayline',
|
||||
method: 'get',
|
||||
})
|
||||
return api({
|
||||
url: '/iot/UAV/getWayline',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
//直播流
|
||||
|
||||
export function getLiveStream(data) {
|
||||
return api({
|
||||
url: '/iot/UAV/liveStream',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
return api({
|
||||
url: '/iot/UAV/liveStream',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
///iot/UAV/flightTaskCommand
|
||||
export function postFlightCommmand(data) {
|
||||
return api({
|
||||
url: '/iot/UAV/flightTaskCommand',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
return api({
|
||||
url: '/iot/UAV/flightTaskCommand',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
//切换相机
|
||||
|
||||
export function changeCamera(data) {
|
||||
return api({
|
||||
url: '/iot/UAV/changeCamera',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
return api({
|
||||
url: '/iot/UAV/changeCamera',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
//直播心跳
|
||||
|
||||
export function postLiveHeartbeat(data) {
|
||||
return api({
|
||||
url: `/iot/UAV/liveHeartbeat?sn=${data.sn}&cameraIndex=${data.cameraIndex}`,
|
||||
method: 'post',
|
||||
})
|
||||
return api({
|
||||
url: `/iot/UAV/liveHeartbeat?sn=${data.sn}&cameraIndex=${data.cameraIndex}`,
|
||||
method: 'post',
|
||||
})
|
||||
}
|
||||
|
||||
//热成像分析
|
||||
|
||||
export function getThermalDefault() {
|
||||
return api({
|
||||
url: `/api/thermal/defaults`,
|
||||
method: 'get',
|
||||
})
|
||||
return api({
|
||||
url: `/api/thermal/defaults`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
//点击分析
|
||||
|
||||
export function getThermalAnalyzelt(data) {
|
||||
return api({
|
||||
url: `/api/thermal/analyze`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
return api({
|
||||
url: `/api/thermal/analyze`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
//像素点信息/api/thermal/probe
|
||||
|
||||
export function getThermalProbe(data) {
|
||||
return api({
|
||||
url: `/api/thermal/probe`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
return api({
|
||||
url: `/api/thermal/probe`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
//获取报告
|
||||
export function getThermalReport(data) {
|
||||
return api({
|
||||
url: `/api/thermal/downloadReport`,
|
||||
method: 'get',
|
||||
data
|
||||
})
|
||||
return api({
|
||||
url: `/api/thermal/downloadReport`,
|
||||
method: 'get',
|
||||
data
|
||||
})
|
||||
}
|
||||
//下载报告
|
||||
export function downloadReport(data) {
|
||||
return api({
|
||||
url: `/api/thermal/report`,
|
||||
method: 'get',
|
||||
params: data,
|
||||
})
|
||||
return api({
|
||||
url: `/api/thermal/report`,
|
||||
method: 'get',
|
||||
params: data,
|
||||
})
|
||||
}
|
||||
|
||||
//获取 用户设备任务列表
|
||||
|
||||
export function getUserWorkRecord(params) {
|
||||
return api({
|
||||
url: `/iot/workRecord/selectByUserId`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
return api({
|
||||
url: `/iot/workRecord/selectByUserId`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
//获取 任务数据
|
||||
export function getWorkData(params) {
|
||||
return api({
|
||||
url: `/iot/workRecord/selectByWorkName`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
return api({
|
||||
url: `/iot/workRecord/selectByWorkName`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function getAlimage(params) {
|
||||
return api({
|
||||
url: `/api/thermal/image`,
|
||||
method: 'get',
|
||||
params,
|
||||
//responseType: "blob", // 必须加这个
|
||||
})
|
||||
return api({
|
||||
url: `/api/thermal/image`,
|
||||
method: 'get',
|
||||
params,
|
||||
//responseType: "blob", // 必须加这个
|
||||
})
|
||||
}
|
||||
|
||||
// 远程遥控 判断是否有权限/forward/device/remoteControl platform:web
|
||||
export function getJurisdiction(data) {
|
||||
return api({
|
||||
url: '/forward/device/remoteControl',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
return api({
|
||||
url: '/forward/device/remoteControl',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//下载割草任务记录
|
||||
//
|
||||
export function downloadOperationReport() {
|
||||
return api({
|
||||
url: '/iot/device/generateOperationReport',
|
||||
method: 'get',
|
||||
responseType: 'arraybuffer' // 👈 只需要加这一行!
|
||||
})
|
||||
return api({
|
||||
url: '/iot/device/generateOperationReport',
|
||||
method: 'get',
|
||||
responseType: 'arraybuffer' // 👈 只需要加这一行!
|
||||
})
|
||||
}
|
||||
|
||||
//
|
||||
export function getDeviceIntradayData(params) {
|
||||
return api({
|
||||
url: '/iot/device/getDeviceIntradayData',
|
||||
method: 'get',
|
||||
return api({
|
||||
url: '/iot/device/getDeviceIntradayData',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
//释放控制权限/forward/device/releaseControl
|
||||
export function releaseControl(data) {
|
||||
return api({
|
||||
url: '/forward/device/releaseControl',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
return api({
|
||||
url: '/forward/device/releaseControl',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
17
src/api/device.ts
Normal file
17
src/api/device.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
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/getProjectDeviceList',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user