嘉禾二期设备管理
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

141 lines
3.4 KiB

<template>
<div class="equipmentLoad box">
<tit :title="'设备负载监控'">
<div class="tit-r" @click="visible = true">监测明细</div>
</tit>
<el-table :data="tableData" style="width: 100%;" height="92%" :stripe="true" :size="mini"
:row-class-name="tableRowClassName">
<el-table-column prop="name" label="设备名称" show-overflow-tooltip>
<template slot-scope="scope">
<span style="font-size: 0.14rem !important;">{{ scope.row.name }}</span>
</template>
</el-table-column>
<el-table-column prop="loadRate" label="负载率">
<template slot-scope="scope">
<span>{{ scope.row.loadRate }}%</span>
</template>
</el-table-column>
<el-table-column prop="sendTime" label="负载最长时段" show-overflow-tooltip>
</el-table-column>
</el-table>
<emodal :visible.sync="visible" @onvisible="v => visible = v" />
</div>
</template>
<script>
import tit from "./tit.vue";
import emodal from "./emodal.vue";
import { mapGetters } from "vuex";
import { getInstrumentActLoad } from "@/api/energySources/energySources"
export default {
data() {
return {
tableData: [],
visible: false
};
},
components: {
tit,
emodal
},
computed: {
...mapGetters(["userInfo", "permission"]),
},
created() {
this.getTableData()
this.timeFun = setInterval(() => {
this.getTableData()
}, 300000)
},
beforeDestroyed() {
clearInterval(this.timeFun)
},
methods: {
getTableData() {
getInstrumentActLoad({ manufacturerBrand: this.userInfo.dept_name }).then(res => {
this.tableData = res.data.data
})
},
tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 === 0) {
if (row.loadRate > 0) {
return 'trEven colorFB5E2D';
} else {
return 'trEven';
}
} else {
if (row.loadRate > 0) {
return 'trOdd colorFB5E2D';
} else {
return 'trOdd';
}
}
}
},
};
</script>
<style></style>
<style lang="scss" scoped>
.equipmentLoad /deep/ .el-table,
.equipmentLoad /deep/ .el-table__expanded-cell {
background-color: transparent;
border: 0 !important;
}
.equipmentLoad /deep/ .el-table th,
.equipmentLoad /deep/ .el-table tr,
.equipmentLoad /deep/ .el-table td {
background-color: transparent !important;
border: 0 !important;
}
.equipmentLoad /deep/ .el-table td span {
font-size: 0.18rem !important;
font-family: Acumin-Pro-Condensed-Regular-2;
}
.equipmentLoad /deep/ .el-table::before {
height: 0 !important;
}
.equipmentLoad /deep/ .trOdd td {
color: #fff;
font-family: Acumin-Pro-Condensed-Regular-2;
}
.equipmentLoad /deep/ .trEven td {
color: #fff;
background: rgba($color: #0de5ff, $alpha: 0.1) !important;
font-family: Acumin-Pro-Condensed-Regular-2;
}
.equipmentLoad /deep/ .trEven td div{
font-size: 0.18rem !important;
}
.equipmentLoad /deep/ .trOdd td div{
font-size: 0.18rem !important;
}
.equipmentLoad /deep/.colorFB5E2D td {
color: #FB5E2D !important;
}
.box {
width: 4.68rem;
height: 3.7rem;
box-sizing: border-box;
background: url("../../../../public/img/energySources/equipmentLoad.png");
background-size: 100% 100%;
margin-right: 0.22rem;
padding: 0.54rem 0.22rem 0 0.22rem;
position: relative;
.tit-r {
font-size: 0.14rem;
color: #0096FF;
margin-top: 0.04rem;
}
}
</style>