<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-10 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>
    <SvgIcon icon-class="home" style="color:  #75f9e2;width: 45px;height: 45px;cursor: pointer;padding-right: 8px;" @click.native="$router.back()"></SvgIcon>
  </div>
</template>

<script>
import SvgIcon from "@/components/SvgIcon"
export default {
  components: {
    SvgIcon
  },
  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(-80px);
    position: relative;

    & > p {
      word-break: keep-all;
      transform: skewX(45deg);
    }

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

    &__dvd8 {
      height: 32px;
      width: 120px;
      transform: translate(100%, 0);
      position: absolute;
      bottom: 0;
      right: -10%;
    }
  }
  &-time {
    color: #fff;
    font-size: 22px;
    padding: 0 20px;
    word-break: keep-all;
    white-space: nowrap;
    text-align: right;
  }
}
</style>
