This commit is contained in:
liqi 2025-04-26 15:30:11 +08:00
parent 63d0f9f5e4
commit 8d57fde6ab
1 changed files with 33 additions and 33 deletions

View File

@ -47,39 +47,39 @@ export default {
this.$refs.rightBtn.style.background = `url(${require("@/assets/img/right-hover.png")})`;
}
let wPath = window.document.location.href;
let pathName = this.$route.path;
let pos = wPath.indexOf(pathName);
let localhostPath = wPath.substring(0, pos);
this.uploadUrl =
process.env.VUE_APP_API_URL === "/"
? localhostPath
: process.env.VUE_APP_API_URL;
let graphicLayer = window.marsMap.getLayerById("devLog");
graphicLayer.eachGraphic((graphic) => {
console.log(graphic, value, "graphic");
if (value === 1) {
graphic.setOptions({
style: {
image: require(`@/assets/img/device/deviceIcon/${graphic.attr.icon}.png`)
}
});
} else {
if (graphic.attr.img !== null) {
graphic.setOptions({
style: {
image: this.uploadUrl + graphic.attr.img
}
});
} else {
graphic.setOptions({
style: {
image: require("@/assets/img/group.png")
}
});
}
}
});
// let wPath = window.document.location.href;
// let pathName = this.$route.path;
// let pos = wPath.indexOf(pathName);
// let localhostPath = wPath.substring(0, pos);
// this.uploadUrl =
// process.env.VUE_APP_API_URL === "/"
// ? localhostPath
// : process.env.VUE_APP_API_URL;
// let graphicLayer = window.marsMap.getLayerById("devLog");
// graphicLayer.eachGraphic((graphic) => {
// console.log(graphic, value, "graphic");
// if (value === 1) {
// graphic.setOptions({
// style: {
// image: require(`@/assets/img/device/deviceIcon/${graphic.attr.icon}.png`)
// }
// });
// } else {
// if (graphic.attr.img !== null) {
// graphic.setOptions({
// style: {
// image: this.uploadUrl + graphic.attr.img
// }
// });
// } else {
// graphic.setOptions({
// style: {
// image: require("@/assets/img/group.png")
// }
// });
// }
// }
// });
}
}
};