<template>
|
<div>
|
<dv-scroll-board :config="config" style="width:100%;flex: 1;display: flex;flex-direction: column"/>
|
</div>
|
</template>
|
|
<script>
|
import signageApi from '@/api/signage'
|
|
export default {
|
name: 'WorkshopAlarmInfoTable',
|
components: {},
|
data() {
|
return {
|
config: {},
|
dataSource: []
|
}
|
},
|
mounted() {
|
this.getWorkshopAlarmInfoByApi()
|
},
|
methods: {
|
getWorkshopAlarmInfoByApi() {
|
const that = this
|
signageApi.getWorkshopAlarmInfoApi()
|
.then(res => {
|
if (res.success) {
|
that.dataSource = res.result
|
that.initChart()
|
}
|
})
|
},
|
|
initChart() {
|
this.config = {
|
// indexHeader: '序号',
|
header: ['设备编号', '报警时间', '报警号'],
|
headerBGC: 'rgb(45, 59, 94)',
|
oddRowBGC: 'transparent',
|
evenRowBGC: 'transparent',
|
data: this.dataSource.map(item => {
|
return [item.equipmentId, item.collectTime, item.alarm]
|
}),
|
rowNum: 3,
|
index: false,
|
// columnWidth: [300, 300],
|
align: ['center', 'center', 'center']
|
}
|
}
|
}
|
}
|
</script>
|
|
<style scoped lang="less">
|
table {
|
width: 100%;
|
|
th, td {
|
text-align: center;
|
}
|
}
|
|
/deep/ .header, /deep/ .row-item {
|
border-bottom: 0.1vw solid #79b2e2;
|
& > div {
|
width: 33.33% !important;
|
font-size: 0.9vw;
|
color: #eee;
|
border-left: 0.1vw solid #79b2e2;
|
border-right: 0.1vw solid #79b2e2;
|
}
|
}
|
|
/deep/ .header {
|
& > div {
|
height: 2vw !important;
|
line-height: 2vw !important;
|
}
|
}
|
</style>
|