<template>
  <div id="index">
    <dv-full-screen-container class="bg">
      <dv-loading v-if="loading">Loading...</dv-loading>
      <div
        v-else
        class="host-body"
      >
        <div class="d-flex jc-center">
          <dv-decoration-10 style="width:33.3%;height:.0625rem;" />
          <div class="d-flex jc-center">
            <dv-decoration-8
              :color="['#568aea', '#000000']"
              style="width:10.45vw;height:2.62vw;"
            />
            <div class="title">
              <span class="title-text">安全管理系统</span>
              <dv-decoration-6
                class="title-bototm"
                :reverse="true"
                :color="['#50e3c2', '#67a1e5']"
                style="width:13vw;height:.41vw;bottom:-1.56vw;"
              />
            </div>
            <dv-decoration-8
              :reverse="true"
              :color="['#568aea', '#000000']"
              style="width:10.45vw;height:2.62vw;"
            />
          </div>
          <dv-decoration-10 style="width:33.3%;height:.0625rem; transform: rotateY(180deg);" />
        </div>

        <!-- 第二行 -->
        <div class="d-flex jc-between px-2">
          <div
            class="d-flex"
            style="width: 40%"
          >
            <div
              class="react-right ml-4"
              style="width: 26vw; text-align: left;background-color: #0f1325;"
            >
              <span class="react-before"></span>
              <span class="text">门锁概况</span>
        </div>
        <div
          class="react-right ml-3"
          style="background-color: #0f1325;"
        >
          <span class="text colorBlue">地图</span>
  </div>
  </div>
  <div
    style="width: 40%"
    class="d-flex"
  >
    <div class="react-left bg-color-blue mr-3">
      <span class="text fw-b">数据汇总</span>
    </div>
    <div
      class="react-left mr-4"
      style="width: 26vw; background-color: #0f1325; text-align: right;"
    >
      <span class="react-after"></span>
      <span class="text">{{dateYear}} {{dateWeek}} {{dateDay}}</span>
      </div>
      </div>
      </div>
      <div class="body-box">
        <!-- 第三行数据 -->
        <div class="content-box1">
          <div>
            <dv-border-box-12>
              <centerLeft1 />
            </dv-border-box-12>
          </div>
          <div>
            <dv-border-box-12>
              <!-- <centerLeft2 /> -->
              <mapcom></mapcom>
            </dv-border-box-12>
          </div>
          <!-- 中间 -->
          <div>
            <dv-border-box-12>
              <center1></center1>
            </dv-border-box-12>
          </div>
          <!-- 中间 -->
          <!-- <div>
              <centerRight2 />
            </div> -->
          <div>
            <dv-border-box-13>
              <centerRight1 />
            </dv-border-box-13>
          </div>
        </div>

        <!-- 第四行数据 -->
        <div class="bototm-box">
          <dv-border-box-13 class="left50">
            <bottomLeft />
          </dv-border-box-13>
          <dv-border-box-12 class="left50">
            <bottomRight />
          </dv-border-box-12>
        </div>
      </div>
      </div>
      </dv-full-screen-container>
      </div>
</template>

<script>
import { formatTime } from "../../utils/index.js";
import centerLeft1 from "./centerLeft1";
import centerLeft2 from "./centerLeft2";
import centerRight1 from "./centerRight1";
import centerRight2 from "./centerRight2";
import center1 from "./center";
import bottomLeft from "./bottomLeft";
import bottomRight from "./bottomRight";
import mapcom from "./map";

export default {
  data() {
    return {
      loading: true,
      dateDay: null,
      dateYear: null,
      dateWeek: null,
      weekday: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"]
    };
  },
  components: {
    centerLeft1,
    centerLeft2,
    centerRight1,
    centerRight2,
    center1,
    bottomLeft,
    bottomRight,
    mapcom
  },
  mounted() {
    this.timeFn();
    this.cancelLoading();
  },
  methods: {
    timeFn() {
      setInterval(() => {
        this.dateDay = formatTime(new Date(), "HH: mm: ss");
        this.dateYear = formatTime(new Date(), "yyyy-MM-dd");
        this.dateWeek = this.weekday[new Date().getDay()];
      }, 1000);
    },
    cancelLoading() {
      setTimeout(() => {
        this.loading = false;
      }, 500);
    }
  }
};
</script>

<style lang="scss" scoped>
@import "../../assets/scss/index.scss";

.bg {
  z-index: 999;
  position: absolute !important;
}

#index {
  width: 100% !important;
  .host-body .title{
    width: 26vw;
  }
  .host-body .react-right{
    width: 15.675vw;
    font-size: 1vw;
    height: 2.61vw;
    line-height: 2.61vw;
  }
  .host-body .react-left{
    width: 15.675vw;
    height: 2.61vw;
    font-size: 1vw;
    line-height: 2.61vw;
  }
  // .title-bototm >>> svg{transform-origin: center top !important;}
  .host-body .react-right .react-before{
    width:2.61vw;
    left: -1.3vw;
    height:2.61vw;
  }
  .host-body .react-left .react-after{
    width:2.61vw;
    right: -1.3vw;
    height:2.61vw;
  }
  .host-body .title .title-text {
    font-size: 1.5vw;
    width: 100%;
  }
}

#dv-full-screen-container {
  height: auto !important;
  width: 100vw !important;
  transform: scale(1) !important;
}
/* .left50{width: 10.35rem;} */
</style>