This commit is contained in:
姚宇浩 2024-08-30 11:42:50 +08:00
parent d763a20212
commit 8e40adcdd3
1 changed files with 13 additions and 8 deletions

View File

@ -821,6 +821,7 @@ const yaosuTotal = ref([
img: j7, img: j7,
img_map: j7_map, img_map: j7_map,
wz: false, wz: false,
tooltip:'name'
}, },
{ {
id: 8, id: 8,
@ -841,6 +842,7 @@ const yaosuTotal = ref([
img: j10, img: j10,
wz: true, wz: true,
url: "/api/ggfwyth/ysyzt/getAeds", url: "/api/ggfwyth/ysyzt/getAeds",
tooltip:'siteAddress'
}, },
{ {
id: 11, id: 11,
@ -849,6 +851,7 @@ const yaosuTotal = ref([
img_map: j11_map, img_map: j11_map,
wz: false, wz: false,
url: "/api/ggfwyth/ysyzt/getJashsxt", url: "/api/ggfwyth/ysyzt/getJashsxt",
tooltip:'sbmc'
}, },
]); ]);
// //
@ -2488,23 +2491,25 @@ const changeys = (name) => {
let url; let url;
let img; let img;
let img_map; let img_map;
let tooltip
yaosuTotal.value.forEach((item, index) => { yaosuTotal.value.forEach((item, index) => {
if (item.name == name) { if (item.name == name) {
url = item.url; url = item.url;
img = item.img; img = item.img;
img_map = item.img_map; img_map = item.img_map;
tooltip=item.tooltip;
} }
}); });
if (name == "摄像头" || name == "AED") { if (name == "摄像头" || name == "AED") {
getZyys(url, name, img, img_map); getZyys(url, name, img, img_map,tooltip);
} }
if (name == "养老机构") { if (name == "养老机构") {
getZyys2(name, img, img_map); getZyys2(name, img, img_map,tooltip);
} }
} }
}; };
//线 //线
const getZyys = (url, name, img, img_map) => { const getZyys = (url, name, img, img_map,tooltip) => {
http.get(url).then((res) => { http.get(url).then((res) => {
if (res.code == 200) { if (res.code == 200) {
yaosuIcon.value[name].sj = res.data; yaosuIcon.value[name].sj = res.data;
@ -2532,13 +2537,13 @@ const getZyys = (url, name, img, img_map) => {
// }; // };
}); });
yaosuIcon.value[name].sj.forEach((itemm, indexx) => { yaosuIcon.value[name].sj.forEach((itemm, indexx) => {
createZyys(itemm, indexx, name); createZyys(itemm, indexx, name,tooltip);
}); });
} }
}); });
}; };
// //
const getZyys2 = (name, img, img_map) => { const getZyys2 = (name, img, img_map,tooltip) => {
if (name == "养老机构") { if (name == "养老机构") {
yaosuIcon.value[name].sj = ylCount; yaosuIcon.value[name].sj = ylCount;
yaosuIcon.value[name].sj.forEach((item, index) => { yaosuIcon.value[name].sj.forEach((item, index) => {
@ -2547,13 +2552,13 @@ const getZyys2 = (name, img, img_map) => {
item.overlay = null; item.overlay = null;
}); });
yaosuIcon.value[name].sj.forEach((itemm, indexx) => { yaosuIcon.value[name].sj.forEach((itemm, indexx) => {
createZyys(itemm, indexx, name); createZyys(itemm, indexx, name,tooltip);
}); });
} }
}; };
// (overlay) // (overlay)
const createZyys = (polygon, indexx, name) => { const createZyys = (polygon, indexx, name,tooltip) => {
function createLabelDOM() { function createLabelDOM() {
var content = document.createElement("div"); var content = document.createElement("div");
content.style.display = "flex"; content.style.display = "flex";
@ -2570,7 +2575,7 @@ const createZyys = (polygon, indexx, name) => {
img2.src = this.properties.imgSrc2; img2.src = this.properties.imgSrc2;
// title // title
img2.title = polygon.name; img2.title = polygon[tooltip];
content.appendChild(img2); content.appendChild(img2);
return content; return content;
} }