zuojincheng
2024-10-22 d3e02569fdef4d270e896bea2f9894f83c4503f9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<template>
  <div class="head">
    <div class="logo"><img src="../assets/menu-logo-white.png"></div>
    <h1 @dblclick="handleReload">信息化智能化生产管理平台</h1>
    <span>{{ clock }}</span>
  </div>
</template>
 
<script>
 
export default {
  name: "Head",
  data() {
    return {
      timer: null,
      clock: '',
    }
  },
  methods: {
    // 设定时钟
    initClock: function () {
      this.timer = setInterval(() => {
        this.clock = this.$dayjs().format("YYYY-MM-DD HH:mm:ss")
      }, 1000);
    },
    handleReload: function () {
      location.reload()
    }
  },
  mounted() {
    this.clock = this.$dayjs().format("YYYY-MM-DD HH:mm:ss")
    this.initClock();
  }
}
</script>
 
<style lang="less" scoped>
.head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
 
  .logo {
    width: 250px;
 
    img {
      display: block;
      height: 45px;
    }
  }
 
  h1 {
    width: 500px;
    font-size: 36px;
    font-weight: 500;
    text-align: center;
 
  }
 
  span {
    width: 250px;
    text-align: right;
    font-size: 24px;
 
  }
}
</style>