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;
try {
require(`../assets/images/${value}.png`);
return <img src={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,8 +170,11 @@ export default { ...@@ -165,8 +170,11 @@ export default {
refresh(data) { refresh(data) {
// this.markersGroupData = data; // this.markersGroupData = data;
//this.$refs.map.clear(); //this.$refs.map.clear();
this.$nextTick(() => {
let map = this.amapManager.getMap(); let map = this.amapManager.getMap();
if (map) {
map.clearMap(); map.clearMap();
}
for (let group of data) { for (let group of data) {
for (let item of group.deviceList) { for (let item of group.deviceList) {
...@@ -174,6 +182,7 @@ export default { ...@@ -174,6 +182,7 @@ export default {
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