Commit cff7ac23 authored by “yiyousong”'s avatar “yiyousong”

perf: 优化站点详情icon显示

parent b5ae35fd
...@@ -157,7 +157,12 @@ export default { ...@@ -157,7 +157,12 @@ export default {
contentRender(h, params) { contentRender(h, params) {
//console.log(params.extData.extData.productId) //console.log(params.extData.extData.productId)
let value = params.extData.extData.productName; let value = params.extData.extData.productName;
return <img src={require(`../assets/images/${value}.png`)} />; try {
require(`../assets/images/${value}.png`);
return <img src={require(`../assets/images/${value}.png`)} />;
} catch (error) {
return <img src={require(`../assets/images/dn.png`)} />;
}
}, },
getDeviceDetial() { getDeviceDetial() {
//获取设备列表 //获取设备列表
...@@ -165,15 +170,19 @@ export default { ...@@ -165,15 +170,19 @@ export default {
refresh(data) { refresh(data) {
// this.markersGroupData = data; // this.markersGroupData = data;
//this.$refs.map.clear(); //this.$refs.map.clear();
let map = this.amapManager.getMap(); this.$nextTick(() => {
map.clearMap(); let map = this.amapManager.getMap();
if (map) {
map.clearMap();
}
for (let group of data) { for (let group of data) {
for (let item of group.deviceList) { for (let item of group.deviceList) {
//console.log("marker", item); //console.log("marker", item);
this.setMarker(item); this.setMarker(item);
}
} }
} });
}, },
relocate(center) { relocate(center) {
...@@ -328,6 +337,3 @@ export default { ...@@ -328,6 +337,3 @@ export default {
} }
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment