ViewTitle.vue 1.75 KB
<template>
  <div class="content flex">
    <div class="logo user-select">
      <img
        src="@/assets/images/logo.svg"
        alt="logo"
      >
    </div>
    <div class="view-title flex user-select">广汇集团客户池数据大屏</div>
    <div class="time">
      <div class="top">{{now}}</div>
      <div class="bottom">数据截止至 {{yesterday}}</div>
    </div>
    <div class="center-control">
      <view-control />
    </div>
  </div>
</template>

<script type='text/ecmascript-6'>
export default {
  name: 'ViewTitle',
  data () {
    return {
      yesterday: '',
      now: new Date().format('yyyy-MM-dd hh:mm:ss')
    }
  },
  mounted () {
    this.yesterday = new Date(new Date().setDate(new Date().getDate() - 1)).format('yyyy-MM-dd')
    this.timer()
  },
  methods: {
    timer () {
      setInterval(() => {
        this.now = new Date().format('yyyy-MM-dd hh:mm:ss')
      }, 1e3)
    }
  }
}
</script>

<style scoped lang='scss'>
.content {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 0 24px;
  position: relative;
  background: #1d1c1c;
  z-index: 9999999999;
  .view-title {
    color: transparent;
    background: linear-gradient(left, #e60115 10%, #eb6001 25%, #f5aa01 50%, #fdf006 100%);
    -webkit-background-clip: text;
    font-size: 24px;
    &::before {
      content: '';
      display: block;
      background: #373739;
      width: 1px;
      height: 20px;
      margin: 0 8px;
    }
  }
  .time {
    margin-left: auto;
    text-align: right;
    font-size: 14px;
    color: #ffffff;
    .bottom {
      font-size: 10px;
      color: #eb6001;
      line-height: 16px;
    }
  }
  .center-control {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
  }
}
</style>