优化 智能安全帽 获取人员最新位置接口更换
This commit is contained in:
parent
cd9680389a
commit
86a75980d1
@ -75,6 +75,10 @@ export const getRealtimeDataApi = (params: {}) => {
|
||||
export const getSafeHatDayRecordApi = (params: {}) => {
|
||||
return http.get(BASEURL + `/xmgl/safetyHatData/list`, params);
|
||||
};
|
||||
// 获取每个设备最新一条实时数据信息
|
||||
export const getSafetyHatNewestApi = (params: {}) => {
|
||||
return http.post(BASEURL + `/xmgl/safetyHatData/getNewestList`, params);
|
||||
};
|
||||
// 智能安全帽--删除围栏
|
||||
export const deleteSafehatFence = (params: {}) => {
|
||||
return http.post(BASEURL + `/xmgl/safetyHatFence/deleteBatch`, params);
|
||||
@ -82,4 +86,4 @@ export const deleteSafehatFence = (params: {}) => {
|
||||
// 智能安全帽--添加围栏
|
||||
export const addSafeHatPositionFence = (params: {}) => {
|
||||
return http.post(BASEURL + `/xmgl/safetyHatFence/add`, params);
|
||||
};
|
||||
};
|
||||
|
||||
@ -399,6 +399,7 @@ import {
|
||||
getVehiclePositionDayRecord,
|
||||
getWeekAlarmDataApi,
|
||||
getRealtimeDataApi,
|
||||
getSafetyHatNewestApi,
|
||||
getSafeHatDayRecordApi,
|
||||
deleteSafehatFence,
|
||||
addSafeHatPositionFence
|
||||
@ -1074,27 +1075,39 @@ function devChange(e) {
|
||||
// 获取车辆实时数据
|
||||
// 智能安全帽--获取实时数据
|
||||
function getRealTimeData(e) {
|
||||
let name = "";
|
||||
let data = {
|
||||
devSn: e.devSn,
|
||||
// devSn: "866652021371993",
|
||||
projectSn: store.sn
|
||||
};
|
||||
getRealtimeDataApi(data).then(res => {
|
||||
// 代码优化,查询最新位置,旧逻辑使用的list,会返回几千个点位数据,响应慢
|
||||
getSafetyHatNewestApi({
|
||||
projectSn: store.sn,
|
||||
devSns: [e.devSn]
|
||||
}).then(res => {
|
||||
if (res.result.length > 0) {
|
||||
// if (res.result.records[0].type === 1) {
|
||||
// echoCarMarker(res.result.records[0]);
|
||||
// }
|
||||
// if (res.result.records[0].type === 2) {
|
||||
// echoPersonMarker(res.result.records[0]);
|
||||
// }
|
||||
// echoCarMarker(res.result[0]);
|
||||
echoPersonMarker(res.result[0]);
|
||||
} else {
|
||||
console.log("设备暂无数据", res);
|
||||
}
|
||||
console.log("实时数据", res);
|
||||
});
|
||||
// let name = "";
|
||||
// let data = {
|
||||
// devSn: e.devSn,
|
||||
// // devSn: "866652021371993",
|
||||
// projectSn: store.sn
|
||||
// };
|
||||
// getRealtimeDataApi(data).then(res => {
|
||||
// if (res.result.length > 0) {
|
||||
// // if (res.result.records[0].type === 1) {
|
||||
// // echoCarMarker(res.result.records[0]);
|
||||
// // }
|
||||
// // if (res.result.records[0].type === 2) {
|
||||
// // echoPersonMarker(res.result.records[0]);
|
||||
// // }
|
||||
// // echoCarMarker(res.result[0]);
|
||||
// echoPersonMarker(res.result[0]);
|
||||
// } else {
|
||||
// console.log("设备暂无数据", res);
|
||||
// }
|
||||
// console.log("实时数据", res);
|
||||
// });
|
||||
}
|
||||
|
||||
// 智能安全帽--获取围栏列表数据
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user