<template >
  <div class="maintenance-supervision">
    <div class="maintenance-supervision_header">
      <button-group @change="change">
        <button-group-item >
          自查情况
        </button-group-item>
        <button-group-item >
          监督检查
        </button-group-item>
        <button-group-item >
          网络排查
        </button-group-item>
        <button-group-item >
          维保概况
        </button-group-item>
      </button-group>
    </div>
    <div>
      <div class="row header">
        <span class="time">排查时间</span>
        <span class="person">排查人员</span>
        <span class="result">排查结果</span>
      </div>
      <VueSeamlessScroll
        :data="list"
        :class-option="classOption"
        class="warp"
      >
        <ul class="item">
          <li class="row" v-for="(item, index) in list" :key="index">
              <span class="time">{{ item[0] }}</span>
              <span class="person">{{ item[1] }}</span>
              <span class="result"
                :style="{
                  color: resultType(item[2])
                }"
                >{{ item[2] }}</span
              >
            </li>
          </ul>
        </VueSeamlessScroll>
    </div>
  </div>
</template>
<script>
import VueSeamlessScroll from "vue-seamless-scroll";

export default {
  name: 'MaintenanceSupervision',
  data() {
    return {
      list: [
        ["09:23 05-14", "张三", "合格"],
        ["09:23 05-14", "王小强", "不合格"],
        ["09:23 05-14", "张三", "合格"],
        ["09:23 05-14", "王小强", "不合格"],
        ["09:23 05-14", "张三", "合格"],
        ["09:23 05-14", "张三", "合格"],
        ["09:23 05-14", "王小强", "不合格"],
        ["09:23 05-14", "王小强", "不合格"]
      ]
    }
  },
  components: {
    VueSeamlessScroll
  },
  computed: {
    classOption() {
      return {
        singleHeight: 43,
      };
    },
  },
  methods: {
    change(idx) {
      console.log("切换索引", idx)
    },
    resultType(text) {
      return {
        "合格": "#23f59d",
        "不合格": "#df575b"
      }[text]
    }
  }
}
</script>

<style scoped lang='less'>
.maintenance-supervision {
  padding: 10px 10px 0px 10px;
  .maintenance-supervision_header {
    border-bottom: 1px solid #154956;
    padding-bottom: 2px;
  }
  .warp {
  height: 258px;
  margin: 0 auto;
  overflow: hidden;
    .item {
      list-style: none;
      padding: 0;
      margin: 0 auto;
      cursor: pointer;
    }
  }

.header {
  color: #fff;
  height: 33px !important;
  line-height: 33px !important;
  background-color: rgba(0, 163, 255, 0.3) !important;
  color: #61DBFF;
  margin-top: 15px;
  margin-bottom: 6px;
}

.row,
li,
a {
  display: block;
  height: 39px;
  line-height: 39px;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  background-color: rgba(0, 0, 0, 0.2);
  .time,
  .person,
  .result {
    flex: 0.33;
    display: flex;
    justify-content: center;
    align-items: center;
  }
}
}
</style>
