From f7b847cf155371d96c343eb56b39751023be1bcc Mon Sep 17 00:00:00 2001 From: qingzhengli <1204552371@qq.com> Date: Mon, 26 Feb 2024 09:15:28 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E9=A2=9C=E8=89=B2=20=20=E4=BB=BB=E4=B8=80?= =?UTF-8?q?=E4=B8=BA=E7=BA=A2=E5=8D=B3=E4=B8=BA=E7=BA=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/components/RoadAndEvents/utils/map.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 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 d7bf94fc..130d527b 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 @@ -77,7 +77,13 @@ export class MarkerCluster { }, 150); } - getState({ config, extData }) { + getState(data) { + if (Array.isArray(data)) { + return data.every((item) => this.getStateSingle(item)); + } else return this.getStateSingle(data); + } + + getStateSingle({ config, extData }) { return typeof config.stateCallback === "function" ? config.stateCallback?.() : extData.deviceState == 1; @@ -106,11 +112,11 @@ export class MarkerCluster { getContent(data) { const faultBg = require(`@screen/images/mapBg/fault.svg`); const normalBg = require(`@screen/images/mapBg/active.svg`); - + const nowBg = this.getState(data) ? normalBg : faultBg; if (data.length === 1) { return `