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

perf: 优化页面

parent f15cabc1
......@@ -139,22 +139,24 @@
<el-divider></el-divider>
<el-row
v-for="(label, value, index) in tableData.dict.productId"
v-for="(v, index) in tableData.data"
:key="index"
type="flex"
style="border-bottom: 1px solid #e8eaec; padding: 10px"
justify="space-between"
>
<!-- <img src="../../assets/images/排队机.png" alt="" /> -->
<img
v-if="label"
:src="require(`../../assets/images/${label}.png`)"
v-if="formatDevIcon(v.productId)"
:src="require(`@/assets/images/${formatDevIcon(v.productId)}.png`)"
/>
<img v-else src="@/assets/images/dn.png" />
<!-- <i style="font-size: 20px" class="el-icon-location-information"></i> -->
<span style="font-size: 12px">{{ label }}</span>
<span style="font-size: 12px">{{
formatDevIcon(v.productId) || "--"
}}</span>
<el-switch
v-model="items[index]"
:active-value="value"
:active-value="String(v.productId)"
:inactive-value="0"
@change="switchChange"
active-color="#2882ED"
......@@ -251,15 +253,14 @@ export default {
if (arr.length > 0) {
this.query = Object.assign({}, this.query, { productIdList: arr });
}
this.getData();
},
afterRender(data) {
if (!this.sync) {
this.$nextTick(() => {
var count = 0;
for (var i in data.dict.productId) {
this.items[count] = i + "";
let count = 0;
for (let i of data.data) {
this.items[count] = i.productId + "";
count++;
}
this.sync = true;
......@@ -287,6 +288,12 @@ export default {
toView(row) {
this.$refs.drawerViewform.view(row);
},
// 格式设备图标
formatDevIcon(product) {
let { productId } = this.tableData.dict;
let label = productId[product];
return label || "";
},
},
data() {
return {
......@@ -314,21 +321,7 @@ export default {
deviceStatus: null,
deviceName: null,
items: {
item0: "",
item1: "",
item2: "",
item3: "",
item4: "",
item5: "",
item6: "",
item7: "",
item8: "",
item9: "",
item10: "",
item11: "",
item12: "",
},
items: {},
info: {},
options: [
......
......@@ -179,7 +179,7 @@ export default {
this.$router.push({
path: "/sitestat/mapDetail",
// query: info,
query: { sitestatId: info.id, siteId: info.siteId || info.id },
query: { sitestatId: info.siteStatId, siteId: info.siteId || info.id },
});
},
......
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