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
<template>
  <dv-scroll-board :config="config"/>
</template>
 
<script>
  import signageApi from '@/api/signage'
 
  export default {
    name: 'DeviceAlarmInfo',
    components: {},
    data() {
      return {
        config: {}
      }
    },
    mounted() {
      this.getDeviceAlarmInfoByApi()
    },
    methods: {
      getDeviceAlarmInfoByApi() {
        const that = this
        that.initChart()
        signageApi.getWorkshopAlarmInfoApi()
          .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>