无人机不显示问题

This commit is contained in:
zengmingjie 2025-06-27 11:17:41 +08:00
parent f925f563fb
commit 3068a4cb91
3 changed files with 60 additions and 15 deletions

View File

@ -342,9 +342,12 @@ export default {
// Id: "1936279217155215360"
// }
// ];
let positionID = localStorage.getItem("PositionIds");
if (positionID === null || positionID === undefined) {
const match = newVal.some((item) => positionID.includes(item.id));
let positionID = JSON.parse(localStorage.getItem("PositionIds"));
if (positionID !== null || positionID !== undefined) {
const match = newVal.some((item) =>
positionID.includes(item.positionId)
);
console.log(match, "match");
if (match) {
newVal.forEach((newItem) => {
if (

View File

@ -33,6 +33,45 @@ export default {
this.initSocket();
},
mounted() {
// let arr = [
// {
// BatchId: "1938433406643867648",
// serial_number: "JF0102501009",
// device_type: "8",
// device_type_8: 91088,
// app_lat: 39.055,
// app_lon: 117.303466,
// drone_lat: 39.040924,
// drone_lon: 117.337103,
// height: 0.0,
// altitude: 0.0,
// home_lat: 0.0,
// home_lon: 0.0,
// distance: 3299.608332218683,
// centerdistance: 198311.46836461234,
// IsWhitelist: false,
// WhiteListId: "0",
// speed_E: 0.0,
// speed_N: 0.0,
// speed_U: 0.0,
// RSSI: 0.0,
// positionId: "1937905595101351936",
// PostionName: "6",
// DeviceId: "1937909591555837952",
// DeviceName: "JF0102501007",
// freq: 0.0,
// alarmLevel: 0,
// Time: 1744872277,
// CreateTime: "2025-06-27T11:05:13.1524513+08:00",
// Id: "1938433406669033472"
// }
// ];
// let time = setInterval(() => {
// this.signaData = arr;
// }, 1000);
// setTimeout(() => {
// clearInterval(time);
// }, 10000);
this.initHomeData();
this.timeInterval = setInterval(() => {
this.initHomeData();

View File

@ -85,19 +85,22 @@ export default {
localStorage.setItem("expires", res.data.expires); //
localStorage.setItem("userId", res.data.userid); // id
localStorage.setItem("isAdmin", res.data.isAdmin); //
// localStorage.setItem("PositionIds", res.data.PositionIds); //
this.$router.push("/");
loginPosition(res.data.positionIds).then((positionRes) => {
if (positionRes.code === 0) {
localStorage.setItem(
"PositionIds",
JSON.stringify(positionRes.data)
JSON.stringify(res.data.positionIds)
); //
this.$message.success("登录成功");
} else {
this.$message.error(positionRes.msg);
}
});
this.$router.push("/");
// loginPosition(res.data.positionIds).then((positionRes) => {
// if (positionRes.code === 0) {
// localStorage.setItem(
// "PositionIds",
// JSON.stringify(positionRes.data)
// ); //
// this.$message.success("");
// } else {
// this.$message.error(positionRes.msg);
// }
// });
} else {
this.state.password = this.state.password;
this.$message.error(res.msg);