|
|
@ -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 ` |
|
|
|
<div style=" |
|
|
|
background-image: url(${this.getState(data[0]) ? normalBg : faultBg}); |
|
|
|
background-image: url(${nowBg}); |
|
|
|
background-size: 100% 100%; |
|
|
|
background-repeat: no-repeat; |
|
|
|
width: 51px; |
|
|
@ -133,7 +139,7 @@ export class MarkerCluster { |
|
|
|
|
|
|
|
return ` |
|
|
|
<div style=" |
|
|
|
background-image: url(${normalBg}); |
|
|
|
background-image: url(${nowBg}); |
|
|
|
background-size: 100% 100%; |
|
|
|
background-repeat: no-repeat; |
|
|
|
width: ${width}; |
|
|
|