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

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

parent b77c49db
......@@ -90,6 +90,7 @@
class="addclass"
size="mini"
icon="el-icon-edit-outline"
@click="editSite"
>编辑站点</el-button
>
......@@ -146,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" />
......@@ -220,6 +221,11 @@ export default {
this.query = Object.assign({}, this.query, { deviceName: val });
this.getData();
},
editSite() {
this.$confirm("请在基础设置系统修改站点信息", "提示", {
showCancelButton: false, //是否显示取消按钮
});
},
addDevice() {
let row = {};
row.siteId = this.info.siteId;
......@@ -296,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