From f3233c2dd44c45cd2b3c12f102c3829764f81080 Mon Sep 17 00:00:00 2001 From: qingzhengli <1204552371@qq.com> Date: Tue, 19 Mar 2024 09:45:39 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E5=88=86=E9=A1=B5=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/RoadAndEvents/utils/map.js | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js index 1dbc227f..fcf6e74a 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js @@ -119,7 +119,7 @@ export class MarkerCluster { const dataContainer = document.getElementById("dataContainer"); // 清空数据容器 - dataContainer.innerHTML = ""; + // dataContainer.innerHTML = ""; // 计算当前页起始索引和结束索引 const startIndex = (page - 1) * pageSize; @@ -144,6 +144,15 @@ export class MarkerCluster { .join(""); // 渲染当前页数据 dataContainer.innerHTML = itemsTpl; + window.infoWindow.dom + .querySelectorAll(".info-window-item") + .forEach((item, index) => { + item.onclick = () => + data[index].config.markerClick?.( + data[index].extData, + data[index].config?.item + ); + }); } window.renderData = renderData; @@ -179,12 +188,17 @@ export class MarkerCluster { ) .join("")} + ${ + totalPages > 1 + ? `
-
+ ` + : "" + } `); - + window.infoWindow = this.infoWindow; this.infoWindow.open(map, data[0].lnglat); this.infoWindow.dom.querySelector(".info-close").onclick = () =>