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