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 `