footerRightDaoXian.vue
4.31 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<template>
<div class="dv-content-body-bottom-list-right">
<dv-border-box-12 :dur="35" :color="[, '#ffffff']">
<el-carousel indicator-position="none" :interval="10000">
<el-carousel-item v-for="item in initDataList" :key="item.index">
<div style="width: 100; height: 10%">
<span class="div-span-title">{{ item.TunnelName }}</span>
</div>
<div style="width: 100%; height: 88%">
<dv-scroll-board :config="item.tableList" style="width: 97%; margin-top: -0.2vw; margin-left: 0.4vw" />
</div>
</el-carousel-item>
</el-carousel>
</dv-border-box-12>
</div>
</template>
<script>
export default {
data() {
return {
// 轮播数组
initDataList: [
{ TunnelName: 'RGV报警', tableList: null },
{ TunnelName: '堆垛机报警', tableList: null },
],
getList: null,
tableroadwayList: null,
sysInitTimeNum: 60,
sysTimeNum: 60,
sysData: {},
sysDataThree: [],
sysDataFour: [],
}
},
methods: {
// Rgv报警信息获取数据
getDataThree() {
let opt = {
//urlSuffix: 'http://172.16.43.228:6001/api/BulletinBoard/Mes/V1/ReadData3',
urlSuffix: 'http://10.13.83.2:8066/api/Board/GetRGVAlarms',
logTitle: 'Rgv报警信息',
headers: false,
isUrlALL: true,
initCallBackFn: () => {
this.ajaxSuccessDataBefore(null)
},
}
let callBackFn = (res) => {
if (!this.ajaxSuccessDataBeforeThree(res, opt.logTitle)) return
this.sysDataThree = res.data.result
this.getroadwayThree()
}
''.ajax(this, opt, callBackFn)
},
// '堆垛机报警信息'
getDataFour() {
let opt = {
//urlSuffix: 'https://mock.apifox.cn/m1/3152972-0-default/api/Board/GetEquipmentInfo',
urlSuffix: 'http://10.13.83.2:8066/api/Board/GetEquipmentInfo',
logTitle: '堆垛机报警信息',
headers: false,
isUrlALL: true,
initCallBackFn: () => {
this.ajaxSuccessDataBefore(null)
},
}
let callBackFn = (res) => {
if (!this.ajaxSuccessDataBeforeFour(res, opt.logTitle)) return
this.sysDataFour = res.data.result.EquipmentAlarms
this.getDataTableFour()
}
''.ajax(this, opt, callBackFn)
},
// Rgv报警信息
getroadwayThree() {
let rGVDataThree = []
this.sysDataThree.forEach((item) => {
let timeData = new Date(item.DateTime).format('yyyy-MM-dd')
rGVDataThree.push([item.AlarmMsg, timeData])
})
this.initDataList[0].tableList = {
data: rGVDataThree,
align: ['left'],
headerBGC: '#201e1e', //表头
oddRowBGC: '#021c66',
evenRowBGC: '#65,105,225',
rowNum: 8,
headerHeight: 25,
carousel: 'page',
waitTime: 8000,
}
},
getDataTableFour() {
let tempList = []
this.sysDataFour.forEach((item) => {
let timeData = new Date(item.DateTime).format('yyyy-MM-dd')
tempList.push([item.Equipment, item.AlarmMsg, timeData])
})
this.initDataList[1].tableList = {
//header: ['设备', '故障信息', '时间'],
data: tempList,
align: ['left'],
headerBGC: '#201e1e', //表头
oddRowBGC: '#021c66',
evenRowBGC: '#65,105,225',
rowNum: 5,
columnWidth: [130, 180, 150],
headerHeight: 25,
carousel: 'page',
waitTime: 8000,
}
},
// Rgv报警信息
ajaxSuccessDataBeforeThree(res, title) {
if (res.data.result == null || res.data.result.length == 0) {
''.Log(title + '无数据', 'getDataThree')
return false
}
return true
},
// 堆垛机报警信息
ajaxSuccessDataBeforeFour(res, title) {
if (res.data.result == null || res.data.result.length == 0) {
''.Log(title + '无数据', 'getDataThree')
return false
}
return true
},
intInterval: function() {
''.intInterval(this, this.sysInitTimeNum, () => {
this.getDataThree()
this.getDataFour()
})
},
},
mounted() {
//eslint-disable-next-line no-debugger
debugger
// Rgv报警信息
this.getDataThree()
// 堆垛机报警信息
this.getDataFour()
//线上环境自动开启定时器 本地一定要测试定时器 会存在数据多次绑定问题4
// 【发布的时候要取消注释】
this.intInterval()
},
}
</script>
<style lang="less" scoped>
.dv-content-body-bottom-list-right {
width: 33vw;
height: 95%;
//background-color: #63a9ad;
}
.dv-scroll-board .header .header-item {
font-size: 1vw !important;
}
.dv-scroll-board .rows div.ceil {
font-size: 0.8vw !important;
}
</style>