<template>
  <div
    class="alarming-situation-dynamics"
    style="padding: 6px 19px 0px 19px; overflow: hidden"
  >
    <!-- 隐患处理排行榜 -->
    <div class="row header">
      <span class="time">发生时间</span>
      <span class="address">所在辖区</span>
      <span class="name">建筑名称</span>
      <span class="type">警情类型</span>
      <span class="org">主管机构</span>
      <span class="state">处置状态</span>
      <span class="level">风险等级</span>
    </div>
    <VueSeamlessScroll
      :data="list"
      :class-option="classOption"
      class="warp"
      hoverStop
    >
      <ul class="item">
        <li class="row" v-for="(item, index) in list" :key="index">
          <span class="time">{{ item[0] }}</span>
          <span class="address">{{ item[1] }}</span>
          <span class="name">{{ item[2] }}</span>
          <span class="type">{{ item[3] }}</span>
          <span class="org">{{ item[4] }}</span>
          <span class="state">{{ item[5] }}</span>
          <span
            class="level"
            :style="{
              color: levelText(item[6]),
            }"
            >{{ item[6] }}</span
          >
        </li>
      </ul>
    </VueSeamlessScroll>
  </div>
</template>

<script>
// 接警 下达 出动 到场 展开 出水 控制 熄灭 停水 清理 返回 #归队
import VueSeamlessScroll from "vue-seamless-scroll";
export default {
  name: "AlarmingSituationDynamics",
  components: {
    VueSeamlessScroll,
  },
  data() {
    return {
      list: [
        [
          "12:08 05-15",
          "渝北区",
          "金融大厦",
          "火灾扑救",
          "悦来消防站",
          "出动",
          "高风险",
        ],
        [
          "12:08 05-15",
          "渝北区",
          "金融大厦",
          "火灾扑救",
          "悦来消防站",
          "出动",
          "较高风险",
        ],
        [
          "12:08 05-15",
          "渝北区",
          "金融大厦",
          "火灾扑救",
          "悦来消防站",
          "到场",
          "一般风险",
        ],
        [
          "12:08 05-15",
          "渝北区",
          "金融大厦",
          "火灾扑救",
          "悦来消防站",
          "出动",
          "低风险",
        ],
        [
          "12:08 05-15",
          "渝北区",
          "金融大厦",
          "火灾扑救",
          "悦来消防站",
          "出动",
          "低风险",
        ],
      ],
    };
  },
  computed: {
    classOption() {
      return {
        singleHeight: 46,
      };
    },
  },
  methods: {
    levelText(text) {
      return {
        高风险: "#FF0B0B",
        较高风险: "#ff833d",
        一般风险: "#fbff3d",
        低风险: "#35c2ff",
      }[text];
    },
  },
};
</script>

<style>
.alarming-situation-dynamics li.row:hover {
  background: rgba(0, 194, 255, 0.14) !important;
}
</style>

<style scoped lang="less">
.warp {
  height: 230px;
  margin: 0 auto;
  overflow: hidden;
  .item {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    cursor: pointer;
  }
}

.header {
  color: #fff;
  height: 38px !important;
  line-height: 38px !important;
  background-color: rgba(68, 241, 255, 0.1) !important;
}

li.row > span {
  text-align: center;
  font-size: 16px;
  position: relative;
  display: inline-block;
  &::before {
    position: absolute;
    content: "";
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background-color: #1d525f;
    height: 14px;
    width: 1px;
  }
  &:nth-child(1) {
    &::before {
      background-color: #44f1ff;
      box-shadow: 0px 0px 2px 0px #44f1ff;
    }
  }
}

li.row {
  .address {
    color: #99e0ff;
  }
  .name,
  .type,
  .org,
  .state,
  .level {
    color: #44f1ff;
  }
  border-bottom: 1px dashed #1d525f;
  box-sizing: border-box;
}

.row,
li,
a {
  display: block;
  height: 46px;
  line-height: 46px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  background-color: rgba(0, 0, 0, 0.2);
  .time,
  .address,
  .name,
  .type,
  .org,
  .state,
  .level {
    flex: 0.15;
    display: flex;
    justify-content: center;
    align-items: center;
  }
}
</style>
