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

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

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