优化 智能安全帽 获取人员最新位置接口更换

This commit is contained in:
jiayu 2024-10-09 14:51:10 +08:00
parent cd9680389a
commit 86a75980d1
2 changed files with 32 additions and 15 deletions

View File

@ -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);
};
};

View File

@ -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);
// });
}
// --