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
| <template>
| <dv-scroll-board :config="config"/>
| </template>
|
| <script>
| import signageApi from '@/api/signage'
|
| export default {
| name: 'DeviceAlarmInfo',
| components: {},
| props: {
| currentProductionId: {
| type: String
| }
| },
| data() {
| return {
| config: {}
| }
| },
| created() {
| if (!this.currentProductionId) return
| this.getDeviceAlarmInfoByApi()
| },
| methods: {
| getDeviceAlarmInfoByApi() {
| const that = this
| signageApi.getWorkshopAlarmInfoApi(that.currentProductionId)
| .then(res => {
| if (!res.success) return
| that.initChart(res.result)
| })
| },
|
| initChart(dataSource = []) {
| this.config = {
| // indexHeader: '序号',
| header: ['设备编号', '报警时间', '报警号'],
| headerBGC: '#333',
| oddRowBGC: 'transparent',
| evenRowBGC: 'transparent',
| data: dataSource.map(item => {
| return [item.equipmentId, item.collectTime, item.alarmNo]
| }),
| // data: [['516313', 'AASDASD', 'ASDADA'], ['ASDSA', '213ASD', '1651ZS'], ['DSXC42', 'SD5846', '2316SD'], ['dasd13', '213asd', '21558xc'], ['dasads522', 'dsa4812', 'asd233'], ['123124', 'zxc32695', '42352s']],
| rowNum: 2,
| index: false,
| // columnWidth: [300, 300],
| align: ['center', 'center', 'center']
| }
| }
| }
| }
| </script>
|
|