Commit 4f8a7cf8 authored by “yiyousong”'s avatar “yiyousong”

perf: 优化站点详情页面的设备icon显示

parent baf08304
......@@ -147,7 +147,7 @@
justify="space-between"
>
<img
v-if="formatDevIcon(v.productId)"
v-if="formatDevIcon(v.productId) && isImageAvailable(v.productId)"
:src="require(`@/assets/images/${formatDevIcon(v.productId)}.png`)"
/>
<img v-else src="@/assets/images/dn.png" />
......@@ -221,10 +221,10 @@ export default {
this.query = Object.assign({}, this.query, { deviceName: val });
this.getData();
},
editSite(){
this.$confirm('请在基础设置系统修改站点信息','提示',{
editSite() {
this.$confirm("请在基础设置系统修改站点信息", "提示", {
showCancelButton: false, //是否显示取消按钮
})
});
},
addDevice() {
let row = {};
......@@ -302,6 +302,14 @@ export default {
let label = productId[product];
return label || "";
},
isImageAvailable(product) {
try {
require(`@/assets/images/${this.formatDevIcon(product)}.png`);
return true;
} catch (error) {
return false;
}
},
},
data() {
return {
......
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