点位图片问题

main
许宏杰 2 weeks ago
parent f092dfa378
commit 69fcda36dc

@ -21,6 +21,7 @@ const useUserStore = defineStore(
const password = userInfo.password const password = userInfo.password
const code = userInfo.code const code = userInfo.code
const uuid = userInfo.uuid const uuid = userInfo.uuid
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
login(username, password, code, uuid).then(res => { login(username, password, code, uuid).then(res => {
setToken(res.token) setToken(res.token)

@ -8,6 +8,10 @@ import PointJson from "./point.json";
import { onMounted, ref, reactive, watch, onUnmounted } from "vue"; import { onMounted, ref, reactive, watch, onUnmounted } from "vue";
import moment from "moment"; import moment from "moment";
import useUavStore from "@/store/modules/uav"; import useUavStore from "@/store/modules/uav";
import markerTypePark from "@/assets/images/marker-park.png"
import markerTypeSchool from "@/assets/images/marker-school.png"
import markerTypeUav from "@/assets/images/marker-uav.png"
const uavStore = useUavStore(); const uavStore = useUavStore();
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
@ -78,10 +82,7 @@ let animationFrameId;
let gamepad = reactive({}); let gamepad = reactive({});
// 使 import.meta.glob
const imageModules = import.meta.glob("@/assets/images/*.png", { eager: true });
//
const imageUrls = Object.values(imageModules).map((module) => module.default);
let map = null; let map = null;
let list = []; let list = [];
@ -405,10 +406,10 @@ const lablePoint = (item, index) => {
} ">${item.name}</div> } ">${item.name}</div>
<img class="marker-icon" src="${ <img class="marker-icon" src="${
item.type == "school" item.type == "school"
? imageUrls[5] ? markerTypeSchool
: item.type == "park" : item.type == "park"
? imageUrls[4] ? markerTypePark
: imageUrls[6] : markerTypeUav
}" /> }" />
</div> </div>
`, `,

Loading…
Cancel
Save