skyouc
2025-06-22 fee38f39e36bcda9924f5b26dca609dda6b331e0
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<template>
  <div id="top-header">
    <dv-decoration-8 class="header-left-decoration" />
    <dv-decoration-5 class="header-center-decoration" />
    <dv-decoration-8 class="header-right-decoration" :reverse="true" />
    <div class="center-title" @click="fullScreen">波次播种任务系统</div>
<!--    <el-button class="center-title" @click="handleFullScreen">全屏</el-button>-->
  </div>
</template>
 
<script>
export default {
  name: 'TopHeader',
 
  data() {
    return {
 
    }
  },
 
  methods: {
    // fullScreen() {
    //   let element = document.documentElement
    //   element.requestFullscreen()
    // },
    handleFullScreen() {
      const element = document.documentElement
      if (this.fullscreen) {
        if (document.exitFullscreen) {
          document.exitFullscreen()
        } else if (document.webkitCancelFullScreen) {
          document.webkitCancelFullScreen()
        } else if (document.mozCancelFullScreen) {
          document.mozCancelFullScreen()
        } else if (document.msExitFullscreen) {
          document.msExitFullscreen()
        }
      } else {
        if (element.requestFullscreen) {
          element.requestFullscreen()
        } else if (element.webkitRequestFullScreen) {
          element.webkitRequestFullScreen()
        } else if (element.mozRequestFullScreen) {
          element.mozRequestFullScreen()
        } else if (element.msRequestFullscreen) {
          element.msRequestFullscreen()
        }
      }
    }
  }
}
</script>
 
<style lang="less">
@media screen and (max-width: 1920px){
  #top-header {
    position: relative;
    width: 100%;
    height: 100px;
    display: flex;
    justify-content: space-between;
    flex-shrink: 0;
 
    .header-center-decoration {
      width: 40%;
      height: 60px;
      margin-top: 30px;
    }
 
    .header-left-decoration, .header-right-decoration {
      width: 25%;
      height: 60px;
    }
 
    .center-title {
      position: absolute;
      font-size: 30px;
      font-weight: bold;
      left: 50%;
      top: 15px;
      transform: translateX(-50%);
    }
  }
}
 
@media only screen and (max-width: 1281px){
  #top-header {
    height: auto;
    margin-bottom: 5px;
 
    .header-center-decoration {
      width: 40%;
      height: 40px;
      margin-top: 20px;
    }
 
    .header-left-decoration, .header-right-decoration {
      width: 25%;
      height: 40px;
    }
 
    .center-title {
      top: 10px;
      font-size: 18px;
      font-weight: bold;
    }
  }
}
</style>