<template>
    <van-row class="recordList">
      <van-row class="titleWrap">
        <span class="line"></span>
        <span class="title">消防隐患</span>
      </van-row>
      <el-table ref="initList" :data="initList"  height="180px"  highlight-current-row :header-cell-style="{background:'#F5F5F5',color:'#000','font-weight':'400'}" class="table">
        <el-table-column label="时间" align="left" prop="alarmTime"  show-overflow-tooltip min-width="35%"   />
        <el-table-column label="内容" align="left" prop="property"  show-overflow-tooltip min-width="25%"/>
        <el-table-column label="名称" align="left" prop="deviceName"  show-overflow-tooltip min-width="25%"/>
        <el-table-column label="地点" align="left" prop="unitInfo"  show-overflow-tooltip min-width="15%"/>
      </el-table>
    </van-row>
</template>
<script>
import axios from 'axios'
export default {
  data() {
    return {
      initList:[],
      table_interval:null,
    };
  },
  created(){
    this.initData();
  },
  mounted() {},
  methods: {
    //初始化数据
    initData() {
      axios({
            method: 'post',
            url: 'https://smartpark.caih.com/dmapi/tbAlarm/page',
            data:{
              current: 1,
              size: 100,
              type:1,
              status:0
            },
            timeout: 3000,
        }).then(res =>{
            if(res.data.data.records){
                let data = res.data.data.records
                this.initList = data
            }
        }).catch(err =>{
        })
    },
    //数据滚动
    dataScrolling:function(){
        let top=this.$refs.initList.bodyWrapper;
        this.table_interval=setInterval(() => {
            top.scrollTop+=1;
            if(top.clientHeight+top.scrollTop==top.scrollHeight){
              top.scrollTop=0;
            }
        }, 100);
    },
    timing(){
      setInterval(() =>{
        this.initList = []
      },1000 * 60)
    },
    
  },
};
</script>

<style lang="scss" scoped></style>
