Browse Source

fix 重叠弹窗未更新问题

wangqin
qingzhengli 8 months ago
parent
commit
6c1b633933
  1. 5
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue
  2. 1
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js
  3. 8
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js

5
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue

@ -227,7 +227,10 @@ export default {
const status = item.status; const status = item.status;
if (!status) { this.nowSelected = item.title; this.nowSelectedCompleted = false; } if (!status) { //
this.nowSelected = item.title;
this.nowSelectedCompleted = false;
}
else if (this.nowSelected === item.title && this.nowSelectedCompleted === false) return; else if (this.nowSelected === item.title && this.nowSelectedCompleted === false) return;
item.status = item.status ? "" : "_active"; item.status = item.status ? "" : "_active";

1
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js

@ -344,4 +344,5 @@ function removeDataPreHandle(markers) {
} }
}; };
lngLatMapHandle(markers, cb); lngLatMapHandle(markers, cb);
window.renderData?.(window.page); //移除后,重新渲染弹出框更新数据
} }

8
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js

@ -127,6 +127,12 @@ export class MarkerCluster {
const startIndex = (page - 1) * pageSize; const startIndex = (page - 1) * pageSize;
const endIndex = startIndex + pageSize; const endIndex = startIndex + pageSize;
let num = (page - 1) * pageSize; let num = (page - 1) * pageSize;
if (data.length === 0 || data.length === 1) {
return this.infoWindow.close();
}
const { latitude: lat, longitude: lng } = data[0].extData;
const lngLatStr = `${parseFloat(lng)}/${parseFloat(lat)}`; //更新清除节点后的数据
data = lngLatMap[lngLatStr];
// 截取当前页的数据 // 截取当前页的数据
const currentPageData = data.slice(startIndex, endIndex); const currentPageData = data.slice(startIndex, endIndex);
window.currentPageData = currentPageData; window.currentPageData = currentPageData;
@ -146,7 +152,7 @@ export class MarkerCluster {
.join(""); .join("");
// 渲染当前页数据 // 渲染当前页数据
dataContainer.innerHTML = itemsTpl; dataContainer.innerHTML = itemsTpl;
dataPage.innerHTML = `${page}`; dataPage && (dataPage.innerHTML = `${page}`);
bindItemClick(); bindItemClick();
} }

Loading…
Cancel
Save