footerLeft.vue
1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<template>
<div class="dv-content-body-bottom-list-right">
<div class="dv-content-body-bottom-list-right-title">堆垛机报警信息</div>
<div class="dv-content-body-bottom-list-right-table">
<dv-scroll-board :config="pickup" style="width: 100%;" />
</div>
</div>
</template>
<script>
export default {
data() {
return {
getList: null,
sysData: {},
pickup: {},
}
},
methods: {
getData(data) {
if (!data || !Array.isArray(data)) {
this.pickup = {
header: ['设备号', '报警代码', '报警信息', '开始时间'],
data: [],
columnWidth: [90, 100, 320, 100],
headerHeight: 30,
rowNum: 4,
}
return
}
// 重用数组,避免频繁创建新数组
if (!this.pickup.data) {
this.pickup.data = []
} else {
this.pickup.data.length = 0 // 清空数组
}
// 确保pickup对象结构完整
if (!this.pickup.header) {
this.pickup = {
header: ['设备号', '报警代码', '报警信息', '开始时间'],
data: this.pickup.data,
columnWidth: [90, 100, 320, 100],
headerHeight: 30,
rowNum: 4,
}
}
data.forEach((item) => {
const startTimes = this.$moment(item.startTime).format(' HH:mm')
this.pickup.data.push([item.code, item.alarmCode, item.msg, startTimes])
})
},
},
}
</script>
<style lang="less" scoped>
.dv-content-body-bottom-list-right {
width: 49%;
height: 95%;
border: 1.5px solid hsl(208.57deg 51.22% 40.2%);
}
.dv-content-body-bottom-list-right-title {
width: 97%;
height: 23px;
margin: auto;
display: flex;
font-size: 14px;
color: #fff;
flex-direction: column;
justify-content: center;
}
.dv-content-body-bottom-list-right-table {
width: 97%;
height: 80%;
margin: auto;
}
</style>
<style>
.dv-scroll-board .header .header-item {
font-size: 1.8vh !important;
}
.dv-scroll-board .rows div.ceil {
font-size: 1.8vh !important;
}
</style>