<template>
  <div class="home-left">
    <div class="topI">
      <msg-card title="危险驾驶监控">
        <div class="videos">
          <local-camera ref="videoItem" class="videoItem" v-for="(item,index) of videos" :key="index" :video-data="item"/>
          <span class="top-left"></span>
          <span class="top-right"></span>
          <span class="bottom-left"></span>
          <span class="bottom-right"></span>
        </div>
      </msg-card>
    </div>
    <div class="bottomI">
      <msg-card class="m-b-10" title="危险驾驶报警">
        <div class="cardInner">
          <div class="optionItem" v-for="(item,index) of dangerOptions" :key="index">
            <div class="leftIcon" :class="`danger${item.type}`"></div>
            <div class="rightDetail">
              <div class="rightInner">
                <div class="license">车牌号：{{ item.picLicense1 }}</div>
                <div>
                  <span>检测时间段：{{ item.timeBetween }}</span>
                </div>
                <div>
                  持续时长：{{ item.duration }}
                </div>
                <div>
                  地点：{{ item.location }}
                </div>
              </div>

            </div>
          </div>
        </div>
      </msg-card>
    </div>
  </div>
</template>

<script>
import CameraVideo from "../../../components/Standard/cameraVideo.vue";
import MsgCard from "../../../components/Standard/msg-card.vue";
import {getCameraListByType} from "../../../dao/api";
import LocalCamera from "../../../components/Standard/localCamera.vue";

export default {
  name: "homeLeft",
  components: {LocalCamera, MsgCard, CameraVideo},
  computed: {
    videos() {
      return situation_dangerousDriving.videos.slice(0, 1);
    },
  },
  data() {
    return {
      cameras: [],
      dangerOptions: [],
    };
  },
  mounted() {
    this.dangerOptions = situation_dangerousDriving.warnings
  },
  methods: {
    startVideo(time) {
      for (let item of this.$refs.videoItem) {
        item.setTime(time)
      }
    }
  },

  beforeDestroy() {
  },
};
</script>

<style lang='less' scoped>
.cTable {
  font-size: 16px;
  border-top: 1px solid rgba(62, 108, 150, 1);
  border-left: 1px solid rgba(62, 108, 150, 1);
  margin-bottom: 7px;

  .row1 {
    height: 30px;
    width: 100%;

    .col {
      display: flex;
      align-items: center;
      height: 100%;
      border-bottom: 1px solid rgba(62, 108, 150, 1);
      border-right: 1px solid rgba(62, 108, 150, 1);

      span {
        display: inline-block;
        height: 20px;
        padding: 0 3px;
        line-height: 20px;
        font-size: 14px;
        margin-left: 3px;
        border: 1px solid rgba(5, 122, 255, 0);
        border-radius: 8px;
      }

      .span-check {
        border: 1px solid rgba(5, 122, 255, 1);
      }
    }

    .deep {
      justify-content: center;
      background-color: rgba(46, 119, 255, 0.15);
    }
  }
}

.customTable {
  color: white;
  width: 100%;
  font-size: 16px;
  border-top: 1px solid rgba(62, 108, 150, 1);
  border-left: 1px solid rgba(62, 108, 150, 1);

  .row {
    display: flex;
    width: 100%;

    .col {
      border-bottom: 1px solid rgba(62, 108, 150, 1);
      border-right: 1px solid rgba(62, 108, 150, 1);
      height: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .longT {
      height: 45px;
    }

    .col-label {
      width: 20%;
      background-color: rgba(46, 119, 255, 0.15);
    }

    .col-value {
      width: 80%;
      padding: 0 20px;
      justify-content: flex-start;
      background-color: transparent;
    }
  }
}

.top-left {
  position: absolute;
  left: -1px;
  top: -1px;
  padding: 10px;
  border-style: solid;
  border-color: rgba(24, 144, 255, 1);
  border-width: 2px 0 0 2px;
}

.top-right {
  position: absolute;
  right: -1px;
  top: -1px;
  padding: 10px;
  border-style: solid;
  border-color: rgba(24, 144, 255, 1);
  border-width: 2px 2px 0 0;
}

.bottom-left {
  position: absolute;
  right: -1px;
  bottom: -1px;
  padding: 10px;
  border-style: solid;
  border-color: rgba(24, 144, 255, 1);
  border-width: 0 2px 2px 0;
}

.bottom-right {
  position: absolute;
  left: -1px;
  bottom: -1px;
  padding: 10px;
  border-style: solid;
  border-color: rgba(24, 144, 255, 1);
  border-width: 0 0 2px 2px;
}

.msgTitle {
  font-size: 18px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  margin-bottom: 5px;

  span {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 3px solid #0d7fd7;
    rotate: 45deg;
    margin-right: 8px;
  }
}

.home-left {
  z-index: 11;
  position: absolute;
  left: 0;
  top: 0;
  color: white;
  height: 100%;
  width: 668px;
  background-color: rgba(3, 11, 25, 0.45);
  // background-image: linear-gradient(90deg, rgba(8, 20, 31, 0) 0%, rgba(6, 16, 26, 1) 100%);
  padding: 15px 25px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;

  .topI {
    height: 40%;
    margin-bottom: 15px;

    .videos {
      height:100%;
      display: flex;
      justify-content: space-between;
      align-content: space-between;
      align-items: stretch;
      position: relative;
      flex-flow: row wrap;

      .videoItem {
        height:100%;
        width: 100%;
        position: relative;
      }
    }
  }

  .bottomI {

    .cardInner {
      display: flex;
      flex-direction: column;
      padding: 10px;

      .optionItem {
        height: 120px;
        display: flex;
        justify-content: space-around;
        margin-bottom: 20px;
        align-items: center;
        /* 四个角 */


        .leftIcon {
          width: 83px;
          height: 84px;
          background-size: 100% 100%;
        }

        .danger1 {
          background-image: url("../../../assets/images/sc/danger_s.png");
        }

        .danger2 {
          background-image: url("../../../assets/images/sc/danger_speedup.png");
        }

        .danger3 {
          background-image: url("../../../assets/images/sc/danger_track.png");
        }

        .rightDetail{
          width: calc(100% - 83px);
          height: 100%;
        }
        .rightInner {
          padding: 8px 8px 8px 16px;
          font-size: 16px;
          color: rgba(222, 234, 255, 1);
          background-image: url("../../../assets/images/sc/textBorderBack.png");
          background-size: 100% 100%;
          height: 100%;
          display: flex;
          flex-direction: column;
          justify-content: space-around;
        }

        span {
          display: inline-block;
          margin-right: 25px;
        }

        .license {
          color: white;
          font-size: 18px;
          font-weight: 500;
          margin-bottom: 8px;

        }
      }
    }
  }
}

.m-b-10 {
  margin-bottom: 10px;
}
</style>