footerRightTwo.vue
2.51 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
<template>
<div class="dv-content-body-bottom-list-center">
<dv-border-box-12 :dur="35">
<div style="width: 100; height: 13%;padding-top: 0.5vw">
<span class="div-span-title"> 设备报警</span>
</div>
<div style="width: 100%; height: 88%">
<dv-scroll-board :config="productionInformationTable" style="width: 96%; margin-left: 0.65vw" />
</div>
</dv-border-box-12>
</div>
</template>
<script>
export default {
data() {
return {
baseUrlOff: 'http://172.16.43.82:6002/api/BulletinBoard/Mes/V1/ReadData4',
baseUrlOnLine: window.appConfig.baseUrlintFive,
sysData: {},
productionInformationTable: null,
optTableproductionInformation: '',
productionInformation: {
header: ['设备', '故障信息', '时间'],
data: [],
align: ['left'],
headerBGC: '#201e1e', //表头
oddRowBGC: '#021c66',
evenRowBGC: '#65,105,225',
rowNum: 5,
columnWidth: [110, 230, 140],
headerHeight: 25,
carousel: 'page',
waitTime: 8000,
},
}
},
methods: {
// 生产情况
getData() {
let opt = {
urlSuffix: window.baseOnLineOrOff ? this.baseUrlOnLine : this.baseUrlOnLine,
logTitle: 'CNC实时数据',
isUrlALL: true,
headers: false,
}
let callBackFn = (res) => {
if (!this.ajaxSuccessDataBefore(res, opt.logTitle)) return
this.setproductionInformation()
}
''.ajax(this, opt, callBackFn)
},
setproductionInformation() {
let listData = []
this.sysData.forEach((item) => {
let Time = ''
if (item.updateTime != null && item.updateTime != '') {
Time = item.updateTime
} else {
Time = item.createTime
}
listData.push([item.equipmentName, item.alarmMessage, Time])
})
this.initproductionInformationTable(listData)
},
initproductionInformationTable(e) {
this.productionInformationTable = {
header: ['设备', '故障信息', '时间'],
data: e,
align: ['left'],
headerBGC: '#201e1e', //表头
oddRowBGC: '#021c66',
evenRowBGC: '#65,105,225',
rowNum: 4,
columnWidth: [110, 220, 150],
headerHeight: 25,
carousel: 'page',
waitTime: 8000,
}
},
ajaxSuccessDataBefore(res, title) {
if (res.data.result == null || res.data.result.length == 0) {
this.initproductionInformationTable([])
''.Log(title + '无数据', 'getData')
return false
}
return true
},
},
mounted() {
this.getData()
debugger
},
}
</script>
<style scoped>
.dv-content-body-bottom-list-center {
width: 33vw;
height: 95%;
/* background-color: #a5c8ca; */
}
</style>