Browse Source

fix 首页地图节点过多无法点开问题临时修复

wangqin
qingzhengli 9 months ago
parent
commit
d545c15fc9
  1. 9
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js

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

@ -102,6 +102,13 @@ export class MarkerCluster {
"font-size:15px; background:#6f5757; color:#b39b9b;",
this.infoWindow
);
//data.length 大于 5 取前5个数, 否则直接返回data
const pageSize = 6;
let pageNum = 1;
const dataFisrtPage =
data.length > pageSize
? data.slice((pageNum - 1) * pageSize, pageSize)
: data;
this.infoWindow.setContent(`<div
style="
@ -119,7 +126,7 @@ export class MarkerCluster {
<img class="info-close" style="width: 12px;cursor: pointer;" src="${require("@screen/images/dialog/icon-close.svg")}" />
</div>
<div style="padding: 15px 9px;flex: 1; overflow: auto;" class="info-window-content">
${data
${dataFisrtPage
.map(
(item) => `
<div style="cursor: pointer; padding: 3px 6px;display: flex;align-items: center; gap: 6px;" class="info-window-item">

Loading…
Cancel
Save