<script setup lang="ts">
import { reactive } from "vue";
import dayjs from "dayjs";
import type { DateDataType } from "./index.d";

const dateData = reactive<DateDataType>({
  dateDay: "",
  dateYear: "",
  dateWeek: "",
  timing:null
});

const weekday = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
const timeFn = () => {
  dateData.timing = setInterval(() => {
    dateData.dateDay = dayjs().format("YYYY-MM-DD hh : mm ");
    dateData.dateWeek = weekday[dayjs().day()];
  }, 1000);
};
timeFn();
</script>

<template>
  <div class="title_wrap">
    <div class="mr-5 logo">
      <img src="@/assets/img/zheke/logo.png" alt="logo" />
    </div>
    <div class="title">
      <span class="title-text">AI校园助手数据统计平台</span>
    </div>
    <div class="ml-auto now-date">当前日期: {{ dateData.dateDay }}</div>
  </div>
</template>

<style scoped lang="scss">
.title_wrap {
  width: 100%;
  height: 80px;
  background-color: #fff;
  position: relative;
  z-index: 999;
  display: flex;
  align-items: center;
  padding:0 20px 0 40px;

  .timers {
    position: absolute;
    right: 0;
    top: 30px;
    font-size: 18px;
    display: flex;
    align-items: center;

    .setting_icon {
      width: 20px;
      height: 20px;
      cursor: pointer;
      margin-left: 12px;
      img {
        width: 100%;
        height: 100%;
      }
    }
  }
}
.title {
  position: relative;
  // width: 500px;
  text-align: center;
  background-size: cover;
  color: transparent;
  height: 80px;
  line-height: 80px;

  .title-text {
    font-size: 36px;
    font-weight: bold;
    letter-spacing: 4px;
    width: 100%;
    background: linear-gradient(92deg, #3e6aff 0%, #4d50dd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
.now-date {
  font-weight: bold;
  font-size: 16px;
  color: #333333;
}
</style>
