From d545c15fc9cc64813040790353418f97614e920b Mon Sep 17 00:00:00 2001 From: qingzhengli <1204552371@qq.com> Date: Fri, 15 Mar 2024 15:06:05 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=20=E9=A6=96=E9=A1=B5=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E8=BF=87=E5=A4=9A=E6=97=A0=E6=B3=95=E7=82=B9?= =?UTF-8?q?=E5=BC=80=E9=97=AE=E9=A2=98=E4=B8=B4=E6=97=B6=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/Home/components/RoadAndEvents/utils/map.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 12e76a5b..9f7be8b9 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 @@ -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(`
- ${data + ${dataFisrtPage .map( (item) => `