<template>
  <div class="header d-flex">
    <div class="header-title">
      <p>智慧资产管理大屏</p>

      <dv-decoration-8 :reverse="true" class="header-title__dvd8" />
    </div>

    <dv-decoration-1 style="width:200px;height:40px;margin-left: 100px;" />
    <dv-decoration-2 style="flex: 1;height:5px;" />

    <div class="header-time">
      <p>{{ time.format('YYYY年MM月DD日 HH:mm:ss') }}</p>
      <p>{{ time.format('dddd') }}</p>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      time: this.$moment(),
      timer: null,
    }
  },
  methods: {
    updateTime() {
      this.time = this.$moment()
    }
  },
  computed: {},
  mounted() {
    this.timer = setInterval(() => {
      this.updateTime()
    }, 1000)
  },
  destroyed() {
    clearInterval(this.timer)
  }
}
</script>

<style scoped lang="scss">
.header {
  display: flex;
  justify-content: space-between;

  &-title {
    color: #fff;
    font-size: 26px;
    font-weight: 600;
    background: linear-gradient(to right, #1d413b, #75f9e2);
    padding: 16px 100px;
    transform: skewX(-45deg) translateX(-6vw);
    position: relative;

    & > p {
      transform: skewX(45deg);
    }

    &::after {
      content: "";
      height: 100%;
      background: #2ba28a;
      width: 10%;
      transform: translateX(100%);
      position: absolute;
      top: 0;
      right: 0;
    }

    &__dvd8 {
      height: 36px;
      width: 100px;
      transform: translate(100%, 0);
      position: absolute;
      bottom: 0;
      right: -10%;
    }
  }
  &-time {
    color: #fff;
    font-size: 22px;
    padding-right: 40px;
  }
}
</style>
