ViewTitle.vue 2.41 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 flex">
        <img src="@/assets/images/time.svg" class="icon" />
        <div class="now">{{ now }}</div>
      </div>
      <div class="bottom flex">
        <div class="merchant">已同步门店数:160</div>
        数据截止至 {{ 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;
    .top {
      justify-content: flex-end;
    }
    .icon {
      width: 16px;
      height: 16px;
      margin-right: 8px;
    }
    .bottom {
      font-size: 10px;
      line-height: 16px;
      color: #fff;
      .merchant {
        color: #eb6001;
        margin-right: 10px;
        padding-right: 10px;
        position: relative;
        &::after {
          position: absolute;
          right: 0;
          top: 50%;
          transform: translateY(-50%);
          width: 1px;
          height: 1.5vh;
          content: '';
          background-color: #606266;
        }
      }
    }
  }
  .center-control {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
  }
}
</style>