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