<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="时间"  prop="eStartTime"  show-overflow-tooltip min-width="35%"/>
        <el-table-column label="内容"  prop="eLName"  show-overflow-tooltip min-width="25%"/>
        <el-table-column label="名称"  prop="ePlaceName"  show-overflow-tooltip min-width="25%"/>
        <el-table-column label="状态"  prop="ePlanState"  show-overflow-tooltip min-width="15%"/>
      </el-table>
      <div style="height:50px;background:#fff"></div>
    </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: 'http://10.21.39.1:8082/pt/queryPatrollingPlanStatus',
            data:{
              pageNo: 1,
              pageSize: 10,
            },
            timeout: 3000,
        }).then(res =>{
            if(res.data.data.pageList){
                let data = res.data.data.pageList
                this.initList = data.slice(0,9)
                let arr = [ '1楼暖通机房','负1楼配电间','1楼配电间','1楼UPS机房','2楼网络机房','2楼新风机房','3楼新风机房','4楼新风机房','4楼阅览室等']
                for(let i =0; i<this.initList.length;i++){
                  this.initList[i].ePlaceName = arr[i]
                }
            }
        }).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);
    },
    //鼠标进入，停止滚动
    mouseEnter:function(){
        // clearInterval(this.table_interval);
        // this.table_interval=null;
    },
    //鼠标离开，开始滚动
    mouseLeave:function(){
        // this.dataScrolling();
    },
    //点击行
    clickData(row){
      this.$emit("xgClick",row)
    },
    // cellStyle (row, column, rowIndex, columnIndex) {
    // //列的label的名称
    //   if (row.column.label === "告警" || row.column.label === "离线") {
    //     return 'color:#2280D9' //修改的样式
    //   }
    // },
  },
};
</script>

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