<template>
  <div class="body">
    <vTitle>今日报警</vTitle>
    <div class="con">
      <section class="s2">
        <div class="jiaotong-table">
          <div class="t-header">
            <span>报警设备</span>
            <span>设备位置</span>
            <span>报警时间</span>
          </div>
          <div class="t-main">
            <div class="t-body" v-for="(item, i) in 10" :key="i">
              <span>摄像头004</span>
              <span>停车场</span>
              <span>2021/02/03</span>
            </div>
          </div>
        </div>
      </section>
    </div>
  </div>
</template>

<script>
export default {
  components: {},
  mounted() {
    let $scroll = document.querySelector(".t-main");
    let last;
    setInterval(() => {
      if ($scroll.scrollTop === last) {
        $scroll.scrollTop = 0;
      }
      last = $scroll.scrollTop;
      $scroll.scrollTop += 1;
    }, 50);
  },
};
</script>

<style lang="less" scoped>
.con {
  .jiaotong-table {
    height: 220px;
    margin-top: 2%;
    overflow: hidden;
  }

  .jiaotong-table .t-main {
    overflow-y: scroll;
    height: 220px;
    margin-top: 15px;
    &::-webkit-scrollbar {
      width: 0;
      height: 0;
      display: none;
    }
  }

  .jiaotong-table span {
    display: inline-block;
    text-align: center;
    flex: 1;
  }

  .jiaotong-table .t-header {
    color: #fff;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    background: linear-gradient(
      to right,
      rgba(38, 159, 152, 0) 0,
      rgba(38, 159, 152, 0.35) 50%,
      rgba(38, 159, 152, 0) 100%
    );
  }

  .jiaotong-table .t-body {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding-bottom: 10px;
    margin-bottom: 5px;
    border-bottom: 1px dotted #fff;
    color: #e0b822;
    &:last-of-type {
      border-bottom: none;
    }
  }
}
</style>
